dl-common-util 0.8.1 → 1.0.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.
@@ -1,14 +1,50 @@
1
1
  type Nullable<T> = T | null | undefined
2
2
  declare function KtSingleton<T>(): T & (abstract new() => any);
3
+ export declare namespace com.d10ng.common.base {
4
+ class BitWriter {
5
+ private constructor();
6
+ get positionBits(): bigint;
7
+ get capacityBits(): bigint;
8
+ get remainingBits(): bigint;
9
+ setPositionBits(newPositionBits: bigint): com.d10ng.common.base.BitWriter;
10
+ writeBit(value: boolean): com.d10ng.common.base.BitWriter;
11
+ writeIntBits(value: number, bitCount: number): com.d10ng.common.base.BitWriter;
12
+ writeLongBits(value: bigint, bitCount: number): com.d10ng.common.base.BitWriter;
13
+ writeBytes(bytes: Int8Array): com.d10ng.common.base.BitWriter;
14
+ rewind(): com.d10ng.common.base.BitWriter;
15
+ clear(): com.d10ng.common.base.BitWriter;
16
+ toByteArray(): Int8Array;
17
+ }
18
+ namespace BitWriter {
19
+ /** @deprecated $metadata$ is used for internal purposes, please don't use it in your code, because it can be removed at any moment */
20
+ namespace $metadata$ {
21
+ const constructor: abstract new () => BitWriter;
22
+ }
23
+ abstract class Companion extends KtSingleton<Companion.$metadata$.constructor>() {
24
+ private constructor();
25
+ }
26
+ namespace Companion {
27
+ /** @deprecated $metadata$ is used for internal purposes, please don't use it in your code, because it can be removed at any moment */
28
+ namespace $metadata$ {
29
+ abstract class constructor {
30
+ allocate(byteCapacity: number): com.d10ng.common.base.BitWriter;
31
+ wrap(bytes: Int8Array): com.d10ng.common.base.BitWriter;
32
+ private constructor();
33
+ }
34
+ }
35
+ }
36
+ }
37
+ }
3
38
  export declare namespace com.d10ng.common.base {
4
39
  function byteArrayToBinString(_this_: Int8Array, space?: boolean): string;
40
+ /** @deprecated Use Kotlin's ByteArray.toHexString(HexFormat) instead. */
5
41
  function byteArrayToHexString(_this_: Int8Array, space?: boolean, uppercase?: boolean): string;
6
42
  function byteArrayToUnsignedInt(_this_: Int8Array): number;
7
43
  function byteArrayToUnsignedLong(_this_: Int8Array): bigint;
8
44
  function indexOfByteArray(_this_: Int8Array, bs: Int8Array): number;
9
45
  function byteArrayPadStart(_this_: Int8Array, length: number, padByte?: number): Int8Array;
10
46
  function byteArrayPadEnd(_this_: Int8Array, length: number, padByte?: number): Int8Array;
11
- function byteArrayGetBitRange(_this_: Int8Array, start: number, length: number): Int8Array;
47
+ function byteArrayGetBitRange(_this_: Int8Array, start: number, length: number, paddingHigh?: boolean): Int8Array;
12
48
  }
13
49
  export declare namespace com.d10ng.common.base {
14
50
  abstract class ByteOrder {
@@ -21,24 +57,26 @@ export declare namespace com.d10ng.common.base {
21
57
  get name(): "LITTLE_ENDIAN";
22
58
  get ordinal(): 1;
23
59
  };
60
+ static values(): [typeof com.d10ng.common.base.ByteOrder.BIG_ENDIAN, typeof com.d10ng.common.base.ByteOrder.LITTLE_ENDIAN];
61
+ static valueOf(value: string): com.d10ng.common.base.ByteOrder;
24
62
  get name(): "BIG_ENDIAN" | "LITTLE_ENDIAN";
25
63
  get ordinal(): 0 | 1;
26
- static values(): Array<com.d10ng.common.base.ByteOrder>;
27
- static valueOf(value: string): com.d10ng.common.base.ByteOrder;
28
- }
29
- /** @deprecated $metadata$ is used for internal purposes, please don't use it in your code, because it can be removed at any moment */
30
- namespace ByteOrder.$metadata$ {
31
- const constructor: abstract new () => ByteOrder;
32
64
  }
33
65
  namespace ByteOrder {
66
+ /** @deprecated $metadata$ is used for internal purposes, please don't use it in your code, because it can be removed at any moment */
67
+ namespace $metadata$ {
68
+ const constructor: abstract new () => ByteOrder;
69
+ }
34
70
  abstract class Companion extends KtSingleton<Companion.$metadata$.constructor>() {
35
71
  private constructor();
36
72
  }
37
- /** @deprecated $metadata$ is used for internal purposes, please don't use it in your code, because it can be removed at any moment */
38
- namespace Companion.$metadata$ {
39
- abstract class constructor {
40
- nativeOrder(): com.d10ng.common.base.ByteOrder;
41
- private constructor();
73
+ namespace Companion {
74
+ /** @deprecated $metadata$ is used for internal purposes, please don't use it in your code, because it can be removed at any moment */
75
+ namespace $metadata$ {
76
+ abstract class constructor {
77
+ nativeOrder(): com.d10ng.common.base.ByteOrder;
78
+ private constructor();
79
+ }
42
80
  }
43
81
  }
44
82
  }
@@ -55,21 +93,21 @@ export declare namespace com.d10ng.common.base {
55
93
  clear(): com.d10ng.common.base.ByteBuffer;
56
94
  flip(): com.d10ng.common.base.ByteBuffer;
57
95
  rewind(): com.d10ng.common.base.ByteBuffer;
58
- /** @deprecated Use rewind() instead */
96
+ /** @deprecated Use rewind() instead. */
59
97
  reset(): void;
60
98
  get(): number;
61
- /** @deprecated Use get() instead */
99
+ /** @deprecated Use get() instead. */
62
100
  getByte(): number;
63
101
  getByteByIndex(index: number): number;
64
102
  getBytesByIndex(dst: Int8Array, offset?: number, length?: number): com.d10ng.common.base.ByteBuffer;
65
103
  getBytes(size: number): Int8Array;
66
104
  put(b: number): com.d10ng.common.base.ByteBuffer;
67
- /** @deprecated Use put() instead */
105
+ /** @deprecated Use put() instead. */
68
106
  setByte(b: number): com.d10ng.common.base.ByteBuffer;
69
107
  putByteByIndex(index: number, b: number): com.d10ng.common.base.ByteBuffer;
70
108
  putBytes(src: Int8Array): com.d10ng.common.base.ByteBuffer;
71
109
  putBytesByIndex(src: Int8Array, offset?: number, length?: number): com.d10ng.common.base.ByteBuffer;
72
- /** @deprecated Use put(value) instead */
110
+ /** @deprecated Use put(value) instead. */
73
111
  setBytes(value: Int8Array): void;
74
112
  array(): Int8Array;
75
113
  getInt(): number;
@@ -91,44 +129,52 @@ export declare namespace com.d10ng.common.base {
91
129
  compact(): com.d10ng.common.base.ByteBuffer;
92
130
  getRemainingBytes(): Int8Array;
93
131
  }
94
- /** @deprecated $metadata$ is used for internal purposes, please don't use it in your code, because it can be removed at any moment */
95
- namespace ByteBuffer.$metadata$ {
96
- const constructor: abstract new () => ByteBuffer;
97
- }
98
132
  namespace ByteBuffer {
133
+ /** @deprecated $metadata$ is used for internal purposes, please don't use it in your code, because it can be removed at any moment */
134
+ namespace $metadata$ {
135
+ const constructor: abstract new () => ByteBuffer;
136
+ }
99
137
  abstract class Companion extends KtSingleton<Companion.$metadata$.constructor>() {
100
138
  private constructor();
101
139
  }
102
- /** @deprecated $metadata$ is used for internal purposes, please don't use it in your code, because it can be removed at any moment */
103
- namespace Companion.$metadata$ {
104
- abstract class constructor {
105
- allocate(capacity: number): com.d10ng.common.base.ByteBuffer;
106
- wrap(array: Int8Array): com.d10ng.common.base.ByteBuffer;
107
- private constructor();
140
+ namespace Companion {
141
+ /** @deprecated $metadata$ is used for internal purposes, please don't use it in your code, because it can be removed at any moment */
142
+ namespace $metadata$ {
143
+ abstract class constructor {
144
+ allocate(capacity: number): com.d10ng.common.base.ByteBuffer;
145
+ wrap(array: Int8Array): com.d10ng.common.base.ByteBuffer;
146
+ private constructor();
147
+ }
108
148
  }
109
149
  }
110
150
  }
111
151
  class BufferOverflowException extends /* kotlin.Exception */ Error {
112
152
  constructor();
113
153
  }
114
- /** @deprecated $metadata$ is used for internal purposes, please don't use it in your code, because it can be removed at any moment */
115
- namespace BufferOverflowException.$metadata$ {
116
- const constructor: abstract new () => BufferOverflowException;
154
+ namespace BufferOverflowException {
155
+ /** @deprecated $metadata$ is used for internal purposes, please don't use it in your code, because it can be removed at any moment */
156
+ namespace $metadata$ {
157
+ const constructor: abstract new () => BufferOverflowException;
158
+ }
117
159
  }
118
160
  class BufferUnderflowException extends /* kotlin.Exception */ Error {
119
161
  constructor();
120
162
  }
121
- /** @deprecated $metadata$ is used for internal purposes, please don't use it in your code, because it can be removed at any moment */
122
- namespace BufferUnderflowException.$metadata$ {
123
- const constructor: abstract new () => BufferUnderflowException;
163
+ namespace BufferUnderflowException {
164
+ /** @deprecated $metadata$ is used for internal purposes, please don't use it in your code, because it can be removed at any moment */
165
+ namespace $metadata$ {
166
+ const constructor: abstract new () => BufferUnderflowException;
167
+ }
124
168
  }
125
169
  }
126
170
  export declare namespace com.d10ng.common.base {
127
- function getBitRange(_this_: com.d10ng.common.base.ByteBuffer, start: number, length: number): Int8Array;
171
+ function getBitRange(_this_: com.d10ng.common.base.ByteBuffer, start: number, length: number, paddingHigh?: boolean): Int8Array;
128
172
  }
129
173
  export declare namespace com.d10ng.common.base {
130
174
  function byteToBinString(_this_: number): string;
175
+ /** @deprecated Use Kotlin's Byte.toHexString(HexFormat) instead. */
131
176
  function byteToHexString(_this_: number, uppercase?: boolean): string;
177
+ /** @deprecated Use toUByte().toInt() instead. */
132
178
  function byteToUnsignedInt(_this_: number): number;
133
179
  function byteGetBit(_this_: number, bitIndex: number): number;
134
180
  }
@@ -156,7 +202,9 @@ export declare namespace com.d10ng.common.base {
156
202
  export declare namespace com.d10ng.common.base {
157
203
  function binStringToByte(_this_: string): number;
158
204
  function binStringToByteArray(_this_: string): Int8Array;
205
+ /** @deprecated Use Kotlin's hexToByte() for strict hexadecimal parsing. */
159
206
  function hexStringToByte(_this_: string): number;
207
+ /** @deprecated Use Kotlin's hexToByteArray() for strict hexadecimal parsing. */
160
208
  function hexStringToByteArray(_this_: string): Int8Array;
161
209
  function getStringByteLength(_this_: string): number;
162
210
  function getStringFirstUpperCase(_this_: string): string;
@@ -165,6 +213,7 @@ export declare namespace com.d10ng.common.base {
165
213
  export declare namespace com.d10ng.common.calculate {
166
214
  abstract class ChecksumType {
167
215
  private constructor();
216
+ /** @deprecated AND historically performs addition. Use SUM instead. */
168
217
  static get AND(): com.d10ng.common.calculate.ChecksumType & {
169
218
  get name(): "AND";
170
219
  get ordinal(): 0;
@@ -177,14 +226,20 @@ export declare namespace com.d10ng.common.calculate {
177
226
  get name(): "XOR";
178
227
  get ordinal(): 2;
179
228
  };
180
- get name(): "AND" | "OR" | "XOR";
181
- get ordinal(): 0 | 1 | 2;
182
- static values(): Array<com.d10ng.common.calculate.ChecksumType>;
229
+ static get SUM(): com.d10ng.common.calculate.ChecksumType & {
230
+ get name(): "SUM";
231
+ get ordinal(): 3;
232
+ };
233
+ static values(): [typeof com.d10ng.common.calculate.ChecksumType.AND, typeof com.d10ng.common.calculate.ChecksumType.OR, typeof com.d10ng.common.calculate.ChecksumType.XOR, typeof com.d10ng.common.calculate.ChecksumType.SUM];
183
234
  static valueOf(value: string): com.d10ng.common.calculate.ChecksumType;
235
+ get name(): "AND" | "OR" | "XOR" | "SUM";
236
+ get ordinal(): 0 | 1 | 2 | 3;
184
237
  }
185
- /** @deprecated $metadata$ is used for internal purposes, please don't use it in your code, because it can be removed at any moment */
186
- namespace ChecksumType.$metadata$ {
187
- const constructor: abstract new () => ChecksumType;
238
+ namespace ChecksumType {
239
+ /** @deprecated $metadata$ is used for internal purposes, please don't use it in your code, because it can be removed at any moment */
240
+ namespace $metadata$ {
241
+ const constructor: abstract new () => ChecksumType;
242
+ }
188
243
  }
189
244
  function assertChecksum(_this_: Int8Array, type?: com.d10ng.common.calculate.ChecksumType): boolean;
190
245
  function getChecksum(_this_: Int8Array, type?: com.d10ng.common.calculate.ChecksumType, start?: number, length?: number): number;
@@ -199,6 +254,7 @@ export declare namespace com.d10ng.common.calculate {
199
254
  }
200
255
  export declare namespace com.d10ng.common.calculate {
201
256
  function keepByRegexStr(_this_: string, regStr: string): string;
257
+ /** @deprecated Use Kotlin's Regex.replace(input, replacement) instead. */
202
258
  function filterByRegexStr(_this_: string, regStr: string): string;
203
259
  function isIdCard(_this_: string): boolean;
204
260
  function isMobileNumber(_this_: string): boolean;
@@ -224,9 +280,11 @@ export declare namespace com.d10ng.common.coordinate {
224
280
  hashCode(): number;
225
281
  equals(other: Nullable<any>): boolean;
226
282
  }
227
- /** @deprecated $metadata$ is used for internal purposes, please don't use it in your code, because it can be removed at any moment */
228
- namespace Coordinate.$metadata$ {
229
- const constructor: abstract new () => Coordinate;
283
+ namespace Coordinate {
284
+ /** @deprecated $metadata$ is used for internal purposes, please don't use it in your code, because it can be removed at any moment */
285
+ namespace $metadata$ {
286
+ const constructor: abstract new () => Coordinate;
287
+ }
230
288
  }
231
289
  }
232
290
  export declare namespace com.d10ng.common.coordinate {
@@ -244,14 +302,16 @@ export declare namespace com.d10ng.common.coordinate {
244
302
  get name(): "BD09";
245
303
  get ordinal(): 2;
246
304
  };
305
+ static values(): [typeof com.d10ng.common.coordinate.CoordinateSystemType.WGS84, typeof com.d10ng.common.coordinate.CoordinateSystemType.GCJ02, typeof com.d10ng.common.coordinate.CoordinateSystemType.BD09];
306
+ static valueOf(value: string): com.d10ng.common.coordinate.CoordinateSystemType;
247
307
  get name(): "WGS84" | "GCJ02" | "BD09";
248
308
  get ordinal(): 0 | 1 | 2;
249
- static values(): Array<com.d10ng.common.coordinate.CoordinateSystemType>;
250
- static valueOf(value: string): com.d10ng.common.coordinate.CoordinateSystemType;
251
309
  }
252
- /** @deprecated $metadata$ is used for internal purposes, please don't use it in your code, because it can be removed at any moment */
253
- namespace CoordinateSystemType.$metadata$ {
254
- const constructor: abstract new () => CoordinateSystemType;
310
+ namespace CoordinateSystemType {
311
+ /** @deprecated $metadata$ is used for internal purposes, please don't use it in your code, because it can be removed at any moment */
312
+ namespace $metadata$ {
313
+ const constructor: abstract new () => CoordinateSystemType;
314
+ }
255
315
  }
256
316
  }
257
317
  export declare namespace com.d10ng.common.coordinate {
@@ -287,9 +347,11 @@ export declare namespace com.d10ng.common.coordinate {
287
347
  hashCode(): number;
288
348
  equals(other: Nullable<any>): boolean;
289
349
  }
290
- /** @deprecated $metadata$ is used for internal purposes, please don't use it in your code, because it can be removed at any moment */
291
- namespace DMS.$metadata$ {
292
- const constructor: abstract new () => DMS;
350
+ namespace DMS {
351
+ /** @deprecated $metadata$ is used for internal purposes, please don't use it in your code, because it can be removed at any moment */
352
+ namespace $metadata$ {
353
+ const constructor: abstract new () => DMS;
354
+ }
293
355
  }
294
356
  }
295
357
  export declare namespace com.d10ng.common.coordinate {
@@ -306,9 +368,11 @@ export declare namespace com.d10ng.common.coordinate {
306
368
  hashCode(): number;
307
369
  equals(other: Nullable<any>): boolean;
308
370
  }
309
- /** @deprecated $metadata$ is used for internal purposes, please don't use it in your code, because it can be removed at any moment */
310
- namespace DistanceAndBearing.$metadata$ {
311
- const constructor: abstract new () => DistanceAndBearing;
371
+ namespace DistanceAndBearing {
372
+ /** @deprecated $metadata$ is used for internal purposes, please don't use it in your code, because it can be removed at any moment */
373
+ namespace $metadata$ {
374
+ const constructor: abstract new () => DistanceAndBearing;
375
+ }
312
376
  }
313
377
  }
314
378
  export declare namespace com.d10ng.common.coordinate {
@@ -353,5 +417,7 @@ export declare namespace com.d10ng.common.base {
353
417
  export declare namespace com.d10ng.common.transform {
354
418
  function encodeGBK(_this_: string): Int8Array;
355
419
  function decodeGBK(_this_: Int8Array): string;
420
+ function encodeGB18030(_this_: string): Int8Array;
421
+ function decodeGB18030(_this_: Int8Array): string;
356
422
  }
357
423
  export as namespace com_github_D10NGYANG_DLCommonUtil;