@tspro/ts-utils-lib 1.17.0 → 1.18.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/CHANGELOG.md +13 -0
- package/README.md +4 -4
- package/dist/index.d.mts +348 -162
- package/dist/index.d.ts +348 -162
- package/dist/index.js +1054 -582
- package/dist/index.mjs +1053 -582
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,207 @@
|
|
|
1
|
+
type EnumObject = Record<string, string | number>;
|
|
2
|
+
type EnumKey<E extends EnumObject> = keyof E;
|
|
3
|
+
type EnumValue<E extends EnumObject> = E[EnumKey<E>];
|
|
4
|
+
declare function getEnumKeys<E extends EnumObject>(e: E): EnumKey<E>[];
|
|
5
|
+
declare function getEnumValues<E extends EnumObject>(e: E): EnumValue<E>[];
|
|
6
|
+
declare function getEnumEntries<E extends EnumObject>(e: E): [keyof E, EnumValue<E>][];
|
|
7
|
+
declare function getEnumKey<E extends EnumObject>(e: E, value: EnumValue<E>): keyof E | undefined;
|
|
8
|
+
declare function forEachEnum<E extends EnumObject>(e: E, callback: (key: keyof E, value: E[keyof E]) => void): void;
|
|
9
|
+
declare function isEnumValue$2<E extends EnumObject>(e: E, value: unknown): value is EnumValue<E>;
|
|
10
|
+
declare function assertEnumValue<E extends EnumObject>(e: E, value: unknown): asserts value is EnumValue<E>;
|
|
11
|
+
|
|
12
|
+
type index$8_EnumKey<E extends EnumObject> = EnumKey<E>;
|
|
13
|
+
type index$8_EnumObject = EnumObject;
|
|
14
|
+
type index$8_EnumValue<E extends EnumObject> = EnumValue<E>;
|
|
15
|
+
declare const index$8_assertEnumValue: typeof assertEnumValue;
|
|
16
|
+
declare const index$8_forEachEnum: typeof forEachEnum;
|
|
17
|
+
declare const index$8_getEnumEntries: typeof getEnumEntries;
|
|
18
|
+
declare const index$8_getEnumKey: typeof getEnumKey;
|
|
19
|
+
declare const index$8_getEnumKeys: typeof getEnumKeys;
|
|
20
|
+
declare const index$8_getEnumValues: typeof getEnumValues;
|
|
21
|
+
declare namespace index$8 {
|
|
22
|
+
export { type index$8_EnumKey as EnumKey, type index$8_EnumObject as EnumObject, type index$8_EnumValue as EnumValue, index$8_assertEnumValue as assertEnumValue, index$8_forEachEnum as forEachEnum, index$8_getEnumEntries as getEnumEntries, index$8_getEnumKey as getEnumKey, index$8_getEnumKeys as getEnumKeys, index$8_getEnumValues as getEnumValues, isEnumValue$2 as isEnumValue };
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
type ErrorConstructor = new (msg: string) => Error;
|
|
26
|
+
declare function setErrorClass(errorClass?: ErrorConstructor): void;
|
|
27
|
+
/** @deprecated */
|
|
28
|
+
declare function interrupt(msg?: string): never;
|
|
29
|
+
/** @deprecated */
|
|
30
|
+
declare function assertEnum<E extends EnumObject>(enumVal: unknown, enumObj: E, name?: string): asserts enumVal is E[keyof E];
|
|
31
|
+
/** @deprecated */
|
|
32
|
+
declare function int(value: unknown, msg?: string): number;
|
|
33
|
+
/** @deprecated */
|
|
34
|
+
declare function eq<T>(value1: T, value2: T, msg?: string): T;
|
|
35
|
+
/** @deprecated */
|
|
36
|
+
declare function int_eq(value: unknown, compareTo: unknown, msg?: string): number;
|
|
37
|
+
/** @deprecated */
|
|
38
|
+
declare function int_lt(value: unknown, compareTo: unknown, msg?: string): number;
|
|
39
|
+
/** @deprecated */
|
|
40
|
+
declare function int_lte(value: unknown, compareTo: unknown, msg?: string): number;
|
|
41
|
+
/** @deprecated */
|
|
42
|
+
declare function int_gt(value: unknown, compareTo: unknown, msg?: string): number;
|
|
43
|
+
/** @deprecated */
|
|
44
|
+
declare function int_gte(value: unknown, compareTo: unknown, msg?: string): number;
|
|
45
|
+
/** @deprecated */
|
|
46
|
+
declare function int_between(value: unknown, min: unknown, max: unknown, msg?: string): number;
|
|
47
|
+
/** @deprecated */
|
|
48
|
+
declare function int_between_exclusive(value: unknown, min: unknown, max: unknown, msg?: string): number;
|
|
49
|
+
/** @deprecated */
|
|
50
|
+
declare function odd(value: unknown, msg?: string): number;
|
|
51
|
+
/** @deprecated */
|
|
52
|
+
declare function even(value: unknown, msg?: string): number;
|
|
53
|
+
/** @deprecated */
|
|
54
|
+
declare function in_group<T>(value: T, group: ReadonlyArray<T>, msg?: string): T;
|
|
55
|
+
/** @deprecated */
|
|
56
|
+
declare function finite(value: unknown, msg?: string): number;
|
|
57
|
+
/** @deprecated */
|
|
58
|
+
declare function array_id<T>(array: Readonly<T[]>, index: unknown, msg?: string): number;
|
|
59
|
+
/** @deprecated */
|
|
60
|
+
declare function array_elem<T>(array: Readonly<T[]>, index: number, msg?: string): T;
|
|
61
|
+
declare function assert<T>(condition: T, msg?: string): void;
|
|
62
|
+
declare function require<T>(value: T | null | undefined, msg?: string): T;
|
|
63
|
+
declare function requireDefined<T>(value: T | undefined, msg?: string): T;
|
|
64
|
+
declare function fail(msg?: string): never;
|
|
65
|
+
declare function isEqual$1(value1: unknown, value2: unknown, msg?: string): boolean;
|
|
66
|
+
declare function isDeepEqual$1(value1: unknown, value2: unknown, msg?: string): boolean;
|
|
67
|
+
declare function isUndefined$1(value: unknown, msg?: string): value is undefined;
|
|
68
|
+
declare function isNull$1(value: unknown, msg?: string): value is null;
|
|
69
|
+
declare function isNullish$1(value: unknown, msg?: string): value is null | undefined;
|
|
70
|
+
declare function isObject$1(value: unknown, msg?: string): value is Record<string, unknown>;
|
|
71
|
+
declare function isObjectOrUndefined$1(value: unknown, msg?: string): value is Record<string, unknown> | undefined;
|
|
72
|
+
declare function isTypedObject$1<T extends object>(obj: unknown, keys: (keyof T)[], msg?: string): obj is HasProps<T>;
|
|
73
|
+
declare function isArray$1<T>(value: T[] | unknown, msg?: string): value is T[];
|
|
74
|
+
declare function isArrayOrUndefined$1(value: unknown, msg?: string): value is unknown[] | undefined;
|
|
75
|
+
declare function isEmptyArray$1<T>(value: T[] | unknown, msg?: string): value is T[];
|
|
76
|
+
declare function isNonEmptyArray$1<T>(value: T[] | unknown, msg?: string): value is T[];
|
|
77
|
+
declare function isEmptyArrayOrUndefined$1<T>(value: T[] | unknown, msg?: string): value is T[] | undefined;
|
|
78
|
+
declare function isNonEmptyArrayOrUndefined$1<T>(value: T[] | unknown, msg?: string): value is T[] | undefined;
|
|
79
|
+
declare function isString$1(value: unknown, msg?: string): value is string;
|
|
80
|
+
declare function isEmptyString$1(value: unknown, msg?: string): value is "";
|
|
81
|
+
declare function isNonEmptyString$1(value: unknown, msg?: string): value is string;
|
|
82
|
+
declare function isStringOrUndefined$1(value: unknown, msg?: string): value is string | undefined;
|
|
83
|
+
declare function isEmptyStringOrUndefined$1(value: unknown, msg?: string): value is "" | undefined;
|
|
84
|
+
declare function isNonEmptyStringOrUndefined$1(value: unknown, msg?: string): value is string | undefined;
|
|
85
|
+
declare function isBoolean$1(value: unknown, msg?: string): value is boolean;
|
|
86
|
+
declare function isBooleanOrUndefined$1(value: unknown, msg?: string): value is boolean | undefined;
|
|
87
|
+
declare function isTrue$1(value: unknown, msg?: string): value is boolean;
|
|
88
|
+
declare function isTrueOrUndefined$1(value: unknown, msg?: string): value is boolean;
|
|
89
|
+
declare function isFalse$1(value: unknown, msg?: string): value is boolean;
|
|
90
|
+
declare function isFalseOrUndefined$1(value: unknown, msg?: string): value is boolean;
|
|
91
|
+
declare function isFunction$1(value: unknown, msg?: string): value is Function;
|
|
92
|
+
declare function isFunctionOrUndefined$1(value: unknown, msg?: string): value is Function | undefined;
|
|
93
|
+
declare function isEnumValue$1<E extends EnumObject>(enumValue: unknown, enumObject: E, msg?: string): enumValue is E[keyof E];
|
|
94
|
+
declare function isEnumValueOrUndefined$1<E extends EnumObject>(enumValue: unknown, enumObject: E, msg?: string): enumValue is E[keyof E];
|
|
95
|
+
declare function isNumber$1(value: unknown, msg?: string): value is number;
|
|
96
|
+
declare function isNumberOrUndefined$1(value: unknown, msg?: string): value is number | undefined;
|
|
97
|
+
declare function isFinite$1(value: unknown, msg?: string): value is number;
|
|
98
|
+
declare function isInteger$1(value: unknown, msg?: string): value is number;
|
|
99
|
+
declare function isIntegerOrUndefined$1(value: unknown, msg?: string): value is number | undefined;
|
|
100
|
+
declare function isIntegerEq$1(value: unknown, compareTo: unknown, msg?: string): value is number;
|
|
101
|
+
declare function isIntegerGt$1(value: unknown, compareTo: unknown, msg?: string): value is number;
|
|
102
|
+
declare function isIntegerGte$1(value: unknown, compareTo: unknown, msg?: string): value is number;
|
|
103
|
+
declare function isIntegerLt$1(value: unknown, compareTo: unknown, msg?: string): value is number;
|
|
104
|
+
declare function isIntegerLte$1(value: unknown, compareTo: unknown, msg?: string): value is number;
|
|
105
|
+
declare function isIntegerBetween$1(value: unknown, min: unknown, max: unknown, msg?: string): value is number;
|
|
106
|
+
declare function isIntegerBetweenExclusive$1(value: unknown, min: unknown, max: unknown, msg?: string): value is number;
|
|
107
|
+
declare function isNumberBetween$1(value: unknown, min: unknown, max: unknown, msg?: string): value is number;
|
|
108
|
+
declare function isNumberBetweenExclusive$1(value: unknown, min: unknown, max: unknown, msg?: string): value is number;
|
|
109
|
+
declare function isNaNValue$1(value: unknown, msg?: string): value is number;
|
|
110
|
+
declare function isInfinity$1(value: unknown, msg?: string): value is number;
|
|
111
|
+
declare function isPosInfinity$1(value: unknown, msg?: string): value is number;
|
|
112
|
+
declare function isNegInfinity$1(value: unknown, msg?: string): value is number;
|
|
113
|
+
declare function isOddNumber$1(value: unknown, msg?: string): value is number;
|
|
114
|
+
declare function isEvenNumber$1(value: unknown, msg?: string): value is number;
|
|
115
|
+
declare function isIncluded$1<T>(value: T, array: ReadonlyArray<T>, msg?: string): value is T;
|
|
116
|
+
declare function isArrayIndex$1<T>(index: unknown, array: ReadonlyArray<T>, msg?: string): index is number;
|
|
117
|
+
declare function isThrowing$1(throwTestFn: () => void, msg?: string): true;
|
|
118
|
+
|
|
119
|
+
type index$7_ErrorConstructor = ErrorConstructor;
|
|
120
|
+
declare const index$7_array_elem: typeof array_elem;
|
|
121
|
+
declare const index$7_array_id: typeof array_id;
|
|
122
|
+
declare const index$7_assert: typeof assert;
|
|
123
|
+
declare const index$7_assertEnum: typeof assertEnum;
|
|
124
|
+
declare const index$7_eq: typeof eq;
|
|
125
|
+
declare const index$7_even: typeof even;
|
|
126
|
+
declare const index$7_fail: typeof fail;
|
|
127
|
+
declare const index$7_finite: typeof finite;
|
|
128
|
+
declare const index$7_in_group: typeof in_group;
|
|
129
|
+
declare const index$7_int: typeof int;
|
|
130
|
+
declare const index$7_int_between: typeof int_between;
|
|
131
|
+
declare const index$7_int_between_exclusive: typeof int_between_exclusive;
|
|
132
|
+
declare const index$7_int_eq: typeof int_eq;
|
|
133
|
+
declare const index$7_int_gt: typeof int_gt;
|
|
134
|
+
declare const index$7_int_gte: typeof int_gte;
|
|
135
|
+
declare const index$7_int_lt: typeof int_lt;
|
|
136
|
+
declare const index$7_int_lte: typeof int_lte;
|
|
137
|
+
declare const index$7_interrupt: typeof interrupt;
|
|
138
|
+
declare const index$7_odd: typeof odd;
|
|
139
|
+
declare const index$7_require: typeof require;
|
|
140
|
+
declare const index$7_requireDefined: typeof requireDefined;
|
|
141
|
+
declare const index$7_setErrorClass: typeof setErrorClass;
|
|
142
|
+
declare namespace index$7 {
|
|
143
|
+
export { type index$7_ErrorConstructor as ErrorConstructor, index$7_array_elem as array_elem, index$7_array_id as array_id, index$7_assert as assert, index$7_assertEnum as assertEnum, index$7_eq as eq, index$7_even as even, index$7_fail as fail, index$7_finite as finite, index$7_in_group as in_group, index$7_int as int, index$7_int_between as int_between, index$7_int_between_exclusive as int_between_exclusive, index$7_int_eq as int_eq, index$7_int_gt as int_gt, index$7_int_gte as int_gte, index$7_int_lt as int_lt, index$7_int_lte as int_lte, index$7_interrupt as interrupt, isArray$1 as isArray, isArrayIndex$1 as isArrayIndex, isArrayOrUndefined$1 as isArrayOrUndefined, isBoolean$1 as isBoolean, isBooleanOrUndefined$1 as isBooleanOrUndefined, isDeepEqual$1 as isDeepEqual, isEmptyArray$1 as isEmptyArray, isEmptyArrayOrUndefined$1 as isEmptyArrayOrUndefined, isEmptyString$1 as isEmptyString, isEmptyStringOrUndefined$1 as isEmptyStringOrUndefined, isEnumValue$1 as isEnumValue, isEnumValueOrUndefined$1 as isEnumValueOrUndefined, isEqual$1 as isEqual, isEvenNumber$1 as isEvenNumber, isFalse$1 as isFalse, isFalseOrUndefined$1 as isFalseOrUndefined, isFinite$1 as isFinite, isFunction$1 as isFunction, isFunctionOrUndefined$1 as isFunctionOrUndefined, isIncluded$1 as isIncluded, isInfinity$1 as isInfinity, isInteger$1 as isInteger, isIntegerBetween$1 as isIntegerBetween, isIntegerBetweenExclusive$1 as isIntegerBetweenExclusive, isIntegerEq$1 as isIntegerEq, isIntegerGt$1 as isIntegerGt, isIntegerGte$1 as isIntegerGte, isIntegerLt$1 as isIntegerLt, isIntegerLte$1 as isIntegerLte, isIntegerOrUndefined$1 as isIntegerOrUndefined, isNaNValue$1 as isNaNValue, isNegInfinity$1 as isNegInfinity, isNonEmptyArray$1 as isNonEmptyArray, isNonEmptyArrayOrUndefined$1 as isNonEmptyArrayOrUndefined, isNonEmptyString$1 as isNonEmptyString, isNonEmptyStringOrUndefined$1 as isNonEmptyStringOrUndefined, isNull$1 as isNull, isNullish$1 as isNullish, isNumber$1 as isNumber, isNumberBetween$1 as isNumberBetween, isNumberBetweenExclusive$1 as isNumberBetweenExclusive, isNumberOrUndefined$1 as isNumberOrUndefined, isObject$1 as isObject, isObjectOrUndefined$1 as isObjectOrUndefined, isOddNumber$1 as isOddNumber, isPosInfinity$1 as isPosInfinity, isString$1 as isString, isStringOrUndefined$1 as isStringOrUndefined, isThrowing$1 as isThrowing, isTrue$1 as isTrue, isTrueOrUndefined$1 as isTrueOrUndefined, isTypedObject$1 as isTypedObject, isUndefined$1 as isUndefined, index$7_odd as odd, index$7_require as require, index$7_requireDefined as requireDefined, index$7_setErrorClass as setErrorClass };
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
declare function setExpireDays(days: number): void;
|
|
147
|
+
declare function isConsentPending(): boolean;
|
|
148
|
+
declare function accept(): void;
|
|
149
|
+
declare function decline(): void;
|
|
150
|
+
declare function save<T extends string | number | boolean>(name: string, value: T): T;
|
|
151
|
+
declare function read(name: string, defaultValue: string): string;
|
|
152
|
+
declare function readInt(name: string, defaultValue: number): number;
|
|
153
|
+
declare function readBool(name: string, defaultValue: boolean): boolean;
|
|
154
|
+
declare function erase(name: string): void;
|
|
155
|
+
declare function eraseAll(): void;
|
|
156
|
+
|
|
157
|
+
declare const cookies_accept: typeof accept;
|
|
158
|
+
declare const cookies_decline: typeof decline;
|
|
159
|
+
declare const cookies_erase: typeof erase;
|
|
160
|
+
declare const cookies_eraseAll: typeof eraseAll;
|
|
161
|
+
declare const cookies_isConsentPending: typeof isConsentPending;
|
|
162
|
+
declare const cookies_read: typeof read;
|
|
163
|
+
declare const cookies_readBool: typeof readBool;
|
|
164
|
+
declare const cookies_readInt: typeof readInt;
|
|
165
|
+
declare const cookies_save: typeof save;
|
|
166
|
+
declare const cookies_setExpireDays: typeof setExpireDays;
|
|
167
|
+
declare namespace cookies {
|
|
168
|
+
export { cookies_accept as accept, cookies_decline as decline, cookies_erase as erase, cookies_eraseAll as eraseAll, cookies_isConsentPending as isConsentPending, cookies_read as read, cookies_readBool as readBool, cookies_readInt as readInt, cookies_save as save, cookies_setExpireDays as setExpireDays };
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
declare const DPI: number;
|
|
172
|
+
declare const PxPerMm: number;
|
|
173
|
+
declare const ScrollbarWidth: number;
|
|
174
|
+
declare const FontSize: number;
|
|
175
|
+
declare const IsTouchDevice: boolean;
|
|
176
|
+
declare const IsMobileDevice: boolean;
|
|
177
|
+
declare const HostAddress: string;
|
|
178
|
+
declare function pxToMm(px: number): number;
|
|
179
|
+
declare function mmToPx(mm: number): number;
|
|
180
|
+
declare function toPx(input: string | number): number;
|
|
181
|
+
|
|
182
|
+
declare const device_DPI: typeof DPI;
|
|
183
|
+
declare const device_FontSize: typeof FontSize;
|
|
184
|
+
declare const device_HostAddress: typeof HostAddress;
|
|
185
|
+
declare const device_IsMobileDevice: typeof IsMobileDevice;
|
|
186
|
+
declare const device_IsTouchDevice: typeof IsTouchDevice;
|
|
187
|
+
declare const device_PxPerMm: typeof PxPerMm;
|
|
188
|
+
declare const device_ScrollbarWidth: typeof ScrollbarWidth;
|
|
189
|
+
declare const device_mmToPx: typeof mmToPx;
|
|
190
|
+
declare const device_pxToMm: typeof pxToMm;
|
|
191
|
+
declare const device_toPx: typeof toPx;
|
|
192
|
+
declare namespace device {
|
|
193
|
+
export { device_DPI as DPI, device_FontSize as FontSize, device_HostAddress as HostAddress, device_IsMobileDevice as IsMobileDevice, device_IsTouchDevice as IsTouchDevice, device_PxPerMm as PxPerMm, device_ScrollbarWidth as ScrollbarWidth, device_mmToPx as mmToPx, device_pxToMm as pxToMm, device_toPx as toPx };
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
declare function isEqual(value1: unknown, value2: unknown): boolean;
|
|
197
|
+
declare function isDeepEqual(value1: unknown, value2: unknown): boolean;
|
|
1
198
|
declare function isUndefined(value: unknown): value is undefined;
|
|
2
199
|
declare function isNull(value: unknown): value is null;
|
|
3
200
|
declare function isNullish(value: unknown): value is null | undefined;
|
|
4
201
|
declare function isObject(value: unknown): value is Record<string, unknown>;
|
|
5
202
|
declare function isObjectOrUndefined(value: unknown): value is Record<string, unknown> | undefined;
|
|
203
|
+
type HasProps<T extends object> = T extends Record<string, unknown> ? T : never;
|
|
204
|
+
declare function isTypedObject<T extends object>(obj: unknown, keys: (keyof T)[]): obj is HasProps<T>;
|
|
6
205
|
declare function isArray<T>(a: T[] | unknown): a is T[];
|
|
7
206
|
declare function isArrayOrUndefined(value: unknown): value is unknown[] | undefined;
|
|
8
207
|
declare function isEmptyArray<T>(a: T[] | unknown): a is T[];
|
|
@@ -17,6 +216,10 @@ declare function isEmptyStringOrUndefined(value: unknown): value is "" | undefin
|
|
|
17
216
|
declare function isNonEmptyStringOrUndefined(value: unknown): value is string | undefined;
|
|
18
217
|
declare function isBoolean(value: unknown): value is boolean;
|
|
19
218
|
declare function isBooleanOrUndefined(value: unknown): value is boolean | undefined;
|
|
219
|
+
declare function isTrue(value: unknown): value is true;
|
|
220
|
+
declare function isTrueOrUndefined(value: unknown): value is true;
|
|
221
|
+
declare function isFalse(value: unknown): value is false;
|
|
222
|
+
declare function isFalseOrUndefined(value: unknown): value is false;
|
|
20
223
|
declare function isFunction(value: unknown): value is Function;
|
|
21
224
|
declare function isFunctionOrUndefined(value: unknown): value is Function | undefined;
|
|
22
225
|
declare function isEnumValue<E extends Record<string, string | number>>(value: unknown, enumObj: E, name?: string): value is E[keyof E];
|
|
@@ -26,57 +229,83 @@ declare function isNumberOrUndefined(value: unknown): value is number | undefine
|
|
|
26
229
|
declare function isFinite(value: unknown): value is number;
|
|
27
230
|
declare function isInteger(n: unknown): n is number;
|
|
28
231
|
declare function isIntegerOrUndefined(n: unknown): n is number | undefined;
|
|
29
|
-
declare function isIntegerEq(value: unknown, compareTo:
|
|
30
|
-
declare function isIntegerGt(value: unknown, compareTo:
|
|
31
|
-
declare function isIntegerGte(value: unknown, compareTo:
|
|
32
|
-
declare function isIntegerLt(value: unknown, compareTo:
|
|
33
|
-
declare function isIntegerLte(value: unknown, compareTo:
|
|
34
|
-
declare function isIntegerBetween(value: unknown, min:
|
|
232
|
+
declare function isIntegerEq(value: unknown, compareTo: unknown): value is number;
|
|
233
|
+
declare function isIntegerGt(value: unknown, compareTo: unknown): value is number;
|
|
234
|
+
declare function isIntegerGte(value: unknown, compareTo: unknown): value is number;
|
|
235
|
+
declare function isIntegerLt(value: unknown, compareTo: unknown): value is number;
|
|
236
|
+
declare function isIntegerLte(value: unknown, compareTo: unknown): value is number;
|
|
237
|
+
declare function isIntegerBetween(value: unknown, min: unknown, max: unknown): value is number;
|
|
238
|
+
declare function isIntegerBetweenExclusive(value: unknown, min: unknown, max: unknown): value is number;
|
|
239
|
+
declare function isNumberBetween(value: unknown, min: unknown, max: unknown): value is number;
|
|
240
|
+
declare function isNumberBetweenExclusive(value: unknown, min: unknown, max: unknown): value is number;
|
|
35
241
|
declare function isNaNValue(value: unknown): value is number;
|
|
36
242
|
declare function isInfinity(value: unknown): value is number;
|
|
37
243
|
declare function isPosInfinity(value: unknown): value is number;
|
|
38
244
|
declare function isNegInfinity(value: unknown): value is number;
|
|
245
|
+
declare function isOddNumber(value: unknown): value is number;
|
|
246
|
+
declare function isEvenNumber(value: unknown): value is number;
|
|
247
|
+
declare function isIncluded<T>(value: T, array: ReadonlyArray<T>): value is T;
|
|
248
|
+
declare function isArrayIndex<T>(index: unknown, array: ReadonlyArray<T>): index is number;
|
|
249
|
+
declare function isThrowing(throwTestFn: () => void): boolean;
|
|
250
|
+
declare function tryOr<TRY_RVAL, OR_RVAL>(tryFn: () => TRY_RVAL, orVal: OR_RVAL | (() => OR_RVAL)): TRY_RVAL | OR_RVAL;
|
|
39
251
|
|
|
40
|
-
|
|
41
|
-
declare const
|
|
42
|
-
declare const
|
|
43
|
-
declare const
|
|
44
|
-
declare const
|
|
45
|
-
declare const
|
|
46
|
-
declare const
|
|
47
|
-
declare const
|
|
48
|
-
declare const
|
|
49
|
-
declare const
|
|
50
|
-
declare const
|
|
51
|
-
declare const
|
|
52
|
-
declare const
|
|
53
|
-
declare const
|
|
54
|
-
declare const
|
|
55
|
-
declare const
|
|
56
|
-
declare const
|
|
57
|
-
declare const
|
|
58
|
-
declare const
|
|
59
|
-
declare const
|
|
60
|
-
declare const
|
|
61
|
-
declare const
|
|
62
|
-
declare const
|
|
63
|
-
declare const
|
|
64
|
-
declare const
|
|
65
|
-
declare const
|
|
66
|
-
declare const
|
|
67
|
-
declare const
|
|
68
|
-
declare const
|
|
69
|
-
declare const
|
|
70
|
-
declare const
|
|
71
|
-
declare const
|
|
72
|
-
declare const
|
|
73
|
-
declare const
|
|
74
|
-
declare const
|
|
75
|
-
declare const
|
|
76
|
-
declare const
|
|
77
|
-
declare const
|
|
78
|
-
declare
|
|
79
|
-
|
|
252
|
+
type Guard_HasProps<T extends object> = HasProps<T>;
|
|
253
|
+
declare const Guard_isArray: typeof isArray;
|
|
254
|
+
declare const Guard_isArrayIndex: typeof isArrayIndex;
|
|
255
|
+
declare const Guard_isArrayOrUndefined: typeof isArrayOrUndefined;
|
|
256
|
+
declare const Guard_isBoolean: typeof isBoolean;
|
|
257
|
+
declare const Guard_isBooleanOrUndefined: typeof isBooleanOrUndefined;
|
|
258
|
+
declare const Guard_isDeepEqual: typeof isDeepEqual;
|
|
259
|
+
declare const Guard_isEmptyArray: typeof isEmptyArray;
|
|
260
|
+
declare const Guard_isEmptyArrayOrUndefined: typeof isEmptyArrayOrUndefined;
|
|
261
|
+
declare const Guard_isEmptyString: typeof isEmptyString;
|
|
262
|
+
declare const Guard_isEmptyStringOrUndefined: typeof isEmptyStringOrUndefined;
|
|
263
|
+
declare const Guard_isEnumValue: typeof isEnumValue;
|
|
264
|
+
declare const Guard_isEnumValueOrUndefined: typeof isEnumValueOrUndefined;
|
|
265
|
+
declare const Guard_isEqual: typeof isEqual;
|
|
266
|
+
declare const Guard_isEvenNumber: typeof isEvenNumber;
|
|
267
|
+
declare const Guard_isFalse: typeof isFalse;
|
|
268
|
+
declare const Guard_isFalseOrUndefined: typeof isFalseOrUndefined;
|
|
269
|
+
declare const Guard_isFinite: typeof isFinite;
|
|
270
|
+
declare const Guard_isFunction: typeof isFunction;
|
|
271
|
+
declare const Guard_isFunctionOrUndefined: typeof isFunctionOrUndefined;
|
|
272
|
+
declare const Guard_isIncluded: typeof isIncluded;
|
|
273
|
+
declare const Guard_isInfinity: typeof isInfinity;
|
|
274
|
+
declare const Guard_isInteger: typeof isInteger;
|
|
275
|
+
declare const Guard_isIntegerBetween: typeof isIntegerBetween;
|
|
276
|
+
declare const Guard_isIntegerBetweenExclusive: typeof isIntegerBetweenExclusive;
|
|
277
|
+
declare const Guard_isIntegerEq: typeof isIntegerEq;
|
|
278
|
+
declare const Guard_isIntegerGt: typeof isIntegerGt;
|
|
279
|
+
declare const Guard_isIntegerGte: typeof isIntegerGte;
|
|
280
|
+
declare const Guard_isIntegerLt: typeof isIntegerLt;
|
|
281
|
+
declare const Guard_isIntegerLte: typeof isIntegerLte;
|
|
282
|
+
declare const Guard_isIntegerOrUndefined: typeof isIntegerOrUndefined;
|
|
283
|
+
declare const Guard_isNaNValue: typeof isNaNValue;
|
|
284
|
+
declare const Guard_isNegInfinity: typeof isNegInfinity;
|
|
285
|
+
declare const Guard_isNonEmptyArray: typeof isNonEmptyArray;
|
|
286
|
+
declare const Guard_isNonEmptyArrayOrUndefined: typeof isNonEmptyArrayOrUndefined;
|
|
287
|
+
declare const Guard_isNonEmptyString: typeof isNonEmptyString;
|
|
288
|
+
declare const Guard_isNonEmptyStringOrUndefined: typeof isNonEmptyStringOrUndefined;
|
|
289
|
+
declare const Guard_isNull: typeof isNull;
|
|
290
|
+
declare const Guard_isNullish: typeof isNullish;
|
|
291
|
+
declare const Guard_isNumber: typeof isNumber;
|
|
292
|
+
declare const Guard_isNumberBetween: typeof isNumberBetween;
|
|
293
|
+
declare const Guard_isNumberBetweenExclusive: typeof isNumberBetweenExclusive;
|
|
294
|
+
declare const Guard_isNumberOrUndefined: typeof isNumberOrUndefined;
|
|
295
|
+
declare const Guard_isObject: typeof isObject;
|
|
296
|
+
declare const Guard_isObjectOrUndefined: typeof isObjectOrUndefined;
|
|
297
|
+
declare const Guard_isOddNumber: typeof isOddNumber;
|
|
298
|
+
declare const Guard_isPosInfinity: typeof isPosInfinity;
|
|
299
|
+
declare const Guard_isString: typeof isString;
|
|
300
|
+
declare const Guard_isStringOrUndefined: typeof isStringOrUndefined;
|
|
301
|
+
declare const Guard_isThrowing: typeof isThrowing;
|
|
302
|
+
declare const Guard_isTrue: typeof isTrue;
|
|
303
|
+
declare const Guard_isTrueOrUndefined: typeof isTrueOrUndefined;
|
|
304
|
+
declare const Guard_isTypedObject: typeof isTypedObject;
|
|
305
|
+
declare const Guard_isUndefined: typeof isUndefined;
|
|
306
|
+
declare const Guard_tryOr: typeof tryOr;
|
|
307
|
+
declare namespace Guard {
|
|
308
|
+
export { type Guard_HasProps as HasProps, Guard_isArray as isArray, Guard_isArrayIndex as isArrayIndex, Guard_isArrayOrUndefined as isArrayOrUndefined, Guard_isBoolean as isBoolean, Guard_isBooleanOrUndefined as isBooleanOrUndefined, Guard_isDeepEqual as isDeepEqual, Guard_isEmptyArray as isEmptyArray, Guard_isEmptyArrayOrUndefined as isEmptyArrayOrUndefined, Guard_isEmptyString as isEmptyString, Guard_isEmptyStringOrUndefined as isEmptyStringOrUndefined, Guard_isEnumValue as isEnumValue, Guard_isEnumValueOrUndefined as isEnumValueOrUndefined, Guard_isEqual as isEqual, Guard_isEvenNumber as isEvenNumber, Guard_isFalse as isFalse, Guard_isFalseOrUndefined as isFalseOrUndefined, Guard_isFinite as isFinite, Guard_isFunction as isFunction, Guard_isFunctionOrUndefined as isFunctionOrUndefined, Guard_isIncluded as isIncluded, Guard_isInfinity as isInfinity, Guard_isInteger as isInteger, Guard_isIntegerBetween as isIntegerBetween, Guard_isIntegerBetweenExclusive as isIntegerBetweenExclusive, Guard_isIntegerEq as isIntegerEq, Guard_isIntegerGt as isIntegerGt, Guard_isIntegerGte as isIntegerGte, Guard_isIntegerLt as isIntegerLt, Guard_isIntegerLte as isIntegerLte, Guard_isIntegerOrUndefined as isIntegerOrUndefined, Guard_isNaNValue as isNaNValue, Guard_isNegInfinity as isNegInfinity, Guard_isNonEmptyArray as isNonEmptyArray, Guard_isNonEmptyArrayOrUndefined as isNonEmptyArrayOrUndefined, Guard_isNonEmptyString as isNonEmptyString, Guard_isNonEmptyStringOrUndefined as isNonEmptyStringOrUndefined, Guard_isNull as isNull, Guard_isNullish as isNullish, Guard_isNumber as isNumber, Guard_isNumberBetween as isNumberBetween, Guard_isNumberBetweenExclusive as isNumberBetweenExclusive, Guard_isNumberOrUndefined as isNumberOrUndefined, Guard_isObject as isObject, Guard_isObjectOrUndefined as isObjectOrUndefined, Guard_isOddNumber as isOddNumber, Guard_isPosInfinity as isPosInfinity, Guard_isString as isString, Guard_isStringOrUndefined as isStringOrUndefined, Guard_isThrowing as isThrowing, Guard_isTrue as isTrue, Guard_isTrueOrUndefined as isTrueOrUndefined, Guard_isTypedObject as isTypedObject, Guard_isUndefined as isUndefined, Guard_tryOr as tryOr };
|
|
80
309
|
}
|
|
81
310
|
|
|
82
311
|
declare function toArray<T>(a: T | T[]): Array<T>;
|
|
@@ -91,20 +320,20 @@ declare function getRangeArray(start: number, end: number): number[];
|
|
|
91
320
|
declare function arrayContains<T extends unknown>(arg: T[], item: T): boolean;
|
|
92
321
|
declare function chunckArray<A>(arr: ReadonlyArray<A>, chunckSize: number): A[][];
|
|
93
322
|
|
|
94
|
-
declare const index$
|
|
95
|
-
declare const index$
|
|
96
|
-
declare const index$
|
|
97
|
-
declare const index$
|
|
98
|
-
declare const index$
|
|
99
|
-
declare const index$
|
|
100
|
-
declare const index$
|
|
101
|
-
declare const index$
|
|
102
|
-
declare const index$
|
|
103
|
-
declare const index$
|
|
104
|
-
declare const index$
|
|
105
|
-
declare const index$
|
|
106
|
-
declare namespace index$
|
|
107
|
-
export { index$
|
|
323
|
+
declare const index$6_arrayContains: typeof arrayContains;
|
|
324
|
+
declare const index$6_chunckArray: typeof chunckArray;
|
|
325
|
+
declare const index$6_duplicate: typeof duplicate;
|
|
326
|
+
declare const index$6_fillArray: typeof fillArray;
|
|
327
|
+
declare const index$6_getRangeArray: typeof getRangeArray;
|
|
328
|
+
declare const index$6_getSequenceArray: typeof getSequenceArray;
|
|
329
|
+
declare const index$6_isArray: typeof isArray;
|
|
330
|
+
declare const index$6_mapRangeArray: typeof mapRangeArray;
|
|
331
|
+
declare const index$6_mapSequenceArray: typeof mapSequenceArray;
|
|
332
|
+
declare const index$6_removeDuplicates: typeof removeDuplicates;
|
|
333
|
+
declare const index$6_removeDuplicatesCmp: typeof removeDuplicatesCmp;
|
|
334
|
+
declare const index$6_toArray: typeof toArray;
|
|
335
|
+
declare namespace index$6 {
|
|
336
|
+
export { index$6_arrayContains as arrayContains, index$6_chunckArray as chunckArray, index$6_duplicate as duplicate, index$6_fillArray as fillArray, index$6_getRangeArray as getRangeArray, index$6_getSequenceArray as getSequenceArray, index$6_isArray as isArray, index$6_mapRangeArray as mapRangeArray, index$6_mapSequenceArray as mapSequenceArray, index$6_removeDuplicates as removeDuplicates, index$6_removeDuplicatesCmp as removeDuplicatesCmp, index$6_toArray as toArray };
|
|
108
337
|
}
|
|
109
338
|
|
|
110
339
|
interface CSSProperties {
|
|
@@ -153,43 +382,28 @@ declare function getDimension(style?: CSSProperties): {
|
|
|
153
382
|
declare function styleLayoutChanged(style1?: CSSProperties, style2?: CSSProperties): boolean;
|
|
154
383
|
declare function getCanvasTextWidth(text: string, font: string): number;
|
|
155
384
|
|
|
156
|
-
type index$
|
|
157
|
-
declare const index$
|
|
158
|
-
declare const index$
|
|
159
|
-
declare const index$
|
|
160
|
-
declare const index$
|
|
161
|
-
declare const index$
|
|
162
|
-
declare const index$
|
|
163
|
-
declare const index$
|
|
164
|
-
declare const index$
|
|
165
|
-
declare const index$
|
|
166
|
-
declare const index$
|
|
167
|
-
declare const index$
|
|
168
|
-
declare const index$
|
|
169
|
-
declare const index$
|
|
170
|
-
declare const index$
|
|
171
|
-
declare const index$
|
|
172
|
-
declare const index$
|
|
173
|
-
declare const index$
|
|
174
|
-
declare const index$
|
|
175
|
-
declare const index$
|
|
176
|
-
declare namespace index$6 {
|
|
177
|
-
export { type index$6_CSSProperties as CSSProperties, index$6_addClass as addClass, index$6_appendTo as appendTo, index$6_getButton as getButton, index$6_getCanvas as getCanvas, index$6_getCanvasTextWidth as getCanvasTextWidth, index$6_getDimension as getDimension, index$6_getHeight as getHeight, index$6_getOffset as getOffset, index$6_getPadding as getPadding, index$6_getWidth as getWidth, index$6_hasClass as hasClass, index$6_removeClass as removeClass, index$6_removeFromParent as removeFromParent, index$6_setHeight as setHeight, index$6_setOffset as setOffset, index$6_setRect as setRect, index$6_setVisibility as setVisibility, index$6_setWidth as setWidth, index$6_styleLayoutChanged as styleLayoutChanged };
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
type EnumObject = {
|
|
181
|
-
[key: string]: string | number;
|
|
182
|
-
};
|
|
183
|
-
type EnumValue<E extends EnumObject> = E extends {
|
|
184
|
-
[key: string]: string | infer V;
|
|
185
|
-
} ? V : never;
|
|
186
|
-
declare function getEnumValues<E extends EnumObject>(e: E): Array<EnumValue<E>>;
|
|
187
|
-
|
|
188
|
-
type index$5_EnumObject = EnumObject;
|
|
189
|
-
type index$5_EnumValue<E extends EnumObject> = EnumValue<E>;
|
|
190
|
-
declare const index$5_getEnumValues: typeof getEnumValues;
|
|
385
|
+
type index$5_CSSProperties = CSSProperties;
|
|
386
|
+
declare const index$5_addClass: typeof addClass;
|
|
387
|
+
declare const index$5_appendTo: typeof appendTo;
|
|
388
|
+
declare const index$5_getButton: typeof getButton;
|
|
389
|
+
declare const index$5_getCanvas: typeof getCanvas;
|
|
390
|
+
declare const index$5_getCanvasTextWidth: typeof getCanvasTextWidth;
|
|
391
|
+
declare const index$5_getDimension: typeof getDimension;
|
|
392
|
+
declare const index$5_getHeight: typeof getHeight;
|
|
393
|
+
declare const index$5_getOffset: typeof getOffset;
|
|
394
|
+
declare const index$5_getPadding: typeof getPadding;
|
|
395
|
+
declare const index$5_getWidth: typeof getWidth;
|
|
396
|
+
declare const index$5_hasClass: typeof hasClass;
|
|
397
|
+
declare const index$5_removeClass: typeof removeClass;
|
|
398
|
+
declare const index$5_removeFromParent: typeof removeFromParent;
|
|
399
|
+
declare const index$5_setHeight: typeof setHeight;
|
|
400
|
+
declare const index$5_setOffset: typeof setOffset;
|
|
401
|
+
declare const index$5_setRect: typeof setRect;
|
|
402
|
+
declare const index$5_setVisibility: typeof setVisibility;
|
|
403
|
+
declare const index$5_setWidth: typeof setWidth;
|
|
404
|
+
declare const index$5_styleLayoutChanged: typeof styleLayoutChanged;
|
|
191
405
|
declare namespace index$5 {
|
|
192
|
-
export { type index$
|
|
406
|
+
export { type index$5_CSSProperties as CSSProperties, index$5_addClass as addClass, index$5_appendTo as appendTo, index$5_getButton as getButton, index$5_getCanvas as getCanvas, index$5_getCanvasTextWidth as getCanvasTextWidth, index$5_getDimension as getDimension, index$5_getHeight as getHeight, index$5_getOffset as getOffset, index$5_getPadding as getPadding, index$5_getWidth as getWidth, index$5_hasClass as hasClass, index$5_removeClass as removeClass, index$5_removeFromParent as removeFromParent, index$5_setHeight as setHeight, index$5_setOffset as setOffset, index$5_setRect as setRect, index$5_setVisibility as setVisibility, index$5_setWidth as setWidth, index$5_styleLayoutChanged as styleLayoutChanged };
|
|
193
407
|
}
|
|
194
408
|
|
|
195
409
|
declare function getMapKeys<K, V>(map: Map<K, V>): K[];
|
|
@@ -321,57 +535,14 @@ declare namespace index$1 {
|
|
|
321
535
|
export { index$1_charCount as charCount, index$1_chunkString as chunkString, index$1_insertAt as insertAt, index$1_isString as isString, index$1_makeSentenceFromPascal as makeSentenceFromPascal, index$1_removeAt as removeAt, index$1_repeatString as repeatString, index$1_replaceAt as replaceAt, index$1_toCharArray as toCharArray };
|
|
322
536
|
}
|
|
323
537
|
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
declare namespace Assert {
|
|
329
|
-
type ErrorConstructor = new (msg: string) => Error;
|
|
330
|
-
function setErrorClass(ec?: ErrorConstructor): void;
|
|
331
|
-
function assert<T>(a: T, userMsg?: string): void;
|
|
332
|
-
function assertEnum<E extends Record<string, string | number>>(value: unknown, enumObj: E, name?: string): asserts value is E[keyof E];
|
|
333
|
-
function interrupt(userMsg?: string): never;
|
|
334
|
-
function int(a: unknown, userMsg?: string): number;
|
|
335
|
-
function eq<T>(a: T, b: T, userMsg?: string): T;
|
|
336
|
-
function int_eq(a: unknown, b: unknown, userMsg?: string): number;
|
|
337
|
-
function int_lt(a: unknown, b: unknown, userMsg?: string): number;
|
|
338
|
-
function int_lte(a: unknown, b: unknown, userMsg?: string): number;
|
|
339
|
-
function int_gt(a: unknown, b: unknown, userMsg?: string): number;
|
|
340
|
-
function int_gte(a: unknown, b: unknown, userMsg?: string): number;
|
|
341
|
-
function int_between(a: unknown, min: unknown, max: unknown, userMsg?: string): number;
|
|
342
|
-
function odd(a: unknown, userMsg?: string): number;
|
|
343
|
-
function even(a: unknown, userMsg?: string): number;
|
|
344
|
-
function in_group<T>(a: T, group: ReadonlyArray<T>, userMsg?: string): T;
|
|
345
|
-
function finite(a: unknown, userMsg?: string): number;
|
|
346
|
-
function array_id<T>(arr: Readonly<T[]>, id: unknown, userMsg?: string): number;
|
|
347
|
-
function array_elem<T>(arr: Readonly<T[]>, id: number, userMsg?: string): T;
|
|
348
|
-
function require<T>(arg: T, userMsg?: string): NonNullable<T>;
|
|
349
|
-
}
|
|
350
|
-
|
|
351
|
-
declare namespace Cookies {
|
|
352
|
-
function setExpireDays(days: number): void;
|
|
353
|
-
function isConsentPending(): boolean;
|
|
354
|
-
function accept(): void;
|
|
355
|
-
function decline(): void;
|
|
356
|
-
function save<T extends string | number | boolean>(name: string, value: T): T;
|
|
357
|
-
function read(name: string, defaultValue: string): string;
|
|
358
|
-
function readInt(name: string, defaultValue: number): number;
|
|
359
|
-
function readBool(name: string, defaultValue: boolean): boolean;
|
|
360
|
-
function erase(name: string): void;
|
|
361
|
-
function eraseAll(): void;
|
|
362
|
-
}
|
|
538
|
+
/**
|
|
539
|
+
* @deprecated Use {@link Guard} instead.
|
|
540
|
+
*/
|
|
541
|
+
declare const Is: typeof Guard;
|
|
363
542
|
|
|
364
|
-
declare
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
const ScrollbarWidth: number;
|
|
368
|
-
const FontSize: number;
|
|
369
|
-
const IsTouchDevice: boolean;
|
|
370
|
-
const IsMobileDevice: boolean;
|
|
371
|
-
const HostAddress: string;
|
|
372
|
-
function pxToMm(px: number): number;
|
|
373
|
-
function mmToPx(mm: number): number;
|
|
374
|
-
function toPx(input: string | number): number;
|
|
543
|
+
declare const index_Is: typeof Is;
|
|
544
|
+
declare namespace index {
|
|
545
|
+
export { index$6 as Arr, index$5 as Dom, index$8 as Enum, index_Is as Is, index$4 as Map, index$3 as Math, index$2 as Obj, index$1 as Str };
|
|
375
546
|
}
|
|
376
547
|
|
|
377
548
|
declare class Stack<T> {
|
|
@@ -405,7 +576,9 @@ declare class Vec {
|
|
|
405
576
|
static vec2(x: number, y: number): Vec;
|
|
406
577
|
static vec3(x: number, y: number, z: number): Vec;
|
|
407
578
|
static zero(dim: number): Vec;
|
|
579
|
+
get dim(): number;
|
|
408
580
|
get length(): number;
|
|
581
|
+
magnitude(): number;
|
|
409
582
|
get x(): number;
|
|
410
583
|
get y(): number;
|
|
411
584
|
get z(): number;
|
|
@@ -418,6 +591,9 @@ declare class Vec {
|
|
|
418
591
|
dot(other: Vec): number;
|
|
419
592
|
distance(other: Vec): number;
|
|
420
593
|
normalize(): Vec;
|
|
594
|
+
static lerp(a: Vec, b: Vec, t: number): Vec;
|
|
595
|
+
toLength(len: number): Vec;
|
|
596
|
+
clamp(minLength?: number, maxLength?: number, defaultDir?: Vec): Vec;
|
|
421
597
|
equals(other: Vec): boolean;
|
|
422
598
|
clone(): Vec;
|
|
423
599
|
toObject(): {
|
|
@@ -430,14 +606,14 @@ declare class Vec {
|
|
|
430
606
|
}
|
|
431
607
|
|
|
432
608
|
/**
|
|
433
|
-
* DivRect class, left, top, right, bottom rectangle divided into four sections by
|
|
609
|
+
* DivRect class, left, top, right, bottom rectangle divided into four sections by anchorX, anchorY.
|
|
434
610
|
*/
|
|
435
611
|
declare class DivRect {
|
|
436
612
|
left: number;
|
|
437
|
-
|
|
613
|
+
anchorX: number;
|
|
438
614
|
right: number;
|
|
439
615
|
top: number;
|
|
440
|
-
|
|
616
|
+
anchorY: number;
|
|
441
617
|
bottom: number;
|
|
442
618
|
/**
|
|
443
619
|
* Create rectangle with all zero values.
|
|
@@ -445,7 +621,7 @@ declare class DivRect {
|
|
|
445
621
|
constructor();
|
|
446
622
|
/**
|
|
447
623
|
* Create rectangle with left, right, top, bottom.
|
|
448
|
-
* Properties
|
|
624
|
+
* Properties anchorX and anchorY will be centered in the middle.
|
|
449
625
|
*
|
|
450
626
|
* @param left - Left coordinate.
|
|
451
627
|
* @param right - Right coordinate.
|
|
@@ -457,13 +633,13 @@ declare class DivRect {
|
|
|
457
633
|
* Create rectangle with full arguments.
|
|
458
634
|
*
|
|
459
635
|
* @param left - Left coordinate.
|
|
460
|
-
* @param
|
|
636
|
+
* @param anchorX - Center x-coordinate.
|
|
461
637
|
* @param right - Right coordinate.
|
|
462
638
|
* @param top - Top coordinate.
|
|
463
|
-
* @param
|
|
639
|
+
* @param anchorY - Center y-coordinate.
|
|
464
640
|
* @param bottom - Bottom coordinate.
|
|
465
641
|
*/
|
|
466
|
-
constructor(left: number,
|
|
642
|
+
constructor(left: number, anchorX: number, right: number, top: number, anchorY: number, bottom: number);
|
|
467
643
|
/**
|
|
468
644
|
* Create rect from basic left, top, width and height arguments.
|
|
469
645
|
*
|
|
@@ -475,7 +651,7 @@ declare class DivRect {
|
|
|
475
651
|
*/
|
|
476
652
|
static create(left: number, top: number, width: number, height: number): DivRect;
|
|
477
653
|
/**
|
|
478
|
-
* Create rect from
|
|
654
|
+
* Create rect from anchorX, anchorY, width, height arguments.
|
|
479
655
|
*
|
|
480
656
|
* @param centerX - Center x-coordinate.
|
|
481
657
|
* @param centerY - Center y-coordinate.
|
|
@@ -494,6 +670,14 @@ declare class DivRect {
|
|
|
494
670
|
* @returns - DivRect.
|
|
495
671
|
*/
|
|
496
672
|
static createSections(leftw: number, rightw: number, toph: number, bottomh: number): DivRect;
|
|
673
|
+
/** @deprecated - Renamed to anchorX. */
|
|
674
|
+
get centerX(): number;
|
|
675
|
+
/** @deprecated - Renamed to anchorX. */
|
|
676
|
+
set centerX(x: number);
|
|
677
|
+
/** @deprecated - Renamed to anchorY. */
|
|
678
|
+
get centerY(): number;
|
|
679
|
+
/** @deprecated - Renamed to anchorY. */
|
|
680
|
+
set centerY(y: number);
|
|
497
681
|
/**
|
|
498
682
|
* Width getter.
|
|
499
683
|
*/
|
|
@@ -556,7 +740,7 @@ declare class DivRect {
|
|
|
556
740
|
*/
|
|
557
741
|
equals(other: DivRect): boolean;
|
|
558
742
|
/**
|
|
559
|
-
* Check if edges of given rects are equal, ignoring
|
|
743
|
+
* Check if edges of given rects are equal, ignoring anchorX and anchorY.
|
|
560
744
|
*
|
|
561
745
|
* @param a - DivRect a.
|
|
562
746
|
* @param b - DivRect b.
|
|
@@ -564,12 +748,14 @@ declare class DivRect {
|
|
|
564
748
|
*/
|
|
565
749
|
static equalsEdges(a: DivRect | null | undefined, b: DivRect | null | undefined): boolean;
|
|
566
750
|
/**
|
|
567
|
-
* Check if edges of this Rect equals with given Rect, ignoring
|
|
751
|
+
* Check if edges of this Rect equals with given Rect, ignoring anchorX and anchorY.
|
|
568
752
|
*
|
|
569
753
|
* @param other - The other DivRect.
|
|
570
754
|
* @returns - True/false.
|
|
571
755
|
*/
|
|
572
756
|
equalsEdges(other: DivRect): boolean;
|
|
757
|
+
/** @deprecated - Use `DivRect.equalsEdges()` instead. */
|
|
758
|
+
static equalsFrame(a: DivRect | null | undefined, b: DivRect | null | undefined): boolean;
|
|
573
759
|
/**
|
|
574
760
|
* Created duplicate of this Rect.
|
|
575
761
|
*
|
|
@@ -621,7 +807,7 @@ declare class DivRect {
|
|
|
621
807
|
*/
|
|
622
808
|
clipCopy(clipRect: DivRect): DivRect;
|
|
623
809
|
/**
|
|
624
|
-
* Scale Rect. Anchor pos is (
|
|
810
|
+
* Scale Rect. Anchor pos is (anchorX, anchorY). Modifies this Rect.
|
|
625
811
|
*
|
|
626
812
|
* @param scaleX - Scale x-amount.
|
|
627
813
|
* @param scaleY - Scale y-amount. If undefined then scale x-amount is used.
|
|
@@ -629,7 +815,7 @@ declare class DivRect {
|
|
|
629
815
|
*/
|
|
630
816
|
scaleInPlace(scaleX: number, scaleY?: number): DivRect;
|
|
631
817
|
/**
|
|
632
|
-
* Scale Rect. Anchor pos is (
|
|
818
|
+
* Scale Rect. Anchor pos is (anchorX, anchorY). Immutable, returns modified copy.
|
|
633
819
|
*
|
|
634
820
|
* @param scaleX - Scale x-amount.
|
|
635
821
|
* @param scaleY - Scale y-amount. If undefined then scale x-amount is used.
|
|
@@ -932,7 +1118,7 @@ declare function asMulti<K extends any[], VALUE>(base: KVComponent<K, VALUE[]>):
|
|
|
932
1118
|
/**
|
|
933
1119
|
* Vec2 class.
|
|
934
1120
|
*
|
|
935
|
-
* @deprecated - Use Vec instead
|
|
1121
|
+
* @deprecated - Use {@link Vec} instead.
|
|
936
1122
|
*/
|
|
937
1123
|
declare class Vec2 {
|
|
938
1124
|
readonly x: number;
|
|
@@ -946,6 +1132,8 @@ declare class Vec2 {
|
|
|
946
1132
|
}
|
|
947
1133
|
|
|
948
1134
|
/**
|
|
1135
|
+
* @deprecated - Use {@link SignedIndexArray} or {@link IndexArray} instead, they have way more functions.
|
|
1136
|
+
*
|
|
949
1137
|
* A cache-like structure optimized for small-range integer keys, including negatives.
|
|
950
1138
|
*
|
|
951
1139
|
* Internally implemented using two sparse arrays: one for non-negative keys,
|
|
@@ -963,8 +1151,6 @@ declare class Vec2 {
|
|
|
963
1151
|
* cache.set(3, 'B');
|
|
964
1152
|
* console.log(cache.get(-2)); // 'A'
|
|
965
1153
|
* ```
|
|
966
|
-
*
|
|
967
|
-
* @deprecated - Same functionality an more is available now in SignedIndexArray<VALUE> and IndexArray<VALUE> containers.
|
|
968
1154
|
*/
|
|
969
1155
|
declare class SmallIntCache<VALUE> {
|
|
970
1156
|
private pos;
|
|
@@ -977,4 +1163,4 @@ declare class SmallIntCache<VALUE> {
|
|
|
977
1163
|
clear(): void;
|
|
978
1164
|
}
|
|
979
1165
|
|
|
980
|
-
export { Assert, Cookies, Device, DivRect, IndexArray, type KVComponent, LRUCache, Map1, Map2, Map3, MultiContainer, SignedIndexArray, SmallIntCache, Stack, index as Utils, Vec, Vec2, asMulti };
|
|
1166
|
+
export { index$7 as Assert, cookies as Cookies, device as Device, DivRect, Guard, IndexArray, type KVComponent, LRUCache, Map1, Map2, Map3, MultiContainer, SignedIndexArray, SmallIntCache, Stack, index as Utils, Vec, Vec2, asMulti };
|