import type { Format } from "./format-types.js"; /** Options for writers */ export type WriterOptions = { core?: { /** worker source. If is set will be used instead of loading worker from the Internet */ source?: string | null; /** Force to load WASM libraries from local file system in NodeJS or from loaders.gl CDN in a web browser */ useLocalLibraries?: boolean; /** Whether to use workers under Node.js (experimental) */ _nodeWorkers?: boolean; /** Set to `false` to disable workers */ worker?: boolean; log?: any; }; /** Any additional JS libraries */ modules?: Record; /** writer-specific options */ [writerId: string]: Record | undefined; }; /** * A writer definition that can be used with `@loaders.gl/core` functions */ export type Writer = Format & { /** The result type of this loader */ dataType?: DataT; /** The batched result type of this loader */ batchType?: BatchT; /** Version should be injected by build tools */ version: string; /** A boolean, or a URL */ worker?: string | boolean; options: WriterOptionsT; deprecatedOptions?: Record; /** Human readable name */ name: string; /** id should be the same as the field used in LoaderOptions */ id: string; /** module is used to generate worker threads, need to be the module directory name */ module: string; /** Which category does this loader belong to */ category?: string; /** File extensions that are potential matches with this loader. */ extensions: string[]; /** MIMETypes that indicate a match with this loader. @note Some MIMETypes are generic and supported by many loaders */ mimeTypes?: string[]; /** Is the input of this loader binary */ binary?: boolean; /** Is the input of this loader text */ text?: boolean; }; /** * A writer definition that can be used with `@loaders.gl/core` functions */ export type WriterWithEncoder = Writer & { /** Encode to binary, asynchronously */ encode(data: DataT, options?: WriterOptionsT): Promise; /** Encode to binary, synchronously */ encodeSync?(data: DataT, options?: WriterOptionsT): ArrayBuffer; /** Encode to binary in batches */ encodeInBatches?(data: AsyncIterable, options?: WriterOptionsT): AsyncIterable; /** Encode to text, asynchronously. For text formats. */ encodeText?(table: DataT, options?: WriterOptionsT): Promise; /** Encode to text, synchronously. For text formats. */ encodeTextSync?(table: DataT, options?: WriterOptionsT): string; /** Encode to text in batched. For text formats. */ encodeTextInBatches?(data: AsyncIterable, options?: WriterOptionsT): AsyncIterable; encodeURLtoURL?: (inputUrl: string, outputUrl: string, options?: WriterOptionsT) => Promise; }; /** Typescript helper to extract the writer options type from a writer type */ export type WriterOptionsType = T extends Writer ? OptionsType : never; /** Typescript helper to extract input data type from a writer type */ export type WriterDataType = T extends Writer ? DataType : never; export type WriterBatchType = T extends Writer ? BatchType : never; //# sourceMappingURL=writer-types.d.ts.map