@lowentry/utils 1.25.2 → 2.0.2
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/LICENSE +23 -0
- package/README.md +0 -2
- package/package.json +52 -53
- package/api-extractor.json +0 -43
- package/index.d.ts +0 -454
- package/index.js +0 -4150
- package/index.js.map +0 -1
- package/src/LeTypes.js +0 -254
- package/src/LeUtils.js +0 -3597
- package/src/classes/EventEmitter.js +0 -124
- package/src/classes/LinkedList.js +0 -145
- package/src/classes/SerializableMap.js +0 -17
- package/src/classes/TreeSet.js +0 -235
- package/src/index.js +0 -6
- package/tsconfig.d.ts +0 -1
- package/tsconfig.json +0 -39
package/LICENSE
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Low Entry
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
22
|
+
|
|
23
|
+
|
package/README.md
CHANGED
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
Provides utilities for general JavaScript development.
|
|
4
4
|
|
|
5
|
-
|
|
6
5
|
## Description
|
|
7
6
|
|
|
8
7
|
This plugin adds utility functions and classes to make it easier to program general JavaScript.
|
|
@@ -17,7 +16,6 @@ Think about things such as:
|
|
|
17
16
|
|
|
18
17
|
It's basically just a collection of general JavaScript utilities.
|
|
19
18
|
|
|
20
|
-
|
|
21
19
|
## Final words
|
|
22
20
|
|
|
23
21
|
I hope this plugin will be useful to you. If you have any questions or suggestions, please feel free to get in touch at [LowEntry.com](https://lowentry.com/).
|
package/package.json
CHANGED
|
@@ -1,55 +1,54 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
}
|
|
2
|
+
"name": "@lowentry/utils",
|
|
3
|
+
"version": "2.0.2",
|
|
4
|
+
"description": "Provides utilities for general JavaScript development.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"import": "./dist/index.js",
|
|
11
|
+
"types": "./dist/index.d.ts"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"files": [
|
|
15
|
+
"dist"
|
|
16
|
+
],
|
|
17
|
+
"scripts": {
|
|
18
|
+
"build": "tsc",
|
|
19
|
+
"lint": "eslint .",
|
|
20
|
+
"format": "eslint . --fix",
|
|
21
|
+
"test": "npm run type-check && npm run lint && vitest run",
|
|
22
|
+
"type-check": "tsc --noEmit",
|
|
23
|
+
"test:watch": "vitest",
|
|
24
|
+
"test:coverage": "vitest run --coverage",
|
|
25
|
+
"clean": "rm -rf dist coverage",
|
|
26
|
+
"prepublishOnly": "npm run clean && npm test && npm run build"
|
|
27
|
+
},
|
|
28
|
+
"devDependencies": {
|
|
29
|
+
"@stylistic/eslint-plugin": "^5.7.1",
|
|
30
|
+
"eslint": "^9.39.2",
|
|
31
|
+
"eslint-plugin-jsonc": "^2.21.0",
|
|
32
|
+
"jsdom": "^27.4.0",
|
|
33
|
+
"jsonc-eslint-parser": "^2.4.2",
|
|
34
|
+
"typescript": "^5.9.3",
|
|
35
|
+
"typescript-eslint": "^8.53.1",
|
|
36
|
+
"vitest": "^4.0.18"
|
|
37
|
+
},
|
|
38
|
+
"keywords": [
|
|
39
|
+
"lowentry",
|
|
40
|
+
"utils",
|
|
41
|
+
"utilities",
|
|
42
|
+
"typescript"
|
|
43
|
+
],
|
|
44
|
+
"author": "Low Entry",
|
|
45
|
+
"license": "MIT",
|
|
46
|
+
"homepage": "https://github.com/LowEntry/lowentry-js-utils",
|
|
47
|
+
"repository": {
|
|
48
|
+
"type": "git",
|
|
49
|
+
"url": "git+https://github.com/LowEntry/lowentry-js-utils.git"
|
|
50
|
+
},
|
|
51
|
+
"bugs": {
|
|
52
|
+
"url": "https://github.com/LowEntry/lowentry-js-utils/issues"
|
|
53
|
+
}
|
|
55
54
|
}
|
package/api-extractor.json
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"projectFolder": ".",
|
|
3
|
-
"mainEntryPointFilePath": "<projectFolder>/build/index.d.ts",
|
|
4
|
-
"bundledPackages": [],
|
|
5
|
-
"compiler": {
|
|
6
|
-
"tsconfigFilePath": "<projectFolder>/tsconfig.json"
|
|
7
|
-
},
|
|
8
|
-
"dtsRollup": {
|
|
9
|
-
"enabled": true,
|
|
10
|
-
"untrimmedFilePath": "<projectFolder>/dist/index.d.ts"
|
|
11
|
-
},
|
|
12
|
-
"apiReport": {
|
|
13
|
-
"enabled": false,
|
|
14
|
-
"includeForgottenExports": true
|
|
15
|
-
},
|
|
16
|
-
"docModel": {
|
|
17
|
-
"enabled": false,
|
|
18
|
-
"includeForgottenExports": true
|
|
19
|
-
},
|
|
20
|
-
"tsdocMetadata": {
|
|
21
|
-
"enabled": false
|
|
22
|
-
},
|
|
23
|
-
"messages": {
|
|
24
|
-
"compilerMessageReporting": {
|
|
25
|
-
"default": {
|
|
26
|
-
"logLevel": "none"
|
|
27
|
-
}
|
|
28
|
-
},
|
|
29
|
-
"extractorMessageReporting": {
|
|
30
|
-
"default": {
|
|
31
|
-
"logLevel": "none"
|
|
32
|
-
},
|
|
33
|
-
"ae-wrong-input-file-type": {
|
|
34
|
-
"logLevel": "none"
|
|
35
|
-
}
|
|
36
|
-
},
|
|
37
|
-
"tsdocMessageReporting": {
|
|
38
|
-
"default": {
|
|
39
|
-
"logLevel": "none"
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
}
|
package/index.d.ts
DELETED
|
@@ -1,454 +0,0 @@
|
|
|
1
|
-
export declare function ARRAY(value: any): any[];
|
|
2
|
-
|
|
3
|
-
export declare function BOOL(value: any): boolean;
|
|
4
|
-
|
|
5
|
-
export declare function BOOL_ANY(...values: any): boolean;
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* A simple event emitter class that allows you to register listeners for events, emit events, and remove listeners.
|
|
9
|
-
*/
|
|
10
|
-
export declare class EventEmitter {
|
|
11
|
-
/**
|
|
12
|
-
* Registers a listener for a specific event.
|
|
13
|
-
*
|
|
14
|
-
* @param {string} event - The name of the event to listen for.
|
|
15
|
-
* @param {Function} listener - The function to call when the event is emitted.
|
|
16
|
-
* @returns {{remove:(()=>void)}}
|
|
17
|
-
*/
|
|
18
|
-
on(event: string, listener: Function): {
|
|
19
|
-
remove: (() => void);
|
|
20
|
-
};
|
|
21
|
-
/**
|
|
22
|
-
* Registers a listener for a specific event, this listener will be called only once.
|
|
23
|
-
*
|
|
24
|
-
* @param {string} event - The name of the event to listen for.
|
|
25
|
-
* @param {Function} listener - The function to call when the event is emitted.
|
|
26
|
-
* @returns {{remove:()=>void}}
|
|
27
|
-
*/
|
|
28
|
-
once(event: string, listener: Function): {
|
|
29
|
-
remove: () => void;
|
|
30
|
-
};
|
|
31
|
-
/**
|
|
32
|
-
* Removes a listener for a specific event.
|
|
33
|
-
*
|
|
34
|
-
* @param {string} event - The name of the event to stop listening for.
|
|
35
|
-
* @param {Function} listener - The function to remove from the event listeners.
|
|
36
|
-
*/
|
|
37
|
-
off(event: string, listener: Function): void;
|
|
38
|
-
/**
|
|
39
|
-
* Emits an event, calling all registered listeners with the provided arguments.
|
|
40
|
-
*
|
|
41
|
-
* @param {string} event - The name of the event to emit.
|
|
42
|
-
* @param {...*} args - The arguments to pass to the listeners.
|
|
43
|
-
*/
|
|
44
|
-
emit(event: string, ...args: any[]): void;
|
|
45
|
-
/**
|
|
46
|
-
* Clears all listeners for a specific event or all events if no event is specified.
|
|
47
|
-
*
|
|
48
|
-
* @param {string} [event] - The name of the event to clear listeners for. If not provided, all events will be cleared.
|
|
49
|
-
*/
|
|
50
|
-
clear(event?: string): void;
|
|
51
|
-
#private;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
export declare function FLOAT(value: any): number;
|
|
55
|
-
|
|
56
|
-
export declare function FLOAT_ANY(...values: any): number;
|
|
57
|
-
|
|
58
|
-
export declare function FLOAT_LAX(value: any): number;
|
|
59
|
-
|
|
60
|
-
export declare function FLOAT_LAX_ANY(...values: any): number;
|
|
61
|
-
|
|
62
|
-
export declare function INT(value: any): number;
|
|
63
|
-
|
|
64
|
-
export declare function INT_ANY(...values: any): number;
|
|
65
|
-
|
|
66
|
-
export declare function INT_LAX(value: any): number;
|
|
67
|
-
|
|
68
|
-
export declare function INT_LAX_ANY(...values: any): number;
|
|
69
|
-
|
|
70
|
-
export declare function IS_ARRAY(value: any): boolean;
|
|
71
|
-
|
|
72
|
-
export declare function IS_OBJECT(value: any): boolean;
|
|
73
|
-
|
|
74
|
-
export declare function ISSET(value: any): boolean;
|
|
75
|
-
|
|
76
|
-
export declare namespace LeUtils {
|
|
77
|
-
export function equals(a: any, b: any): boolean;
|
|
78
|
-
export function equalsMapLike(elementsA: any, elementsB: any, ignoreKeys?: any[]): boolean;
|
|
79
|
-
export function clone(value: any): any;
|
|
80
|
-
export function onDomReady(callback: Function): {
|
|
81
|
-
remove: Function;
|
|
82
|
-
};
|
|
83
|
-
export function parseVersionString(versionString: string | any): {
|
|
84
|
-
major: (number);
|
|
85
|
-
minor: (number);
|
|
86
|
-
patch: (number);
|
|
87
|
-
toString: (() => string);
|
|
88
|
-
equals: ((arg0: string | any) => boolean);
|
|
89
|
-
smallerThan: ((arg0: string | any) => boolean);
|
|
90
|
-
smallerThanOrEquals: ((arg0: string | any) => boolean);
|
|
91
|
-
largerThan: ((arg0: string | any) => boolean);
|
|
92
|
-
largerThanOrEquals: ((arg0: string | any) => boolean);
|
|
93
|
-
};
|
|
94
|
-
export function contains(array: any[] | any | Function, value: any): boolean;
|
|
95
|
-
export function containsCaseInsensitive(array: any[] | any | Function, value: any): boolean;
|
|
96
|
-
export function containsAll(array: any[] | any | Function, values: any[] | any | Function): boolean;
|
|
97
|
-
export function containsAllCaseInsensitive(array: any[] | any | Function, values: any[] | any | Function): boolean;
|
|
98
|
-
export function containsAny(array: any[] | any | Function, values: any[] | any | Function): boolean;
|
|
99
|
-
export function containsAnyCaseInsensitive(array: any[] | any | Function, values: any[] | any | Function): boolean;
|
|
100
|
-
export function containsNone(array: any[] | any | Function, values: any[] | any | Function): boolean;
|
|
101
|
-
export function containsNoneCaseInsensitive(array: any[] | any | Function, values: any[] | any | Function): boolean;
|
|
102
|
-
export function findIndexValue(elements: any[] | any | Function, callback: (value: any, index: any) => boolean | void, optionalSkipHasOwnPropertyCheck?: boolean): {
|
|
103
|
-
index: any;
|
|
104
|
-
value: any;
|
|
105
|
-
} | null;
|
|
106
|
-
export function findIndex(elements: any[] | any | Function, callback: (value: any, index: any) => boolean | void, optionalSkipHasOwnPropertyCheck?: boolean): any | null;
|
|
107
|
-
export function find(elements: any[] | any | Function, callback: (value: any, index: any) => boolean | void, optionalSkipHasOwnPropertyCheck?: boolean): any | null;
|
|
108
|
-
export function getValueAtIndex(elements: any, index: any, optionalSkipHasOwnPropertyCheck?: boolean): any;
|
|
109
|
-
export function supportsEach(elements: any): boolean;
|
|
110
|
-
export function eachIterator(elements: any, optionalSkipHasOwnPropertyCheck?: boolean): Generator<any, void, unknown>;
|
|
111
|
-
export function each(elements: any, callback: (value: any, index?: any) => boolean | void, optionalSkipHasOwnPropertyCheck?: boolean): any;
|
|
112
|
-
export function eachAsync(elements: any, asyncCallback: any, parallelCount?: number, optionalSkipHasOwnPropertyCheck?: boolean): Promise<any>;
|
|
113
|
-
export function getEmptySimplifiedCollection(elements: any): [boolean, any[] | any | Map<any, any>, (value: any, index: any) => void];
|
|
114
|
-
export function filter(elements: any, callback?: (value: any, index: any) => boolean | undefined, optionalSkipHasOwnPropertyCheck?: boolean): any;
|
|
115
|
-
export function map(elements: any, callback?: (value: any, index: any) => any, optionalSkipHasOwnPropertyCheck?: boolean): any;
|
|
116
|
-
export function mapToArray(elements: any, callback?: (value: any, index: any) => any, optionalSkipHasOwnPropertyCheck?: boolean): any[];
|
|
117
|
-
export function mapToArraySorted(elements: any, comparator: (valueA: any, valueB: any) => number, callback?: (value: any, index: any) => any, optionalSkipHasOwnPropertyCheck?: boolean): any[];
|
|
118
|
-
export function sortKeys(elements: any, comparator: (valueA: any, valueB: any) => number, optionalSkipHasOwnPropertyCheck?: boolean): any[];
|
|
119
|
-
export function flattenArray(array: any): any[];
|
|
120
|
-
export function flattenToArray(elements: any, optionalSkipHasOwnPropertyCheck?: boolean): any[];
|
|
121
|
-
export function compare(a: any, b: any): number;
|
|
122
|
-
export function compareNumbers(a: number, b: number): number;
|
|
123
|
-
export function compareNumericStrings(a: string | number, b: string | number): number;
|
|
124
|
-
export function compareNaturalStrings(a: string, b: string): number;
|
|
125
|
-
export function compareTimestampStrings(a: string, b: string): number;
|
|
126
|
-
export function isEmptyObject(obj: any, optionalSkipHasOwnPropertyCheck?: boolean | undefined): boolean;
|
|
127
|
-
export function getObjectFieldsCount(obj: any, optionalSkipHasOwnPropertyCheck?: boolean | undefined): number;
|
|
128
|
-
export function isGeneratorFunction(func: any): any;
|
|
129
|
-
export function setTimeout(callback: (deltaTime: number) => any, ms: number): {
|
|
130
|
-
remove: Function;
|
|
131
|
-
};
|
|
132
|
-
export function setInterval(callback: (deltaTime: number) => any, intervalMs?: number, fireImmediately?: boolean): {
|
|
133
|
-
remove: Function;
|
|
134
|
-
};
|
|
135
|
-
export function setAnimationFrameTimeout(callback: (deltaTime: number) => any, frames?: number): {
|
|
136
|
-
remove: Function;
|
|
137
|
-
};
|
|
138
|
-
export function setAnimationFrameInterval(callback: (deltaTime: number) => any, intervalFrames?: number, fireImmediately?: boolean): {
|
|
139
|
-
remove: Function;
|
|
140
|
-
};
|
|
141
|
-
export function promiseTimeout(ms: number): Promise<number>;
|
|
142
|
-
export function promiseAnimationFrameTimeout(frames: number): Promise<number>;
|
|
143
|
-
export function fetch(url: string, options?: {
|
|
144
|
-
retries?: number | null;
|
|
145
|
-
delay?: number | ((attempt: number) => number) | null;
|
|
146
|
-
} | any | null): {
|
|
147
|
-
then: Function;
|
|
148
|
-
catch: Function;
|
|
149
|
-
finally: Function;
|
|
150
|
-
remove: Function;
|
|
151
|
-
isRemoved: Function;
|
|
152
|
-
};
|
|
153
|
-
export function cachedFetch(url: any, options: any, responseFunction: any): Promise<any>;
|
|
154
|
-
export function platformIsMobile(): boolean;
|
|
155
|
-
export function platformHasCursor(): boolean;
|
|
156
|
-
export function capitalize(string: string): string;
|
|
157
|
-
export function endsWithAny(string: string, endingCharsStringOrArray: string | string[]): boolean;
|
|
158
|
-
export function startsWithAny(string: string, startingCharsStringOrArray: string | string[]): boolean;
|
|
159
|
-
export function trimEnd(string: string, trimCharsStringOrArray: string | string[]): string;
|
|
160
|
-
export function trimStart(string: string, trimCharsStringOrArray: string | string[]): string;
|
|
161
|
-
export function trim(string: string, trimCharsStringOrArray: string | string[]): string;
|
|
162
|
-
export function purgeSentence(sentence: string): string;
|
|
163
|
-
export function purgeErrorMessage(error: any): string;
|
|
164
|
-
export function generateNamePermutations(...names: string[]): string[];
|
|
165
|
-
export function increaseNumericStringByOne(string: string): string;
|
|
166
|
-
export function uniqueId(): string;
|
|
167
|
-
export function timestamp(now?: number | null | undefined): string;
|
|
168
|
-
export function getEmptyImageSrc(): string;
|
|
169
|
-
export function getPercentage(part: number | string, total: number | string): number;
|
|
170
|
-
export function getImagePixels(image: HTMLImageElement): Uint8ClampedArray;
|
|
171
|
-
export function getColoredImage(image: HTMLImageElement, color: string): string;
|
|
172
|
-
export function rgbToHex(rgb: number[]): string;
|
|
173
|
-
export function hexToRgb(hexstring: string): number[];
|
|
174
|
-
export function rgbToHsl(rgb: number[]): number[];
|
|
175
|
-
export function hslToRgb(hsl: any): number[];
|
|
176
|
-
export function rgbToLab(rgb: number[]): number[];
|
|
177
|
-
export function getDifferenceBetweenRgb(rgbA: number[], rgbB: number[]): number;
|
|
178
|
-
export function getDifferenceBetweenLab(labA: number[], labB: number[]): number;
|
|
179
|
-
export function getRgbOfGradient(gradient: {
|
|
180
|
-
percentage?: number[];
|
|
181
|
-
}, percentage: number): number[];
|
|
182
|
-
export function getRgbBetween(startRgb: number[], endRgb: number[], percentage: number): number[];
|
|
183
|
-
export function btoa(string: string): string;
|
|
184
|
-
export function atob(base64string: string): string;
|
|
185
|
-
export function utf8ToBase64(string: string): string;
|
|
186
|
-
export function base64ToUtf8(base64string: string): string;
|
|
187
|
-
export function base64ToHex(base64string: string): string;
|
|
188
|
-
export function hexToBase64(hexstring: string): string;
|
|
189
|
-
export function base64ToBytes(base64string: string): Uint8Array;
|
|
190
|
-
export function bytesToBase64(arraybuffer: ArrayLike<number> | ArrayBuffer): string;
|
|
191
|
-
export function downloadFile(base64string: string, fileName?: string, mimeType?: string): void;
|
|
192
|
-
export function localStorageGet(id: string): any;
|
|
193
|
-
export function localStorageSet(id: string, data: any): void;
|
|
194
|
-
export function localStorageRemove(id: string): void;
|
|
195
|
-
export function isCurrentHostPrivate(): boolean;
|
|
196
|
-
export function isGivenHostPrivate(host: string): boolean;
|
|
197
|
-
export function createTransactionalValue(value?: any): {
|
|
198
|
-
value: any;
|
|
199
|
-
changes: {
|
|
200
|
-
id: string;
|
|
201
|
-
value: any;
|
|
202
|
-
}[];
|
|
203
|
-
};
|
|
204
|
-
export function isTransactionalValueValid(transactionalValue: {
|
|
205
|
-
value: any;
|
|
206
|
-
changes: {
|
|
207
|
-
id: string;
|
|
208
|
-
value: any;
|
|
209
|
-
}[];
|
|
210
|
-
}): boolean;
|
|
211
|
-
export function transactionalValueToString(transactionalValue: {
|
|
212
|
-
value: any;
|
|
213
|
-
changes: {
|
|
214
|
-
id: string;
|
|
215
|
-
value: any;
|
|
216
|
-
}[];
|
|
217
|
-
}): string;
|
|
218
|
-
export function transactionSetAndCommit(transactionalValue: {
|
|
219
|
-
value: any;
|
|
220
|
-
changes: {
|
|
221
|
-
id: string;
|
|
222
|
-
value: any;
|
|
223
|
-
}[];
|
|
224
|
-
}, value: any): void;
|
|
225
|
-
export function transactionSetWithoutCommitting(transactionalValue: {
|
|
226
|
-
value: any;
|
|
227
|
-
changes: {
|
|
228
|
-
id: string;
|
|
229
|
-
value: any;
|
|
230
|
-
}[];
|
|
231
|
-
}, value: any): string;
|
|
232
|
-
export function transactionCommitChange(transactionalValue: {
|
|
233
|
-
value: any;
|
|
234
|
-
changes: {
|
|
235
|
-
id: string;
|
|
236
|
-
value: any;
|
|
237
|
-
}[];
|
|
238
|
-
}, changeId: string): boolean;
|
|
239
|
-
export function transactionCancelChange(transactionalValue: {
|
|
240
|
-
value: any;
|
|
241
|
-
changes: {
|
|
242
|
-
id: string;
|
|
243
|
-
value: any;
|
|
244
|
-
}[];
|
|
245
|
-
}, changeId: string): boolean;
|
|
246
|
-
export function transactionIsChangeRelevant(transactionalValue: {
|
|
247
|
-
value: any;
|
|
248
|
-
changes: {
|
|
249
|
-
id: string;
|
|
250
|
-
value: any;
|
|
251
|
-
}[];
|
|
252
|
-
}, changeId: string): boolean;
|
|
253
|
-
export function transactionGetCommittedValue(transactionalValue: {
|
|
254
|
-
value: any;
|
|
255
|
-
changes: {
|
|
256
|
-
id: string;
|
|
257
|
-
value: any;
|
|
258
|
-
}[];
|
|
259
|
-
}): any;
|
|
260
|
-
export function transactionGetValue(transactionalValue: {
|
|
261
|
-
value: any;
|
|
262
|
-
changes: {
|
|
263
|
-
id: string;
|
|
264
|
-
value: any;
|
|
265
|
-
}[];
|
|
266
|
-
}): any;
|
|
267
|
-
export function createWorkerThread(name: string): {
|
|
268
|
-
worker: Worker | null;
|
|
269
|
-
sendMessage: (data: any, options: {
|
|
270
|
-
timeout: number | undefined;
|
|
271
|
-
} | undefined) => Promise<any>;
|
|
272
|
-
};
|
|
273
|
-
export function sendWorkerMessage(workerName: any, data: any, options: any): any;
|
|
274
|
-
export function purgeEmail(email: string): string;
|
|
275
|
-
export function isFocusClear(): boolean;
|
|
276
|
-
export function getUserLocale(): any;
|
|
277
|
-
export function getUserLocaleDateFormat(): any;
|
|
278
|
-
}
|
|
279
|
-
|
|
280
|
-
export declare class LinkedList {
|
|
281
|
-
/**
|
|
282
|
-
* Returns the number of elements in the list.
|
|
283
|
-
*
|
|
284
|
-
* @returns {number}
|
|
285
|
-
*/
|
|
286
|
-
get size(): number;
|
|
287
|
-
/**
|
|
288
|
-
* Adds a new value to the beginning of the list.
|
|
289
|
-
*
|
|
290
|
-
* @param {*} value
|
|
291
|
-
*/
|
|
292
|
-
unshift(value: any): void;
|
|
293
|
-
/**
|
|
294
|
-
* Adds a new value to the end of the list.
|
|
295
|
-
*
|
|
296
|
-
* @param {*} value
|
|
297
|
-
*/
|
|
298
|
-
push(value: any): void;
|
|
299
|
-
/**
|
|
300
|
-
* Removes the first value from the list and returns it.
|
|
301
|
-
*
|
|
302
|
-
* @returns {*|undefined}
|
|
303
|
-
*/
|
|
304
|
-
shift(): any | undefined;
|
|
305
|
-
/**
|
|
306
|
-
* Removes the last value from the list and returns it.
|
|
307
|
-
*
|
|
308
|
-
* @returns {*|undefined}
|
|
309
|
-
*/
|
|
310
|
-
pop(): any | undefined;
|
|
311
|
-
#private;
|
|
312
|
-
}
|
|
313
|
-
|
|
314
|
-
export declare function OBJECT(value: any): any;
|
|
315
|
-
|
|
316
|
-
/**
|
|
317
|
-
* SerializableMap class extends the native Map to provide a JSON representation.
|
|
318
|
-
*
|
|
319
|
-
* This class can only have string keys, as JSON does not support non-string keys.
|
|
320
|
-
*/
|
|
321
|
-
export declare class SerializableMap extends Map<any, any> {
|
|
322
|
-
constructor();
|
|
323
|
-
constructor(entries?: readonly (readonly [any, any])[] | null | undefined);
|
|
324
|
-
constructor();
|
|
325
|
-
constructor(iterable?: Iterable<readonly [any, any]> | null | undefined);
|
|
326
|
-
/**
|
|
327
|
-
* Returns a JSON representation of the map.
|
|
328
|
-
*
|
|
329
|
-
* @returns {Object}
|
|
330
|
-
*/
|
|
331
|
-
toJSON(): any;
|
|
332
|
-
}
|
|
333
|
-
|
|
334
|
-
export declare function STRING(value: any): string;
|
|
335
|
-
|
|
336
|
-
export declare function STRING_ANY(...values: any): string;
|
|
337
|
-
|
|
338
|
-
/**
|
|
339
|
-
* A TreeSet is a set of elements, sorted by a comparator.
|
|
340
|
-
* Binary search is used to find elements, which makes it very fast to find elements.
|
|
341
|
-
*
|
|
342
|
-
* The comparator is also used to determine if two values are equal to each other.
|
|
343
|
-
* This way, you can have values that aren't the same be treated as if they are. This can be used to deal with issues such as floating point errors for example.
|
|
344
|
-
*/
|
|
345
|
-
export declare class TreeSet {
|
|
346
|
-
/**
|
|
347
|
-
* Creates a new TreeSet with the given elements and comparator.
|
|
348
|
-
*
|
|
349
|
-
* @param {*[]} [elements=[]] - The initial elements of the set.
|
|
350
|
-
* @param {(valueA:*, valueB:*) => number} [comparator=LeUtils.compare] - The comparator function to use for sorting.
|
|
351
|
-
*/
|
|
352
|
-
constructor(elements?: any[], comparator?: (valueA: any, valueB: any) => number);
|
|
353
|
-
/**
|
|
354
|
-
*
|
|
355
|
-
*
|
|
356
|
-
* @param {*} value - The value to search for in the set.
|
|
357
|
-
* @returns {{found:boolean, index:number, value:*|undefined}} - An object containing whether the value was found, the index where it would be inserted, and the value at that index (if found).
|
|
358
|
-
* @private
|
|
359
|
-
*/
|
|
360
|
-
private binarySearch;
|
|
361
|
-
/**
|
|
362
|
-
* Returns the elements of the set.
|
|
363
|
-
*/
|
|
364
|
-
getElements(): any[];
|
|
365
|
-
/**
|
|
366
|
-
* Returns the comparator of the set.
|
|
367
|
-
*
|
|
368
|
-
* @returns {(valueA:*, valueB:*) => number}
|
|
369
|
-
*/
|
|
370
|
-
getComparator(): (valueA: any, valueB: any) => number;
|
|
371
|
-
/**
|
|
372
|
-
* Returns the size of the set.
|
|
373
|
-
*
|
|
374
|
-
* @returns {number}
|
|
375
|
-
*/
|
|
376
|
-
size(): number;
|
|
377
|
-
/**
|
|
378
|
-
* Returns true if the set is empty, false otherwise.
|
|
379
|
-
*
|
|
380
|
-
* @returns {boolean}
|
|
381
|
-
*/
|
|
382
|
-
isEmpty(): boolean;
|
|
383
|
-
/**
|
|
384
|
-
* Returns true if the set contains a value that is equal to the given value, returns false otherwise.
|
|
385
|
-
*
|
|
386
|
-
* @param {*} value - The value to check for in the set.
|
|
387
|
-
* @return {boolean} - True if the set contains the value, false otherwise.
|
|
388
|
-
*/
|
|
389
|
-
contains(value: any): boolean;
|
|
390
|
-
/**
|
|
391
|
-
* Returns the first element of the set, or undefined if it is empty.
|
|
392
|
-
*
|
|
393
|
-
* @return {*|undefined} - The first element of the set, or undefined if it is empty.
|
|
394
|
-
*/
|
|
395
|
-
first(): any | undefined;
|
|
396
|
-
/**
|
|
397
|
-
* Returns the last element of the set, or undefined if it is empty.
|
|
398
|
-
*
|
|
399
|
-
* @return {*|undefined} - The last element of the set, or undefined if it is empty.
|
|
400
|
-
*/
|
|
401
|
-
last(): any | undefined;
|
|
402
|
-
/**
|
|
403
|
-
* Removes and returns the first element of the set, or undefined if it is empty.
|
|
404
|
-
*
|
|
405
|
-
* @returns {*|undefined} - The first element of the set, or undefined if it is empty.
|
|
406
|
-
*/
|
|
407
|
-
pollFirst(): any | undefined;
|
|
408
|
-
/**
|
|
409
|
-
* Removes and returns the last element of the set, or undefined if it is empty.
|
|
410
|
-
*
|
|
411
|
-
* @returns {*|undefined} - The last element of the set, or undefined if it is empty.
|
|
412
|
-
*/
|
|
413
|
-
pollLast(): any | undefined;
|
|
414
|
-
/**
|
|
415
|
-
* Adds the given value to the set. Will only do so if no equal value already exists.
|
|
416
|
-
* @param {*} value - The value to add to the set.
|
|
417
|
-
*/
|
|
418
|
-
add(value: any): void;
|
|
419
|
-
/**
|
|
420
|
-
* Adds all the given values to the set. Will only do so if no equal value already exists.
|
|
421
|
-
*
|
|
422
|
-
* @param {*} values - The values to add to the set.
|
|
423
|
-
*/
|
|
424
|
-
addAll(values: any): void;
|
|
425
|
-
/**
|
|
426
|
-
* Returns an equal value that's already in the tree set, or undefined if no equal values in it exist.
|
|
427
|
-
*
|
|
428
|
-
* @param {*} value - The value to search for in the set.
|
|
429
|
-
* @return {*|undefined} - The equal value if found, or undefined if not found.
|
|
430
|
-
*/
|
|
431
|
-
getEqualValue(value: any): any | undefined;
|
|
432
|
-
/**
|
|
433
|
-
* Returns an equal value that's already in the tree set. If no equal values in it exist, the given value will be added and returned.
|
|
434
|
-
*
|
|
435
|
-
* @param {*} value - The value to search for in the set.
|
|
436
|
-
* @return {*} - The equal value if found, or the added value if not found.
|
|
437
|
-
*/
|
|
438
|
-
getEqualValueOrAdd(value: any): any;
|
|
439
|
-
/**
|
|
440
|
-
* Returns a string representation of the TreeSet.
|
|
441
|
-
*
|
|
442
|
-
* @returns {string} - A string representation of the TreeSet, including its elements and comparator.
|
|
443
|
-
*/
|
|
444
|
-
toString(): string;
|
|
445
|
-
/**
|
|
446
|
-
* Returns a JSON representation of the TreeSet.
|
|
447
|
-
*
|
|
448
|
-
* @returns {Object} - An object containing the elements and comparator of the TreeSet.
|
|
449
|
-
*/
|
|
450
|
-
toJSON(): any;
|
|
451
|
-
#private;
|
|
452
|
-
}
|
|
453
|
-
|
|
454
|
-
export { }
|