@loaders.gl/loader-utils 4.0.0-beta.5 → 4.0.0-beta.7
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/json-loader.js.map +1 -1
- package/dist/lib/sources/image-source.d.ts +0 -2
- package/dist/lib/sources/image-source.d.ts.map +1 -1
- package/dist/lib/sources/image-source.js.map +1 -1
- package/dist/loader-types.d.ts +12 -12
- package/dist/loader-types.d.ts.map +1 -1
- package/dist/loader-types.js.map +1 -1
- package/package.json +3 -3
- package/src/json-loader.ts +1 -1
- package/src/lib/sources/image-source.ts +0 -3
- package/src/loader-types.ts +12 -12
package/dist/json-loader.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"json-loader.js","names":["VERSION","__VERSION__","JSONLoader","name","id","module","version","extensions","mimeTypes","category","text","parseTextSync","parse","arrayBuffer","TextDecoder","decode","options","JSON"],"sources":["../src/json-loader.ts"],"sourcesContent":["import type {LoaderWithParser, LoaderOptions} from './loader-types';\nimport type {Table, TableBatch} from '@loaders.gl/schema';\n\n// __VERSION__ is injected by babel-plugin-version-inline\n// @ts-ignore TS2304: Cannot find name '__VERSION__'.\nconst VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';\n\nexport type JSONLoaderOptions = LoaderOptions;\n\n/**\n * A JSON Micro loader (minimal bundle size)\n * Alternative to `@loaders.gl/json`\n */\nexport const JSONLoader: LoaderWithParser<Table, TableBatch, JSONLoaderOptions> = {\n name: 'JSON',\n id: 'json',\n module: 'json',\n version: VERSION,\n extensions: ['json', 'geojson'],\n mimeTypes: ['application/json'],\n category: 'json',\n text: true,\n parseTextSync,\n parse: async (arrayBuffer) => parseTextSync(new TextDecoder().decode(arrayBuffer)),\n options: {}\n};\n\n// TODO -
|
|
1
|
+
{"version":3,"file":"json-loader.js","names":["VERSION","__VERSION__","JSONLoader","name","id","module","version","extensions","mimeTypes","category","text","parseTextSync","parse","arrayBuffer","TextDecoder","decode","options","JSON"],"sources":["../src/json-loader.ts"],"sourcesContent":["import type {LoaderWithParser, LoaderOptions} from './loader-types';\nimport type {Table, TableBatch} from '@loaders.gl/schema';\n\n// __VERSION__ is injected by babel-plugin-version-inline\n// @ts-ignore TS2304: Cannot find name '__VERSION__'.\nconst VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';\n\nexport type JSONLoaderOptions = LoaderOptions;\n\n/**\n * A JSON Micro loader (minimal bundle size)\n * Alternative to `@loaders.gl/json`\n */\nexport const JSONLoader: LoaderWithParser<Table, TableBatch, JSONLoaderOptions> = {\n name: 'JSON',\n id: 'json',\n module: 'json',\n version: VERSION,\n extensions: ['json', 'geojson'],\n mimeTypes: ['application/json'],\n category: 'json',\n text: true,\n parseTextSync,\n parse: async (arrayBuffer) => parseTextSync(new TextDecoder().decode(arrayBuffer)),\n options: {}\n};\n\n// TODO - Better error handling!\nfunction parseTextSync(text) {\n return JSON.parse(text);\n}\n"],"mappings":"AAKA,MAAMA,OAAO,GAAG,OAAOC,WAAW,KAAK,WAAW,GAAGA,WAAW,GAAG,QAAQ;AAQ3E,OAAO,MAAMC,UAAkE,GAAG;EAChFC,IAAI,EAAE,MAAM;EACZC,EAAE,EAAE,MAAM;EACVC,MAAM,EAAE,MAAM;EACdC,OAAO,EAAEN,OAAO;EAChBO,UAAU,EAAE,CAAC,MAAM,EAAE,SAAS,CAAC;EAC/BC,SAAS,EAAE,CAAC,kBAAkB,CAAC;EAC/BC,QAAQ,EAAE,MAAM;EAChBC,IAAI,EAAE,IAAI;EACVC,aAAa;EACbC,KAAK,EAAE,MAAOC,WAAW,IAAKF,aAAa,CAAC,IAAIG,WAAW,CAAC,CAAC,CAACC,MAAM,CAACF,WAAW,CAAC,CAAC;EAClFG,OAAO,EAAE,CAAC;AACZ,CAAC;AAGD,SAASL,aAAaA,CAACD,IAAI,EAAE;EAC3B,OAAOO,IAAI,CAACL,KAAK,CAACF,IAAI,CAAC;AACzB"}
|
|
@@ -26,8 +26,6 @@ export type ImageSourceLayer = {
|
|
|
26
26
|
geographicBoundingBox?: [min: [x: number, y: number], max: [x: number, y: number]];
|
|
27
27
|
/** Sub layers of this layer */
|
|
28
28
|
layers?: ImageSourceLayer[];
|
|
29
|
-
/** @deprecated from v3.4: non-vis.gl style bounding box. Use `.geographicBoundingBox` instead */
|
|
30
|
-
boundingBox?: [number, number, number, number];
|
|
31
29
|
};
|
|
32
30
|
/** Generic parameters for requesting an image from an image source */
|
|
33
31
|
export type GetImageParameters = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"image-source.d.ts","sourceRoot":"","sources":["../../../src/lib/sources/image-source.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,eAAe,CAAC;AACnD,OAAO,EAAC,UAAU,EAAC,MAAM,eAAe,CAAC;AACzC,OAAO,EAAC,SAAS,EAAC,MAAM,oBAAoB,CAAC;AAE7C;;;;;GAKG;AACH,MAAM,MAAM,mBAAmB,GAAG;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,MAAM,EAAE,gBAAgB,EAAE,CAAC;CAC5B,CAAC;AAEF,wDAAwD;AACxD,MAAM,MAAM,gBAAgB,GAAG;IAC7B,yBAAyB;IACzB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,yCAAyC;IACzC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,iDAAiD;IACjD,GAAG,CAAC,EAAE,MAAM,EAAE,CAAC;IACf,8FAA8F;IAC9F,qBAAqB,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;I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url"],"sources":["../../../src/lib/sources/image-source.ts"],"sourcesContent":["// loaders.gl, MIT license\n\nimport type {DataSourceProps} from './data-source';\nimport {DataSource} from './data-source';\nimport {ImageType} from './utils/image-type';\n\n/**\n * Normalized capabilities of an Image service\n * @example\n * The WMSService will normalize the response to the WMS `GetCapabilities`\n * data structure extracted from WMS XML response into an ImageSourceMetadata.\n */\nexport type ImageSourceMetadata = {\n name: string;\n title?: string;\n abstract?: string;\n keywords: string[];\n layers: ImageSourceLayer[];\n};\n\n/** Description of one data layer in the image source */\nexport type ImageSourceLayer = {\n /** Name of this layer */\n name?: string;\n /** Human readable title of this layer */\n title?: string;\n /** Coordinate systems supported by this layer */\n crs?: string[];\n /** layer limits in unspecified CRS:84-like lng/lat, for quick access w/o CRS calculations. */\n geographicBoundingBox?: [min: [x: number, y: number], max: [x: number, y: number]];\n /** Sub layers of this layer */\n layers?: ImageSourceLayer[];\n
|
|
1
|
+
{"version":3,"file":"image-source.js","names":["DataSource","ImageSource","type","testURL","url"],"sources":["../../../src/lib/sources/image-source.ts"],"sourcesContent":["// loaders.gl, MIT license\n\nimport type {DataSourceProps} from './data-source';\nimport {DataSource} from './data-source';\nimport {ImageType} from './utils/image-type';\n\n/**\n * Normalized capabilities of an Image service\n * @example\n * The WMSService will normalize the response to the WMS `GetCapabilities`\n * data structure extracted from WMS XML response into an ImageSourceMetadata.\n */\nexport type ImageSourceMetadata = {\n name: string;\n title?: string;\n abstract?: string;\n keywords: string[];\n layers: ImageSourceLayer[];\n};\n\n/** Description of one data layer in the image source */\nexport type ImageSourceLayer = {\n /** Name of this layer */\n name?: string;\n /** Human readable title of this layer */\n title?: string;\n /** Coordinate systems supported by this layer */\n crs?: string[];\n /** layer limits in unspecified CRS:84-like lng/lat, for quick access w/o CRS calculations. */\n geographicBoundingBox?: [min: [x: number, y: number], max: [x: number, y: number]];\n /** Sub layers of this layer */\n layers?: ImageSourceLayer[];\n};\n\n/** Generic parameters for requesting an image from an image source */\nexport type GetImageParameters = {\n /** Layers to render */\n layers: string | string[];\n /** Styling */\n styles?: unknown;\n /** bounding box of the requested map image */\n bbox: [number, number, number, number];\n /** pixel width of returned image */\n width: number;\n /** pixels */\n height: number;\n /** crs for the image (not the bounding box) */\n crs?: string;\n /** requested format for the return image */\n format?: 'image/png';\n};\n\n// Attempt to break down GetImageParameters\nexport type ImageFilters = {\n /** Layers to render */\n layers: string | string[];\n /** Styling */\n styles?: unknown;\n};\n\nexport type ImageRegion = {\n /** bounding box of the requested map image */\n bbox: [number, number, number, number];\n};\n\nexport type ImageFormat = {\n /** pixel width of returned image */\n width: number;\n /** pixels */\n height: number;\n /** crs for the image (not the bounding box) */\n crs?: string;\n /** requested format for the return image */\n format?: 'image/png';\n};\n\nexport type ImageSourceProps = DataSourceProps;\n\n/**\n * MapImageSource - data sources that allow data to be queried by (geospatial) extents\n * @note\n * - If geospatial, bounding box is expected to be in web mercator coordinates\n */\nexport abstract class ImageSource<\n PropsT extends ImageSourceProps = ImageSourceProps\n> extends DataSource<PropsT> {\n static type: string = 'template';\n static testURL = (url: string): boolean => false;\n\n abstract getMetadata(): Promise<ImageSourceMetadata>;\n abstract getImage(parameters: GetImageParameters): Promise<ImageType>;\n}\n"],"mappings":"SAGQA,UAAU;AAgFlB,OAAO,MAAeC,WAAW,SAEvBD,UAAU,CAAS;AAFPC,WAAW,CAGxBC,IAAI,GAAW,UAAU;AAHZD,WAAW,CAIxBE,OAAO,GAAIC,GAAW,IAAc,KAAK"}
|
package/dist/loader-types.d.ts
CHANGED
|
@@ -51,29 +51,29 @@ export type LoaderOptions = {
|
|
|
51
51
|
dataType?: never;
|
|
52
52
|
/** @deprecated `options.uri` no longer used */
|
|
53
53
|
uri?: never;
|
|
54
|
-
/** @deprecated
|
|
54
|
+
/** @deprecated Use `options.fetch.method` */
|
|
55
55
|
method?: never;
|
|
56
|
-
/** @deprecated
|
|
56
|
+
/** @deprecated Use `options.fetch.headers` */
|
|
57
57
|
headers?: never;
|
|
58
|
-
/** @deprecated
|
|
58
|
+
/** @deprecated Use `options.fetch.body` */
|
|
59
59
|
body?: never;
|
|
60
|
-
/** @deprecated
|
|
60
|
+
/** @deprecated Use `options.fetch.mode` */
|
|
61
61
|
mode?: never;
|
|
62
|
-
/** @deprecated
|
|
62
|
+
/** @deprecated Use `options.fetch.credentials` */
|
|
63
63
|
credentials?: never;
|
|
64
|
-
/** @deprecated
|
|
64
|
+
/** @deprecated Use `options.fetch.cache` */
|
|
65
65
|
cache?: never;
|
|
66
|
-
/** @deprecated
|
|
66
|
+
/** @deprecated Use `options.fetch.redirect` */
|
|
67
67
|
redirect?: never;
|
|
68
|
-
/** @deprecated
|
|
68
|
+
/** @deprecated Use `options.fetch.referrer` */
|
|
69
69
|
referrer?: never;
|
|
70
|
-
/** @deprecated
|
|
70
|
+
/** @deprecated Use `options.fetch.referrerPolicy` */
|
|
71
71
|
referrerPolicy?: never;
|
|
72
|
-
/** @deprecated
|
|
72
|
+
/** @deprecated Use `options.fetch.integrity` */
|
|
73
73
|
integrity?: never;
|
|
74
|
-
/** @deprecated
|
|
74
|
+
/** @deprecated Use `options.fetch.keepalive` */
|
|
75
75
|
keepalive?: never;
|
|
76
|
-
/** @deprecated
|
|
76
|
+
/** @deprecated Use `options.fetch.signal` */
|
|
77
77
|
signal?: never;
|
|
78
78
|
[loaderId: string]: unknown;
|
|
79
79
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loader-types.d.ts","sourceRoot":"","sources":["../src/loader-types.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,SAAS,EACT,gBAAgB,EACjB,MAAM,SAAS,CAAC;AAIjB;;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,EAA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D,IAAI,EAAE,QAAQ,CAAC,WAAW,CAAC,GAAG,aAAa,CAAC,WAAW,CAAC,GAAG,QAAQ,EACnE,MAAM,EAAE,OAAO,EACf,OAAO,EAAE,QAAQ,GAAG,SAAS,EAC7B,OAAO,EAAE,aAAa,GACrB,OAAO,CAAC,aAAa,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC,CAAC,CAKlD"}
|
package/dist/loader-types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loader-types.js","names":["parseFromContext","data","loaders","options","context","_parse","parseSyncFromContext","loader","_parseSync","Error","parseInBatchesFromContext","_parseInBatches"],"sources":["../src/loader-types.ts"],"sourcesContent":["// loaders.gl, MIT license\n\nimport {\n FetchLike,\n TransformBatches /* , DataType, SyncDataType, BatchableDataType */\n} from './types';\n\n// LOADERS\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 /** Force to load WASM libraries from local file system in NodeJS or from loaders.gl CDN in a web browser */\n useLocalLibraries?: boolean;\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<DataT = any, BatchT = any, LoaderOptionsT = LoaderOptions> = {\n /** The result type of this loader */\n dataType?: DataT;\n /** The batched result type of this loader */\n batchType?: BatchT;\n\n /** Default Options */\n options: LoaderOptionsT;\n /** Deprecated Options */\n deprecatedOptions?: Record<string, string | Record<string, string>>;\n\n /** Human readable name */\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 // end Worker\n\n /** Which category does this loader belong to */\n category?: string;\n /** File extensions that are potential matches with this loader. */\n extensions: string[];\n /** MIMETypes that indicate a match with this loader. @note Some MIMETypes are generic and supported by many loaders */\n mimeTypes: string[];\n\n /** Is the input of this loader binary */\n binary?: boolean;\n /** Is the input of this loader text */\n text?: boolean;\n\n /** Test some initial bytes of content to see if this loader might be a match */\n tests?: (((ArrayBuffer: ArrayBuffer) => boolean) | ArrayBuffer | string)[];\n\n /** @deprecated */\n supported?: boolean;\n /** @deprecated */\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<DataT = any, BatchT = any, LoaderOptionsT = LoaderOptions> = Loader<\n DataT,\n BatchT,\n LoaderOptionsT\n> & {\n /** Perform actions before load. @deprecated Not officially supported. */\n preload?: Preload;\n /** Parse atomically from an arraybuffer asynchronously */\n parse: (\n arrayBuffer: ArrayBuffer,\n options?: LoaderOptionsT,\n context?: LoaderContext\n ) => Promise<DataT>;\n parseFile?: (file: Blob, options?: LoaderOptionsT, context?: LoaderContext) => Promise<DataT>;\n /** Parse atomically from an arraybuffer synchronously */\n parseSync?: (\n arrayBuffer: ArrayBuffer,\n options?: LoaderOptionsT,\n context?: LoaderContext\n ) => DataT;\n /** Parse atomically from a string asynchronously */\n parseText?: (text: string, options?: LoaderOptionsT, context?: LoaderContext) => Promise<DataT>;\n /** Parse atomically from a string synchronously */\n parseTextSync?: (text: string, options?: LoaderOptionsT, context?: LoaderContext) => DataT;\n /** Parse batches of data from an iterator, return an iterator that yield parsed batches. */\n parseInBatches?: (\n iterator: AsyncIterable<ArrayBuffer> | Iterable<ArrayBuffer>,\n options?: LoaderOptionsT,\n context?: LoaderContext\n ) => AsyncIterable<BatchT>;\n /** Like `parseInBatches` for loaders that don't integrate with fetch. @deprecated Not officially supported. */\n parseFileInBatches?: (\n file: Blob,\n options?: LoaderOptionsT,\n context?: LoaderContext\n ) => AsyncIterable<BatchT>;\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 /** Loader list provided to top-level loader call plus any sub loaders */\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\n /** TBD */\n response?: Response;\n\n /**\n * Parse function for subloaders. Avoids importing `core`. In workers, may redirect to main thread\n */\n _parse: (\n arrayBuffer: ArrayBuffer,\n loaders?: Loader | Loader[] | LoaderOptions,\n options?: LoaderOptions,\n context?: LoaderContext\n ) => Promise<any>;\n\n /**\n * ParseSync function. Avoids importing `core`. In workers, may redirect to main thread\n * @deprecated Do not call directly, use `parseSyncFromContext` instead\n */\n _parseSync?: (\n arrayBuffer: ArrayBuffer,\n loaders?: Loader | Loader[] | LoaderOptions,\n options?: LoaderOptions,\n context?: LoaderContext\n ) => any;\n\n /**\n * ParseInBatches function. Avoids importing `core`.\n * @deprecated Do not call directly, use `parseInBatchesFromContext` instead\n */\n _parseInBatches?: (\n iterator: AsyncIterable<ArrayBuffer> | Iterable<ArrayBuffer> | Response,\n loaders?: Loader | Loader[] | LoaderOptions,\n options?: LoaderOptions,\n context?: LoaderContext\n ) => AsyncIterable<any> | Promise<AsyncIterable<any>>;\n};\n\n// type Parse = (\n// arrayBuffer: ArrayBuffer,\n// options?: LoaderOptions,\n// context?: LoaderContext\n// ) => Promise<any>;\n// type ParseSync = (\n// arrayBuffer: ArrayBuffer,\n// options?: LoaderOptions,\n// context?: LoaderContext\n// ) => any;\n// type ParseText = (text: string, options?: LoaderOptions) => Promise<any>;\n// type ParseTextSync = (text: string, options?: LoaderOptions) => any;\n// type ParseInBatches = (\n// iterator: AsyncIterable<ArrayBuffer> | Iterable<ArrayBuffer>,\n// options?: LoaderOptions,\n// context?: LoaderContext\n// ) => AsyncIterable<any>;\n// type ParseFileInBatches = (\n// file: Blob,\n// options?: LoaderOptions,\n// context?: LoaderContext\n// ) => AsyncIterable<any>;\n\ntype Preload = (url: string, options?: PreloadOptions) => any;\n\n/** Typescript helper to extract options type from a generic loader type */\nexport type LoaderOptionsType<T = Loader> = T extends Loader<any, any, infer Options>\n ? Options\n : never;\n/** Typescript helper to extract data type from a generic loader type */\nexport type LoaderReturnType<T = Loader> = T extends Loader<infer Return, any, any>\n ? Return\n : never;\n/** Typescript helper to extract batch type from a generic loader type */\nexport type LoaderBatchType<T = Loader> = T extends Loader<any, infer Batch, any> ? Batch : never;\n\n/**\n * Parses `data` asynchronously using the supplied loader, parse function provided via the loader context\n */\nexport async function parseFromContext<\n LoaderT extends Loader,\n OptionsT extends LoaderOptions = LoaderOptionsType<LoaderT>\n>(\n data: ArrayBuffer,\n loader: LoaderT,\n options: OptionsT | undefined,\n context: LoaderContext\n): Promise<LoaderReturnType<LoaderT>>;\n\n/**\n * Parses `data` asynchronously by matching one of the supplied loader\n */\nexport async function parseFromContext(\n data: ArrayBuffer,\n loaders: Loader[],\n options: LoaderOptions | undefined,\n context: LoaderContext\n): Promise<unknown>;\n\n/**\n * Parses `data` using a specified loader\n * @param data\n * @param loaders\n * @param options\n * @param context\n */\n// implementation signature\nexport async function parseFromContext(\n data: ArrayBuffer,\n loaders: Loader | Loader[],\n options: LoaderOptions | undefined,\n context: LoaderContext\n): Promise<unknown> {\n return context._parse(data, loaders, options, context);\n}\n\n/**\n * Parses `data` synchronously using the specified loader, parse function provided via the loader context\n */\nexport function parseSyncFromContext<\n LoaderT extends Loader,\n OptionsT extends LoaderOptions = LoaderOptionsType<LoaderT>\n>(\n data: ArrayBuffer,\n loader: LoaderT,\n options: OptionsT | undefined,\n context: LoaderContext\n): LoaderReturnType<LoaderT> {\n if (!context._parseSync) {\n throw new Error('parseSync');\n }\n return context._parseSync(data, loader, options, context);\n}\n\n/**\n * Parses `data` synchronously using a specified loader, parse function provided via the loader context\n */\nexport async function parseInBatchesFromContext<\n LoaderT extends Loader,\n OptionsT extends LoaderOptions = LoaderOptionsType<LoaderT>\n>(\n data: Iterable<ArrayBuffer> | AsyncIterable<ArrayBuffer> | Response,\n loader: LoaderT,\n options: OptionsT | undefined,\n context: LoaderContext\n): Promise<AsyncIterable<LoaderBatchType<LoaderT>>> {\n if (!context._parseInBatches) {\n throw new Error('parseInBatches');\n }\n return context._parseInBatches(data, loader, options, context);\n}\n"],"mappings":"AAmUA,OAAO,eAAeA,gBAAgBA,CACpCC,IAAiB,EACjBC,OAA0B,EAC1BC,OAAkC,EAClCC,OAAsB,EACJ;EAClB,OAAOA,OAAO,CAACC,MAAM,CAACJ,IAAI,EAAEC,OAAO,EAAEC,OAAO,EAAEC,OAAO,CAAC;AACxD;AAKA,OAAO,SAASE,oBAAoBA,CAIlCL,IAAiB,EACjBM,MAAe,EACfJ,OAA6B,EAC7BC,OAAsB,EACK;EAC3B,IAAI,CAACA,OAAO,CAACI,UAAU,EAAE;IACvB,MAAM,IAAIC,KAAK,CAAC,WAAW,CAAC;EAC9B;EACA,OAAOL,OAAO,CAACI,UAAU,CAACP,IAAI,EAAEM,MAAM,EAAEJ,OAAO,EAAEC,OAAO,CAAC;AAC3D;AAKA,OAAO,eAAeM,yBAAyBA,CAI7CT,IAAmE,EACnEM,MAAe,EACfJ,OAA6B,EAC7BC,OAAsB,EAC4B;EAClD,IAAI,CAACA,OAAO,CAACO,eAAe,EAAE;IAC5B,MAAM,IAAIF,KAAK,CAAC,gBAAgB,CAAC;EACnC;EACA,OAAOL,OAAO,CAACO,eAAe,CAACV,IAAI,EAAEM,MAAM,EAAEJ,OAAO,EAAEC,OAAO,CAAC;AAChE"}
|
|
1
|
+
{"version":3,"file":"loader-types.js","names":["parseFromContext","data","loaders","options","context","_parse","parseSyncFromContext","loader","_parseSync","Error","parseInBatchesFromContext","_parseInBatches"],"sources":["../src/loader-types.ts"],"sourcesContent":["// loaders.gl, MIT license\n\nimport {\n FetchLike,\n TransformBatches /* , DataType, SyncDataType, BatchableDataType */\n} from './types';\n\n// LOADERS\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 /** Force to load WASM libraries from local file system in NodeJS or from loaders.gl CDN in a web browser */\n useLocalLibraries?: boolean;\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 Use `options.fetch.method` */\n method?: never;\n /** @deprecated Use `options.fetch.headers` */\n headers?: never;\n /** @deprecated Use `options.fetch.body` */\n body?: never;\n /** @deprecated Use `options.fetch.mode` */\n mode?: never;\n /** @deprecated Use `options.fetch.credentials` */\n credentials?: never;\n /** @deprecated Use `options.fetch.cache` */\n cache?: never;\n /** @deprecated Use `options.fetch.redirect` */\n redirect?: never;\n /** @deprecated Use `options.fetch.referrer` */\n referrer?: never;\n /** @deprecated Use `options.fetch.referrerPolicy` */\n referrerPolicy?: never;\n /** @deprecated Use `options.fetch.integrity` */\n integrity?: never;\n /** @deprecated Use `options.fetch.keepalive` */\n keepalive?: never;\n /** @deprecated 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<DataT = any, BatchT = any, LoaderOptionsT = LoaderOptions> = {\n /** The result type of this loader */\n dataType?: DataT;\n /** The batched result type of this loader */\n batchType?: BatchT;\n\n /** Default Options */\n options: LoaderOptionsT;\n /** Deprecated Options */\n deprecatedOptions?: Record<string, string | Record<string, string>>;\n\n /** Human readable name */\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 // end Worker\n\n /** Which category does this loader belong to */\n category?: string;\n /** File extensions that are potential matches with this loader. */\n extensions: string[];\n /** MIMETypes that indicate a match with this loader. @note Some MIMETypes are generic and supported by many loaders */\n mimeTypes: string[];\n\n /** Is the input of this loader binary */\n binary?: boolean;\n /** Is the input of this loader text */\n text?: boolean;\n\n /** Test some initial bytes of content to see if this loader might be a match */\n tests?: (((ArrayBuffer: ArrayBuffer) => boolean) | ArrayBuffer | string)[];\n\n /** @deprecated */\n supported?: boolean;\n /** @deprecated */\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<DataT = any, BatchT = any, LoaderOptionsT = LoaderOptions> = Loader<\n DataT,\n BatchT,\n LoaderOptionsT\n> & {\n /** Perform actions before load. @deprecated Not officially supported. */\n preload?: Preload;\n /** Parse atomically from an arraybuffer asynchronously */\n parse: (\n arrayBuffer: ArrayBuffer,\n options?: LoaderOptionsT,\n context?: LoaderContext\n ) => Promise<DataT>;\n parseFile?: (file: Blob, options?: LoaderOptionsT, context?: LoaderContext) => Promise<DataT>;\n /** Parse atomically from an arraybuffer synchronously */\n parseSync?: (\n arrayBuffer: ArrayBuffer,\n options?: LoaderOptionsT,\n context?: LoaderContext\n ) => DataT;\n /** Parse atomically from a string asynchronously */\n parseText?: (text: string, options?: LoaderOptionsT, context?: LoaderContext) => Promise<DataT>;\n /** Parse atomically from a string synchronously */\n parseTextSync?: (text: string, options?: LoaderOptionsT, context?: LoaderContext) => DataT;\n /** Parse batches of data from an iterator, return an iterator that yield parsed batches. */\n parseInBatches?: (\n iterator: AsyncIterable<ArrayBuffer> | Iterable<ArrayBuffer>,\n options?: LoaderOptionsT,\n context?: LoaderContext\n ) => AsyncIterable<BatchT>;\n /** Like `parseInBatches` for loaders that don't integrate with fetch. @deprecated Not officially supported. */\n parseFileInBatches?: (\n file: Blob,\n options?: LoaderOptionsT,\n context?: LoaderContext\n ) => AsyncIterable<BatchT>;\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 /** Loader list provided to top-level loader call plus any sub loaders */\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\n /** TBD */\n response?: Response;\n\n /**\n * Parse function for subloaders. Avoids importing `core`. In workers, may redirect to main thread\n */\n _parse: (\n arrayBuffer: ArrayBuffer,\n loaders?: Loader | Loader[] | LoaderOptions,\n options?: LoaderOptions,\n context?: LoaderContext\n ) => Promise<any>;\n\n /**\n * ParseSync function. Avoids importing `core`. In workers, may redirect to main thread\n * @deprecated Do not call directly, use `parseSyncFromContext` instead\n */\n _parseSync?: (\n arrayBuffer: ArrayBuffer,\n loaders?: Loader | Loader[] | LoaderOptions,\n options?: LoaderOptions,\n context?: LoaderContext\n ) => any;\n\n /**\n * ParseInBatches function. Avoids importing `core`.\n * @deprecated Do not call directly, use `parseInBatchesFromContext` instead\n */\n _parseInBatches?: (\n iterator: AsyncIterable<ArrayBuffer> | Iterable<ArrayBuffer> | Response,\n loaders?: Loader | Loader[] | LoaderOptions,\n options?: LoaderOptions,\n context?: LoaderContext\n ) => AsyncIterable<any> | Promise<AsyncIterable<any>>;\n};\n\n// type Parse = (\n// arrayBuffer: ArrayBuffer,\n// options?: LoaderOptions,\n// context?: LoaderContext\n// ) => Promise<any>;\n// type ParseSync = (\n// arrayBuffer: ArrayBuffer,\n// options?: LoaderOptions,\n// context?: LoaderContext\n// ) => any;\n// type ParseText = (text: string, options?: LoaderOptions) => Promise<any>;\n// type ParseTextSync = (text: string, options?: LoaderOptions) => any;\n// type ParseInBatches = (\n// iterator: AsyncIterable<ArrayBuffer> | Iterable<ArrayBuffer>,\n// options?: LoaderOptions,\n// context?: LoaderContext\n// ) => AsyncIterable<any>;\n// type ParseFileInBatches = (\n// file: Blob,\n// options?: LoaderOptions,\n// context?: LoaderContext\n// ) => AsyncIterable<any>;\n\ntype Preload = (url: string, options?: PreloadOptions) => any;\n\n/** Typescript helper to extract options type from a generic loader type */\nexport type LoaderOptionsType<T = Loader> = T extends Loader<any, any, infer Options>\n ? Options\n : never;\n/** Typescript helper to extract data type from a generic loader type */\nexport type LoaderReturnType<T = Loader> = T extends Loader<infer Return, any, any>\n ? Return\n : never;\n/** Typescript helper to extract batch type from a generic loader type */\nexport type LoaderBatchType<T = Loader> = T extends Loader<any, infer Batch, any> ? Batch : never;\n\n/**\n * Parses `data` asynchronously using the supplied loader, parse function provided via the loader context\n */\nexport async function parseFromContext<\n LoaderT extends Loader,\n OptionsT extends LoaderOptions = LoaderOptionsType<LoaderT>\n>(\n data: ArrayBuffer,\n loader: LoaderT,\n options: OptionsT | undefined,\n context: LoaderContext\n): Promise<LoaderReturnType<LoaderT>>;\n\n/**\n * Parses `data` asynchronously by matching one of the supplied loader\n */\nexport async function parseFromContext(\n data: ArrayBuffer,\n loaders: Loader[],\n options: LoaderOptions | undefined,\n context: LoaderContext\n): Promise<unknown>;\n\n/**\n * Parses `data` using a specified loader\n * @param data\n * @param loaders\n * @param options\n * @param context\n */\n// implementation signature\nexport async function parseFromContext(\n data: ArrayBuffer,\n loaders: Loader | Loader[],\n options: LoaderOptions | undefined,\n context: LoaderContext\n): Promise<unknown> {\n return context._parse(data, loaders, options, context);\n}\n\n/**\n * Parses `data` synchronously using the specified loader, parse function provided via the loader context\n */\nexport function parseSyncFromContext<\n LoaderT extends Loader,\n OptionsT extends LoaderOptions = LoaderOptionsType<LoaderT>\n>(\n data: ArrayBuffer,\n loader: LoaderT,\n options: OptionsT | undefined,\n context: LoaderContext\n): LoaderReturnType<LoaderT> {\n if (!context._parseSync) {\n throw new Error('parseSync');\n }\n return context._parseSync(data, loader, options, context);\n}\n\n/**\n * Parses `data` synchronously using a specified loader, parse function provided via the loader context\n */\nexport async function parseInBatchesFromContext<\n LoaderT extends Loader,\n OptionsT extends LoaderOptions = LoaderOptionsType<LoaderT>\n>(\n data: Iterable<ArrayBuffer> | AsyncIterable<ArrayBuffer> | Response,\n loader: LoaderT,\n options: OptionsT | undefined,\n context: LoaderContext\n): Promise<AsyncIterable<LoaderBatchType<LoaderT>>> {\n if (!context._parseInBatches) {\n throw new Error('parseInBatches');\n }\n return context._parseInBatches(data, loader, options, context);\n}\n"],"mappings":"AAmUA,OAAO,eAAeA,gBAAgBA,CACpCC,IAAiB,EACjBC,OAA0B,EAC1BC,OAAkC,EAClCC,OAAsB,EACJ;EAClB,OAAOA,OAAO,CAACC,MAAM,CAACJ,IAAI,EAAEC,OAAO,EAAEC,OAAO,EAAEC,OAAO,CAAC;AACxD;AAKA,OAAO,SAASE,oBAAoBA,CAIlCL,IAAiB,EACjBM,MAAe,EACfJ,OAA6B,EAC7BC,OAAsB,EACK;EAC3B,IAAI,CAACA,OAAO,CAACI,UAAU,EAAE;IACvB,MAAM,IAAIC,KAAK,CAAC,WAAW,CAAC;EAC9B;EACA,OAAOL,OAAO,CAACI,UAAU,CAACP,IAAI,EAAEM,MAAM,EAAEJ,OAAO,EAAEC,OAAO,CAAC;AAC3D;AAKA,OAAO,eAAeM,yBAAyBA,CAI7CT,IAAmE,EACnEM,MAAe,EACfJ,OAA6B,EAC7BC,OAAsB,EAC4B;EAClD,IAAI,CAACA,OAAO,CAACO,eAAe,EAAE;IAC5B,MAAM,IAAIF,KAAK,CAAC,gBAAgB,CAAC;EACnC;EACA,OAAOL,OAAO,CAACO,eAAe,CAACV,IAAI,EAAEM,MAAM,EAAEJ,OAAO,EAAEC,OAAO,CAAC;AAChE"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@loaders.gl/loader-utils",
|
|
3
|
-
"version": "4.0.0-beta.
|
|
3
|
+
"version": "4.0.0-beta.7",
|
|
4
4
|
"description": "Framework-independent loaders for 3D graphics formats",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -47,8 +47,8 @@
|
|
|
47
47
|
"scripts": {},
|
|
48
48
|
"dependencies": {
|
|
49
49
|
"@babel/runtime": "^7.3.1",
|
|
50
|
-
"@loaders.gl/worker-utils": "4.0.0-beta.
|
|
50
|
+
"@loaders.gl/worker-utils": "4.0.0-beta.7",
|
|
51
51
|
"@probe.gl/stats": "^4.0.2"
|
|
52
52
|
},
|
|
53
|
-
"gitHead": "
|
|
53
|
+
"gitHead": "5b6cab0ab5d73212cfa37fa5da6e25ad7ef83fe5"
|
|
54
54
|
}
|
package/src/json-loader.ts
CHANGED
|
@@ -30,9 +30,6 @@ export type ImageSourceLayer = {
|
|
|
30
30
|
geographicBoundingBox?: [min: [x: number, y: number], max: [x: number, y: number]];
|
|
31
31
|
/** Sub layers of this layer */
|
|
32
32
|
layers?: ImageSourceLayer[];
|
|
33
|
-
|
|
34
|
-
/** @deprecated from v3.4: non-vis.gl style bounding box. Use `.geographicBoundingBox` instead */
|
|
35
|
-
boundingBox?: [number, number, number, number];
|
|
36
33
|
};
|
|
37
34
|
|
|
38
35
|
/** Generic parameters for requesting an image from an image source */
|
package/src/loader-types.ts
CHANGED
|
@@ -69,29 +69,29 @@ export type LoaderOptions = {
|
|
|
69
69
|
dataType?: never;
|
|
70
70
|
/** @deprecated `options.uri` no longer used */
|
|
71
71
|
uri?: never;
|
|
72
|
-
/** @deprecated
|
|
72
|
+
/** @deprecated Use `options.fetch.method` */
|
|
73
73
|
method?: never;
|
|
74
|
-
/** @deprecated
|
|
74
|
+
/** @deprecated Use `options.fetch.headers` */
|
|
75
75
|
headers?: never;
|
|
76
|
-
/** @deprecated
|
|
76
|
+
/** @deprecated Use `options.fetch.body` */
|
|
77
77
|
body?: never;
|
|
78
|
-
/** @deprecated
|
|
78
|
+
/** @deprecated Use `options.fetch.mode` */
|
|
79
79
|
mode?: never;
|
|
80
|
-
/** @deprecated
|
|
80
|
+
/** @deprecated Use `options.fetch.credentials` */
|
|
81
81
|
credentials?: never;
|
|
82
|
-
/** @deprecated
|
|
82
|
+
/** @deprecated Use `options.fetch.cache` */
|
|
83
83
|
cache?: never;
|
|
84
|
-
/** @deprecated
|
|
84
|
+
/** @deprecated Use `options.fetch.redirect` */
|
|
85
85
|
redirect?: never;
|
|
86
|
-
/** @deprecated
|
|
86
|
+
/** @deprecated Use `options.fetch.referrer` */
|
|
87
87
|
referrer?: never;
|
|
88
|
-
/** @deprecated
|
|
88
|
+
/** @deprecated Use `options.fetch.referrerPolicy` */
|
|
89
89
|
referrerPolicy?: never;
|
|
90
|
-
/** @deprecated
|
|
90
|
+
/** @deprecated Use `options.fetch.integrity` */
|
|
91
91
|
integrity?: never;
|
|
92
|
-
/** @deprecated
|
|
92
|
+
/** @deprecated Use `options.fetch.keepalive` */
|
|
93
93
|
keepalive?: never;
|
|
94
|
-
/** @deprecated
|
|
94
|
+
/** @deprecated Use `options.fetch.signal` */
|
|
95
95
|
signal?: never;
|
|
96
96
|
|
|
97
97
|
// Accept other keys (loader options objects, e.g. `options.csv`, `options.json` ...)
|