@dczy/tie-tools 0.1.0
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/common/date.d.ts +2 -0
- package/dist/common/date.d.ts.map +1 -0
- package/dist/common/index.d.ts +43 -0
- package/dist/common/index.d.ts.map +1 -0
- package/dist/common/number.d.ts +2 -0
- package/dist/common/number.d.ts.map +1 -0
- package/dist/common/string.d.ts +2 -0
- package/dist/common/string.d.ts.map +1 -0
- package/dist/common/types.d.ts +63 -0
- package/dist/common/types.d.ts.map +1 -0
- package/dist/crypt/ecdh/ellipticCrypto.d.ts +25 -0
- package/dist/crypt/ecdh/ellipticCrypto.d.ts.map +1 -0
- package/dist/crypt/ecdh/index.d.ts +28 -0
- package/dist/crypt/ecdh/index.d.ts.map +1 -0
- package/dist/crypt/ecdh/textCoder.d.ts +12 -0
- package/dist/crypt/ecdh/textCoder.d.ts.map +1 -0
- package/dist/crypt/index.d.ts +34 -0
- package/dist/crypt/index.d.ts.map +1 -0
- package/dist/crypt/seed/index.d.ts +19 -0
- package/dist/crypt/seed/index.d.ts.map +1 -0
- package/dist/crypt/sm/index.d.ts +108 -0
- package/dist/crypt/sm/index.d.ts.map +1 -0
- package/dist/crypt/utils.d.ts +12 -0
- package/dist/crypt/utils.d.ts.map +1 -0
- package/dist/date/index.d.ts +13 -0
- package/dist/date/index.d.ts.map +1 -0
- package/dist/deep/index.d.ts +26 -0
- package/dist/deep/index.d.ts.map +1 -0
- package/dist/enum/index.d.ts +24 -0
- package/dist/enum/index.d.ts.map +1 -0
- package/dist/error-report/index.d.ts +11 -0
- package/dist/error-report/index.d.ts.map +1 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/location/gcoord/crs/BD09.d.ts +4 -0
- package/dist/location/gcoord/crs/BD09.d.ts.map +1 -0
- package/dist/location/gcoord/crs/BD09MC.d.ts +4 -0
- package/dist/location/gcoord/crs/BD09MC.d.ts.map +1 -0
- package/dist/location/gcoord/crs/EPSG3857.d.ts +4 -0
- package/dist/location/gcoord/crs/EPSG3857.d.ts.map +1 -0
- package/dist/location/gcoord/crs/GCJ02.d.ts +4 -0
- package/dist/location/gcoord/crs/GCJ02.d.ts.map +1 -0
- package/dist/location/gcoord/crs/WGS84.d.ts +1 -0
- package/dist/location/gcoord/crs/WGS84.d.ts.map +1 -0
- package/dist/location/gcoord/crs/index.d.ts +31 -0
- package/dist/location/gcoord/crs/index.d.ts.map +1 -0
- package/dist/location/gcoord/geojson.d.ts +200 -0
- package/dist/location/gcoord/geojson.d.ts.map +1 -0
- package/dist/location/gcoord/helper.d.ts +69 -0
- package/dist/location/gcoord/helper.d.ts.map +1 -0
- package/dist/location/gcoord/index.d.ts +26 -0
- package/dist/location/gcoord/index.d.ts.map +1 -0
- package/dist/location/gcoord/transform.d.ts +10 -0
- package/dist/location/gcoord/transform.d.ts.map +1 -0
- package/dist/location/index.d.ts +37 -0
- package/dist/location/index.d.ts.map +1 -0
- package/dist/pin-yin/index.d.ts +21 -0
- package/dist/pin-yin/index.d.ts.map +1 -0
- package/dist/requests/index.d.ts +41 -0
- package/dist/requests/index.d.ts.map +1 -0
- package/dist/requests/interceptors/index.d.ts +4 -0
- package/dist/requests/interceptors/index.d.ts.map +1 -0
- package/dist/requests/interceptors/request.d.ts +5 -0
- package/dist/requests/interceptors/request.d.ts.map +1 -0
- package/dist/requests/interceptors/response.d.ts +5 -0
- package/dist/requests/interceptors/response.d.ts.map +1 -0
- package/dist/requests/interceptors/util.d.ts +41 -0
- package/dist/requests/interceptors/util.d.ts.map +1 -0
- package/dist/storage/index.d.ts +25 -0
- package/dist/storage/index.d.ts.map +1 -0
- package/dist/tie-tools.cjs +2 -0
- package/dist/tie-tools.js +2580 -0
- package/dist/tree/index.d.ts +76 -0
- package/dist/tree/index.d.ts.map +1 -0
- package/dist/uri/index.d.ts +61 -0
- package/dist/uri/index.d.ts.map +1 -0
- package/dist/validate/index.d.ts +11 -0
- package/dist/validate/index.d.ts.map +1 -0
- package/package.json +48 -0
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GeometryTypes
|
|
3
|
+
*
|
|
4
|
+
* https://tools.ietf.org/html/rfc7946#section-1.4
|
|
5
|
+
* The valid values for the 'type' property of GeoJSON geometry objects.
|
|
6
|
+
*/
|
|
7
|
+
export type GeometryTypes = 'Point' | 'LineString' | 'Polygon' | 'MultiPoint' | 'MultiLineString' | 'MultiPolygon' | 'GeometryCollection';
|
|
8
|
+
export type CollectionTypes = 'FeatureCollection' | 'GeometryCollection';
|
|
9
|
+
/**
|
|
10
|
+
* Types
|
|
11
|
+
*
|
|
12
|
+
* https://tools.ietf.org/html/rfc7946#section-1.4
|
|
13
|
+
* The value values for the 'type' property of GeoJSON Objects.
|
|
14
|
+
*/
|
|
15
|
+
export type Types = 'Feature' | GeometryTypes | CollectionTypes;
|
|
16
|
+
/**
|
|
17
|
+
* Bounding box
|
|
18
|
+
*
|
|
19
|
+
* https://tools.ietf.org/html/rfc7946#section-5
|
|
20
|
+
* A GeoJSON object MAY have a member named 'bbox' to include information on the coordinate range for its Geometries, Features, or FeatureCollections.
|
|
21
|
+
* The value of the bbox member MUST be an array of length 2*n where n is the number of dimensions represented in the contained geometries,
|
|
22
|
+
* with all axes of the most southwesterly point followed by all axes of the more northeasterly point.
|
|
23
|
+
* The axes order of a bbox follows the axes order of geometries.
|
|
24
|
+
*/
|
|
25
|
+
export type BBox2d = [number, number, number, number];
|
|
26
|
+
export type BBox3d = [number, number, number, number, number, number];
|
|
27
|
+
export type BBox = BBox2d | BBox3d;
|
|
28
|
+
/**
|
|
29
|
+
* Id
|
|
30
|
+
*
|
|
31
|
+
* https://tools.ietf.org/html/rfc7946#section-3.2
|
|
32
|
+
* If a Feature has a commonly used identifier, that identifier SHOULD be included as a member of
|
|
33
|
+
* the Feature object with the name 'id', and the value of this member is either a JSON string or number.
|
|
34
|
+
*/
|
|
35
|
+
export type Id = string | number;
|
|
36
|
+
/**
|
|
37
|
+
* Position
|
|
38
|
+
*
|
|
39
|
+
* https://tools.ietf.org/html/rfc7946#section-3.1.1
|
|
40
|
+
* Array should contain between two and three elements.
|
|
41
|
+
* The previous GeoJSON specification allowed more elements (e.g., which could be used to represent M values),
|
|
42
|
+
* but the current specification only allows X, Y, and (optionally) Z to be defined.
|
|
43
|
+
*/
|
|
44
|
+
export type Position = [number, number] | [number, number, number];
|
|
45
|
+
/**
|
|
46
|
+
* Properties
|
|
47
|
+
*
|
|
48
|
+
* https://tools.ietf.org/html/rfc7946#section-3.2
|
|
49
|
+
* A Feature object has a member with the name 'properties'.
|
|
50
|
+
* The value of the properties member is an object (any JSON object or a JSON null value).
|
|
51
|
+
*/
|
|
52
|
+
export type Properties = {
|
|
53
|
+
[name: string]: any;
|
|
54
|
+
} | null;
|
|
55
|
+
/**
|
|
56
|
+
* Geometries
|
|
57
|
+
*/
|
|
58
|
+
export type Geometries = Point | LineString | Polygon | MultiPoint | MultiLineString | MultiPolygon;
|
|
59
|
+
/**
|
|
60
|
+
* GeoJSON Object
|
|
61
|
+
*
|
|
62
|
+
* https://tools.ietf.org/html/rfc7946#section-3
|
|
63
|
+
* The GeoJSON specification also allows [foreign members](https://tools.ietf.org/html/rfc7946#section-6.1)
|
|
64
|
+
* Developers should use '&' type in TypeScript or extend the interface to add these foreign members.
|
|
65
|
+
*/
|
|
66
|
+
export interface GeoJSONObject {
|
|
67
|
+
/**
|
|
68
|
+
* Specifies the type of GeoJSON object.
|
|
69
|
+
*/
|
|
70
|
+
type: string;
|
|
71
|
+
/**
|
|
72
|
+
* Bounding box of the coordinate range of the object's Geometries, Features, or Feature Collections.
|
|
73
|
+
* https://tools.ietf.org/html/rfc7946#section-5
|
|
74
|
+
*/
|
|
75
|
+
bbox?: BBox;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Geometry Object
|
|
79
|
+
*
|
|
80
|
+
* https://tools.ietf.org/html/rfc7946#section-3
|
|
81
|
+
*/
|
|
82
|
+
export interface GeometryObject extends GeoJSONObject {
|
|
83
|
+
type: GeometryTypes;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Geometry
|
|
87
|
+
*
|
|
88
|
+
* https://tools.ietf.org/html/rfc7946#section-3
|
|
89
|
+
*/
|
|
90
|
+
export interface Geometry extends GeoJSONObject {
|
|
91
|
+
coordinates: Position | Position[] | Position[][] | Position[][][];
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Point Geometry Object
|
|
95
|
+
*
|
|
96
|
+
* https://tools.ietf.org/html/rfc7946#section-3.1.2
|
|
97
|
+
*/
|
|
98
|
+
export interface Point extends GeometryObject {
|
|
99
|
+
type: 'Point';
|
|
100
|
+
coordinates: Position;
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* MultiPoint Geometry Object
|
|
104
|
+
*
|
|
105
|
+
* https://tools.ietf.org/html/rfc7946#section-3.1.3
|
|
106
|
+
*/
|
|
107
|
+
export interface MultiPoint extends GeometryObject {
|
|
108
|
+
type: 'MultiPoint';
|
|
109
|
+
coordinates: Position[];
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* LineString Geometry Object
|
|
113
|
+
*
|
|
114
|
+
* https://tools.ietf.org/html/rfc7946#section-3.1.4
|
|
115
|
+
*/
|
|
116
|
+
export interface LineString extends GeometryObject {
|
|
117
|
+
type: 'LineString';
|
|
118
|
+
coordinates: Position[];
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* MultiLineString Geometry Object
|
|
122
|
+
*
|
|
123
|
+
* https://tools.ietf.org/html/rfc7946#section-3.1.5
|
|
124
|
+
*/
|
|
125
|
+
export interface MultiLineString extends GeometryObject {
|
|
126
|
+
type: 'MultiLineString';
|
|
127
|
+
coordinates: Position[][];
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Polygon Geometry Object
|
|
131
|
+
*
|
|
132
|
+
* https://tools.ietf.org/html/rfc7946#section-3.1.6
|
|
133
|
+
*/
|
|
134
|
+
export interface Polygon extends GeometryObject {
|
|
135
|
+
type: 'Polygon';
|
|
136
|
+
coordinates: Position[][];
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* MultiPolygon Geometry Object
|
|
140
|
+
*
|
|
141
|
+
* https://tools.ietf.org/html/rfc7946#section-3.1.7
|
|
142
|
+
*/
|
|
143
|
+
export interface MultiPolygon extends GeometryObject {
|
|
144
|
+
type: 'MultiPolygon';
|
|
145
|
+
coordinates: Position[][][];
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* GeometryCollection
|
|
149
|
+
*
|
|
150
|
+
* https://tools.ietf.org/html/rfc7946#section-3.1.8
|
|
151
|
+
*
|
|
152
|
+
* A GeoJSON object with type 'GeometryCollection' is a Geometry object.
|
|
153
|
+
* A GeometryCollection has a member with the name 'geometries'.
|
|
154
|
+
* The value of 'geometries' is an array. Each element of this array is a GeoJSON Geometry object.
|
|
155
|
+
* It is possible for this array to be empty.
|
|
156
|
+
*/
|
|
157
|
+
export interface GeometryCollection extends GeometryObject {
|
|
158
|
+
type: 'GeometryCollection';
|
|
159
|
+
geometries: Array<Point | LineString | Polygon | MultiPoint | MultiLineString | MultiPolygon>;
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* Feature
|
|
163
|
+
*
|
|
164
|
+
* https://tools.ietf.org/html/rfc7946#section-3.2
|
|
165
|
+
* A Feature object represents a spatially bounded thing.
|
|
166
|
+
* Every Feature object is a GeoJSON object no matter where it occurs in a GeoJSON text.
|
|
167
|
+
*/
|
|
168
|
+
export interface Feature<G = Geometry | GeometryCollection, P = Properties> extends GeoJSONObject {
|
|
169
|
+
type: 'Feature';
|
|
170
|
+
geometry: G;
|
|
171
|
+
/**
|
|
172
|
+
* A value that uniquely identifies this feature in a
|
|
173
|
+
* https://tools.ietf.org/html/rfc7946#section-3.2.
|
|
174
|
+
*/
|
|
175
|
+
id?: Id;
|
|
176
|
+
/**
|
|
177
|
+
* Properties associated with this feature.
|
|
178
|
+
*/
|
|
179
|
+
properties: P;
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* Feature Collection
|
|
183
|
+
*
|
|
184
|
+
* https://tools.ietf.org/html/rfc7946#section-3.3
|
|
185
|
+
* A GeoJSON object with the type 'FeatureCollection' is a FeatureCollection object.
|
|
186
|
+
* A FeatureCollection object has a member with the name 'features'.
|
|
187
|
+
* The value of 'features' is a JSON array. Each element of the array is a Feature object as defined above.
|
|
188
|
+
* It is possible for this array to be empty.
|
|
189
|
+
*/
|
|
190
|
+
export interface FeatureCollection<G = Geometry | GeometryCollection, P = Properties> extends GeoJSONObject {
|
|
191
|
+
type: 'FeatureCollection';
|
|
192
|
+
features: Array<Feature<G, P>>;
|
|
193
|
+
}
|
|
194
|
+
/**
|
|
195
|
+
* GeoJSON
|
|
196
|
+
*
|
|
197
|
+
* All GeoJSON objects
|
|
198
|
+
*/
|
|
199
|
+
export type GeoJSON = Feature | FeatureCollection | Geometry | GeometryCollection;
|
|
200
|
+
//# sourceMappingURL=geojson.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"geojson.d.ts","sourceRoot":"","sources":["../../../src/location/gcoord/geojson.ts"],"names":[],"mappings":"AAeA;;;;;GAKG;AACH,MAAM,MAAM,aAAa,GACrB,OAAO,GACP,YAAY,GACZ,SAAS,GACT,YAAY,GACZ,iBAAiB,GACjB,cAAc,GACd,oBAAoB,CAAC;AAEzB,MAAM,MAAM,eAAe,GAAG,mBAAmB,GAAG,oBAAoB,CAAC;AAEzE;;;;;GAKG;AACH,MAAM,MAAM,KAAK,GAAG,SAAS,GAAG,aAAa,GAAG,eAAe,CAAC;AAEhE;;;;;;;;GAQG;AACH,MAAM,MAAM,MAAM,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;AACtD,MAAM,MAAM,MAAM,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,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,OAAO,GACf,OAAO,GACP,iBAAiB,GACjB,QAAQ,GACR,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { GeoJSON, Position } from './geojson';
|
|
2
|
+
export declare function assert(condition: boolean, msg?: string): asserts condition;
|
|
3
|
+
/**
|
|
4
|
+
* isObject
|
|
5
|
+
*
|
|
6
|
+
* @param {*} input variable to validate
|
|
7
|
+
* @returns {boolean} true/false
|
|
8
|
+
* @example
|
|
9
|
+
* isObject({elevation: 10})
|
|
10
|
+
* //=true
|
|
11
|
+
* isObject('foo')
|
|
12
|
+
* //=false
|
|
13
|
+
*/
|
|
14
|
+
export declare function isObject(input: any): input is object;
|
|
15
|
+
/**
|
|
16
|
+
* isArray
|
|
17
|
+
*
|
|
18
|
+
* @param {*} input variable to validate
|
|
19
|
+
* @returns {boolean} true/false
|
|
20
|
+
*/
|
|
21
|
+
export declare function isArray(input: any): input is any[];
|
|
22
|
+
/**
|
|
23
|
+
* isNumber
|
|
24
|
+
*
|
|
25
|
+
* @param {*} num Number to validate
|
|
26
|
+
* @returns {boolean} true/false
|
|
27
|
+
* @example
|
|
28
|
+
* isNumber(123)
|
|
29
|
+
* //=true
|
|
30
|
+
* isNumber('foo')
|
|
31
|
+
* //=false
|
|
32
|
+
*/
|
|
33
|
+
export declare function isNumber(input: any): input is number;
|
|
34
|
+
/**
|
|
35
|
+
* isString
|
|
36
|
+
*
|
|
37
|
+
* @param {*} input variable to validate
|
|
38
|
+
* @returns {boolean} true/false
|
|
39
|
+
*/
|
|
40
|
+
export declare function isString(input: any): input is string;
|
|
41
|
+
/**
|
|
42
|
+
* compose
|
|
43
|
+
*/
|
|
44
|
+
export declare function compose(...funcs: Function[]): Function;
|
|
45
|
+
/**
|
|
46
|
+
* Iterate over coordinates in any GeoJSON object, similar to Array.forEach()
|
|
47
|
+
* https://github.com/Turfjs/turf/blob/master/packages/turf-meta/index.mjs
|
|
48
|
+
*
|
|
49
|
+
* @name coordEach
|
|
50
|
+
* @param {FeatureCollection|Feature|Geometry} geojson any GeoJSON object
|
|
51
|
+
* @param {Function} callback a method that takes (currentCoord, coordIndex, featureIndex, multiFeatureIndex)
|
|
52
|
+
* @param {boolean} [excludeWrapCoord=false] whether or not to include the final coordinate of LinearRings that wraps the ring in its iteration.
|
|
53
|
+
* @returns {void}
|
|
54
|
+
* @example
|
|
55
|
+
* let features = featureCollection([
|
|
56
|
+
* point([26, 37], {"foo": "bar"}),
|
|
57
|
+
* point([36, 53], {"hello": "world"})
|
|
58
|
+
* ]);
|
|
59
|
+
*
|
|
60
|
+
* coordEach(features, function (currentCoord, coordIndex, featureIndex, multiFeatureIndex, geometryIndex) {
|
|
61
|
+
* //=currentCoord
|
|
62
|
+
* //=coordIndex
|
|
63
|
+
* //=featureIndex
|
|
64
|
+
* //=multiFeatureIndex
|
|
65
|
+
* //=geometryIndex
|
|
66
|
+
* });
|
|
67
|
+
*/
|
|
68
|
+
export declare function coordEach(geojson: GeoJSON, callback: (currentCoord: Position, coordIndex: number, featureIndex: number, multiFeatureIndex: number, geometryIndex: number) => any, excludeWrapCoord?: boolean): boolean | void | never;
|
|
69
|
+
//# sourceMappingURL=helper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helper.d.ts","sourceRoot":"","sources":["../../../src/location/gcoord/helper.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EAKP,QAAQ,EAOT,MAAM,WAAW,CAAC;AAEnB,wBAAgB,MAAM,CAAC,SAAS,EAAE,OAAO,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,CAE1E;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,MAAM,CAEpD;AAED;;;;;GAKG;AACH,wBAAgB,OAAO,CAAC,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,GAAG,EAAE,CAElD;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,MAAM,CAEpD;AAED;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,MAAM,CAEpD;AAED;;GAEG;AACH,wBAAgB,OAAO,CAAC,GAAG,KAAK,EAAE,QAAQ,EAAE,GAAG,QAAQ,CAStD;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,wBAAgB,SAAS,CACvB,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,CACR,YAAY,EAAE,QAAQ,EACtB,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,MAAM,EACpB,iBAAiB,EAAE,MAAM,EACzB,aAAa,EAAE,MAAM,KAClB,GAAG,EACR,gBAAgB,UAAQ,GACvB,OAAO,GAAG,IAAI,GAAG,KAAK,CA0KxB"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { CRSTypes } from './crs';
|
|
2
|
+
import transform from './transform';
|
|
3
|
+
export type { GeoJSON, Position } from './geojson';
|
|
4
|
+
export type { CRSTypes };
|
|
5
|
+
declare const exported: {
|
|
6
|
+
CRSTypes: typeof CRSTypes;
|
|
7
|
+
transform: typeof transform;
|
|
8
|
+
WGS84: CRSTypes.WGS84;
|
|
9
|
+
WGS1984: CRSTypes.WGS84;
|
|
10
|
+
EPSG4326: CRSTypes.WGS84;
|
|
11
|
+
GCJ02: CRSTypes.GCJ02;
|
|
12
|
+
AMap: CRSTypes.GCJ02;
|
|
13
|
+
BD09: CRSTypes.BD09;
|
|
14
|
+
BD09LL: CRSTypes.BD09;
|
|
15
|
+
Baidu: CRSTypes.BD09;
|
|
16
|
+
BMap: CRSTypes.BD09;
|
|
17
|
+
BD09MC: CRSTypes.BD09MC;
|
|
18
|
+
BD09Meter: CRSTypes.BD09MC;
|
|
19
|
+
EPSG3857: CRSTypes.EPSG3857;
|
|
20
|
+
EPSG900913: CRSTypes.EPSG3857;
|
|
21
|
+
EPSG102100: CRSTypes.EPSG3857;
|
|
22
|
+
WebMercator: CRSTypes.EPSG3857;
|
|
23
|
+
WM: CRSTypes.EPSG3857;
|
|
24
|
+
};
|
|
25
|
+
export default exported;
|
|
26
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/location/gcoord/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,SAAS,MAAM,aAAa,CAAC;AAEpC,YAAY,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAEnD,YAAY,EAAE,QAAQ,EAAE,CAAC;AAEzB,QAAA,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;CAIb,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Position, GeoJSON } from './geojson';
|
|
2
|
+
import { CRSTypes } from './crs';
|
|
3
|
+
/**
|
|
4
|
+
* transform
|
|
5
|
+
*
|
|
6
|
+
* @param {geojson|position|string} input
|
|
7
|
+
* @returns {geojson|position} output
|
|
8
|
+
*/
|
|
9
|
+
export default function transform<T extends GeoJSON | Position>(input: T | string, crsFrom: CRSTypes, crsTo: CRSTypes): T;
|
|
10
|
+
//# sourceMappingURL=transform.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transform.d.ts","sourceRoot":"","sources":["../../../src/location/gcoord/transform.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC9C,OAAe,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEzC;;;;;GAKG;AAEH,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,CAAC,SAAS,OAAO,GAAG,QAAQ,EAC5D,KAAK,EAAE,CAAC,GAAG,MAAM,EACjB,OAAO,EAAE,QAAQ,EACjB,KAAK,EAAE,QAAQ,GACd,CAAC,CAgDH"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import * as gcoord from './gcoord';
|
|
2
|
+
type AddressObject = {
|
|
3
|
+
province?: string;
|
|
4
|
+
city?: string;
|
|
5
|
+
county?: string;
|
|
6
|
+
town?: string;
|
|
7
|
+
village?: string;
|
|
8
|
+
};
|
|
9
|
+
export declare class DcToolsLocation {
|
|
10
|
+
/**
|
|
11
|
+
* 获取两点间的距离
|
|
12
|
+
* @param startPiont 开始点
|
|
13
|
+
* @param endPoint 结束点
|
|
14
|
+
* @param unitStep 单位(默认1,即米)
|
|
15
|
+
* @returns
|
|
16
|
+
*/
|
|
17
|
+
getDistance(startPiont: {
|
|
18
|
+
lat: number;
|
|
19
|
+
lng: number;
|
|
20
|
+
}, endPoint: {
|
|
21
|
+
lat: number;
|
|
22
|
+
lng: number;
|
|
23
|
+
}, unitStep?: number): number;
|
|
24
|
+
/**
|
|
25
|
+
* 根据地址字符串获取省市区名称
|
|
26
|
+
* @param address 地址字符串
|
|
27
|
+
* @returns
|
|
28
|
+
*/
|
|
29
|
+
getAddressObject(address?: string): AddressObject;
|
|
30
|
+
transform: typeof import("./gcoord/transform").default;
|
|
31
|
+
CRSTypes: typeof gcoord.CRSTypes;
|
|
32
|
+
private distanceByLnglat;
|
|
33
|
+
private rad;
|
|
34
|
+
}
|
|
35
|
+
export declare const DcLocation: DcToolsLocation;
|
|
36
|
+
export {};
|
|
37
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/location/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AACnC,KAAK,aAAa,GAAG;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAA;AAED,qBAAa,eAAe;IAC1B;;;;;;OAMG;IACH,WAAW,CACT,UAAU,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,EACxC,QAAQ,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,EACtC,QAAQ,SAAI;IAMd;;;;OAIG;IACH,gBAAgB,CAAC,OAAO,CAAC,EAAE,MAAM;IAkBjC,SAAS,8CAA4B;IACrC,QAAQ,yBAA2B;IACnC,OAAO,CAAC,gBAAgB;IAiBxB,OAAO,CAAC,GAAG;CAGZ;AAED,eAAO,MAAM,UAAU,iBAAwB,CAAA"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
declare class DcToolsPinYin {
|
|
2
|
+
private PinYin;
|
|
3
|
+
private codefans_net_CC2PY;
|
|
4
|
+
private arraySearch;
|
|
5
|
+
private ucfirst;
|
|
6
|
+
/**
|
|
7
|
+
* 获取首字母 大写
|
|
8
|
+
* @param ipt
|
|
9
|
+
* @returns
|
|
10
|
+
*/
|
|
11
|
+
getFirst(ipt: string): string;
|
|
12
|
+
/**
|
|
13
|
+
* 获取全拼
|
|
14
|
+
* @param ipt
|
|
15
|
+
* @returns
|
|
16
|
+
*/
|
|
17
|
+
getFull(ipt: string): string;
|
|
18
|
+
}
|
|
19
|
+
export declare const DcPinyin: DcToolsPinYin;
|
|
20
|
+
export {};
|
|
21
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/pin-yin/index.ts"],"names":[],"mappings":"AACA,cAAM,aAAa;IACjB,OAAO,CAAC,MAAM,CA+Zb;IAED,OAAO,CAAC,kBAAkB;IAmB1B,OAAO,CAAC,WAAW;IAKnB,OAAO,CAAC,OAAO;IAOf;;;;OAIG;IACH,QAAQ,CAAC,GAAG,EAAE,MAAM;IAQpB;;;;OAIG;IACH,OAAO,CAAC,GAAG,EAAE,MAAM;CAIpB;AAED,eAAO,MAAM,QAAQ,eAAsB,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { AxiosInstance } from "axios";
|
|
2
|
+
import type { defineConfig, ResponseError, interceptorsUse } from './interceptors';
|
|
3
|
+
import { CryptoType } from './interceptors';
|
|
4
|
+
export declare class DcToolsRequest<T = any> {
|
|
5
|
+
service: AxiosInstance;
|
|
6
|
+
private defaultOptions;
|
|
7
|
+
private _options;
|
|
8
|
+
constructor(_config?: defineConfig<T>, use?: interceptorsUse);
|
|
9
|
+
private GetServerPk;
|
|
10
|
+
get<T = any, E = any, D = any>(url: string, params?: D, useStructResponse?: true, config?: defineConfig<D>): Promise<[null | ResponseError<E>, T]>;
|
|
11
|
+
get<T = any, E = any, D = any>(url: string, params?: D, useStructResponse?: false, config?: defineConfig<D>): Promise<T>;
|
|
12
|
+
post<T = any, E = any, D = any>(url: string, data?: D, useStructResponse?: true, config?: defineConfig<D>): Promise<[null | ResponseError<E>, T]>;
|
|
13
|
+
post<T = any, E = any, D = any>(url: string, data?: D, useStructResponse?: false, config?: defineConfig<D>): Promise<T>;
|
|
14
|
+
delete<T = any, E = any, D = any>(url: string, useStructResponse?: true, config?: defineConfig<D>): Promise<[null | ResponseError<E>, T]>;
|
|
15
|
+
delete<T = any, E = any, D = any>(url: string, useStructResponse?: false, config?: defineConfig<D>): Promise<T>;
|
|
16
|
+
head<T = any, E = any, D = any>(url: string, useStructResponse?: true, config?: defineConfig<D>): Promise<[null | ResponseError<E>, T]>;
|
|
17
|
+
head<T = any, E = any, D = any>(url: string, useStructResponse?: false, config?: defineConfig<D>): Promise<T>;
|
|
18
|
+
options<T = any, E = any, D = any>(url: string, useStructResponse?: true, config?: defineConfig<D>): Promise<[null | ResponseError<E>, T]>;
|
|
19
|
+
options<T = any, E = any, D = any>(url: string, useStructResponse?: false, config?: defineConfig<D>): Promise<T>;
|
|
20
|
+
put<T = any, E = any, D = any>(url: string, data?: D, useStructResponse?: true, config?: defineConfig<D>): Promise<[null | ResponseError<E>, T]>;
|
|
21
|
+
put<T = any, E = any, D = any>(url: string, data?: D, useStructResponse?: false, config?: defineConfig<D>): Promise<T>;
|
|
22
|
+
patch<T = any, E = any, D = any>(url: string, data?: D, useStructResponse?: true, config?: defineConfig<D>): Promise<[null | ResponseError<E>, T]>;
|
|
23
|
+
patch<T = any, E = any, D = any>(url: string, data?: D, useStructResponse?: false, config?: defineConfig<D>): Promise<T>;
|
|
24
|
+
postForm<T = any, E = any, D = any>(url: string, data?: D, useStructResponse?: true, config?: defineConfig<D>): Promise<[null | ResponseError<E>, T]>;
|
|
25
|
+
postForm<T = any, E = any, D = any>(url: string, data?: D, useStructResponse?: false, config?: defineConfig<D>): Promise<T>;
|
|
26
|
+
putForm<T = any, E = any, D = any>(url: string, data?: D, useStructResponse?: true, config?: defineConfig<D>): Promise<[null | ResponseError<E>, T]>;
|
|
27
|
+
putForm<T = any, E = any, D = any>(url: string, data?: D, useStructResponse?: false, config?: defineConfig<D>): Promise<T>;
|
|
28
|
+
patchForm<T = any, E = any, D = any>(url: string, data?: D, useStructResponse?: true, config?: defineConfig<D>): Promise<[null | ResponseError<E>, T]>;
|
|
29
|
+
patchForm<T = any, E = any, D = any>(url: string, data?: D, useStructResponse?: false, config?: defineConfig<D>): Promise<T>;
|
|
30
|
+
cancelRequest<T = any, D = any>(config: defineConfig<D>, useCancel: true): Promise<{
|
|
31
|
+
cancel: AbortController["abort"];
|
|
32
|
+
request: () => Promise<T>;
|
|
33
|
+
}>;
|
|
34
|
+
cancelRequest<T = any, D = any>(config: defineConfig<D>, useCancel: false): Promise<T>;
|
|
35
|
+
cancelRequest<T = any, D = any>(config: defineConfig<D>, useCancel?: boolean): Promise<T>;
|
|
36
|
+
streamRequest<T = any, D = any>(config: defineConfig<D>): Promise<import("mitt").Emitter<Record<import("mitt").EventType, unknown>>>;
|
|
37
|
+
all(requests: unknown[]): Promise<unknown[]>;
|
|
38
|
+
}
|
|
39
|
+
export type { defineConfig, interceptorsUse, ResponseError };
|
|
40
|
+
export { CryptoType };
|
|
41
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/requests/index.ts"],"names":[],"mappings":"AAAA,OAAc,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAI7C,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACnF,OAAO,EAA8F,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAExI,qBAAa,cAAc,CAAC,CAAC,GAAG,GAAG;IAC1B,OAAO,EAAE,aAAa,CAAC;IAC9B,OAAO,CAAC,cAAc,CAapB;IACF,OAAO,CAAC,QAAQ,CAAkB;gBACtB,OAAO,CAAC,EAAE,YAAY,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,eAAe;YAiC9C,WAAW;IAoBzB,GAAG,CAAC,CAAC,GAAG,GAAG,EAAE,CAAC,GAAG,GAAG,EAAE,CAAC,GAAG,GAAG,EAC3B,GAAG,EAAE,MAAM,EACX,MAAM,CAAC,EAAE,CAAC,EACV,iBAAiB,CAAC,EAAE,IAAI,EACxB,MAAM,CAAC,EAAE,YAAY,CAAC,CAAC,CAAC,GACvB,OAAO,CAAC,CAAC,IAAI,GAAG,aAAa,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IACxC,GAAG,CAAC,CAAC,GAAG,GAAG,EAAE,CAAC,GAAG,GAAG,EAAE,CAAC,GAAG,GAAG,EAC3B,GAAG,EAAE,MAAM,EACX,MAAM,CAAC,EAAE,CAAC,EACV,iBAAiB,CAAC,EAAE,KAAK,EACzB,MAAM,CAAC,EAAE,YAAY,CAAC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,CAAC,EACvB,SAAS,EAAE,IAAI,GACd,OAAO,CAAC;QAAE,MAAM,EAAE,eAAe,CAAC,OAAO,CAAC,CAAC;QAAC,OAAO,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,CAAA;KAAE,CAAC;IAC3E,aAAa,CAAC,CAAC,GAAG,GAAG,EAAE,CAAC,GAAG,GAAG,EAC5B,MAAM,EAAE,YAAY,CAAC,CAAC,CAAC,EACvB,SAAS,EAAE,KAAK,GACf,OAAO,CAAC,CAAC,CAAC;IACb,aAAa,CAAC,CAAC,GAAG,GAAG,EAAE,CAAC,GAAG,GAAG,EAC5B,MAAM,EAAE,YAAY,CAAC,CAAC,CAAC,EACvB,SAAS,CAAC,EAAE,OAAO,GAClB,OAAO,CAAC,CAAC,CAAC;IA6BP,aAAa,CAAC,CAAC,GAAG,GAAG,EAAE,CAAC,GAAG,GAAG,EAAE,MAAM,EAAE,YAAY,CAAC,CAAC,CAAC;IAuG7D,GAAG,CAAC,QAAQ,EAAE,OAAO,EAAE;CAOxB;AACD,YAAY,EAAE,YAAY,EAAE,eAAe,EAAE,aAAa,EAAE,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/requests/interceptors/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { defineConfig } from './util';
|
|
2
|
+
declare function requestInterceptor<T = any>(config: defineConfig<T>): Promise<boolean | undefined>;
|
|
3
|
+
declare function defaultRequestInterceptor<T = any>(config: defineConfig<T>): void;
|
|
4
|
+
export { requestInterceptor, defaultRequestInterceptor };
|
|
5
|
+
//# sourceMappingURL=request.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"request.d.ts","sourceRoot":"","sources":["../../../src/requests/interceptors/request.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAM3C,iBAAS,kBAAkB,CAAC,CAAC,GAAG,GAAG,EAAE,MAAM,EAAE,YAAY,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,OAAO,GAAG,SAAS,CAAC,CAoB1F;AAED,iBAAS,yBAAyB,CAAC,CAAC,GAAG,GAAG,EAAE,MAAM,EAAE,YAAY,CAAC,CAAC,CAAC,QA2BlE;AA8GD,OAAO,EAAE,kBAAkB,EAAE,yBAAyB,EAAE,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { AxiosResponse } from 'axios';
|
|
2
|
+
import type { interceptorsUse } from './util';
|
|
3
|
+
declare function responseInterceptor(response: AxiosResponse, onFulfilled?: interceptorsUse['onFulfilled']): Promise<AxiosResponse<any, any, {}>>;
|
|
4
|
+
export { responseInterceptor };
|
|
5
|
+
//# sourceMappingURL=response.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"response.d.ts","sourceRoot":"","sources":["../../../src/requests/interceptors/response.ts"],"names":[],"mappings":"AACA,OAAO,EAAc,aAAa,EAAE,MAAM,OAAO,CAAC;AAClD,OAAO,KAAK,EAAE,eAAe,EAAgB,MAAM,QAAQ,CAAC;AAG5D,iBAAe,mBAAmB,CAAC,QAAQ,EAAE,aAAa,EAAE,WAAW,CAAC,EAAE,eAAe,CAAC,aAAa,CAAC,wCAyBvG;AAuFD,OAAO,EAAE,mBAAmB,EAAE,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { AxiosInterceptorOptions, AxiosRequestConfig, AxiosResponse } from 'axios';
|
|
2
|
+
interface ResponseError<T = any> {
|
|
3
|
+
code: null | number;
|
|
4
|
+
data: T;
|
|
5
|
+
details: any;
|
|
6
|
+
message: string | null;
|
|
7
|
+
validationErrors: any;
|
|
8
|
+
[key: string]: any;
|
|
9
|
+
}
|
|
10
|
+
declare enum CryptoType {
|
|
11
|
+
SM = 0,
|
|
12
|
+
Ecdh = 1
|
|
13
|
+
}
|
|
14
|
+
interface defineConfig<T = any> extends AxiosRequestConfig<T> {
|
|
15
|
+
disableResponseError?: boolean;
|
|
16
|
+
calculateTime?: boolean;
|
|
17
|
+
isJwt?: boolean;
|
|
18
|
+
tokenStorage?: 'localStorage' | 'sessionStorage';
|
|
19
|
+
tokenKey?: string;
|
|
20
|
+
tokenPrefix?: string;
|
|
21
|
+
crypto?: boolean;
|
|
22
|
+
crdpn?: string;
|
|
23
|
+
cryptoType?: CryptoType;
|
|
24
|
+
cpk?: string;
|
|
25
|
+
iv?: string;
|
|
26
|
+
useSeed?: boolean;
|
|
27
|
+
seed?: string;
|
|
28
|
+
}
|
|
29
|
+
interface interceptorsUse {
|
|
30
|
+
onFulfilled?: ((value: AxiosResponse) => AxiosResponse | Promise<AxiosResponse>) | null;
|
|
31
|
+
onRejected?: ((error: any) => any) | null;
|
|
32
|
+
onRequestFulfilled?: (config: defineConfig) => PromiseLike<defineConfig>;
|
|
33
|
+
options?: AxiosInterceptorOptions;
|
|
34
|
+
}
|
|
35
|
+
declare function GetServerJs(config: defineConfig): Promise<string>;
|
|
36
|
+
declare function getUid(config: defineConfig): string;
|
|
37
|
+
declare function getSecurity(config: defineConfig): Promise<string | undefined>;
|
|
38
|
+
declare function getSmUserId(config: defineConfig): string;
|
|
39
|
+
declare function getSecurityKey(config: defineConfig): Promise<string>;
|
|
40
|
+
export { getUid, GetServerJs, getSecurity, getSecurityKey, getSmUserId, defineConfig, interceptorsUse, ResponseError, CryptoType };
|
|
41
|
+
//# sourceMappingURL=util.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../../src/requests/interceptors/util.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,OAA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O,CAAC,EAAE,uBAAuB,CAAC;CACnC;AAED,iBAAS,WAAW,CAAC,MAAM,EAAE,YAAY,mBA6BxC;AAmBD,iBAAS,MAAM,CAAC,MAAM,EAAE,YAAY,GAAG,MAAM,CAoB5C;AACD,iBAAS,WAAW,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAsBtE;AACD,iBAAS,WAAW,CAAC,MAAM,EAAE,YAAY,UAMxC;AAED,iBAAe,cAAc,CAAC,MAAM,EAAE,YAAY,mBAejD;AAED,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,WAAW,EAAE,cAAc,EAAE,WAAW,EAAE,YAAY,EAAE,eAAe,EAAE,aAAa,EAAE,UAAU,EAAE,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
type StorageOptions = {
|
|
2
|
+
storageType: "localStorage" | "sessionStorage";
|
|
3
|
+
prefix?: string;
|
|
4
|
+
};
|
|
5
|
+
interface IDcToolsStorage {
|
|
6
|
+
get(key: string): any;
|
|
7
|
+
set(key: string, value: any): void;
|
|
8
|
+
remove(key: string): void;
|
|
9
|
+
clear(): void;
|
|
10
|
+
}
|
|
11
|
+
export declare class DcToolsStorage implements IDcToolsStorage {
|
|
12
|
+
private options;
|
|
13
|
+
constructor(_options?: StorageOptions);
|
|
14
|
+
get(key: string): any;
|
|
15
|
+
set(key: string, value: any): void;
|
|
16
|
+
remove(key: string): void;
|
|
17
|
+
removeBatch(keys: string[]): void;
|
|
18
|
+
clear(): void;
|
|
19
|
+
}
|
|
20
|
+
declare global {
|
|
21
|
+
var dcStorage: IDcToolsStorage;
|
|
22
|
+
}
|
|
23
|
+
export declare function useDcStorage(options?: StorageOptions): void;
|
|
24
|
+
export {};
|
|
25
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/storage/index.ts"],"names":[],"mappings":"AAAA,KAAK,cAAc,GAAG;IACpB,WAAW,EAAE,cAAc,GAAG,gBAAgB,CAAC;IAC/C,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB,CAAA;AACD,UAAU,eAAe;IACvB,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;IACtB,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,IAAI,CAAC;IACnC,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,KAAK,IAAI,IAAI,CAAC;CACf;AAED,qBAAa,cAAe,YAAW,eAAe;IACpD,OAAO,CAAC,OAAO,CAGd;gBACW,QAAQ,CAAC,EAAE,cAAc;IAIrC,GAAG,CAAC,GAAG,EAAE,MAAM;IAIf,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG;IAI3B,MAAM,CAAC,GAAG,EAAE,MAAM;IAGlB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE;IAK1B,KAAK;CAGN;AAID,OAAO,CAAC,MAAM,CAAC;IACb,IAAI,SAAS,EAAE,eAAe,CAAA;CAM/B;AACD,wBAAgB,YAAY,CAAC,OAAO,CAAC,EAAE,cAAc,QAOpD"}
|