@sswroom/sswr 1.5.5 → 1.6.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/cesium.d.ts CHANGED
@@ -1,32 +1,32 @@
1
- import { Cartesian3, Ellipsoid, Viewer } from "cesium";
1
+ import { Cartesian3, Ellipsoid, Viewer, Color, PolygonGraphics } from "cesium";
2
2
  import * as geometry from "./geometry";
3
3
  import * as kml from "./kml";
4
4
  import * as map from "./map";
5
- import { Coord2D } from "./math";
5
+ import * as math from "./math";
6
6
 
7
7
  declare class KMLFeatureOptions
8
8
  {
9
9
  noPopup: boolean;
10
10
  }
11
11
 
12
- export function screenToLatLon(viewer: Viewer, x: number, y: number, ellipsoid: Ellipsoid) : Coord2D;
12
+ export function screenToLatLon(viewer: Viewer, x: number, y: number, ellipsoid: Ellipsoid) : math.Coord2D;
13
13
  export function fromCXYZArray(arr: any[]): Cartesian3[];
14
14
  export function toCartesian3Arr(coords: number[][]) : Cartesian3[];
15
15
  export function newObjFromGeoJSON(geoJSON: object) : object;
16
- export function addGeoJSON(viewer: Viewer, geoJSON: object, color: any, extSize: number): void;
16
+ export function addGeoJSON(viewer: Viewer, geoJSON: object, color: Color, extSize: number): void;
17
17
  export function fromCartesian3Array(viewer: Viewer, arr: Cartesian3[]): object[];
18
- export function fromPolygonGraphics(viewer: Viewer, pg: any): geometry.Polygon;
19
- export function createFromKMLFeature(feature: kml.Feature, options: KMLFeatureOptions): any;
20
- export function createFromGeometry(geom: geometry.Vector2D, options: GeometryOptions)
18
+ export function fromPolygonGraphics(viewer: Viewer, pg: PolygonGraphics): geometry.Polygon;
19
+ export function createFromKML(feature: kml.Feature | kml.KMLFile, options: KMLFeatureOptions): any;
20
+ export function createFromGeometry(geom: geometry.Vector2D, options: map.GeometryOptions)
21
21
 
22
22
  export class CesiumMap extends map.MapControl
23
23
  {
24
24
  constructor(divId: string);
25
- createLayer(layer: map.LayerInfo, options?: LayerOptions): any;
26
- createMarkerLayer(name: string, options?: LayerOptions): any;
27
- createGeometryLayer(name: string, options?: LayerOptions): any;
25
+ createLayer(layer: map.LayerInfo, options?: map.LayerOptions): any;
26
+ createMarkerLayer(name: string, options?: map.LayerOptions): any;
27
+ createGeometryLayer(name: string, options?: map.LayerOptions): any;
28
28
  addLayer(layer: any): void;
29
- addKMLFeature(feature: kml.Feature): void;
29
+ addKML(feature: kml.Feature | kml.KMLFile): void;
30
30
  uninit(): void;
31
31
  zoomIn(): void;
32
32
  zoomOut(): void;
@@ -40,13 +40,13 @@ export class CesiumMap extends map.MapControl
40
40
  map2ScnPos(mapPos: math.Coord2D): math.Coord2D;
41
41
  scn2MapPos(scnPos: math.Coord2D): math.Coord2D;
42
42
 
43
- createMarker(mapPos: math.Coord2D, imgURL: string, imgWidth: number, imgHeight: number, options?: MarkerOptions): any;
43
+ createMarker(mapPos: math.Coord2D, imgURL: string, imgWidth: number, imgHeight: number, options?: map.MarkerOptions): any;
44
44
  layerAddMarker(markerLayer: any, marker: any): void;
45
45
  layerRemoveMarker(markerLayer: any, marker: any): void;
46
46
  layerClearMarkers(markerLayer: any): void;
47
47
  markerIsOver(marker: any, scnPos: math.Coord2D): boolean;
48
48
 
49
- createGeometry(geom: geometry.Vector2D, options: GeometryOptions): any;
49
+ createGeometry(geom: geometry.Vector2D, options: map.GeometryOptions): any;
50
50
  layerAddGeometry(geometryLayer: any, geom: any): void;
51
51
  layerRemoveGeometry(geometryLayer: any, geom: any): void;
52
52
  layerClearGeometries(geometryLayer: any): void;
package/cesium.js CHANGED
@@ -154,8 +154,12 @@ export function fromPolygonGraphics(viewer, pg)
154
154
  return new geometry.Polygon(4326, coordinates);
155
155
  }
156
156
 
157
- export function createFromKMLFeature(feature, options)
157
+ export function createFromKML(feature, options)
158
158
  {
159
+ if (feature instanceof kml.KMLFile)
160
+ {
161
+ return createFromKML(feature.root, options);
162
+ }
159
163
  options = data.mergeOptions(options, {noPopup: false});
160
164
  if (feature instanceof kml.Container)
161
165
  {
@@ -164,7 +168,7 @@ export function createFromKMLFeature(feature, options)
164
168
  let layer;
165
169
  for (i in feature.features)
166
170
  {
167
- layer = createFromKMLFeature(feature.features[i], options);
171
+ layer = createFromKML(feature.features[i], options);
168
172
  if (layer instanceof Cesium.Entity)
169
173
  {
170
174
  layers.push(layer);
@@ -432,9 +436,9 @@ export class CesiumMap extends map.MapControl
432
436
  }
433
437
  }
434
438
 
435
- addKMLFeature(feature)
439
+ addKML(feature)
436
440
  {
437
- this.addLayer(createFromKMLFeature(feature));
441
+ this.addLayer(createFromKML(feature));
438
442
  }
439
443
 
440
444
  // uninit(): void;
package/data.d.ts CHANGED
@@ -1,7 +1,8 @@
1
1
  export function isArray(o: any): boolean;
2
2
  export function isObject(o: any): boolean;
3
3
  export function toObjectString(o: any, lev: number): string;
4
- export function arrayBuffer2Base64(buff: any): string;
4
+ export function arrayBuffer2Base64(buff: ArrayBuffer): string;
5
+ export function arrayBufferEquals(buff1: ArrayBuffer, buff2: ArrayBuffer): boolean;
5
6
  export function compare(a: any, b: any): number;
6
7
  export function sort(arr: object[], compareFunc?: (val1: object, val2: object) => number, firstIndex?: number, lastIndex?: number): void;
7
8
  export function mergeOptions(options: object | null, defOptions: object): object;
@@ -11,6 +12,11 @@ export function readUInt24(arr: Uint8Array, index: number): number;
11
12
  export function readMUInt24(arr: Uint8Array, index: number): number;
12
13
  export function readUInt32(arr: Uint8Array, index: number): number;
13
14
  export function readMUInt32(arr: Uint8Array, index: number): number;
15
+ export function rol32(v: number, n: number): number;
16
+ export function ror32(v: number, n: number): number;
17
+ export function shl32(v: number, n: number): number;
18
+ export function sar32(v: number, n: number): number;
19
+ export function shr32(v: number, n: number): number;
14
20
 
15
21
  export class DateValue
16
22
  {
@@ -19,7 +25,7 @@ export class DateValue
19
25
  day: number;
20
26
 
21
27
  constructor();
22
- };
28
+ }
23
29
 
24
30
  export class TimeValue extends DateValue
25
31
  {
@@ -30,7 +36,7 @@ export class TimeValue extends DateValue
30
36
  tzQhr: number;
31
37
 
32
38
  constructor();
33
- };
39
+ }
34
40
 
35
41
  export class DateTimeUtil
36
42
  {
@@ -40,28 +46,28 @@ export class DateTimeUtil
40
46
  static timeValueSetTime(t: TimeValue, timeStrs: string[]): void;
41
47
  static date2TotalDays(year: number, month: number, day: number): number;
42
48
  static dateValue2TotalDays(d: DateValue): number;
43
- static timeValue2Secs(tval: TimeValue): number;
44
- static timeValue2Ticks(t: TimeValue): number;
49
+ static timeValue2Secs(tval: TimeValue): bigint;
50
+ static timeValue2Ticks(t: TimeValue): bigint;
45
51
  static ticks2TimeValue(ticks: number, tzQhr?: number): TimeValue;
46
- static secs2TimeValue(secs: number, tzQhr?: number): TimeValue;
52
+ static secs2TimeValue(secs: bigint, tzQhr?: number): TimeValue;
47
53
  static totalDays2DateValue(totalDays: number, d: DateValue): void;
48
- static instant2TimeValue(secs: number, nanosec: number, tzQhr?: number): TimeValue;
54
+ static instant2TimeValue(secs: bigint, nanosec: number, tzQhr?: number): TimeValue;
49
55
  static toString(tval: TimeValue, pattern: string): string;
50
56
  static string2TimeValue(dateStr: string, tzQhr?: number): TimeValue;
51
57
  static isYearLeap(year: number): boolean;
52
58
  static parseYearStr(year: string): number;
53
59
  static parseMonthStr(month: string): number;
54
60
  static getLocalTzQhr(): number;
55
- };
61
+ }
56
62
 
57
63
  export class Duration
58
64
  {
59
- seconds: number;
65
+ seconds: bigint;
60
66
  ns: number;
61
- constructor(seconds: number, nanosec: number);
67
+ constructor(seconds: number | bigint, nanosec: number);
62
68
  static fromTicks(ticks: number): Duration;
63
- static fromUs(us: number): Duration;
64
- getSeconds(): number;
69
+ static fromUs(us: bigint): Duration;
70
+ getSeconds(): bigint;
65
71
  getNS(): number;
66
72
  getTotalMS(): number;
67
73
  getTotalSec(): number;
@@ -72,7 +78,7 @@ export class Duration
72
78
 
73
79
  export class LocalDate
74
80
  {
75
- static DATE_NULL: number = -1234567;
81
+ static DATE_NULL: number;
76
82
 
77
83
  dateVal: number;
78
84
  constructor();
@@ -95,13 +101,13 @@ export class LocalDate
95
101
 
96
102
  export class TimeInstant
97
103
  {
98
- sec: number;
104
+ sec: bigint;
99
105
  nanosec: number;
100
106
 
101
- constructor(sec: number, nanosec: number);
107
+ constructor(sec: bigint | number, nanosec: number);
102
108
  static now(): TimeInstant;
103
- static fromVariTime(variTime: number): TimeInstant;
104
- static fromTicks(ticks: number): TimeInstant;
109
+ static fromVariTime(variTime: bigint | number): TimeInstant;
110
+ static fromTicks(ticks: bigint | number): TimeInstant;
105
111
  addDay(val: number): TimeInstant;
106
112
  addHour(val: number): TimeInstant;
107
113
  addMinute(val: number): TimeInstant;
@@ -117,26 +123,26 @@ export class TimeInstant
117
123
  diffSecDbl(ts: TimeInstant): number;
118
124
  diff(ts: TimeInstant): Duration;
119
125
  toTicks(): number;
120
- toDotNetTicks(): number;
126
+ toDotNetTicks(): bigint;
121
127
  toUnixTimestamp(): number;
122
- toEpochSec(): number;
123
- toEpochMS(): number;
124
- toEpochNS(): number;
128
+ toEpochSec(): bigint;
129
+ toEpochMS(): bigint;
130
+ toEpochNS(): bigint;
125
131
  }
126
132
 
127
133
  export class Timestamp {
128
134
  constructor(inst: TimeInstant, tzQhr?: number);
129
- static fromTicks(ticks: number, tzQhr?: number): Timestamp;
135
+ static fromTicks(ticks: number | number, tzQhr?: number): Timestamp;
130
136
  static fromStr(str: string, defTzQhr?: number): Timestamp;
131
137
  static now(): Timestamp;
132
138
  static utcNow(): Timestamp;
133
139
  static fromVariTime(variTime: any): Timestamp;
134
140
  static fromSecNS(unixTS: number, nanosec: number, tzQhr?: number): Timestamp;
135
- static fromDotNetTicks(ticks: number, tzQhr?: number): Timestamp;
136
- static fromEpochSec(epochSec: number, tzQhr?: number): Timestamp;
137
- static fromEpochMS(epochMS: number, tzQhr?: number): Timestamp;
138
- static fromEpochUS(epochUS: number, tzQhr?: number): Timestamp;
139
- static fromEpochNS(epochNS: number, tzQhr?: number): Timestamp;
141
+ static fromDotNetTicks(ticks: bigint, tzQhr?: number): Timestamp;
142
+ static fromEpochSec(epochSec: number | bigint, tzQhr?: number): Timestamp;
143
+ static fromEpochMS(epochMS: number | bigint, tzQhr?: number): Timestamp;
144
+ static fromEpochUS(epochUS: number | bigint, tzQhr?: number): Timestamp;
145
+ static fromEpochNS(epochNS: number | bigint, tzQhr?: number): Timestamp;
140
146
  static fromTimeValue(tval: TimeValue): Timestamp;
141
147
  static fromYMDHMS(ymdhms: number, tzQhr?: number): Timestamp;
142
148
  addMonth(val: number): Timestamp;
@@ -161,9 +167,9 @@ export class Timestamp {
161
167
  toTicks(): number;
162
168
  toDotNetTicks(): number;
163
169
  toUnixTimestamp(): number;
164
- toEpochSec(): number;
165
- toEpochMS(): number;
166
- toEpochNS(): number;
170
+ toEpochSec(): bigint;
171
+ toEpochMS(): bigint;
172
+ toEpochNS(): bigint;
167
173
  toString(pattern?: string): string;
168
174
  toStringISO8601(): string;
169
175
  toStringNoZone(): string;
@@ -183,18 +189,22 @@ export class ByteReader
183
189
 
184
190
  constructor(arr: ArrayBuffer);
185
191
  getLength(): number;
186
- getArrayBuffer(ofst: number, size: number): ArrayBuffer;
192
+ getArrayBuffer(ofst?: number, size?: number): ArrayBuffer;
193
+ getU8Arr(ofst?: number, size?: number): Uint8Array;
187
194
 
188
195
  readUInt8(ofst: number): number;
189
196
  readUInt16(ofst: number, lsb: boolean): number;
197
+ readUInt24(ofst: number, lsb: boolean): number;
190
198
  readUInt32(ofst: number, lsb: boolean): number;
191
199
  readInt8(ofst: number): number;
192
200
  readInt16(ofst: number, lsb: boolean): number;
201
+ readInt24(ofst: number, lsb: boolean): number;
193
202
  readInt32(ofst: number, lsb: boolean): number;
194
203
  readFloat64(ofst: number, lsb: boolean): number;
195
204
  readUTF8(ofst: number, len: number): string;
196
205
  readUTF8Z(ofst: number, maxSize?: number): string;
197
-
206
+ readUTF16(ofst: number, nChar: number, lsb: boolean): string;
207
+
198
208
  readUInt8Arr(ofst: number, cnt: number): number[];
199
209
  readUInt16Arr(ofst: number, lsb: boolean, cnt: number): number[];
200
210
  readUInt32Arr(ofst: number, lsb: boolean, cnt: number): number[];
@@ -202,4 +212,13 @@ export class ByteReader
202
212
  readInt16Arr(ofst: number, lsb: boolean, cnt: number): number[];
203
213
  readInt32Arr(ofst: number, lsb: boolean, cnt: number): number[];
204
214
  readFloat64Arr(ofst: number, lsb: boolean, cnt: number): number[];
215
+
216
+ isASCIIText(ofst: number, len: number): boolean;
217
+ }
218
+
219
+ export abstract class ParsedObject
220
+ {
221
+ sourceName: string;
222
+ objType: string;
223
+ constructor(sourceName: string, objType: string);
205
224
  }