function parseBatchTable(options) {
  //>>includeStart('debug', pragmas.debug);
  Check.typeOf.number("options.count", options.count);
  Check.typeOf.object("options.batchTable", options.batchTable);
  //>>includeEnd('debug');

  const featureCount = options.count;
  const batchTable = options.batchTable;
  const binaryBody = options.binaryBody;
  const parseAsPropertyAttributes = options.parseAsPropertyAttributes ?? false;
  const customAttributeOutput = options.customAttributeOutput;

  //>>includeStart('debug', pragmas.debug);
  if (parseAsPropertyAttributes && !defined(customAttributeOutput)) {
    throw new DeveloperError(
      "customAttributeOutput is required when parsing batch table as property attributes",
    );
  }
  //>>includeEnd('debug');

  // divide properties into binary, json and hierarchy
  const partitionResults = partitionProperties(batchTable);

  let jsonMetadataTable;
  if (defined(partitionResults.jsonProperties)) {
    jsonMetadataTable = new JsonMetadataTable({
      count: featureCount,
      properties: partitionResults.jsonProperties,
    });
  }

  let hierarchy;
  if (defined(partitionResults.hierarchy)) {
    hierarchy = new BatchTableHierarchy({
      extension: partitionResults.hierarchy,
      binaryBody: binaryBody,
    });
  }

  const className = MetadataClass.BATCH_TABLE_CLASS_NAME;
  const binaryProperties = partitionResults.binaryProperties;

  let metadataTable;
  let propertyAttributes;
  let transcodedSchema;
  if (parseAsPropertyAttributes) {
    const attributeResults = transcodeBinaryPropertiesAsPropertyAttributes(
      featureCount,
      className,
      binaryProperties,
      binaryBody,
      customAttributeOutput,
    );
    transcodedSchema = attributeResults.transcodedSchema;
    const propertyAttribute = new PropertyAttribute({
      propertyAttribute: attributeResults.propertyAttributeJson,
      class: attributeResults.transcodedClass,
    });

    propertyAttributes = [propertyAttribute];
  } else {
    const binaryResults = transcodeBinaryProperties(
      featureCount,
      className,
      binaryProperties,
      binaryBody,
    );
    transcodedSchema = binaryResults.transcodedSchema;
    const featureTableJson = binaryResults.featureTableJson;
    metadataTable = new MetadataTable({
      count: featureTableJson.count,
      properties: featureTableJson.properties,
      class: binaryResults.transcodedClass,
      bufferViews: binaryResults.bufferViewsTypedArrays,
    });
    propertyAttributes = [];
  }

  const propertyTables = [];
  if (
    defined(metadataTable) ||
    defined(jsonMetadataTable) ||
    defined(hierarchy)
  ) {
    const propertyTable = new PropertyTable({
      id: 0,
      name: "Batch Table",
      count: featureCount,
      metadataTable: metadataTable,
      jsonMetadataTable: jsonMetadataTable,
      batchTableHierarchy: hierarchy,
    });
    propertyTables.push(propertyTable);
  }

  const metadataOptions = {
    schema: transcodedSchema,
    propertyTables: propertyTables,
    propertyAttributes: propertyAttributes,
    extensions: partitionResults.extensions,
    extras: partitionResults.extras,
  };

  return new StructuralMetadata(metadataOptions);
}
An object that parses the the 3D Tiles 1.0 batch table and transcodes it to
be compatible with structural metadata from the <code>EXT_structural_metadata</code> glTF extension
<p>
See the {@link https://github.com/CesiumGS/glTF/tree/3d-tiles-next/extensions/2.0/Vendor/EXT_structural_metadata|EXT_structural_metadata Extension} for glTF.
</p>

@param {object} options Object with the following properties:
@param {number} options.count The number of features in the batch table.
@param {object} options.batchTable The batch table JSON
@param {Uint8Array} [options.binaryBody] The batch table binary body
@param {boolean} [options.parseAsPropertyAttributes=false] If true, binary properties are parsed as property attributes instead of a property table. This is used for .pnts models for GPU styling.
@param {ModelComponents.Attribute[]} [options.customAttributeOutput] Pass in an empty array here and this method will populate it with a list of custom attributes that will store the values of the property attributes. The attributes will be created with typed arrays, the caller is responsible for uploading them to the GPU. This option is required when options.parseAsPropertyAttributes is true.
@return {StructuralMetadata} A transcoded structural metadata object

@private
@experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.