wenay-common 1.0.16 → 1.0.18

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.
Files changed (57) hide show
  1. package/lib/12.js +1 -1
  2. package/lib/Common/BaseTypes.d.ts +38 -38
  3. package/lib/Common/BaseTypes.js +2 -2
  4. package/lib/Common/ByteStream.d.ts +96 -96
  5. package/lib/Common/ByteStream.js +426 -426
  6. package/lib/Common/Color.d.ts +26 -26
  7. package/lib/Common/Color.js +51 -51
  8. package/lib/Common/Common.d.ts +232 -232
  9. package/lib/Common/Common.js +614 -615
  10. package/lib/Common/Common.js.map +1 -1
  11. package/lib/Common/List.d.ts +64 -64
  12. package/lib/Common/List.js +193 -193
  13. package/lib/Common/ListNodeAnd.d.ts +46 -46
  14. package/lib/Common/ListNodeAnd.js +89 -89
  15. package/lib/Common/ListNodeAnd.js.map +1 -1
  16. package/lib/Common/Math.d.ts +27 -27
  17. package/lib/Common/Math.js +70 -70
  18. package/lib/Common/Time.d.ts +181 -181
  19. package/lib/Common/Time.js +355 -355
  20. package/lib/Common/Time.js.map +1 -1
  21. package/lib/Common/math/other.d.ts +23 -0
  22. package/lib/Common/math/other.js +71 -0
  23. package/lib/Common/math/other.js.map +1 -0
  24. package/lib/Common/math/scoreLana.d.ts +23 -0
  25. package/lib/Common/math/scoreLana.js +65 -0
  26. package/lib/Common/math/scoreLana.js.map +1 -0
  27. package/lib/Common/node_console.d.ts +1 -1
  28. package/lib/Common/node_console.js +42 -42
  29. package/lib/Common/objectPath.d.ts +11 -11
  30. package/lib/Common/objectPath.js +60 -60
  31. package/lib/Exchange/Bars.d.ts +182 -182
  32. package/lib/Exchange/Bars.js +453 -453
  33. package/lib/Exchange/ConnectData/Binance/marketData.d.ts +14 -14
  34. package/lib/Exchange/ConnectData/Binance/marketData.js +116 -116
  35. package/lib/Exchange/ConnectData/Binance.d.ts +122 -122
  36. package/lib/Exchange/ConnectData/Binance.js +513 -511
  37. package/lib/Exchange/ConnectData/Binance.js.map +1 -1
  38. package/lib/Exchange/ConnectData/test.d.ts +3 -3
  39. package/lib/Exchange/ConnectData/test.js +14 -14
  40. package/lib/Exchange/ConnectData/test.js.map +1 -1
  41. package/lib/Exchange/ConnectData/type.d.ts +11 -11
  42. package/lib/Exchange/ConnectData/type.js +2 -2
  43. package/lib/Exchange/IHistoryBase.d.ts +157 -157
  44. package/lib/Exchange/IHistoryBase.js +2 -2
  45. package/lib/Exchange/LoadBase.d.ts +59 -59
  46. package/lib/Exchange/LoadBase.js +102 -102
  47. package/lib/Exchange/LoadBase.js.map +1 -1
  48. package/lib/Exchange/MarketData.d.ts +78 -78
  49. package/lib/Exchange/MarketData.js +357 -357
  50. package/lib/Exchange/mini.d.ts +68 -68
  51. package/lib/Exchange/mini.js +2 -2
  52. package/lib/index.d.ts +17 -16
  53. package/lib/index.js +41 -40
  54. package/lib/index.js.map +1 -1
  55. package/lib/minitest.d.ts +1 -1
  56. package/lib/minitest.js +3 -3
  57. package/package.json +6 -5
package/lib/12.js CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";
1
+ "use strict";
2
2
  //# sourceMappingURL=12.js.map
@@ -1,38 +1,38 @@
1
- export type Immutable<T> = ReadonlyFull<T> & {
2
- readonly Mutable: false;
3
- };
4
- export type ReadonlyFull<T> = T extends ((...args: any) => any) ? T : T extends number | string | boolean | symbol ? T : T extends const_Date ? const_Date : {
5
- readonly [P in keyof T]: ReadonlyFull<T[P]>;
6
- };
7
- export type MutableFull<T> = T extends ((...args: any) => any) ? T : T extends number | string | boolean | symbol ? T : T extends const_Date ? const_Date : {
8
- -readonly [P in keyof T]: MutableFull<T[P]>;
9
- };
10
- export type Mutable<T> = {
11
- -readonly [P in keyof T]: T[P];
12
- };
13
- export type const_Date = Omit<Date, "setTime" | "setFullYear" | "setMonth" | "setDate" | "setHours" | "setMinutes" | "setSeconds" | "setMilliseconds" | "setUTCFullYear" | "setUTCMonth" | "setUTCDate" | "setUTCHours" | "setUTCMinutes" | "setUTCSeconds" | "setUTCMilliseconds">;
14
- export interface DateConstructor {
15
- new (value: number | string | Date | const_Date): Date;
16
- }
17
- export declare var Date: DateConstructor;
18
- export interface ArrayConstructor {
19
- isArray<T>(a: unknown): a is readonly unknown[];
20
- isArray<T>(a: readonly T[]): a is readonly T[];
21
- isArray<T>(a: T[]): a is T[];
22
- }
23
- export type ReplaceKeyType<Struct extends object, Key extends keyof Struct, NewType> = {
24
- [key in keyof Struct]: key extends Key ? NewType : Struct[key];
25
- };
26
- export type KeysByTypeUnchecked<T, PickT> = {
27
- [key in keyof T]: T[key] extends PickT ? key : never;
28
- }[keyof T];
29
- export type KeysByType<T, PickT extends T[keyof T]> = {
30
- [key in keyof T]: T[key] extends PickT ? key : never;
31
- }[keyof T];
32
- export type KeysWithoutType<T, ExcludeT> = {
33
- [key in keyof T]: T[key] extends ExcludeT ? never : key;
34
- }[keyof T];
35
- export type OmitTypes<T, ExcludeT> = Pick<T, KeysWithoutType<T, ExcludeT>>;
36
- export type PickTypes<T, PickT extends T[keyof T]> = Pick<T, KeysByType<T, PickT>>;
37
- export type PickTypesUnchecked<T, PickT> = Pick<T, KeysByTypeUnchecked<T, PickT>>;
38
- export type RequiredExcept<T, E extends keyof T> = Required<Omit<T, E>> & Pick<T, E>;
1
+ export type Immutable<T> = ReadonlyFull<T> & {
2
+ readonly Mutable: false;
3
+ };
4
+ export type ReadonlyFull<T> = T extends ((...args: any) => any) ? T : T extends number | string | boolean | symbol ? T : T extends const_Date ? const_Date : {
5
+ readonly [P in keyof T]: ReadonlyFull<T[P]>;
6
+ };
7
+ export type MutableFull<T> = T extends ((...args: any) => any) ? T : T extends number | string | boolean | symbol ? T : T extends const_Date ? const_Date : {
8
+ -readonly [P in keyof T]: MutableFull<T[P]>;
9
+ };
10
+ export type Mutable<T> = {
11
+ -readonly [P in keyof T]: T[P];
12
+ };
13
+ export type const_Date = Omit<Date, "setTime" | "setFullYear" | "setMonth" | "setDate" | "setHours" | "setMinutes" | "setSeconds" | "setMilliseconds" | "setUTCFullYear" | "setUTCMonth" | "setUTCDate" | "setUTCHours" | "setUTCMinutes" | "setUTCSeconds" | "setUTCMilliseconds">;
14
+ export interface DateConstructor {
15
+ new (value: number | string | Date | const_Date): Date;
16
+ }
17
+ export declare var Date: DateConstructor;
18
+ export interface ArrayConstructor {
19
+ isArray<T>(a: unknown): a is readonly unknown[];
20
+ isArray<T>(a: readonly T[]): a is readonly T[];
21
+ isArray<T>(a: T[]): a is T[];
22
+ }
23
+ export type ReplaceKeyType<Struct extends object, Key extends keyof Struct, NewType> = {
24
+ [key in keyof Struct]: key extends Key ? NewType : Struct[key];
25
+ };
26
+ export type KeysByTypeUnchecked<T, PickT> = {
27
+ [key in keyof T]: T[key] extends PickT ? key : never;
28
+ }[keyof T];
29
+ export type KeysByType<T, PickT extends T[keyof T]> = {
30
+ [key in keyof T]: T[key] extends PickT ? key : never;
31
+ }[keyof T];
32
+ export type KeysWithoutType<T, ExcludeT> = {
33
+ [key in keyof T]: T[key] extends ExcludeT ? never : key;
34
+ }[keyof T];
35
+ export type OmitTypes<T, ExcludeT> = Pick<T, KeysWithoutType<T, ExcludeT>>;
36
+ export type PickTypes<T, PickT extends T[keyof T]> = Pick<T, KeysByType<T, PickT>>;
37
+ export type PickTypesUnchecked<T, PickT> = Pick<T, KeysByTypeUnchecked<T, PickT>>;
38
+ export type RequiredExcept<T, E extends keyof T> = Required<Omit<T, E>> & Pick<T, E>;
@@ -1,3 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  //# sourceMappingURL=BaseTypes.js.map
@@ -1,96 +1,96 @@
1
- import { const_Date } from "./BaseTypes";
2
- export type NumericTypes = "int8" | "int16" | "int24" | "int32" | "int48" | "int64" | "float" | "double" | "uint8" | "uint16" | "uint24" | "uint32" | "uint48" | "uint64";
3
- export declare class Nullable<T extends NumericTypes> {
4
- value: T;
5
- constructor(type: T);
6
- }
7
- export declare function nullable(type: NumericTypes): Nullable<NumericTypes>;
8
- export type WritableToBytes = {
9
- write(stream: ByteStreamW): boolean | void;
10
- };
11
- export declare class ByteStreamW {
12
- protected _view: DataView;
13
- protected _pos: number;
14
- protected _isThrowable: boolean;
15
- protected _buffer(): ArrayBuffer;
16
- protected resize(size: number): void;
17
- constructor(view?: DataView);
18
- get length(): number;
19
- get data(): Readonly<DataView>;
20
- noThrow(): ByteStreamW;
21
- private _ensureAllocation;
22
- private _setInt8;
23
- private _setInt16;
24
- private _setInt32;
25
- protected _push(value: number, bytes: number, isInteger: boolean): this;
26
- pushInt8(value: number): this;
27
- pushInt16(value: number): this;
28
- pushInt24(value: number): this;
29
- pushInt32(value: number): this;
30
- pushInt48(value: number): this;
31
- pushInt64(value: number): this;
32
- pushFloat(value: number): this;
33
- pushDouble(value: number): this;
34
- pushBool(value: boolean): this;
35
- pushDate(value: const_Date): this;
36
- private _checkResult;
37
- push(obj: WritableToBytes): this | null;
38
- pushNullable(obj: WritableToBytes | null): this | null;
39
- pushNumber(value: number, type: NumericTypes | Nullable<NumericTypes>): boolean;
40
- pushNumbers(values: readonly number[], type: NumericTypes | Nullable<NumericTypes>): this | null;
41
- pushArrayByFunc<T>(array: Iterable<T>, func: (stream: ByteStreamW, item: T) => boolean | void, maxlength?: number): this | null;
42
- protected _getWriteFuncForNumeric(type: NumericTypes | Nullable<NumericTypes>): (stream: ByteStreamW, value: number) => boolean;
43
- pushArrayNumeric(array: Iterable<number>, type: NumericTypes | Nullable<NumericTypes>, maxlength?: number): this | null;
44
- pushArray<T extends WritableToBytes>(array: Iterable<T> | Int8Array | Uint8Array, maxlength?: number): this | null;
45
- pushArrayOfNullable<T extends WritableToBytes | null>(array: Iterable<T>, maxlength?: number): this | null;
46
- private _pushNullableString;
47
- pushAnsi(text: string | null): this;
48
- pushUnicode(text: string | null): this;
49
- }
50
- type ReaderFromBytes<T> = {
51
- read(stream: ByteStreamR | any): T;
52
- };
53
- declare class ByteStreamR_<throwable extends boolean> {
54
- protected _wstream?: Readonly<ByteStreamW>;
55
- protected _view: Readonly<DataView>;
56
- protected _pos: number;
57
- private isThrowable;
58
- constructor(data: Readonly<ArrayBuffer | DataView>);
59
- UpdateFrom(stream: Readonly<ByteStreamW>): void;
60
- private __readNumber;
61
- _readNumber(bytes: number, isInteger: boolean, isSigned?: boolean): throwable extends true ? number : number | null;
62
- noThrow(): ByteStreamR_<false>;
63
- readInt8(): throwable extends true ? number : number | null;
64
- readInt16(): throwable extends true ? number : number | null;
65
- readInt24(): throwable extends true ? number : number | null;
66
- readInt32(): throwable extends true ? number : number | null;
67
- readInt48(): throwable extends true ? number : number | null;
68
- readInt64(): throwable extends true ? number : number | null;
69
- readUint8(): throwable extends true ? number : number | null;
70
- readUint16(): throwable extends true ? number : number | null;
71
- readUint24(): throwable extends true ? number : number | null;
72
- readUint32(): throwable extends true ? number : number | null;
73
- readUint48(): throwable extends true ? number : number | null;
74
- readUint64(): throwable extends true ? number : number | null;
75
- readFloat(): throwable extends true ? number : number | null;
76
- readDouble(): throwable extends true ? number : number | null;
77
- readBool(): throwable extends true ? boolean : boolean | null;
78
- readNumber(type: NumericTypes | Nullable<NumericTypes>): throwable extends true ? number : number | null;
79
- readDate(): Date;
80
- toType<T>(value: T): throwable extends true ? T : T | null;
81
- protected _getReadFuncForNumeric<T extends NumericTypes | Nullable<NumericTypes>>(type: T): (stream: ByteStreamR_<throwable>) => throwable extends true ? number : T extends NumericTypes ? number : number | null;
82
- readNullable<T>(reader: ReaderFromBytes<NonNullable<T>>): NonNullable<T> | null;
83
- readArray<T>(func: (stream: ByteStreamR) => NonNullable<T>): T[];
84
- readArray<T extends NumericTypes | Nullable<NumericTypes>>(type: T): T extends NumericTypes ? number[] : (number | null)[];
85
- readArray<T>(reader: ReaderFromBytes<NonNullable<T>>): T[];
86
- protected _readArrayByFunc<T>(func: (stream: ByteStreamR | any) => T): T[] | null;
87
- protected _readArrayOfNumeric(type: NumericTypes): (throwable extends true ? number : number)[] | null;
88
- protected _readArrayByReader<T>(reader: ReaderFromBytes<T>): T[] | null;
89
- private _readNullableString;
90
- readAnsi(): string | null;
91
- readUnicode(): string | null;
92
- }
93
- export declare class ByteStreamR extends ByteStreamR_<true> {
94
- constructor(data: Readonly<ArrayBuffer | DataView>);
95
- }
96
- export {};
1
+ import { const_Date } from "./BaseTypes";
2
+ export type NumericTypes = "int8" | "int16" | "int24" | "int32" | "int48" | "int64" | "float" | "double" | "uint8" | "uint16" | "uint24" | "uint32" | "uint48" | "uint64";
3
+ export declare class Nullable<T extends NumericTypes> {
4
+ value: T;
5
+ constructor(type: T);
6
+ }
7
+ export declare function nullable(type: NumericTypes): Nullable<NumericTypes>;
8
+ export type WritableToBytes = {
9
+ write(stream: ByteStreamW): boolean | void;
10
+ };
11
+ export declare class ByteStreamW {
12
+ protected _view: DataView;
13
+ protected _pos: number;
14
+ protected _isThrowable: boolean;
15
+ protected _buffer(): ArrayBuffer;
16
+ protected resize(size: number): void;
17
+ constructor(view?: DataView);
18
+ get length(): number;
19
+ get data(): Readonly<DataView>;
20
+ noThrow(): ByteStreamW;
21
+ private _ensureAllocation;
22
+ private _setInt8;
23
+ private _setInt16;
24
+ private _setInt32;
25
+ protected _push(value: number, bytes: number, isInteger: boolean): this;
26
+ pushInt8(value: number): this;
27
+ pushInt16(value: number): this;
28
+ pushInt24(value: number): this;
29
+ pushInt32(value: number): this;
30
+ pushInt48(value: number): this;
31
+ pushInt64(value: number): this;
32
+ pushFloat(value: number): this;
33
+ pushDouble(value: number): this;
34
+ pushBool(value: boolean): this;
35
+ pushDate(value: const_Date): this;
36
+ private _checkResult;
37
+ push(obj: WritableToBytes): this | null;
38
+ pushNullable(obj: WritableToBytes | null): this | null;
39
+ pushNumber(value: number, type: NumericTypes | Nullable<NumericTypes>): boolean;
40
+ pushNumbers(values: readonly number[], type: NumericTypes | Nullable<NumericTypes>): this | null;
41
+ pushArrayByFunc<T>(array: Iterable<T>, func: (stream: ByteStreamW, item: T) => boolean | void, maxlength?: number): this | null;
42
+ protected _getWriteFuncForNumeric(type: NumericTypes | Nullable<NumericTypes>): (stream: ByteStreamW, value: number) => boolean;
43
+ pushArrayNumeric(array: Iterable<number>, type: NumericTypes | Nullable<NumericTypes>, maxlength?: number): this | null;
44
+ pushArray<T extends WritableToBytes>(array: Iterable<T> | Int8Array | Uint8Array, maxlength?: number): this | null;
45
+ pushArrayOfNullable<T extends WritableToBytes | null>(array: Iterable<T>, maxlength?: number): this | null;
46
+ private _pushNullableString;
47
+ pushAnsi(text: string | null): this;
48
+ pushUnicode(text: string | null): this;
49
+ }
50
+ type ReaderFromBytes<T> = {
51
+ read(stream: ByteStreamR | any): T;
52
+ };
53
+ declare class ByteStreamR_<throwable extends boolean> {
54
+ protected _wstream?: Readonly<ByteStreamW>;
55
+ protected _view: Readonly<DataView>;
56
+ protected _pos: number;
57
+ private isThrowable;
58
+ constructor(data: Readonly<ArrayBuffer | DataView>);
59
+ UpdateFrom(stream: Readonly<ByteStreamW>): void;
60
+ private __readNumber;
61
+ _readNumber(bytes: number, isInteger: boolean, isSigned?: boolean): throwable extends true ? number : number | null;
62
+ noThrow(): ByteStreamR_<false>;
63
+ readInt8(): throwable extends true ? number : number | null;
64
+ readInt16(): throwable extends true ? number : number | null;
65
+ readInt24(): throwable extends true ? number : number | null;
66
+ readInt32(): throwable extends true ? number : number | null;
67
+ readInt48(): throwable extends true ? number : number | null;
68
+ readInt64(): throwable extends true ? number : number | null;
69
+ readUint8(): throwable extends true ? number : number | null;
70
+ readUint16(): throwable extends true ? number : number | null;
71
+ readUint24(): throwable extends true ? number : number | null;
72
+ readUint32(): throwable extends true ? number : number | null;
73
+ readUint48(): throwable extends true ? number : number | null;
74
+ readUint64(): throwable extends true ? number : number | null;
75
+ readFloat(): throwable extends true ? number : number | null;
76
+ readDouble(): throwable extends true ? number : number | null;
77
+ readBool(): throwable extends true ? boolean : boolean | null;
78
+ readNumber(type: NumericTypes | Nullable<NumericTypes>): throwable extends true ? number : number | null;
79
+ readDate(): Date;
80
+ toType<T>(value: T): throwable extends true ? T : T | null;
81
+ protected _getReadFuncForNumeric<T extends NumericTypes | Nullable<NumericTypes>>(type: T): (stream: ByteStreamR_<throwable>) => throwable extends true ? number : T extends NumericTypes ? number : number | null;
82
+ readNullable<T>(reader: ReaderFromBytes<NonNullable<T>>): NonNullable<T> | null;
83
+ readArray<T>(func: (stream: ByteStreamR) => NonNullable<T>): T[];
84
+ readArray<T extends NumericTypes | Nullable<NumericTypes>>(type: T): T extends NumericTypes ? number[] : (number | null)[];
85
+ readArray<T>(reader: ReaderFromBytes<NonNullable<T>>): T[];
86
+ protected _readArrayByFunc<T>(func: (stream: ByteStreamR | any) => T): T[] | null;
87
+ protected _readArrayOfNumeric(type: NumericTypes): (throwable extends true ? number : number)[] | null;
88
+ protected _readArrayByReader<T>(reader: ReaderFromBytes<T>): T[] | null;
89
+ private _readNullableString;
90
+ readAnsi(): string | null;
91
+ readUnicode(): string | null;
92
+ }
93
+ export declare class ByteStreamR extends ByteStreamR_<true> {
94
+ constructor(data: Readonly<ArrayBuffer | DataView>);
95
+ }
96
+ export {};