@loaders.gl/loader-utils 3.4.0-alpha.4 → 3.4.0-alpha.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/es5/json-loader.js +1 -1
- package/dist/es5/types.js.map +1 -1
- package/dist/esm/json-loader.js +1 -1
- package/dist/esm/types.js.map +1 -1
- package/dist/types.d.ts +32 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/types.ts +33 -2
package/dist/es5/json-loader.js
CHANGED
|
@@ -7,7 +7,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports._typecheckJSONLoader = exports.JSONLoader = void 0;
|
|
8
8
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
9
9
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
10
|
-
var VERSION = typeof "3.4.0-alpha.
|
|
10
|
+
var VERSION = typeof "3.4.0-alpha.5" !== 'undefined' ? "3.4.0-alpha.5" : 'latest';
|
|
11
11
|
var JSONLoader = {
|
|
12
12
|
name: 'JSON',
|
|
13
13
|
id: 'json',
|
package/dist/es5/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","names":[],"sources":["../../src/types.ts"],"sourcesContent":["// Typed arrays\n\nexport type TypedIntArray =\n | Int8Array\n | Uint8Array\n | Uint8ClampedArray\n | Int16Array\n | Uint16Array\n | Int32Array\n | Uint32Array\n | Int32Array\n | Uint32Array;\n\nexport type TypedFloatArray = Uint16Array | Float32Array | Float64Array;\n\nexport type TypedArray = TypedIntArray | TypedFloatArray;\n\nexport type NumericArray = Array<number> | TypedIntArray | TypedFloatArray;\n\ntype FetchLike = (url: string, options?: RequestInit) => Promise<Response>;\n\n/**\n * Core Loader Options\n */\nexport type LoaderOptions = {\n /** fetch options or a custom fetch function */\n fetch?: typeof fetch | FetchLike | RequestInit | null;\n /** Do not throw on errors */\n nothrow?: boolean;\n\n /** loader selection, search first for supplied mimeType */\n mimeType?: string;\n /** loader selection, provide fallback mimeType is server does not provide */\n fallbackMimeType?: string;\n /** loader selection, avoid searching registered loaders */\n ignoreRegisteredLoaders?: boolean;\n\n // general\n /** Experimental: Supply a logger to the parser */\n log?: any;\n\n // batched parsing\n\n /** Size of each batch. `auto` matches batches to size of incoming chunks */\n batchSize?: number | 'auto';\n /** Minimal amount of time between batches */\n batchDebounceMs?: number;\n /** Stop loading after a given number of rows (compare SQL limit clause) */\n limit?: 0;\n /** Experimental: Stop loading after reaching */\n _limitMB?: 0;\n /** Generate metadata batches */\n metadata?: boolean;\n /** Transforms to run on incoming batches */\n transforms?: TransformBatches[];\n\n // workers\n\n /** CDN load workers from */\n CDN?: string | null;\n /** Set to `false` to disable workers */\n worker?: boolean;\n /** Number of concurrent workers (per loader) on desktop browser */\n maxConcurrency?: number;\n /** Number of concurrent workers (per loader) on mobile browsers */\n maxMobileConcurrency?: number;\n /** Set to `false` to prevent reuse workers */\n reuseWorkers?: boolean;\n /** Whether to use workers under Node.js (experimental) */\n _nodeWorkers?: boolean;\n /** set to 'test' to run local worker */\n _workerType?: string;\n\n /** @deprecated `options.batchType` removed, Use `options.<loader>.type` instead */\n batchType?: 'row' | 'columnar' | 'arrow';\n /** @deprecated `options.throw removed`, Use `options.nothrow` instead */\n throws?: boolean;\n /** @deprecated `options.dataType` no longer used */\n dataType?: never;\n /** @deprecated `options.uri` no longer used */\n uri?: never;\n /** @deprecated `options.method` removed. Use `options.fetch.method` */\n method?: never;\n /** @deprecated `options.headers` removed. Use `options.fetch.headers` */\n headers?: never;\n /** @deprecated `options.body` removed. Use `options.fetch.body` */\n body?: never;\n /** @deprecated `options.mode` removed. Use `options.fetch.mode` */\n mode?: never;\n /** @deprecated `options.credentials` removed. Use `options.fetch.credentials` */\n credentials?: never;\n /** @deprecated `options.cache` removed. Use `options.fetch.cache` */\n cache?: never;\n /** @deprecated `options.redirect` removed. Use `options.fetch.redirect` */\n redirect?: never;\n /** @deprecated `options.referrer` removed. Use `options.fetch.referrer` */\n referrer?: never;\n /** @deprecated `options.referrerPolicy` removed. Use `options.fetch.referrerPolicy` */\n referrerPolicy?: never;\n /** @deprecated `options.integrity` removed. Use `options.fetch.integrity` */\n integrity?: never;\n /** @deprecated `options.keepalive` removed. Use `options.fetch.keepalive` */\n keepalive?: never;\n /** @deprecated `options.signal` removed. Use `options.fetch.signal` */\n signal?: never;\n\n // Accept other keys (loader options objects, e.g. `options.csv`, `options.json` ...)\n [loaderId: string]: unknown;\n};\n\ntype PreloadOptions = {\n [key: string]: unknown;\n};\n\n/**\n * A worker loader definition that can be used with `@loaders.gl/core` functions\n */\nexport type Loader = {\n // Worker\n name: string;\n id: string;\n module: string;\n version: string;\n worker?: string | boolean;\n options: LoaderOptions;\n deprecatedOptions?: object;\n // end Worker\n\n category?: string;\n extensions: string[];\n mimeTypes: string[];\n\n binary?: boolean;\n text?: boolean;\n\n tests?: (((ArrayBuffer: ArrayBuffer) => boolean) | ArrayBuffer | string)[];\n\n // TODO - deprecated\n supported?: boolean;\n testText?: (string: string) => boolean;\n};\n\n/**\n * A \"bundled\" loader definition that can be used with `@loaders.gl/core` functions\n * If a worker loader is supported it will also be supported.\n */\nexport type LoaderWithParser = Loader & {\n // TODO - deprecated\n testText?: (string: string) => boolean;\n\n parse: Parse;\n preload?: Preload;\n parseSync?: ParseSync;\n parseText?: ParseText;\n parseTextSync?: ParseTextSync;\n parseInBatches?: ParseInBatches;\n parseFileInBatches?: ParseFileInBatches;\n};\n\n/** Options for writers */\nexport type WriterOptions = {\n /** worker source. If is set will be used instead of loading worker from the Internet */\n souce?: string | null;\n /** writer-specific options */\n [writerId: string]: any;\n};\n\n/**\n * A writer definition that can be used with `@loaders.gl/core` functions\n */\nexport type Writer = {\n name: string;\n\n id: string;\n module: string;\n version: string;\n worker?: string | boolean;\n\n options: WriterOptions;\n deprecatedOptions?: object;\n\n // TODO - are these are needed?\n binary?: boolean;\n extensions?: string[];\n mimeTypes?: string[];\n text?: boolean;\n\n encode?: Encode;\n encodeSync?: EncodeSync;\n encodeInBatches?: EncodeInBatches;\n encodeURLtoURL?: EncodeURLtoURL;\n encodeText?: EncodeText;\n};\n\nexport type LoaderContext = {\n loaders?: Loader[] | null;\n url?: string;\n\n fetch: typeof fetch | FetchLike;\n response?: Response;\n parse: (\n arrayBuffer: ArrayBuffer,\n loaders?: Loader | Loader[] | LoaderOptions,\n options?: LoaderOptions,\n context?: LoaderContext\n ) => Promise<any>;\n parseSync?: (\n arrayBuffer: ArrayBuffer,\n loaders?: Loader | Loader[] | LoaderOptions,\n options?: LoaderOptions,\n context?: LoaderContext\n ) => any;\n parseInBatches?: (\n iterator: AsyncIterable<ArrayBuffer> | Iterable<ArrayBuffer>,\n loaders?: Loader | Loader[] | LoaderOptions,\n options?: LoaderOptions,\n context?: LoaderContext\n ) => AsyncIterable<any> | Promise<AsyncIterable<any>>;\n};\n\ntype Parse = (\n arrayBuffer: ArrayBuffer,\n options?: LoaderOptions,\n context?: LoaderContext\n) => Promise<any>;\ntype ParseSync = (\n arrayBuffer: ArrayBuffer,\n options?: LoaderOptions,\n context?: LoaderContext\n) => any;\ntype ParseText = (text: string, options?: LoaderOptions) => Promise<any>;\ntype ParseTextSync = (text: string, options?: LoaderOptions) => any;\ntype ParseInBatches = (\n iterator: AsyncIterable<ArrayBuffer> | Iterable<ArrayBuffer>,\n options?: LoaderOptions,\n context?: LoaderContext\n) => AsyncIterable<any>;\ntype ParseFileInBatches = (\n file: Blob,\n options?: LoaderOptions,\n context?: LoaderContext\n) => AsyncIterable<any>;\n\ntype Encode = (data: any, options?: WriterOptions) => Promise<ArrayBuffer>;\ntype EncodeSync = (data: any, options?: WriterOptions) => ArrayBuffer;\n// TODO\ntype EncodeText = Function;\ntype EncodeInBatches = Function;\ntype EncodeURLtoURL = (\n inputUrl: string,\n outputUrl: string,\n options?: WriterOptions\n) => Promise<string>;\ntype Preload = (url: string, options?: PreloadOptions) => any;\n\nexport type TransformBatches = (\n asyncIterator: AsyncIterable<ArrayBuffer> | Iterable<ArrayBuffer>\n) => AsyncIterable<ArrayBuffer>;\n\n/** Types that can be synchronously parsed */\nexport type SyncDataType = string | ArrayBuffer; // TODO File | Blob can be read synchronously...\n\n/** Types that can be parsed async */\nexport type DataType =\n | string\n | ArrayBuffer\n | File\n | Blob\n | Response\n | ReadableStream\n | Iterable<ArrayBuffer>\n | AsyncIterable<ArrayBuffer>;\n\n/** Types that can be parsed in batches */\nexport type BatchableDataType =\n | DataType\n | Iterable<ArrayBuffer>\n | AsyncIterable<ArrayBuffer>\n | Promise<AsyncIterable<ArrayBuffer>>;\n\n/**\n * A FileSystem interface can encapsulate a FileList, a ZipFile, a GoogleDrive etc.\n */\nexport interface IFileSystem {\n /**\n * Return a list of file names\n * @param dirname directory name. file system root directory if omitted\n */\n readdir(dirname?: string, options?: {recursive?: boolean}): Promise<string[]>;\n\n /**\n * Gets information from a local file from the filesystem\n * @param filename file name to stat\n * @param options currently unused\n * @throws if filename is not in local filesystem\n */\n stat(filename: string, options?: object): Promise<{size: number}>;\n\n /**\n * Fetches a local file from the filesystem (or a URL)\n * @param filename\n * @param options\n */\n fetch(filename: string, options?: object): Promise<Response>;\n}\n\ntype ReadOptions = {buffer?: ArrayBuffer; offset?: number; length?: number; position?: number};\nexport interface IRandomAccessReadFileSystem extends IFileSystem {\n open(path: string, flags: string | number, mode?: any): Promise<any>;\n close(fd: any): Promise<void>;\n fstat(fd: any): Promise<object>;\n read(fd: any, options?: ReadOptions): Promise<{bytesRead: number; buffer: Buffer}>;\n}\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"types.js","names":[],"sources":["../../src/types.ts"],"sourcesContent":["// Typed arrays\n\nexport type TypedIntArray =\n | Int8Array\n | Uint8Array\n | Uint8ClampedArray\n | Int16Array\n | Uint16Array\n | Int32Array\n | Uint32Array\n | Int32Array\n | Uint32Array;\n\nexport type TypedFloatArray = Uint16Array | Float32Array | Float64Array;\n\nexport type TypedArray = TypedIntArray | TypedFloatArray;\n\nexport type NumericArray = Array<number> | TypedIntArray | TypedFloatArray;\n\ntype FetchLike = (url: string, options?: RequestInit) => Promise<Response>;\n\n/**\n * Core Loader Options\n */\nexport type LoaderOptions = {\n /** fetch options or a custom fetch function */\n fetch?: typeof fetch | FetchLike | RequestInit | null;\n /** Do not throw on errors */\n nothrow?: boolean;\n\n /** loader selection, search first for supplied mimeType */\n mimeType?: string;\n /** loader selection, provide fallback mimeType is server does not provide */\n fallbackMimeType?: string;\n /** loader selection, avoid searching registered loaders */\n ignoreRegisteredLoaders?: boolean;\n\n // general\n /** Experimental: Supply a logger to the parser */\n log?: any;\n\n // batched parsing\n\n /** Size of each batch. `auto` matches batches to size of incoming chunks */\n batchSize?: number | 'auto';\n /** Minimal amount of time between batches */\n batchDebounceMs?: number;\n /** Stop loading after a given number of rows (compare SQL limit clause) */\n limit?: 0;\n /** Experimental: Stop loading after reaching */\n _limitMB?: 0;\n /** Generate metadata batches */\n metadata?: boolean;\n /** Transforms to run on incoming batches */\n transforms?: TransformBatches[];\n\n // workers\n\n /** CDN load workers from */\n CDN?: string | null;\n /** Set to `false` to disable workers */\n worker?: boolean;\n /** Number of concurrent workers (per loader) on desktop browser */\n maxConcurrency?: number;\n /** Number of concurrent workers (per loader) on mobile browsers */\n maxMobileConcurrency?: number;\n /** Set to `false` to prevent reuse workers */\n reuseWorkers?: boolean;\n /** Whether to use workers under Node.js (experimental) */\n _nodeWorkers?: boolean;\n /** set to 'test' to run local worker */\n _workerType?: string;\n\n /** @deprecated `options.batchType` removed, Use `options.<loader>.type` instead */\n batchType?: 'row' | 'columnar' | 'arrow';\n /** @deprecated `options.throw removed`, Use `options.nothrow` instead */\n throws?: boolean;\n /** @deprecated `options.dataType` no longer used */\n dataType?: never;\n /** @deprecated `options.uri` no longer used */\n uri?: never;\n /** @deprecated `options.method` removed. Use `options.fetch.method` */\n method?: never;\n /** @deprecated `options.headers` removed. Use `options.fetch.headers` */\n headers?: never;\n /** @deprecated `options.body` removed. Use `options.fetch.body` */\n body?: never;\n /** @deprecated `options.mode` removed. Use `options.fetch.mode` */\n mode?: never;\n /** @deprecated `options.credentials` removed. Use `options.fetch.credentials` */\n credentials?: never;\n /** @deprecated `options.cache` removed. Use `options.fetch.cache` */\n cache?: never;\n /** @deprecated `options.redirect` removed. Use `options.fetch.redirect` */\n redirect?: never;\n /** @deprecated `options.referrer` removed. Use `options.fetch.referrer` */\n referrer?: never;\n /** @deprecated `options.referrerPolicy` removed. Use `options.fetch.referrerPolicy` */\n referrerPolicy?: never;\n /** @deprecated `options.integrity` removed. Use `options.fetch.integrity` */\n integrity?: never;\n /** @deprecated `options.keepalive` removed. Use `options.fetch.keepalive` */\n keepalive?: never;\n /** @deprecated `options.signal` removed. Use `options.fetch.signal` */\n signal?: never;\n\n // Accept other keys (loader options objects, e.g. `options.csv`, `options.json` ...)\n [loaderId: string]: unknown;\n};\n\ntype PreloadOptions = {\n [key: string]: unknown;\n};\n\n/**\n * A worker loader definition that can be used with `@loaders.gl/core` functions\n */\nexport type Loader = {\n // Worker\n name: string;\n /** id should be the same as the field used in LoaderOptions */\n id: string;\n /** module is used to generate worker threads, need to be the module directory name */\n module: string;\n /** Version should be injected by build tools */\n version: string;\n /** A boolean, or a URL */\n worker?: string | boolean;\n /** Default Options */\n options: LoaderOptions;\n /** Deprecated Options */\n deprecatedOptions?: object;\n\n /** Which category does this loader belong to */\n category?: string;\n /** What extensions does this loader generate */\n extensions: string[];\n mimeTypes: string[];\n\n binary?: boolean;\n text?: boolean;\n\n tests?: (((ArrayBuffer: ArrayBuffer) => boolean) | ArrayBuffer | string)[];\n\n // TODO - deprecated\n supported?: boolean;\n testText?: (string: string) => boolean;\n};\n\n/**\n * A \"bundled\" loader definition that can be used with `@loaders.gl/core` functions\n * If a worker loader is supported it will also be supported.\n */\nexport type LoaderWithParser = Loader & {\n // TODO - deprecated\n testText?: (string: string) => boolean;\n\n parse: Parse;\n preload?: Preload;\n parseSync?: ParseSync;\n parseText?: ParseText;\n parseTextSync?: ParseTextSync;\n parseInBatches?: ParseInBatches;\n parseFileInBatches?: ParseFileInBatches;\n};\n\n/** Options for writers */\nexport type WriterOptions = {\n /** worker source. If is set will be used instead of loading worker from the Internet */\n souce?: string | null;\n /** writer-specific options */\n [writerId: string]: any;\n};\n\n/**\n * A writer definition that can be used with `@loaders.gl/core` functions\n */\nexport type Writer = {\n name: string;\n\n id: string;\n module: string;\n version: string;\n worker?: string | boolean;\n\n options: WriterOptions;\n deprecatedOptions?: object;\n\n // TODO - are these are needed?\n binary?: boolean;\n extensions?: string[];\n mimeTypes?: string[];\n text?: boolean;\n\n encode?: Encode;\n encodeSync?: EncodeSync;\n encodeInBatches?: EncodeInBatches;\n encodeURLtoURL?: EncodeURLtoURL;\n encodeText?: EncodeText;\n};\n\n/**\n * A Loader context is provided as a third parameters to a loader object's\n * parse functions when that loader is called by other loaders rather then\n * directly by the application.\n *\n * - The context object allows the subloaders to be aware of the parameters and\n * options that the application provided in the top level call.\n * - The context also providedsaccess to parse functions so that the subloader\n * does not need to include the core module.\n * - In addition, the context's parse functions may also redirect loads from worker\n * threads back to main thread.\n */\nexport type LoaderContext = {\n loaders?: Loader[] | null;\n /** If URL is available. */\n url?: string;\n /** the file name component of the URL (leading path and query string removed) */\n filename?: string;\n /** the directory name component of the URL (leading path excluding file name and query string) */\n baseUrl?: string;\n /** Query string (characters after `?`) */\n queryString?: string;\n\n /** Provides access to any application overrides of fetch() */\n fetch: typeof fetch | FetchLike;\n /** TBD */\n response?: Response;\n /** Parse function. Use instead of importing `core`. In workers, may redirect to main thread */\n parse: (\n arrayBuffer: ArrayBuffer,\n loaders?: Loader | Loader[] | LoaderOptions,\n options?: LoaderOptions,\n context?: LoaderContext\n ) => Promise<any>;\n /** ParseSync function. Use instead of importing `core`. In workers, may redirect to main thread */\n parseSync?: (\n arrayBuffer: ArrayBuffer,\n loaders?: Loader | Loader[] | LoaderOptions,\n options?: LoaderOptions,\n context?: LoaderContext\n ) => any;\n /** ParseInBatches function. Use instead of importing `core`. */\n parseInBatches?: (\n iterator: AsyncIterable<ArrayBuffer> | Iterable<ArrayBuffer>,\n loaders?: Loader | Loader[] | LoaderOptions,\n options?: LoaderOptions,\n context?: LoaderContext\n ) => AsyncIterable<any> | Promise<AsyncIterable<any>>;\n};\n\ntype Parse = (\n arrayBuffer: ArrayBuffer,\n options?: LoaderOptions,\n context?: LoaderContext\n) => Promise<any>;\ntype ParseSync = (\n arrayBuffer: ArrayBuffer,\n options?: LoaderOptions,\n context?: LoaderContext\n) => any;\ntype ParseText = (text: string, options?: LoaderOptions) => Promise<any>;\ntype ParseTextSync = (text: string, options?: LoaderOptions) => any;\ntype ParseInBatches = (\n iterator: AsyncIterable<ArrayBuffer> | Iterable<ArrayBuffer>,\n options?: LoaderOptions,\n context?: LoaderContext\n) => AsyncIterable<any>;\ntype ParseFileInBatches = (\n file: Blob,\n options?: LoaderOptions,\n context?: LoaderContext\n) => AsyncIterable<any>;\n\ntype Encode = (data: any, options?: WriterOptions) => Promise<ArrayBuffer>;\ntype EncodeSync = (data: any, options?: WriterOptions) => ArrayBuffer;\n// TODO\ntype EncodeText = Function;\ntype EncodeInBatches = Function;\ntype EncodeURLtoURL = (\n inputUrl: string,\n outputUrl: string,\n options?: WriterOptions\n) => Promise<string>;\ntype Preload = (url: string, options?: PreloadOptions) => any;\n\nexport type TransformBatches = (\n asyncIterator: AsyncIterable<ArrayBuffer> | Iterable<ArrayBuffer>\n) => AsyncIterable<ArrayBuffer>;\n\n/** Types that can be synchronously parsed */\nexport type SyncDataType = string | ArrayBuffer; // TODO File | Blob can be read synchronously...\n\n/** Types that can be parsed async */\nexport type DataType =\n | string\n | ArrayBuffer\n | File\n | Blob\n | Response\n | ReadableStream\n | Iterable<ArrayBuffer>\n | AsyncIterable<ArrayBuffer>;\n\n/** Types that can be parsed in batches */\nexport type BatchableDataType =\n | DataType\n | Iterable<ArrayBuffer>\n | AsyncIterable<ArrayBuffer>\n | Promise<AsyncIterable<ArrayBuffer>>;\n\n/**\n * A FileSystem interface can encapsulate a FileList, a ZipFile, a GoogleDrive etc.\n */\nexport interface IFileSystem {\n /**\n * Return a list of file names\n * @param dirname directory name. file system root directory if omitted\n */\n readdir(dirname?: string, options?: {recursive?: boolean}): Promise<string[]>;\n\n /**\n * Gets information from a local file from the filesystem\n * @param filename file name to stat\n * @param options currently unused\n * @throws if filename is not in local filesystem\n */\n stat(filename: string, options?: object): Promise<{size: number}>;\n\n /**\n * Fetches a local file from the filesystem (or a URL)\n * @param filename\n * @param options\n */\n fetch(filename: string, options?: object): Promise<Response>;\n}\n\ntype ReadOptions = {buffer?: ArrayBuffer; offset?: number; length?: number; position?: number};\nexport interface IRandomAccessReadFileSystem extends IFileSystem {\n open(path: string, flags: string | number, mode?: any): Promise<any>;\n close(fd: any): Promise<void>;\n fstat(fd: any): Promise<object>;\n read(fd: any, options?: ReadOptions): Promise<{bytesRead: number; buffer: Buffer}>;\n}\n"],"mappings":""}
|
package/dist/esm/json-loader.js
CHANGED
package/dist/esm/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","names":[],"sources":["../../src/types.ts"],"sourcesContent":["// Typed arrays\n\nexport type TypedIntArray =\n | Int8Array\n | Uint8Array\n | Uint8ClampedArray\n | Int16Array\n | Uint16Array\n | Int32Array\n | Uint32Array\n | Int32Array\n | Uint32Array;\n\nexport type TypedFloatArray = Uint16Array | Float32Array | Float64Array;\n\nexport type TypedArray = TypedIntArray | TypedFloatArray;\n\nexport type NumericArray = Array<number> | TypedIntArray | TypedFloatArray;\n\ntype FetchLike = (url: string, options?: RequestInit) => Promise<Response>;\n\n/**\n * Core Loader Options\n */\nexport type LoaderOptions = {\n /** fetch options or a custom fetch function */\n fetch?: typeof fetch | FetchLike | RequestInit | null;\n /** Do not throw on errors */\n nothrow?: boolean;\n\n /** loader selection, search first for supplied mimeType */\n mimeType?: string;\n /** loader selection, provide fallback mimeType is server does not provide */\n fallbackMimeType?: string;\n /** loader selection, avoid searching registered loaders */\n ignoreRegisteredLoaders?: boolean;\n\n // general\n /** Experimental: Supply a logger to the parser */\n log?: any;\n\n // batched parsing\n\n /** Size of each batch. `auto` matches batches to size of incoming chunks */\n batchSize?: number | 'auto';\n /** Minimal amount of time between batches */\n batchDebounceMs?: number;\n /** Stop loading after a given number of rows (compare SQL limit clause) */\n limit?: 0;\n /** Experimental: Stop loading after reaching */\n _limitMB?: 0;\n /** Generate metadata batches */\n metadata?: boolean;\n /** Transforms to run on incoming batches */\n transforms?: TransformBatches[];\n\n // workers\n\n /** CDN load workers from */\n CDN?: string | null;\n /** Set to `false` to disable workers */\n worker?: boolean;\n /** Number of concurrent workers (per loader) on desktop browser */\n maxConcurrency?: number;\n /** Number of concurrent workers (per loader) on mobile browsers */\n maxMobileConcurrency?: number;\n /** Set to `false` to prevent reuse workers */\n reuseWorkers?: boolean;\n /** Whether to use workers under Node.js (experimental) */\n _nodeWorkers?: boolean;\n /** set to 'test' to run local worker */\n _workerType?: string;\n\n /** @deprecated `options.batchType` removed, Use `options.<loader>.type` instead */\n batchType?: 'row' | 'columnar' | 'arrow';\n /** @deprecated `options.throw removed`, Use `options.nothrow` instead */\n throws?: boolean;\n /** @deprecated `options.dataType` no longer used */\n dataType?: never;\n /** @deprecated `options.uri` no longer used */\n uri?: never;\n /** @deprecated `options.method` removed. Use `options.fetch.method` */\n method?: never;\n /** @deprecated `options.headers` removed. Use `options.fetch.headers` */\n headers?: never;\n /** @deprecated `options.body` removed. Use `options.fetch.body` */\n body?: never;\n /** @deprecated `options.mode` removed. Use `options.fetch.mode` */\n mode?: never;\n /** @deprecated `options.credentials` removed. Use `options.fetch.credentials` */\n credentials?: never;\n /** @deprecated `options.cache` removed. Use `options.fetch.cache` */\n cache?: never;\n /** @deprecated `options.redirect` removed. Use `options.fetch.redirect` */\n redirect?: never;\n /** @deprecated `options.referrer` removed. Use `options.fetch.referrer` */\n referrer?: never;\n /** @deprecated `options.referrerPolicy` removed. Use `options.fetch.referrerPolicy` */\n referrerPolicy?: never;\n /** @deprecated `options.integrity` removed. Use `options.fetch.integrity` */\n integrity?: never;\n /** @deprecated `options.keepalive` removed. Use `options.fetch.keepalive` */\n keepalive?: never;\n /** @deprecated `options.signal` removed. Use `options.fetch.signal` */\n signal?: never;\n\n // Accept other keys (loader options objects, e.g. `options.csv`, `options.json` ...)\n [loaderId: string]: unknown;\n};\n\ntype PreloadOptions = {\n [key: string]: unknown;\n};\n\n/**\n * A worker loader definition that can be used with `@loaders.gl/core` functions\n */\nexport type Loader = {\n // Worker\n name: string;\n id: string;\n module: string;\n version: string;\n worker?: string | boolean;\n options: LoaderOptions;\n deprecatedOptions?: object;\n // end Worker\n\n category?: string;\n extensions: string[];\n mimeTypes: string[];\n\n binary?: boolean;\n text?: boolean;\n\n tests?: (((ArrayBuffer: ArrayBuffer) => boolean) | ArrayBuffer | string)[];\n\n // TODO - deprecated\n supported?: boolean;\n testText?: (string: string) => boolean;\n};\n\n/**\n * A \"bundled\" loader definition that can be used with `@loaders.gl/core` functions\n * If a worker loader is supported it will also be supported.\n */\nexport type LoaderWithParser = Loader & {\n // TODO - deprecated\n testText?: (string: string) => boolean;\n\n parse: Parse;\n preload?: Preload;\n parseSync?: ParseSync;\n parseText?: ParseText;\n parseTextSync?: ParseTextSync;\n parseInBatches?: ParseInBatches;\n parseFileInBatches?: ParseFileInBatches;\n};\n\n/** Options for writers */\nexport type WriterOptions = {\n /** worker source. If is set will be used instead of loading worker from the Internet */\n souce?: string | null;\n /** writer-specific options */\n [writerId: string]: any;\n};\n\n/**\n * A writer definition that can be used with `@loaders.gl/core` functions\n */\nexport type Writer = {\n name: string;\n\n id: string;\n module: string;\n version: string;\n worker?: string | boolean;\n\n options: WriterOptions;\n deprecatedOptions?: object;\n\n // TODO - are these are needed?\n binary?: boolean;\n extensions?: string[];\n mimeTypes?: string[];\n text?: boolean;\n\n encode?: Encode;\n encodeSync?: EncodeSync;\n encodeInBatches?: EncodeInBatches;\n encodeURLtoURL?: EncodeURLtoURL;\n encodeText?: EncodeText;\n};\n\nexport type LoaderContext = {\n loaders?: Loader[] | null;\n url?: string;\n\n fetch: typeof fetch | FetchLike;\n response?: Response;\n parse: (\n arrayBuffer: ArrayBuffer,\n loaders?: Loader | Loader[] | LoaderOptions,\n options?: LoaderOptions,\n context?: LoaderContext\n ) => Promise<any>;\n parseSync?: (\n arrayBuffer: ArrayBuffer,\n loaders?: Loader | Loader[] | LoaderOptions,\n options?: LoaderOptions,\n context?: LoaderContext\n ) => any;\n parseInBatches?: (\n iterator: AsyncIterable<ArrayBuffer> | Iterable<ArrayBuffer>,\n loaders?: Loader | Loader[] | LoaderOptions,\n options?: LoaderOptions,\n context?: LoaderContext\n ) => AsyncIterable<any> | Promise<AsyncIterable<any>>;\n};\n\ntype Parse = (\n arrayBuffer: ArrayBuffer,\n options?: LoaderOptions,\n context?: LoaderContext\n) => Promise<any>;\ntype ParseSync = (\n arrayBuffer: ArrayBuffer,\n options?: LoaderOptions,\n context?: LoaderContext\n) => any;\ntype ParseText = (text: string, options?: LoaderOptions) => Promise<any>;\ntype ParseTextSync = (text: string, options?: LoaderOptions) => any;\ntype ParseInBatches = (\n iterator: AsyncIterable<ArrayBuffer> | Iterable<ArrayBuffer>,\n options?: LoaderOptions,\n context?: LoaderContext\n) => AsyncIterable<any>;\ntype ParseFileInBatches = (\n file: Blob,\n options?: LoaderOptions,\n context?: LoaderContext\n) => AsyncIterable<any>;\n\ntype Encode = (data: any, options?: WriterOptions) => Promise<ArrayBuffer>;\ntype EncodeSync = (data: any, options?: WriterOptions) => ArrayBuffer;\n// TODO\ntype EncodeText = Function;\ntype EncodeInBatches = Function;\ntype EncodeURLtoURL = (\n inputUrl: string,\n outputUrl: string,\n options?: WriterOptions\n) => Promise<string>;\ntype Preload = (url: string, options?: PreloadOptions) => any;\n\nexport type TransformBatches = (\n asyncIterator: AsyncIterable<ArrayBuffer> | Iterable<ArrayBuffer>\n) => AsyncIterable<ArrayBuffer>;\n\n/** Types that can be synchronously parsed */\nexport type SyncDataType = string | ArrayBuffer; // TODO File | Blob can be read synchronously...\n\n/** Types that can be parsed async */\nexport type DataType =\n | string\n | ArrayBuffer\n | File\n | Blob\n | Response\n | ReadableStream\n | Iterable<ArrayBuffer>\n | AsyncIterable<ArrayBuffer>;\n\n/** Types that can be parsed in batches */\nexport type BatchableDataType =\n | DataType\n | Iterable<ArrayBuffer>\n | AsyncIterable<ArrayBuffer>\n | Promise<AsyncIterable<ArrayBuffer>>;\n\n/**\n * A FileSystem interface can encapsulate a FileList, a ZipFile, a GoogleDrive etc.\n */\nexport interface IFileSystem {\n /**\n * Return a list of file names\n * @param dirname directory name. file system root directory if omitted\n */\n readdir(dirname?: string, options?: {recursive?: boolean}): Promise<string[]>;\n\n /**\n * Gets information from a local file from the filesystem\n * @param filename file name to stat\n * @param options currently unused\n * @throws if filename is not in local filesystem\n */\n stat(filename: string, options?: object): Promise<{size: number}>;\n\n /**\n * Fetches a local file from the filesystem (or a URL)\n * @param filename\n * @param options\n */\n fetch(filename: string, options?: object): Promise<Response>;\n}\n\ntype ReadOptions = {buffer?: ArrayBuffer; offset?: number; length?: number; position?: number};\nexport interface IRandomAccessReadFileSystem extends IFileSystem {\n open(path: string, flags: string | number, mode?: any): Promise<any>;\n close(fd: any): Promise<void>;\n fstat(fd: any): Promise<object>;\n read(fd: any, options?: ReadOptions): Promise<{bytesRead: number; buffer: Buffer}>;\n}\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"types.js","names":[],"sources":["../../src/types.ts"],"sourcesContent":["// Typed arrays\n\nexport type TypedIntArray =\n | Int8Array\n | Uint8Array\n | Uint8ClampedArray\n | Int16Array\n | Uint16Array\n | Int32Array\n | Uint32Array\n | Int32Array\n | Uint32Array;\n\nexport type TypedFloatArray = Uint16Array | Float32Array | Float64Array;\n\nexport type TypedArray = TypedIntArray | TypedFloatArray;\n\nexport type NumericArray = Array<number> | TypedIntArray | TypedFloatArray;\n\ntype FetchLike = (url: string, options?: RequestInit) => Promise<Response>;\n\n/**\n * Core Loader Options\n */\nexport type LoaderOptions = {\n /** fetch options or a custom fetch function */\n fetch?: typeof fetch | FetchLike | RequestInit | null;\n /** Do not throw on errors */\n nothrow?: boolean;\n\n /** loader selection, search first for supplied mimeType */\n mimeType?: string;\n /** loader selection, provide fallback mimeType is server does not provide */\n fallbackMimeType?: string;\n /** loader selection, avoid searching registered loaders */\n ignoreRegisteredLoaders?: boolean;\n\n // general\n /** Experimental: Supply a logger to the parser */\n log?: any;\n\n // batched parsing\n\n /** Size of each batch. `auto` matches batches to size of incoming chunks */\n batchSize?: number | 'auto';\n /** Minimal amount of time between batches */\n batchDebounceMs?: number;\n /** Stop loading after a given number of rows (compare SQL limit clause) */\n limit?: 0;\n /** Experimental: Stop loading after reaching */\n _limitMB?: 0;\n /** Generate metadata batches */\n metadata?: boolean;\n /** Transforms to run on incoming batches */\n transforms?: TransformBatches[];\n\n // workers\n\n /** CDN load workers from */\n CDN?: string | null;\n /** Set to `false` to disable workers */\n worker?: boolean;\n /** Number of concurrent workers (per loader) on desktop browser */\n maxConcurrency?: number;\n /** Number of concurrent workers (per loader) on mobile browsers */\n maxMobileConcurrency?: number;\n /** Set to `false` to prevent reuse workers */\n reuseWorkers?: boolean;\n /** Whether to use workers under Node.js (experimental) */\n _nodeWorkers?: boolean;\n /** set to 'test' to run local worker */\n _workerType?: string;\n\n /** @deprecated `options.batchType` removed, Use `options.<loader>.type` instead */\n batchType?: 'row' | 'columnar' | 'arrow';\n /** @deprecated `options.throw removed`, Use `options.nothrow` instead */\n throws?: boolean;\n /** @deprecated `options.dataType` no longer used */\n dataType?: never;\n /** @deprecated `options.uri` no longer used */\n uri?: never;\n /** @deprecated `options.method` removed. Use `options.fetch.method` */\n method?: never;\n /** @deprecated `options.headers` removed. Use `options.fetch.headers` */\n headers?: never;\n /** @deprecated `options.body` removed. Use `options.fetch.body` */\n body?: never;\n /** @deprecated `options.mode` removed. Use `options.fetch.mode` */\n mode?: never;\n /** @deprecated `options.credentials` removed. Use `options.fetch.credentials` */\n credentials?: never;\n /** @deprecated `options.cache` removed. Use `options.fetch.cache` */\n cache?: never;\n /** @deprecated `options.redirect` removed. Use `options.fetch.redirect` */\n redirect?: never;\n /** @deprecated `options.referrer` removed. Use `options.fetch.referrer` */\n referrer?: never;\n /** @deprecated `options.referrerPolicy` removed. Use `options.fetch.referrerPolicy` */\n referrerPolicy?: never;\n /** @deprecated `options.integrity` removed. Use `options.fetch.integrity` */\n integrity?: never;\n /** @deprecated `options.keepalive` removed. Use `options.fetch.keepalive` */\n keepalive?: never;\n /** @deprecated `options.signal` removed. Use `options.fetch.signal` */\n signal?: never;\n\n // Accept other keys (loader options objects, e.g. `options.csv`, `options.json` ...)\n [loaderId: string]: unknown;\n};\n\ntype PreloadOptions = {\n [key: string]: unknown;\n};\n\n/**\n * A worker loader definition that can be used with `@loaders.gl/core` functions\n */\nexport type Loader = {\n // Worker\n name: string;\n /** id should be the same as the field used in LoaderOptions */\n id: string;\n /** module is used to generate worker threads, need to be the module directory name */\n module: string;\n /** Version should be injected by build tools */\n version: string;\n /** A boolean, or a URL */\n worker?: string | boolean;\n /** Default Options */\n options: LoaderOptions;\n /** Deprecated Options */\n deprecatedOptions?: object;\n\n /** Which category does this loader belong to */\n category?: string;\n /** What extensions does this loader generate */\n extensions: string[];\n mimeTypes: string[];\n\n binary?: boolean;\n text?: boolean;\n\n tests?: (((ArrayBuffer: ArrayBuffer) => boolean) | ArrayBuffer | string)[];\n\n // TODO - deprecated\n supported?: boolean;\n testText?: (string: string) => boolean;\n};\n\n/**\n * A \"bundled\" loader definition that can be used with `@loaders.gl/core` functions\n * If a worker loader is supported it will also be supported.\n */\nexport type LoaderWithParser = Loader & {\n // TODO - deprecated\n testText?: (string: string) => boolean;\n\n parse: Parse;\n preload?: Preload;\n parseSync?: ParseSync;\n parseText?: ParseText;\n parseTextSync?: ParseTextSync;\n parseInBatches?: ParseInBatches;\n parseFileInBatches?: ParseFileInBatches;\n};\n\n/** Options for writers */\nexport type WriterOptions = {\n /** worker source. If is set will be used instead of loading worker from the Internet */\n souce?: string | null;\n /** writer-specific options */\n [writerId: string]: any;\n};\n\n/**\n * A writer definition that can be used with `@loaders.gl/core` functions\n */\nexport type Writer = {\n name: string;\n\n id: string;\n module: string;\n version: string;\n worker?: string | boolean;\n\n options: WriterOptions;\n deprecatedOptions?: object;\n\n // TODO - are these are needed?\n binary?: boolean;\n extensions?: string[];\n mimeTypes?: string[];\n text?: boolean;\n\n encode?: Encode;\n encodeSync?: EncodeSync;\n encodeInBatches?: EncodeInBatches;\n encodeURLtoURL?: EncodeURLtoURL;\n encodeText?: EncodeText;\n};\n\n/**\n * A Loader context is provided as a third parameters to a loader object's\n * parse functions when that loader is called by other loaders rather then\n * directly by the application.\n *\n * - The context object allows the subloaders to be aware of the parameters and\n * options that the application provided in the top level call.\n * - The context also providedsaccess to parse functions so that the subloader\n * does not need to include the core module.\n * - In addition, the context's parse functions may also redirect loads from worker\n * threads back to main thread.\n */\nexport type LoaderContext = {\n loaders?: Loader[] | null;\n /** If URL is available. */\n url?: string;\n /** the file name component of the URL (leading path and query string removed) */\n filename?: string;\n /** the directory name component of the URL (leading path excluding file name and query string) */\n baseUrl?: string;\n /** Query string (characters after `?`) */\n queryString?: string;\n\n /** Provides access to any application overrides of fetch() */\n fetch: typeof fetch | FetchLike;\n /** TBD */\n response?: Response;\n /** Parse function. Use instead of importing `core`. In workers, may redirect to main thread */\n parse: (\n arrayBuffer: ArrayBuffer,\n loaders?: Loader | Loader[] | LoaderOptions,\n options?: LoaderOptions,\n context?: LoaderContext\n ) => Promise<any>;\n /** ParseSync function. Use instead of importing `core`. In workers, may redirect to main thread */\n parseSync?: (\n arrayBuffer: ArrayBuffer,\n loaders?: Loader | Loader[] | LoaderOptions,\n options?: LoaderOptions,\n context?: LoaderContext\n ) => any;\n /** ParseInBatches function. Use instead of importing `core`. */\n parseInBatches?: (\n iterator: AsyncIterable<ArrayBuffer> | Iterable<ArrayBuffer>,\n loaders?: Loader | Loader[] | LoaderOptions,\n options?: LoaderOptions,\n context?: LoaderContext\n ) => AsyncIterable<any> | Promise<AsyncIterable<any>>;\n};\n\ntype Parse = (\n arrayBuffer: ArrayBuffer,\n options?: LoaderOptions,\n context?: LoaderContext\n) => Promise<any>;\ntype ParseSync = (\n arrayBuffer: ArrayBuffer,\n options?: LoaderOptions,\n context?: LoaderContext\n) => any;\ntype ParseText = (text: string, options?: LoaderOptions) => Promise<any>;\ntype ParseTextSync = (text: string, options?: LoaderOptions) => any;\ntype ParseInBatches = (\n iterator: AsyncIterable<ArrayBuffer> | Iterable<ArrayBuffer>,\n options?: LoaderOptions,\n context?: LoaderContext\n) => AsyncIterable<any>;\ntype ParseFileInBatches = (\n file: Blob,\n options?: LoaderOptions,\n context?: LoaderContext\n) => AsyncIterable<any>;\n\ntype Encode = (data: any, options?: WriterOptions) => Promise<ArrayBuffer>;\ntype EncodeSync = (data: any, options?: WriterOptions) => ArrayBuffer;\n// TODO\ntype EncodeText = Function;\ntype EncodeInBatches = Function;\ntype EncodeURLtoURL = (\n inputUrl: string,\n outputUrl: string,\n options?: WriterOptions\n) => Promise<string>;\ntype Preload = (url: string, options?: PreloadOptions) => any;\n\nexport type TransformBatches = (\n asyncIterator: AsyncIterable<ArrayBuffer> | Iterable<ArrayBuffer>\n) => AsyncIterable<ArrayBuffer>;\n\n/** Types that can be synchronously parsed */\nexport type SyncDataType = string | ArrayBuffer; // TODO File | Blob can be read synchronously...\n\n/** Types that can be parsed async */\nexport type DataType =\n | string\n | ArrayBuffer\n | File\n | Blob\n | Response\n | ReadableStream\n | Iterable<ArrayBuffer>\n | AsyncIterable<ArrayBuffer>;\n\n/** Types that can be parsed in batches */\nexport type BatchableDataType =\n | DataType\n | Iterable<ArrayBuffer>\n | AsyncIterable<ArrayBuffer>\n | Promise<AsyncIterable<ArrayBuffer>>;\n\n/**\n * A FileSystem interface can encapsulate a FileList, a ZipFile, a GoogleDrive etc.\n */\nexport interface IFileSystem {\n /**\n * Return a list of file names\n * @param dirname directory name. file system root directory if omitted\n */\n readdir(dirname?: string, options?: {recursive?: boolean}): Promise<string[]>;\n\n /**\n * Gets information from a local file from the filesystem\n * @param filename file name to stat\n * @param options currently unused\n * @throws if filename is not in local filesystem\n */\n stat(filename: string, options?: object): Promise<{size: number}>;\n\n /**\n * Fetches a local file from the filesystem (or a URL)\n * @param filename\n * @param options\n */\n fetch(filename: string, options?: object): Promise<Response>;\n}\n\ntype ReadOptions = {buffer?: ArrayBuffer; offset?: number; length?: number; position?: number};\nexport interface IRandomAccessReadFileSystem extends IFileSystem {\n open(path: string, flags: string | number, mode?: any): Promise<any>;\n close(fd: any): Promise<void>;\n fstat(fd: any): Promise<object>;\n read(fd: any, options?: ReadOptions): Promise<{bytesRead: number; buffer: Buffer}>;\n}\n"],"mappings":""}
|
package/dist/types.d.ts
CHANGED
|
@@ -88,13 +88,21 @@ type PreloadOptions = {
|
|
|
88
88
|
*/
|
|
89
89
|
export type Loader = {
|
|
90
90
|
name: string;
|
|
91
|
+
/** id should be the same as the field used in LoaderOptions */
|
|
91
92
|
id: string;
|
|
93
|
+
/** module is used to generate worker threads, need to be the module directory name */
|
|
92
94
|
module: string;
|
|
95
|
+
/** Version should be injected by build tools */
|
|
93
96
|
version: string;
|
|
97
|
+
/** A boolean, or a URL */
|
|
94
98
|
worker?: string | boolean;
|
|
99
|
+
/** Default Options */
|
|
95
100
|
options: LoaderOptions;
|
|
101
|
+
/** Deprecated Options */
|
|
96
102
|
deprecatedOptions?: object;
|
|
103
|
+
/** Which category does this loader belong to */
|
|
97
104
|
category?: string;
|
|
105
|
+
/** What extensions does this loader generate */
|
|
98
106
|
extensions: string[];
|
|
99
107
|
mimeTypes: string[];
|
|
100
108
|
binary?: boolean;
|
|
@@ -145,13 +153,37 @@ export type Writer = {
|
|
|
145
153
|
encodeURLtoURL?: EncodeURLtoURL;
|
|
146
154
|
encodeText?: EncodeText;
|
|
147
155
|
};
|
|
156
|
+
/**
|
|
157
|
+
* A Loader context is provided as a third parameters to a loader object's
|
|
158
|
+
* parse functions when that loader is called by other loaders rather then
|
|
159
|
+
* directly by the application.
|
|
160
|
+
*
|
|
161
|
+
* - The context object allows the subloaders to be aware of the parameters and
|
|
162
|
+
* options that the application provided in the top level call.
|
|
163
|
+
* - The context also providedsaccess to parse functions so that the subloader
|
|
164
|
+
* does not need to include the core module.
|
|
165
|
+
* - In addition, the context's parse functions may also redirect loads from worker
|
|
166
|
+
* threads back to main thread.
|
|
167
|
+
*/
|
|
148
168
|
export type LoaderContext = {
|
|
149
169
|
loaders?: Loader[] | null;
|
|
170
|
+
/** If URL is available. */
|
|
150
171
|
url?: string;
|
|
172
|
+
/** the file name component of the URL (leading path and query string removed) */
|
|
173
|
+
filename?: string;
|
|
174
|
+
/** the directory name component of the URL (leading path excluding file name and query string) */
|
|
175
|
+
baseUrl?: string;
|
|
176
|
+
/** Query string (characters after `?`) */
|
|
177
|
+
queryString?: string;
|
|
178
|
+
/** Provides access to any application overrides of fetch() */
|
|
151
179
|
fetch: typeof fetch | FetchLike;
|
|
180
|
+
/** TBD */
|
|
152
181
|
response?: Response;
|
|
182
|
+
/** Parse function. Use instead of importing `core`. In workers, may redirect to main thread */
|
|
153
183
|
parse: (arrayBuffer: ArrayBuffer, loaders?: Loader | Loader[] | LoaderOptions, options?: LoaderOptions, context?: LoaderContext) => Promise<any>;
|
|
184
|
+
/** ParseSync function. Use instead of importing `core`. In workers, may redirect to main thread */
|
|
154
185
|
parseSync?: (arrayBuffer: ArrayBuffer, loaders?: Loader | Loader[] | LoaderOptions, options?: LoaderOptions, context?: LoaderContext) => any;
|
|
186
|
+
/** ParseInBatches function. Use instead of importing `core`. */
|
|
155
187
|
parseInBatches?: (iterator: AsyncIterable<ArrayBuffer> | Iterable<ArrayBuffer>, loaders?: Loader | Loader[] | LoaderOptions, options?: LoaderOptions, context?: LoaderContext) => AsyncIterable<any> | Promise<AsyncIterable<any>>;
|
|
156
188
|
};
|
|
157
189
|
type Parse = (arrayBuffer: ArrayBuffer, options?: LoaderOptions, context?: LoaderContext) => Promise<any>;
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":";AAEA,MAAM,MAAM,aAAa,GACrB,SAAS,GACT,UAAU,GACV,iBAAiB,GACjB,UAAU,GACV,WAAW,GACX,UAAU,GACV,WAAW,GACX,UAAU,GACV,WAAW,CAAC;AAEhB,MAAM,MAAM,eAAe,GAAG,WAAW,GAAG,YAAY,GAAG,YAAY,CAAC;AAExE,MAAM,MAAM,UAAU,GAAG,aAAa,GAAG,eAAe,CAAC;AAEzD,MAAM,MAAM,YAAY,GAAG,KAAK,CAAC,MAAM,CAAC,GAAG,aAAa,GAAG,eAAe,CAAC;AAE3E,KAAK,SAAS,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,WAAW,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAC;AAE3E;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B,+CAA+C;IAC/C,KAAK,CAAC,EAAE,OAAO,KAAK,GAAG,SAAS,GAAG,WAAW,GAAG,IAAI,CAAC;IACtD,6BAA6B;IAC7B,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB,2DAA2D;IAC3D,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,6EAA6E;IAC7E,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,2DAA2D;IAC3D,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAGlC,kDAAkD;IAClD,GAAG,CAAC,EAAE,GAAG,CAAC;IAIV,4EAA4E;IAC5E,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC5B,6CAA6C;IAC7C,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,2EAA2E;IAC3E,KAAK,CAAC,EAAE,CAAC,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CAAA;KAAC,CAAC,CAAC;IAElE;;;;OAIG;IACH,KAAK,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;CAC9D;AAED,KAAK,WAAW,GAAG;IAAC,MAAM,CAAC,EAAE,WAAW,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAC,CAAC;AAC/F,MAAM,WAAW,2BAA4B,SAAQ,WAAW;IAC9D,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,IAAI,CAAC,EAAE,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;IACrE,KAAK,CAAC,EAAE,EAAE,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9B,KAAK,CAAC,EAAE,EAAE,GAAG,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAChC,IAAI,CAAC,EAAE,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC;QAAC,SAAS,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAC,CAAC,CAAC;CACpF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@loaders.gl/loader-utils",
|
|
3
|
-
"version": "3.4.0-alpha.
|
|
3
|
+
"version": "3.4.0-alpha.5",
|
|
4
4
|
"description": "Framework-independent loaders for 3D graphics formats",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"publishConfig": {
|
|
@@ -38,8 +38,8 @@
|
|
|
38
38
|
"scripts": {},
|
|
39
39
|
"dependencies": {
|
|
40
40
|
"@babel/runtime": "^7.3.1",
|
|
41
|
-
"@loaders.gl/worker-utils": "3.4.0-alpha.
|
|
41
|
+
"@loaders.gl/worker-utils": "3.4.0-alpha.5",
|
|
42
42
|
"@probe.gl/stats": "^4.0.1"
|
|
43
43
|
},
|
|
44
|
-
"gitHead": "
|
|
44
|
+
"gitHead": "686929f85b3420c15df051eab769942b260dd242"
|
|
45
45
|
}
|
package/src/types.ts
CHANGED
|
@@ -118,15 +118,22 @@ type PreloadOptions = {
|
|
|
118
118
|
export type Loader = {
|
|
119
119
|
// Worker
|
|
120
120
|
name: string;
|
|
121
|
+
/** id should be the same as the field used in LoaderOptions */
|
|
121
122
|
id: string;
|
|
123
|
+
/** module is used to generate worker threads, need to be the module directory name */
|
|
122
124
|
module: string;
|
|
125
|
+
/** Version should be injected by build tools */
|
|
123
126
|
version: string;
|
|
127
|
+
/** A boolean, or a URL */
|
|
124
128
|
worker?: string | boolean;
|
|
129
|
+
/** Default Options */
|
|
125
130
|
options: LoaderOptions;
|
|
131
|
+
/** Deprecated Options */
|
|
126
132
|
deprecatedOptions?: object;
|
|
127
|
-
// end Worker
|
|
128
133
|
|
|
134
|
+
/** Which category does this loader belong to */
|
|
129
135
|
category?: string;
|
|
136
|
+
/** What extensions does this loader generate */
|
|
130
137
|
extensions: string[];
|
|
131
138
|
mimeTypes: string[];
|
|
132
139
|
|
|
@@ -192,24 +199,48 @@ export type Writer = {
|
|
|
192
199
|
encodeText?: EncodeText;
|
|
193
200
|
};
|
|
194
201
|
|
|
202
|
+
/**
|
|
203
|
+
* A Loader context is provided as a third parameters to a loader object's
|
|
204
|
+
* parse functions when that loader is called by other loaders rather then
|
|
205
|
+
* directly by the application.
|
|
206
|
+
*
|
|
207
|
+
* - The context object allows the subloaders to be aware of the parameters and
|
|
208
|
+
* options that the application provided in the top level call.
|
|
209
|
+
* - The context also providedsaccess to parse functions so that the subloader
|
|
210
|
+
* does not need to include the core module.
|
|
211
|
+
* - In addition, the context's parse functions may also redirect loads from worker
|
|
212
|
+
* threads back to main thread.
|
|
213
|
+
*/
|
|
195
214
|
export type LoaderContext = {
|
|
196
215
|
loaders?: Loader[] | null;
|
|
216
|
+
/** If URL is available. */
|
|
197
217
|
url?: string;
|
|
198
|
-
|
|
218
|
+
/** the file name component of the URL (leading path and query string removed) */
|
|
219
|
+
filename?: string;
|
|
220
|
+
/** the directory name component of the URL (leading path excluding file name and query string) */
|
|
221
|
+
baseUrl?: string;
|
|
222
|
+
/** Query string (characters after `?`) */
|
|
223
|
+
queryString?: string;
|
|
224
|
+
|
|
225
|
+
/** Provides access to any application overrides of fetch() */
|
|
199
226
|
fetch: typeof fetch | FetchLike;
|
|
227
|
+
/** TBD */
|
|
200
228
|
response?: Response;
|
|
229
|
+
/** Parse function. Use instead of importing `core`. In workers, may redirect to main thread */
|
|
201
230
|
parse: (
|
|
202
231
|
arrayBuffer: ArrayBuffer,
|
|
203
232
|
loaders?: Loader | Loader[] | LoaderOptions,
|
|
204
233
|
options?: LoaderOptions,
|
|
205
234
|
context?: LoaderContext
|
|
206
235
|
) => Promise<any>;
|
|
236
|
+
/** ParseSync function. Use instead of importing `core`. In workers, may redirect to main thread */
|
|
207
237
|
parseSync?: (
|
|
208
238
|
arrayBuffer: ArrayBuffer,
|
|
209
239
|
loaders?: Loader | Loader[] | LoaderOptions,
|
|
210
240
|
options?: LoaderOptions,
|
|
211
241
|
context?: LoaderContext
|
|
212
242
|
) => any;
|
|
243
|
+
/** ParseInBatches function. Use instead of importing `core`. */
|
|
213
244
|
parseInBatches?: (
|
|
214
245
|
iterator: AsyncIterable<ArrayBuffer> | Iterable<ArrayBuffer>,
|
|
215
246
|
loaders?: Loader | Loader[] | LoaderOptions,
|