@kepler.gl/processors 3.3.0-alpha.8 → 3.3.0-alpha.9
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/cjs/file-handler.js +28 -11
- package/dist/cjs/remote-file.js +222 -94
- package/dist/esm/file-handler.js +28 -11
- package/dist/esm/remote-file.js +223 -95
- package/dist/file-handler.d.ts +7 -1
- package/dist/remote-file.d.ts +45 -2
- package/package.json +7 -7
package/dist/remote-file.d.ts
CHANGED
|
@@ -2,6 +2,35 @@ import { ProcessorResult } from '@kepler.gl/types';
|
|
|
2
2
|
export type KeplerRemoteFile = File & {
|
|
3
3
|
keplerSourceUrl?: string;
|
|
4
4
|
keplerFormat?: string;
|
|
5
|
+
keplerRefreshIntervalMs?: number;
|
|
6
|
+
keplerEtag?: string;
|
|
7
|
+
keplerLastModified?: string;
|
|
8
|
+
};
|
|
9
|
+
export type FetchRemoteFileOptions = {
|
|
10
|
+
format?: string | null;
|
|
11
|
+
onProgress?: (progress: {
|
|
12
|
+
loaded: number;
|
|
13
|
+
total?: number;
|
|
14
|
+
percent: number;
|
|
15
|
+
}) => void;
|
|
16
|
+
etag?: string;
|
|
17
|
+
lastModified?: string;
|
|
18
|
+
/** Bypass the HTTP cache. Used for poll/reload, not the first remote URL load. */
|
|
19
|
+
bypassCache?: boolean;
|
|
20
|
+
};
|
|
21
|
+
export type FetchRemoteFileResult = {
|
|
22
|
+
file: KeplerRemoteFile | null;
|
|
23
|
+
notModified: boolean;
|
|
24
|
+
etag?: string;
|
|
25
|
+
lastModified?: string;
|
|
26
|
+
size?: number;
|
|
27
|
+
};
|
|
28
|
+
export type LoadExternallyHostedDatasetResult = {
|
|
29
|
+
data: NonNullable<ProcessorResult> | null;
|
|
30
|
+
notModified: boolean;
|
|
31
|
+
etag?: string;
|
|
32
|
+
lastModified?: string;
|
|
33
|
+
size?: number;
|
|
5
34
|
};
|
|
6
35
|
export declare function getExtensionFromUrl(url: string): string;
|
|
7
36
|
export declare function getMimeTypeForFormat(format?: string | null): string | undefined;
|
|
@@ -11,6 +40,11 @@ export declare function isRemoteDatasetUrl(url: string): boolean;
|
|
|
11
40
|
* Prefers an explicit format, then the URL path extension, then Content-Type.
|
|
12
41
|
*/
|
|
13
42
|
export declare function getFileNameForRemoteUrl(url: string, format?: string | null, mimeType?: string | null): string;
|
|
43
|
+
/**
|
|
44
|
+
* Fetch a remote dataset URL. Honors If-None-Match / If-Modified-Since when etag
|
|
45
|
+
* or lastModified are provided so unchanged files can skip a re-parse.
|
|
46
|
+
*/
|
|
47
|
+
export declare function fetchRemoteFile(url: string, options?: FetchRemoteFileOptions): Promise<FetchRemoteFileResult>;
|
|
14
48
|
/**
|
|
15
49
|
* Fetch a remote dataset URL and wrap it as a File the existing loadFiles pipeline can parse.
|
|
16
50
|
* Sets File.type from an explicit format or the response Content-Type so extensionless
|
|
@@ -23,11 +57,20 @@ export declare function fetchRemoteFileAsKeplerFile(url: string, format?: string
|
|
|
23
57
|
}) => void): Promise<KeplerRemoteFile>;
|
|
24
58
|
/**
|
|
25
59
|
* Fetch, parse, and process a remote file into Kepler dataset data.
|
|
26
|
-
* Used when reloading an `externally-hosted` dataset from a saved map config
|
|
60
|
+
* Used when reloading an `externally-hosted` dataset from a saved map config
|
|
61
|
+
* and when refreshing a live remote dataset.
|
|
27
62
|
*/
|
|
28
63
|
export declare function loadExternallyHostedDataset(metadata: {
|
|
29
64
|
source: string;
|
|
30
65
|
format?: string;
|
|
31
66
|
size?: number;
|
|
32
|
-
|
|
67
|
+
etag?: string;
|
|
68
|
+
lastModified?: string;
|
|
69
|
+
bypassCache?: boolean;
|
|
70
|
+
onProgress?: (progress: {
|
|
71
|
+
loaded: number;
|
|
72
|
+
total?: number;
|
|
73
|
+
percent: number;
|
|
74
|
+
}) => void;
|
|
75
|
+
}): Promise<LoadExternallyHostedDatasetResult>;
|
|
33
76
|
export declare function isExternallyHostedFile(file: File): file is KeplerRemoteFile;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kepler.gl/processors",
|
|
3
3
|
"author": "Shan He <shan@uber.com>",
|
|
4
|
-
"version": "3.3.0-alpha.
|
|
4
|
+
"version": "3.3.0-alpha.9",
|
|
5
5
|
"description": "kepler.gl constants used by kepler.gl components, actions and reducers",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"main": "dist/cjs/index.js",
|
|
@@ -29,12 +29,12 @@
|
|
|
29
29
|
],
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@deck.gl-community/editable-layers": "9.3.8",
|
|
32
|
-
"@kepler.gl/common-utils": "3.3.0-alpha.
|
|
33
|
-
"@kepler.gl/constants": "3.3.0-alpha.
|
|
34
|
-
"@kepler.gl/schemas": "3.3.0-alpha.
|
|
35
|
-
"@kepler.gl/table": "3.3.0-alpha.
|
|
36
|
-
"@kepler.gl/types": "3.3.0-alpha.
|
|
37
|
-
"@kepler.gl/utils": "3.3.0-alpha.
|
|
32
|
+
"@kepler.gl/common-utils": "3.3.0-alpha.9",
|
|
33
|
+
"@kepler.gl/constants": "3.3.0-alpha.9",
|
|
34
|
+
"@kepler.gl/schemas": "3.3.0-alpha.9",
|
|
35
|
+
"@kepler.gl/table": "3.3.0-alpha.9",
|
|
36
|
+
"@kepler.gl/types": "3.3.0-alpha.9",
|
|
37
|
+
"@kepler.gl/utils": "3.3.0-alpha.9",
|
|
38
38
|
"@loaders.gl/arrow": "^4.4.1",
|
|
39
39
|
"@loaders.gl/core": "^4.4.1",
|
|
40
40
|
"@loaders.gl/csv": "^4.4.1",
|