import BinaryParser from './BinaryParser'; import ByteReader from './ByteReader'; import Instance, { InstanceRoot } from './Instance'; import { toXmlString } from './XmlSerializer'; import { updateAnimationIds } from './utils'; /** * Options controlling how asset extraction is performed. By default both * animation and sound ID extraction are enabled. Additional custom * extractors may be provided; each extractor receives an instance and * returns an array of numeric IDs to include in the final result. */ export interface ParseOptions { /** When true (default), extract animation IDs from recognised properties. */ extractAnimations?: boolean; /** When true (default), extract sound IDs from recognised properties. */ extractSounds?: boolean; /** User defined extractors keyed by name. Each extractor is called for * every instance in the parsed model and should return any asset IDs it * discovers. The IDs will be collected under the corresponding key in * the returned AssetExtractionResults. */ additionalExtractors?: { [name: string]: (instance: Instance) => number[]; }; } /** * Results returned from parseBuffer(). In addition to the root instance * hierarchy and the flat list of all instances, any discovered asset IDs * are grouped into categories. The builtin categories are animationIds * and soundIds; custom extractors will appear as additional keys. */ export interface AssetExtractionResults { animationIds: number[]; soundIds: number[]; [key: string]: number[]; } export interface ParseResult { root: InstanceRoot; instances: Instance[]; assets: AssetExtractionResults; } /** * Parse a Roblox binary buffer (.rbxm or .rbxl) and return its instance * hierarchy along with any extracted asset references. This function * handles only the binary format; XML formatted files are not supported. */ export declare function parseBuffer(buffer: ArrayBuffer, options?: ParseOptions): ParseResult; export { Instance, InstanceRoot, BinaryParser, ByteReader, toXmlString, updateAnimationIds };