declare type BaseEncoding = 'WinAnsiEncoding' | 'Identity-H'; declare type DerivedEncoding = { BaseEncoding: BaseEncoding; Differences: Map; }; declare type Encoding = 'WinAnsiEncoding' | 'Identity-H' | DerivedEncoding; declare type Font$1 = { Encoding: Encoding; ToUnicode?: Map; }; interface PDFRef { ObjectNumber: number; GenerationNumber: number; } declare type PDFValue = null | number | string | boolean; declare type PDFObject = { [key: string]: A | PDFObject; } | PDFObject[] | A; declare type PDFObjectWithRefs = PDFObject; declare type XPages = { Type: 'Pages'; Kids: PDFRef[]; }; declare type XPage = { Type: 'Page'; Resources: PDFObjectWithRefs; Contents: PDFRef; MediaBox: number[]; }; declare type StreamDict = { Object: { Dict: { Filter: string; Length: number; }; StreamOffset: number; StreamLength: number; }; }; declare type XObject = { Object: XPage | XPages | PDFObjectWithRefs; } | StreamDict; interface XRefTable { Table: { [key: string]: XObject; }; PageCount: number; Root: PDFRef; RootDict: { Pages: PDFRef; OCProperties?: OCProperties; }; Title: string; } declare type OCProperties = { D: { ON?: PDFRef[]; OFF?: PDFRef[]; Order: PDFRef; RBGroups: unknown[]; }; OCGs: PDFRef[]; }; declare type Frame = { width: number; height: number; }; declare type TextLayerRecord = { name?: string; content: string; index: number; frame?: Frame; }; declare type RawPrivateData = () => AsyncGenerator; declare type PrivateData = { TextLayers?: TextLayerRecord[]; LayerNames: string[]; }; interface AIFile { XRefTable: XRefTable; Version: string; } declare type StreamDictFetcher = (objId: number) => Promise; interface Context { aiFile: AIFile; streamDict: StreamDictFetcher; privateData: RawPrivateData; externalResourceURLs?: { Bitmaps: { [key: string]: unknown; }; Fonts: { [key: string]: unknown; }; }; xobjectMutex: Map>; fontCache: Map>; parsedPrivateData?: Promise; strictPopplerCompat?: true; } interface Bitmap { name: string mime: string content: Uint8Array } type BitmapReader = () => Promise interface Font { name: string type: string content: Uint8Array } type FontReader = () => Promise interface ParsedFile { value: string // JSON-serialized bitmaps: Record fonts: Record // privateData: () => Promise<{ done: boolean, value: Uint8Array }> // almost AsyncIterator, dunno how to create one from Go WASM privateData: AsyncIterator streamDict: StreamDictFetcher } interface AICpu { parse: (fileBytes: Uint8Array) => Promise exit: () => void bufferSize: number } declare global { // called by wasm exec // eslint complains about var - wtf? // eslint-disable-next-line var IllustratorParser: AICpu | undefined // set by wasm exec // eslint complains about var - wtf? // eslint-disable-next-line var Go = Go } interface WasmContext extends Context { Bitmaps: ParsedFile['bitmaps']; Fonts: ParsedFile['fonts']; exit: () => void; } interface WASMContextOptions { bufferSize?: number; } declare function WASMContext(data: Uint8Array, options?: WASMContextOptions): Promise; export { Bitmap, BitmapReader, Font, FontReader, WASMContext, WASMContextOptions, WasmContext }; //# sourceMappingURL=wasm_context.d.ts.map