@esposter/shared 4.3.2 → 4.4.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/README.md +8 -19
- package/dist/index.d.ts +34 -438
- package/dist/index.js +238 -324
- package/package.json +7 -7
package/dist/index.d.ts
CHANGED
|
@@ -2,12 +2,9 @@ import { z } from "zod";
|
|
|
2
2
|
import { Result, ResultAsync } from "neverthrow";
|
|
3
3
|
import { HTMLElement } from "node-html-parser";
|
|
4
4
|
import { DefaultTreeAdapterTypes, html as html$1 } from "parse5";
|
|
5
|
-
//#region src/models/error/ForbiddenError.d.ts
|
|
6
5
|
export declare class ForbiddenError extends Error {
|
|
7
6
|
constructor(message: string);
|
|
8
7
|
}
|
|
9
|
-
//#endregion
|
|
10
|
-
//#region src/models/shared/Operation.d.ts
|
|
11
8
|
export declare enum Operation {
|
|
12
9
|
Create = "Create",
|
|
13
10
|
Delete = "Delete",
|
|
@@ -16,37 +13,23 @@ export declare enum Operation {
|
|
|
16
13
|
Unshift = "Unshift",
|
|
17
14
|
Update = "Update"
|
|
18
15
|
}
|
|
19
|
-
//#endregion
|
|
20
|
-
//#region src/models/error/InvalidOperationError.d.ts
|
|
21
16
|
export declare class InvalidOperationError extends Error {
|
|
22
17
|
constructor(operation: Operation, name: string, message: string);
|
|
23
18
|
}
|
|
24
|
-
//#endregion
|
|
25
|
-
//#region src/models/error/NotFoundError.d.ts
|
|
26
19
|
export declare class NotFoundError<T extends string = string> extends Error {
|
|
27
20
|
constructor(name: T, id: string);
|
|
28
21
|
}
|
|
29
|
-
//#endregion
|
|
30
|
-
//#region src/models/error/NotInitializedError.d.ts
|
|
31
22
|
export declare class NotInitializedError<T extends string = string> extends Error {
|
|
32
23
|
constructor(name: T);
|
|
33
24
|
}
|
|
34
|
-
//#endregion
|
|
35
|
-
//#region src/models/error/WordFilteredError.d.ts
|
|
36
25
|
export declare class WordFilteredError extends Error {
|
|
37
26
|
constructor(message: string);
|
|
38
27
|
}
|
|
39
|
-
//#endregion
|
|
40
|
-
//#region src/models/eventEmitter/EventListenerEntry.d.ts
|
|
41
28
|
export interface EventListenerEntry<TEventMap> {
|
|
42
29
|
isOnce: boolean;
|
|
43
30
|
listener: TEventMap[keyof TEventMap];
|
|
44
31
|
}
|
|
45
|
-
//#endregion
|
|
46
|
-
//#region src/models/eventEmitter/EventListenerMap.d.ts
|
|
47
32
|
export type EventListenerMap<TEventMap> = { [TEvent in keyof TEventMap]: (...args: never[]) => void; };
|
|
48
|
-
//#endregion
|
|
49
|
-
//#region src/models/eventEmitter/TypedEventEmitter.d.ts
|
|
50
33
|
export declare class TypedEventEmitter<TEventMap extends EventListenerMap<TEventMap>> {
|
|
51
34
|
#private;
|
|
52
35
|
emit<TEvent extends keyof TEventMap>(event: TEvent, ...args: Parameters<TEventMap[TEvent]>): boolean;
|
|
@@ -55,75 +38,47 @@ export declare class TypedEventEmitter<TEventMap extends EventListenerMap<TEvent
|
|
|
55
38
|
once<TEvent extends keyof TEventMap>(event: TEvent, listener: TEventMap[TEvent]): void;
|
|
56
39
|
removeAllListeners(event?: keyof TEventMap): void;
|
|
57
40
|
}
|
|
58
|
-
//#endregion
|
|
59
|
-
//#region src/models/history/History.d.ts
|
|
60
41
|
export interface History<T> {
|
|
61
42
|
future: T[];
|
|
62
43
|
limit: number;
|
|
63
44
|
past: T[];
|
|
64
45
|
}
|
|
65
|
-
//#endregion
|
|
66
|
-
//#region src/models/history/HistoryStep.d.ts
|
|
67
46
|
export interface HistoryStep<T> {
|
|
68
47
|
entry?: T;
|
|
69
48
|
history: History<T>;
|
|
70
49
|
}
|
|
71
|
-
//#endregion
|
|
72
|
-
//#region src/models/indexedDb/DatabaseStoreSchema.d.ts
|
|
73
50
|
export interface DatabaseStoreSchema {
|
|
74
51
|
indexes: Record<string, IDBValidKey>;
|
|
75
52
|
key: IDBValidKey;
|
|
76
53
|
value: unknown;
|
|
77
54
|
}
|
|
78
|
-
//#endregion
|
|
79
|
-
//#region src/models/indexedDb/DatabaseSchema.d.ts
|
|
80
55
|
export type DatabaseSchema = Record<string, DatabaseStoreSchema>;
|
|
81
|
-
//#endregion
|
|
82
|
-
//#region src/models/indexedDb/DatabaseStoreName.d.ts
|
|
83
56
|
export type DatabaseStoreName<TSchema extends DatabaseSchema> = [LiteralKeys<TSchema>] extends [never] ? string : LiteralKeys<TSchema>;
|
|
84
57
|
type LiteralKeys<TSchema> = keyof { [TKey in keyof TSchema as string extends TKey ? never : TKey]: TKey; } & string;
|
|
85
|
-
//#endregion
|
|
86
|
-
//#region src/models/indexedDb/DatabaseIndexName.d.ts
|
|
87
58
|
export type DatabaseIndexName<TSchema extends DatabaseSchema, TStoreName extends DatabaseStoreName<TSchema>> = string extends keyof TSchema[TStoreName]["indexes"] ? string : keyof TSchema[TStoreName]["indexes"] & string;
|
|
88
|
-
//#endregion
|
|
89
|
-
//#region src/models/indexedDb/DatabaseIndexCreator.d.ts
|
|
90
59
|
export interface DatabaseIndexCreator<TSchema extends DatabaseSchema, TStoreName extends DatabaseStoreName<TSchema>> {
|
|
91
60
|
createIndex: (name: DatabaseIndexName<TSchema, TStoreName>, keyPath: string | string[], options?: IDBIndexParameters) => void;
|
|
92
61
|
}
|
|
93
|
-
//#endregion
|
|
94
|
-
//#region src/models/indexedDb/DatabaseIndexKey.d.ts
|
|
95
62
|
export type DatabaseIndexKey<TSchema extends DatabaseSchema, TStoreName extends DatabaseStoreName<TSchema>, TIndexName extends DatabaseIndexName<TSchema, TStoreName>> = TSchema[TStoreName]["indexes"][TIndexName];
|
|
96
|
-
//#endregion
|
|
97
|
-
//#region src/models/indexedDb/DatabaseIndex.d.ts
|
|
98
63
|
export interface DatabaseIndex<TSchema extends DatabaseSchema, TStoreName extends DatabaseStoreName<TSchema>, TIndexName extends DatabaseIndexName<TSchema, TStoreName>> {
|
|
99
64
|
getAll: (query?: DatabaseIndexKey<TSchema, TStoreName, TIndexName> | IDBKeyRange | null, count?: number) => Promise<TSchema[TStoreName]["value"][]>;
|
|
100
65
|
getAllKeys: (query?: DatabaseIndexKey<TSchema, TStoreName, TIndexName> | IDBKeyRange | null, count?: number) => Promise<TSchema[TStoreName]["key"][]>;
|
|
101
66
|
}
|
|
102
|
-
//#endregion
|
|
103
|
-
//#region src/models/indexedDb/DatabaseObjectStoreReader.d.ts
|
|
104
67
|
export interface DatabaseObjectStoreReader<TSchema extends DatabaseSchema, TStoreName extends DatabaseStoreName<TSchema>> {
|
|
105
68
|
get: (key: TSchema[TStoreName]["key"]) => Promise<TSchema[TStoreName]["value"] | undefined>;
|
|
106
69
|
getAll: (query?: IDBKeyRange | null | TSchema[TStoreName]["key"], count?: number) => Promise<TSchema[TStoreName]["value"][]>;
|
|
107
70
|
getAllKeys: (query?: IDBKeyRange | null | TSchema[TStoreName]["key"], count?: number) => Promise<TSchema[TStoreName]["key"][]>;
|
|
108
71
|
index: <TIndexName extends DatabaseIndexName<TSchema, TStoreName>>(name: TIndexName) => DatabaseIndex<TSchema, TStoreName, TIndexName>;
|
|
109
72
|
}
|
|
110
|
-
//#endregion
|
|
111
|
-
//#region src/models/indexedDb/DatabaseObjectStoreWriter.d.ts
|
|
112
73
|
export interface DatabaseObjectStoreWriter<TSchema extends DatabaseSchema, TStoreName extends DatabaseStoreName<TSchema>> {
|
|
113
74
|
delete: (query: IDBKeyRange | TSchema[TStoreName]["key"]) => Promise<void>;
|
|
114
75
|
put: (value: TSchema[TStoreName]["value"], key?: TSchema[TStoreName]["key"]) => Promise<TSchema[TStoreName]["key"]>;
|
|
115
76
|
}
|
|
116
|
-
//#endregion
|
|
117
|
-
//#region src/models/indexedDb/DatabaseObjectStore.d.ts
|
|
118
77
|
export type DatabaseObjectStore<TSchema extends DatabaseSchema, TStoreName extends DatabaseStoreName<TSchema>, TMode extends IDBTransactionMode> = DatabaseObjectStoreReader<TSchema, TStoreName> & (TMode extends "readonly" ? unknown : DatabaseObjectStoreWriter<TSchema, TStoreName> & (TMode extends "versionchange" ? DatabaseIndexCreator<TSchema, TStoreName> : unknown));
|
|
119
|
-
//#endregion
|
|
120
|
-
//#region src/models/indexedDb/DatabaseTransaction.d.ts
|
|
121
78
|
export interface DatabaseTransaction<TSchema extends DatabaseSchema, TStoreName extends DatabaseStoreName<TSchema>, TMode extends IDBTransactionMode> {
|
|
122
79
|
done: Promise<void>;
|
|
123
80
|
objectStore: <TName extends TStoreName>(name: TName) => DatabaseObjectStore<TSchema, TName, TMode>;
|
|
124
81
|
}
|
|
125
|
-
//#endregion
|
|
126
|
-
//#region src/models/indexedDb/Database.d.ts
|
|
127
82
|
export interface Database<TSchema extends DatabaseSchema = DatabaseSchema> {
|
|
128
83
|
close: () => void;
|
|
129
84
|
delete: <TStoreName extends DatabaseStoreName<TSchema>>(storeName: TStoreName, query: IDBKeyRange | TSchema[TStoreName]["key"]) => Promise<void>;
|
|
@@ -134,21 +89,15 @@ export interface Database<TSchema extends DatabaseSchema = DatabaseSchema> {
|
|
|
134
89
|
put: <TStoreName extends DatabaseStoreName<TSchema>>(storeName: TStoreName, value: TSchema[TStoreName]["value"], key?: TSchema[TStoreName]["key"]) => Promise<TSchema[TStoreName]["key"]>;
|
|
135
90
|
transaction: <TStoreName extends DatabaseStoreName<TSchema>, TMode extends IDBTransactionMode = "readonly">(storeNames: readonly TStoreName[] | TStoreName, mode?: TMode, options?: IDBTransactionOptions) => DatabaseTransaction<TSchema, TStoreName, TMode>;
|
|
136
91
|
}
|
|
137
|
-
//#endregion
|
|
138
|
-
//#region src/models/indexedDb/UpgradeDatabase.d.ts
|
|
139
92
|
export interface UpgradeDatabase<TSchema extends DatabaseSchema = DatabaseSchema> extends Database<TSchema> {
|
|
140
93
|
createObjectStore: <TStoreName extends DatabaseStoreName<TSchema>>(name: TStoreName, options?: IDBObjectStoreParameters) => DatabaseObjectStore<TSchema, TStoreName, "versionchange">;
|
|
141
94
|
}
|
|
142
|
-
//#endregion
|
|
143
|
-
//#region src/models/indexedDb/DatabaseOpenOptions.d.ts
|
|
144
95
|
export interface DatabaseOpenOptions<TSchema extends DatabaseSchema = DatabaseSchema> {
|
|
145
96
|
blocked?: (currentVersion: number, blockedVersion: null | number) => void;
|
|
146
97
|
blocking?: (currentVersion: number, blockedVersion: null | number) => void;
|
|
147
98
|
terminated?: () => void;
|
|
148
99
|
upgrade?: (database: UpgradeDatabase<TSchema>, oldVersion: number, newVersion: null | number, transaction: DatabaseTransaction<TSchema, DatabaseStoreName<TSchema>, "versionchange">) => void;
|
|
149
100
|
}
|
|
150
|
-
//#endregion
|
|
151
|
-
//#region src/models/jsonPatch/JsonPatchOperationType.d.ts
|
|
152
101
|
export declare enum JsonPatchOperationType {
|
|
153
102
|
Add = "add",
|
|
154
103
|
Copy = "copy",
|
|
@@ -157,8 +106,6 @@ export declare enum JsonPatchOperationType {
|
|
|
157
106
|
Replace = "replace",
|
|
158
107
|
Test = "test"
|
|
159
108
|
}
|
|
160
|
-
//#endregion
|
|
161
|
-
//#region src/models/jsonPatch/JsonPatchOperation.d.ts
|
|
162
109
|
export type JsonPatchOperation = JsonPatchFromOperation | JsonPatchRemoveOperation | JsonPatchValueOperation;
|
|
163
110
|
interface JsonPatchFromOperation {
|
|
164
111
|
from: string;
|
|
@@ -174,44 +121,30 @@ interface JsonPatchValueOperation {
|
|
|
174
121
|
path: string;
|
|
175
122
|
value: unknown;
|
|
176
123
|
}
|
|
177
|
-
//#endregion
|
|
178
|
-
//#region src/models/jsonPatch/ApplyPatchesResult.d.ts
|
|
179
124
|
export interface ApplyPatchesResult<T> {
|
|
180
125
|
document: T;
|
|
181
126
|
inverses: JsonPatchOperation[];
|
|
182
127
|
}
|
|
183
|
-
//#endregion
|
|
184
|
-
//#region src/models/message/MentionType.d.ts
|
|
185
128
|
export declare enum MentionType {
|
|
186
129
|
Role = "role",
|
|
187
130
|
User = "user"
|
|
188
131
|
}
|
|
189
|
-
//#endregion
|
|
190
|
-
//#region src/models/mime/MimeDatabaseEntry.d.ts
|
|
191
132
|
export interface MimeDatabaseEntry {
|
|
192
133
|
charset?: string;
|
|
193
134
|
compressible?: boolean;
|
|
194
135
|
extensions?: string[];
|
|
195
136
|
source?: string;
|
|
196
137
|
}
|
|
197
|
-
//#endregion
|
|
198
|
-
//#region src/models/object/ObjectMethod.d.ts
|
|
199
138
|
export declare enum ObjectMethod {
|
|
200
139
|
ToString = "toString",
|
|
201
140
|
ValueOf = "valueOf"
|
|
202
141
|
}
|
|
203
|
-
//#endregion
|
|
204
|
-
//#region src/models/profanity/ProfanityOptions.d.ts
|
|
205
142
|
export interface ProfanityOptions {
|
|
206
143
|
isWholeWord: boolean;
|
|
207
144
|
}
|
|
208
|
-
//#endregion
|
|
209
|
-
//#region src/models/reactivity/MaybeReactive.d.ts
|
|
210
145
|
export interface MaybeReactive {
|
|
211
146
|
__v_raw?: unknown;
|
|
212
147
|
}
|
|
213
|
-
//#endregion
|
|
214
|
-
//#region src/models/router/RoutePath.d.ts
|
|
215
148
|
export declare const RoutePath: {
|
|
216
149
|
readonly About: "/about";
|
|
217
150
|
readonly Achievements: "/achievements";
|
|
@@ -251,53 +184,42 @@ export declare const RoutePath: {
|
|
|
251
184
|
readonly View: (type: string, id: string) => string;
|
|
252
185
|
};
|
|
253
186
|
export type RoutePath = typeof RoutePath;
|
|
254
|
-
//#endregion
|
|
255
|
-
//#region src/models/sanitizeHtml/AttributesTransformer.d.ts
|
|
256
187
|
export type AttributesTransformer = (attributes: Record<string, string>) => Record<string, string>;
|
|
257
|
-
//#endregion
|
|
258
|
-
//#region src/models/sanitizeHtml/SanitizeHtmlOptions.d.ts
|
|
259
188
|
export interface SanitizeHtmlOptions {
|
|
260
189
|
allowedAttributes?: Record<string, string[]>;
|
|
261
190
|
allowedClasses?: Record<string, string[]>;
|
|
191
|
+
allowedSources?: Record<string, Record<string, RegExp[]>>;
|
|
262
192
|
allowedStyles?: Record<string, Record<string, RegExp[]>>;
|
|
263
193
|
allowedTags?: string[];
|
|
264
194
|
transformAttributes?: Record<string, AttributesTransformer>;
|
|
265
195
|
}
|
|
266
|
-
//#endregion
|
|
267
|
-
//#region src/models/sanitizeHtml/SanitizePolicy.d.ts
|
|
268
196
|
export interface SanitizePolicy {
|
|
269
197
|
allowedAttributes: Record<string, string[]>;
|
|
270
198
|
allowedClasses: Record<string, string[]>;
|
|
271
199
|
allowedSchemes: string[];
|
|
200
|
+
allowedSources: Record<string, Record<string, RegExp[]>>;
|
|
272
201
|
allowedStyles: Record<string, Record<string, RegExp[]>>;
|
|
273
202
|
allowedTags: string[];
|
|
274
203
|
transformAttributes: Record<string, AttributesTransformer>;
|
|
275
204
|
}
|
|
276
|
-
|
|
277
|
-
//#region src/models/shared/ItemEntityType.d.ts
|
|
205
|
+
export type TextHtmlAllowance = Pick<SanitizeHtmlOptions, "allowedAttributes" | "allowedSources" | "allowedTags">;
|
|
278
206
|
export interface ItemEntityType<T extends string> {
|
|
279
207
|
type: T;
|
|
280
208
|
}
|
|
281
209
|
export declare const createItemEntityTypeSchema: <T extends z.ZodType<string>>(schema: T) => z.ZodObject<{
|
|
282
210
|
type: T;
|
|
283
211
|
}>;
|
|
284
|
-
//#endregion
|
|
285
|
-
//#region src/models/shared/ItemMetadata.d.ts
|
|
286
212
|
export declare class ItemMetadata {
|
|
287
213
|
createdAt: Date;
|
|
288
214
|
deletedAt: Date | null;
|
|
289
215
|
updatedAt: Date;
|
|
290
216
|
}
|
|
291
|
-
//#endregion
|
|
292
|
-
//#region ../../node_modules/.pnpm/type-fest@5.10.0/node_modules/type-fest/source/primitive.d.ts
|
|
293
217
|
/**
|
|
294
218
|
Matches any [primitive value](https://developer.mozilla.org/en-US/docs/Glossary/Primitive).
|
|
295
219
|
|
|
296
220
|
@category Type
|
|
297
221
|
*/
|
|
298
222
|
type Primitive = null | undefined | string | number | boolean | symbol | bigint;
|
|
299
|
-
//#endregion
|
|
300
|
-
//#region ../../node_modules/.pnpm/type-fest@5.10.0/node_modules/type-fest/source/basic.d.ts
|
|
301
223
|
/**
|
|
302
224
|
Matches a [`class`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes).
|
|
303
225
|
|
|
@@ -307,8 +229,6 @@ type Class<T, Arguments extends unknown[] = any[]> = {
|
|
|
307
229
|
prototype: Pick<T, keyof T>;
|
|
308
230
|
new (...arguments_: Arguments): T;
|
|
309
231
|
};
|
|
310
|
-
//#endregion
|
|
311
|
-
//#region ../../node_modules/.pnpm/type-fest@5.10.0/node_modules/type-fest/source/union-to-intersection.d.ts
|
|
312
232
|
/**
|
|
313
233
|
Convert a union type to an intersection type.
|
|
314
234
|
|
|
@@ -341,8 +261,6 @@ never
|
|
|
341
261
|
) extends ((mergedIntersection: infer Intersection) => void) ?
|
|
342
262
|
// The `& Union` is to ensure result of `UnionToIntersection<A | B>` is always assignable to `A | B`
|
|
343
263
|
Intersection & Union : never;
|
|
344
|
-
//#endregion
|
|
345
|
-
//#region ../../node_modules/.pnpm/type-fest@5.10.0/node_modules/type-fest/source/keys-of-union.d.ts
|
|
346
264
|
/**
|
|
347
265
|
Create a union of all keys from a given type, even those exclusive to specific union members.
|
|
348
266
|
|
|
@@ -383,8 +301,6 @@ type AllKeys = KeysOfUnion<Union>;
|
|
|
383
301
|
type KeysOfUnion<ObjectType> =
|
|
384
302
|
// Hack to fix https://github.com/sindresorhus/type-fest/issues/1008
|
|
385
303
|
keyof UnionToIntersection<ObjectType extends unknown ? Record<keyof ObjectType, never> : never>;
|
|
386
|
-
//#endregion
|
|
387
|
-
//#region ../../node_modules/.pnpm/type-fest@5.10.0/node_modules/type-fest/source/is-any.d.ts
|
|
388
304
|
/**
|
|
389
305
|
Returns a boolean for whether the given type is `any`.
|
|
390
306
|
|
|
@@ -414,8 +330,6 @@ const anyA = get(anyObject, 'a');
|
|
|
414
330
|
@category Utilities
|
|
415
331
|
*/
|
|
416
332
|
type IsAny<T> = 0 extends 1 & NoInfer<T> ? true : false;
|
|
417
|
-
//#endregion
|
|
418
|
-
//#region ../../node_modules/.pnpm/type-fest@5.10.0/node_modules/type-fest/source/is-optional-key-of.d.ts
|
|
419
333
|
/**
|
|
420
334
|
Returns a boolean for whether the given key is an optional key of type.
|
|
421
335
|
|
|
@@ -457,8 +371,6 @@ type T5 = IsOptionalKeyOf<User | Admin, 'surname'>;
|
|
|
457
371
|
@category Utilities
|
|
458
372
|
*/
|
|
459
373
|
type IsOptionalKeyOf<Type extends object, Key extends keyof Type> = IsAny<Type | Key> extends true ? never : Key extends keyof Type ? Type extends Record<Key, Type[Key]> ? false : true : false;
|
|
460
|
-
//#endregion
|
|
461
|
-
//#region ../../node_modules/.pnpm/type-fest@5.10.0/node_modules/type-fest/source/optional-keys-of.d.ts
|
|
462
374
|
/**
|
|
463
375
|
Extract all optional keys from the given type.
|
|
464
376
|
|
|
@@ -495,8 +407,6 @@ const update2: UpdateOperation<User> = {
|
|
|
495
407
|
type OptionalKeysOf<Type extends object> = Type extends unknown // For distributing `Type`
|
|
496
408
|
? (keyof { [Key in keyof Type as IsOptionalKeyOf<Type, Key> extends false ? never : Key]: never; }) & keyof Type // Intersect with `keyof Type` to ensure result of `OptionalKeysOf<Type>` is always assignable to `keyof Type`
|
|
497
409
|
: never; // Should never happen
|
|
498
|
-
//#endregion
|
|
499
|
-
//#region ../../node_modules/.pnpm/type-fest@5.10.0/node_modules/type-fest/source/required-keys-of.d.ts
|
|
500
410
|
/**
|
|
501
411
|
Extract all required keys from the given type.
|
|
502
412
|
|
|
@@ -529,8 +439,6 @@ const validator3 = createValidation<User>('luckyNumber', value => value > 0);
|
|
|
529
439
|
*/
|
|
530
440
|
type RequiredKeysOf<Type extends object> = Type extends unknown // For distributing `Type`
|
|
531
441
|
? Exclude<keyof Type, OptionalKeysOf<Type>> : never; // Should never happen
|
|
532
|
-
//#endregion
|
|
533
|
-
//#region ../../node_modules/.pnpm/type-fest@5.10.0/node_modules/type-fest/source/is-never.d.ts
|
|
534
442
|
/**
|
|
535
443
|
Returns a boolean for whether the given type is `never`.
|
|
536
444
|
|
|
@@ -585,8 +493,6 @@ type B = IsTrueFixed<never>;
|
|
|
585
493
|
@category Utilities
|
|
586
494
|
*/
|
|
587
495
|
type IsNever<T> = [T] extends [never] ? true : false;
|
|
588
|
-
//#endregion
|
|
589
|
-
//#region ../../node_modules/.pnpm/type-fest@5.10.0/node_modules/type-fest/source/if.d.ts
|
|
590
496
|
/**
|
|
591
497
|
An if-else-like type that resolves depending on whether the given `boolean` type is `true` or `false`.
|
|
592
498
|
|
|
@@ -680,8 +586,6 @@ type Works = IncludesWithoutIf<HundredZeroes, '1'>;
|
|
|
680
586
|
@category Utilities
|
|
681
587
|
*/
|
|
682
588
|
type If<Type extends boolean, IfBranch, ElseBranch> = IsNever<Type> extends true ? ElseBranch : Type extends true ? IfBranch : ElseBranch;
|
|
683
|
-
//#endregion
|
|
684
|
-
//#region ../../node_modules/.pnpm/type-fest@5.10.0/node_modules/type-fest/source/unknown-array.d.ts
|
|
685
589
|
/**
|
|
686
590
|
Represents an array with `unknown` value.
|
|
687
591
|
|
|
@@ -707,8 +611,6 @@ type C = IsArray<string>;
|
|
|
707
611
|
@category Array
|
|
708
612
|
*/
|
|
709
613
|
type UnknownArray = readonly unknown[];
|
|
710
|
-
//#endregion
|
|
711
|
-
//#region ../../node_modules/.pnpm/type-fest@5.10.0/node_modules/type-fest/source/internal/type.d.ts
|
|
712
614
|
/**
|
|
713
615
|
Returns a boolean for whether A is false.
|
|
714
616
|
|
|
@@ -775,8 +677,6 @@ type IfNotAnyOrNever<T, Cases extends {
|
|
|
775
677
|
Indicates the value of `exactOptionalPropertyTypes` compiler option.
|
|
776
678
|
*/
|
|
777
679
|
type IsExactOptionalPropertyTypesEnabled = [(string | undefined)?] extends [string?] ? false : true;
|
|
778
|
-
//#endregion
|
|
779
|
-
//#region ../../node_modules/.pnpm/type-fest@5.10.0/node_modules/type-fest/source/internal/array.d.ts
|
|
780
680
|
/**
|
|
781
681
|
Transforms a tuple type by replacing it's rest element with a single element that has the same type as the rest element, while keeping all the non-rest elements intact.
|
|
782
682
|
|
|
@@ -824,8 +724,6 @@ TArray extends readonly [unknown, ...unknown[]] ? First : If<IsExactOptionalProp
|
|
|
824
724
|
TArray extends readonly [...infer Rest, infer Last] ? _CollapseRestElement<Rest, ForwardAccumulator, [Last, ...BackwardAccumulator]> // Accumulate elements that are present after the rest element.
|
|
825
725
|
: TArray extends readonly [] ? [...ForwardAccumulator, ...BackwardAccumulator] : [...ForwardAccumulator, TArray[number], ...BackwardAccumulator] // Add the rest element between the accumulated elements.
|
|
826
726
|
: never; // Should never happen
|
|
827
|
-
//#endregion
|
|
828
|
-
//#region ../../node_modules/.pnpm/type-fest@5.10.0/node_modules/type-fest/source/internal/characters.d.ts
|
|
829
727
|
type Whitespace = '\t' // '\t'
|
|
830
728
|
| '\n' // '\n'
|
|
831
729
|
| '\v' // '\v'
|
|
@@ -835,8 +733,6 @@ type Whitespace = '\t' // '\t'
|
|
|
835
733
|
| '
' | ' ' | ' ' | ' ' | ' ' | ' ' | ' ' | ' ' | ' ' | ' ' | ' ' | ' ' | ' ' | ' ' | '
' | '
' | ' ' | ' ' | ' ' | '';
|
|
836
734
|
type WordSeparators = '-' | '_' | Whitespace;
|
|
837
735
|
type AsciiPunctuation = '!' | '"' | '#' | '$' | '%' | '&' | '\'' | '(' | ')' | '*' | '+' | ',' | '-' | '.' | '/' | ':' | ';' | '<' | '=' | '>' | '?' | '@' | '[' | '\\' | ']' | '^' | '_' | '`' | '{' | '|' | '}' | '~';
|
|
838
|
-
//#endregion
|
|
839
|
-
//#region ../../node_modules/.pnpm/type-fest@5.10.0/node_modules/type-fest/source/simplify.d.ts
|
|
840
736
|
/**
|
|
841
737
|
Useful to flatten the type output to improve type hints shown in editors. And also to transform an interface into a type to aide with assignability.
|
|
842
738
|
|
|
@@ -896,8 +792,6 @@ fn(someInterface as Simplify<SomeInterface>); // Good: transform an `interface`
|
|
|
896
792
|
@category Object
|
|
897
793
|
*/
|
|
898
794
|
type Simplify<T> = { [KeyType in keyof T]: T[KeyType]; } & {};
|
|
899
|
-
//#endregion
|
|
900
|
-
//#region ../../node_modules/.pnpm/type-fest@5.10.0/node_modules/type-fest/source/is-equal.d.ts
|
|
901
795
|
/**
|
|
902
796
|
Returns a boolean for whether the two given types are equal.
|
|
903
797
|
|
|
@@ -927,8 +821,6 @@ type Includes<Value extends readonly any[], Item> =
|
|
|
927
821
|
type IsEqual<A, B> = [A] extends [B] ? [B] extends [A] ? _IsEqual<A, B> : false : false;
|
|
928
822
|
// This version fails the `equalWrappedTupleIntersectionToBeNeverAndNeverExpanded` test in `test-d/is-equal.ts`.
|
|
929
823
|
type _IsEqual<A, B> = (<G>() => G extends A & G | G ? 1 : 2) extends (<G>() => G extends B & G | G ? 1 : 2) ? true : false;
|
|
930
|
-
//#endregion
|
|
931
|
-
//#region ../../node_modules/.pnpm/type-fest@5.10.0/node_modules/type-fest/source/omit-index-signature.d.ts
|
|
932
824
|
/**
|
|
933
825
|
Omit any index signatures from the given object type, leaving only explicitly defined properties.
|
|
934
826
|
|
|
@@ -1021,8 +913,6 @@ type ExampleWithoutIndexSignatures = OmitIndexSignature<Example>;
|
|
|
1021
913
|
@category Object
|
|
1022
914
|
*/
|
|
1023
915
|
type OmitIndexSignature<ObjectType> = { [KeyType in keyof ObjectType as {} extends Record<KeyType, unknown> ? never : KeyType]: ObjectType[KeyType]; };
|
|
1024
|
-
//#endregion
|
|
1025
|
-
//#region ../../node_modules/.pnpm/type-fest@5.10.0/node_modules/type-fest/source/pick-index-signature.d.ts
|
|
1026
916
|
/**
|
|
1027
917
|
Pick only index signatures from the given object type, leaving out all explicitly defined properties.
|
|
1028
918
|
|
|
@@ -1069,8 +959,6 @@ type ExampleIndexSignature = PickIndexSignature<Example>;
|
|
|
1069
959
|
@category Object
|
|
1070
960
|
*/
|
|
1071
961
|
type PickIndexSignature<ObjectType> = { [KeyType in keyof ObjectType as {} extends Record<KeyType, unknown> ? KeyType : never]: ObjectType[KeyType]; };
|
|
1072
|
-
//#endregion
|
|
1073
|
-
//#region ../../node_modules/.pnpm/type-fest@5.10.0/node_modules/type-fest/source/merge.d.ts
|
|
1074
962
|
// Merges two objects without worrying about index signatures.
|
|
1075
963
|
type SimpleMerge<Destination, Source> = Simplify<{ [Key in keyof Destination as Key extends keyof Source ? never : Key]: Destination[Key]; } & Source>;
|
|
1076
964
|
/**
|
|
@@ -1140,8 +1028,6 @@ type Merge<Destination, Source> = Destination extends unknown // For distributin
|
|
|
1140
1028
|
? If<IsEqual<Destination, Source>, Destination, _Merge<Destination, Source>> : never // Should never happen
|
|
1141
1029
|
: never; // Should never happen
|
|
1142
1030
|
type _Merge<Destination, Source> = Simplify<SimpleMerge<PickIndexSignature<Destination>, PickIndexSignature<Source>> & SimpleMerge<OmitIndexSignature<Destination>, OmitIndexSignature<Source>>>;
|
|
1143
|
-
//#endregion
|
|
1144
|
-
//#region ../../node_modules/.pnpm/type-fest@5.10.0/node_modules/type-fest/source/trim.d.ts
|
|
1145
1031
|
/**
|
|
1146
1032
|
Remove spaces from the left side.
|
|
1147
1033
|
*/
|
|
@@ -1165,8 +1051,6 @@ type Example = Trim<' foo '>;
|
|
|
1165
1051
|
@category Template literal
|
|
1166
1052
|
*/
|
|
1167
1053
|
type Trim<V extends string> = TrimLeft<TrimRight<V>>;
|
|
1168
|
-
//#endregion
|
|
1169
|
-
//#region ../../node_modules/.pnpm/type-fest@5.10.0/node_modules/type-fest/source/some-extend.d.ts
|
|
1170
1054
|
/**
|
|
1171
1055
|
@see {@link SomeExtend}
|
|
1172
1056
|
*/
|
|
@@ -1262,8 +1146,6 @@ type SomeExtend<TArray extends UnknownArray, Type, Options extends SomeExtendOpt
|
|
|
1262
1146
|
type _SomeExtend<TArray extends UnknownArray, Type, Options extends Required<SomeExtendOptions>> = TArray extends readonly [infer First, ...infer Rest] ? IsNever<First> extends true ? Or<Or<IsNever<Type>, IsAny<Type>>, Not<Options['strictNever']>> extends true ?
|
|
1263
1147
|
// If target `Type` is also `never`, or is `any`, or `strictNever` is disabled, return `true`.
|
|
1264
1148
|
true : _SomeExtend<Rest, Type, Options> : First extends Type ? true : _SomeExtend<Rest, Type, Options> : false;
|
|
1265
|
-
//#endregion
|
|
1266
|
-
//#region ../../node_modules/.pnpm/type-fest@5.10.0/node_modules/type-fest/source/or-all.d.ts
|
|
1267
1149
|
/**
|
|
1268
1150
|
Returns a boolean for whether any of the given elements is `true`.
|
|
1269
1151
|
|
|
@@ -1333,8 +1215,6 @@ Note: `OrAll<[]>` evaluates to `false` because there are no `true` elements in a
|
|
|
1333
1215
|
@see {@link AndAll}
|
|
1334
1216
|
*/
|
|
1335
1217
|
type OrAll<T extends readonly boolean[]> = SomeExtend<T, true>;
|
|
1336
|
-
//#endregion
|
|
1337
|
-
//#region ../../node_modules/.pnpm/type-fest@5.10.0/node_modules/type-fest/source/or.d.ts
|
|
1338
1218
|
/**
|
|
1339
1219
|
Returns a boolean for whether either of two given types is `true`.
|
|
1340
1220
|
|
|
@@ -1413,8 +1293,6 @@ type G = Or<never, never>;
|
|
|
1413
1293
|
@see {@link Xor}
|
|
1414
1294
|
*/
|
|
1415
1295
|
type Or<A extends boolean, B extends boolean> = OrAll<[A, B]>;
|
|
1416
|
-
//#endregion
|
|
1417
|
-
//#region ../../node_modules/.pnpm/type-fest@5.10.0/node_modules/type-fest/source/internal/string.d.ts
|
|
1418
1296
|
/**
|
|
1419
1297
|
Returns a boolean for whether the given string `S` starts with the given string `SearchString`.
|
|
1420
1298
|
|
|
@@ -1443,8 +1321,6 @@ Returns a boolean for whether the string is numeric.
|
|
|
1443
1321
|
This type is a workaround for [Microsoft/TypeScript#46109](https://github.com/microsoft/TypeScript/issues/46109#issuecomment-930307987).
|
|
1444
1322
|
*/
|
|
1445
1323
|
type IsNumeric<T extends string> = T extends `${number}` ? Trim<T> extends T ? true : false : false;
|
|
1446
|
-
//#endregion
|
|
1447
|
-
//#region ../../node_modules/.pnpm/type-fest@5.10.0/node_modules/type-fest/source/internal/object.d.ts
|
|
1448
1324
|
/**
|
|
1449
1325
|
Merges user specified options with default options.
|
|
1450
1326
|
|
|
@@ -1552,8 +1428,6 @@ type UnwrapBrand<T> = IfNotAnyOrNever<T, {
|
|
|
1552
1428
|
ifNot: _UnwrapBrand<T, Primitive>;
|
|
1553
1429
|
}>;
|
|
1554
1430
|
type _UnwrapBrand<T, Base> = T extends Primitive ? T extends (infer U) & Pick<T, Exclude<keyof T, KeysOfUnion<Base>>> ? U : T : T;
|
|
1555
|
-
//#endregion
|
|
1556
|
-
//#region ../../node_modules/.pnpm/type-fest@5.10.0/node_modules/type-fest/source/is-string-literal.d.ts
|
|
1557
1431
|
/**
|
|
1558
1432
|
Returns a boolean for whether the given type is a `string` [literal type](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#literal-types).
|
|
1559
1433
|
|
|
@@ -1616,8 +1490,6 @@ type _IsStringLiteral<S> =
|
|
|
1616
1490
|
// If `S` is an infinite string type (e.g., `on${string}`), `Record<S, never>` produces an index signature,
|
|
1617
1491
|
// and since `{}` extends index signatures, the result becomes `false`.
|
|
1618
1492
|
S extends string ? {} extends Record<S, never> ? false : true : false;
|
|
1619
|
-
//#endregion
|
|
1620
|
-
//#region ../../node_modules/.pnpm/type-fest@5.10.0/node_modules/type-fest/source/all-extend.d.ts
|
|
1621
1493
|
/**
|
|
1622
1494
|
@see {@link AllExtend}
|
|
1623
1495
|
*/
|
|
@@ -1719,8 +1591,6 @@ type AllExtend<TArray extends UnknownArray, Type, Options extends AllExtendOptio
|
|
|
1719
1591
|
type _AllExtend<TArray extends UnknownArray, Type, Options extends Required<AllExtendOptions>> = TArray extends readonly [infer First, ...infer Rest] ? IsNever<First> extends true ? Or<Or<IsNever<Type>, IsAny<Type>>, Not<Options['strictNever']>> extends true ?
|
|
1720
1592
|
// If target `Type` is also `never`, or is `any`, or `strictNever` is disabled, recurse further.
|
|
1721
1593
|
_AllExtend<Rest, Type, Options> : false : First extends Type ? _AllExtend<Rest, Type, Options> : false : true;
|
|
1722
|
-
//#endregion
|
|
1723
|
-
//#region ../../node_modules/.pnpm/type-fest@5.10.0/node_modules/type-fest/source/promisable.d.ts
|
|
1724
1594
|
/**
|
|
1725
1595
|
Create a type that represents either the value or the value wrapped in `PromiseLike`.
|
|
1726
1596
|
|
|
@@ -1746,8 +1616,6 @@ await logger(() => Promise.resolve('bar'));
|
|
|
1746
1616
|
@category Async
|
|
1747
1617
|
*/
|
|
1748
1618
|
type Promisable<T> = T | PromiseLike<T>;
|
|
1749
|
-
//#endregion
|
|
1750
|
-
//#region ../../node_modules/.pnpm/type-fest@5.10.0/node_modules/type-fest/source/is-lowercase.d.ts
|
|
1751
1619
|
/**
|
|
1752
1620
|
Returns a boolean for whether the given string literal is lowercase.
|
|
1753
1621
|
|
|
@@ -1774,8 +1642,6 @@ type _IsLowercase<S extends string, Accumulator extends boolean[] = []> = S exte
|
|
|
1774
1642
|
Returns a boolean for whether an individual part of the string is lowercase.
|
|
1775
1643
|
*/
|
|
1776
1644
|
type IsLowercaseHelper<S extends string> = S extends Lowercase<string> ? true : S extends Uppercase<string> | Capitalize<string> | `${string}${Uppercase<string>}${string}` ? false : boolean;
|
|
1777
|
-
//#endregion
|
|
1778
|
-
//#region ../../node_modules/.pnpm/type-fest@5.10.0/node_modules/type-fest/source/is-uppercase.d.ts
|
|
1779
1645
|
/**
|
|
1780
1646
|
Returns a boolean for whether the given string literal is uppercase.
|
|
1781
1647
|
|
|
@@ -1802,8 +1668,6 @@ type _IsUppercase<S extends string, Accumulator extends boolean[] = []> = S exte
|
|
|
1802
1668
|
Returns a boolean for whether an individual part of the string is uppercase.
|
|
1803
1669
|
*/
|
|
1804
1670
|
type IsUppercaseHelper<S extends string> = S extends Uppercase<string> ? true : S extends Lowercase<string> | Uncapitalize<string> | `${string}${Lowercase<string>}${string}` ? false : boolean;
|
|
1805
|
-
//#endregion
|
|
1806
|
-
//#region ../../node_modules/.pnpm/type-fest@5.10.0/node_modules/type-fest/source/words.d.ts
|
|
1807
1671
|
type SkipEmptyWord<Word extends string> = Word extends '' ? [] : [Word];
|
|
1808
1672
|
type RemoveLastCharacter<Sentence extends string, Character extends string> = Sentence extends `${infer LeftSide}${Character}` ? SkipEmptyWord<LeftSide> : never;
|
|
1809
1673
|
/**
|
|
@@ -1918,8 +1782,6 @@ WordsImplementation<RemainingCharacters, Options, FirstCharacter, `${CurrentWord
|
|
|
1918
1782
|
[true, true] extends [IsUppercase<LastCharacter>, IsLowercase<FirstCharacter>] ? [...RemoveLastCharacter<CurrentWord, LastCharacter>, ...WordsImplementation<RemainingCharacters, Options, FirstCharacter, `${LastCharacter}${FirstCharacter}`>] :
|
|
1919
1783
|
// No case change: concat word
|
|
1920
1784
|
WordsImplementation<RemainingCharacters, Options, FirstCharacter, `${CurrentWord}${FirstCharacter}`> : [...SkipEmptyWord<CurrentWord>];
|
|
1921
|
-
//#endregion
|
|
1922
|
-
//#region ../../node_modules/.pnpm/type-fest@5.10.0/node_modules/type-fest/source/delimiter-case.d.ts
|
|
1923
1785
|
type _DefaultDelimiterCaseOptions = Merge<_DefaultWordsOptions, {
|
|
1924
1786
|
splitOnNumbers: false;
|
|
1925
1787
|
}>;
|
|
@@ -1969,8 +1831,6 @@ const rawCliOptions: OddlyCasedProperties<SomeOptions> = {
|
|
|
1969
1831
|
*/
|
|
1970
1832
|
type DelimiterCase<Value, Delimiter extends string, Options extends WordsOptions = {}> = Value extends string ? Delimiter extends string // For distributing `Delimiter`
|
|
1971
1833
|
? IsStringLiteral<Value> extends false ? Value : Lowercase<DelimiterCaseFromArray<Words<Value, ApplyDefaultOptions<WordsOptions, _DefaultDelimiterCaseOptions, Options>>, Delimiter>> : never : Value;
|
|
1972
|
-
//#endregion
|
|
1973
|
-
//#region ../../node_modules/.pnpm/type-fest@5.10.0/node_modules/type-fest/source/kebab-case.d.ts
|
|
1974
1834
|
/**
|
|
1975
1835
|
Convert a string literal to kebab-case.
|
|
1976
1836
|
|
|
@@ -2009,157 +1869,91 @@ const rawCliOptions: KebabCasedProperties<CliOptions> = {
|
|
|
2009
1869
|
@category Template literal
|
|
2010
1870
|
*/
|
|
2011
1871
|
type KebabCase<Value, Options extends WordsOptions = {}> = DelimiterCase<Value, '-', ApplyDefaultOptions<WordsOptions, _DefaultDelimiterCaseOptions, Options>>;
|
|
2012
|
-
//#endregion
|
|
2013
|
-
//#region src/models/shared/ItemMetadataClass.d.ts
|
|
2014
1872
|
export interface ItemMetadataClass<TBase extends Class<object>> {
|
|
2015
1873
|
new (...args: ConstructorParameters<TBase>): InstanceType<TBase> & ItemMetadata;
|
|
2016
1874
|
prototype: InstanceType<TBase> & ItemMetadata;
|
|
2017
1875
|
}
|
|
2018
|
-
|
|
2019
|
-
|
|
1876
|
+
export type GetArrayProps<T extends unknown[], P extends string, D extends unknown[], R extends boolean> = (D extends [unknown, ...infer Rest] ? GetProperties<T[number], R extends true ? `${P}[number]` : `${P}.[number]`, Rest, false> : never) | {
|
|
1877
|
+
path: R extends true ? "length" : `${P}.length`;
|
|
1878
|
+
value: T["length"];
|
|
1879
|
+
};
|
|
1880
|
+
export type FunctionLike = ((...args: never) => unknown) | (abstract new (...args: never) => unknown);
|
|
1881
|
+
export type KnownKeys<T> = { [K in keyof T as string extends K ? never : number extends K ? never : K]: T[K]; };
|
|
1882
|
+
export type GetObjectProps<T, P extends string, D extends unknown[], R extends boolean> = { [K in keyof KnownKeys<T> & (number | string)]: K extends `${number}` ? never : NonNullable<T[K]> extends FunctionLike ? never : (D extends [unknown, ...infer Rest] ? GetProperties<T[K], R extends true ? `${K}` : `${P}.${K}`, Rest, false> : never) | {
|
|
1883
|
+
path: R extends true ? `${K}` : `${P}.${K}`;
|
|
1884
|
+
value: T[K];
|
|
1885
|
+
}; }[keyof KnownKeys<T> & (number | string)];
|
|
1886
|
+
export type GetPrimitiveProps<T, P extends string, D extends unknown[], R extends boolean> = T extends string ? {
|
|
1887
|
+
path: R extends true ? "length" : `${P}.length`;
|
|
1888
|
+
value: number;
|
|
1889
|
+
} : T extends symbol ? (D extends [unknown, ...infer Rest] ? GetProperties<string | undefined, R extends true ? "description" : `${P}.description`, Rest, false> : never) | {
|
|
1890
|
+
path: R extends true ? "description" : `${P}.description`;
|
|
1891
|
+
value: string | undefined;
|
|
1892
|
+
} : never;
|
|
1893
|
+
export type GetProperties<T, P extends string = "", D extends unknown[] = [unknown, unknown, unknown, unknown, unknown], R extends boolean = true> = [T] extends [never] ? never : D extends [] ? never : NonNullable<T> extends (infer O) ? O extends unknown[] ? GetArrayProps<O, P, D, R> : O extends object ? GetObjectProps<O, P, D, R> : GetPrimitiveProps<O, P, D, R> : never;
|
|
1894
|
+
export type GetPaths<T> = GetProperties<T> extends (infer U) ? (U extends {
|
|
1895
|
+
path: infer Path;
|
|
1896
|
+
} ? Path : never) : never;
|
|
1897
|
+
export type PropertyNames<T> = { [P in GetPaths<T>]: P; };
|
|
1898
|
+
export declare const ItemMetadataPropertyNames: PropertyNames<ItemMetadata>;
|
|
2020
1899
|
export declare abstract class Serializable {
|
|
2021
1900
|
toJSON(): this;
|
|
2022
1901
|
}
|
|
2023
|
-
//#endregion
|
|
2024
|
-
//#region src/models/shared/TakeOne.d.ts
|
|
2025
1902
|
export interface TakeOne {
|
|
2026
1903
|
<T extends readonly unknown[]>(values: T, index?: number): T[number];
|
|
2027
1904
|
<T extends object>(values: T, index: keyof T): T[keyof T];
|
|
2028
1905
|
}
|
|
2029
|
-
//#endregion
|
|
2030
|
-
//#region src/util/types/FunctionLike.d.ts
|
|
2031
|
-
export type FunctionLike = ((...args: never) => unknown) | (abstract new (...args: never) => unknown);
|
|
2032
|
-
//#endregion
|
|
2033
|
-
//#region src/util/types/DeepOmit.d.ts
|
|
2034
1906
|
export type DeepOmit<T, TKey extends PropertyKey> = T extends DeepOmitKeptValue ? T : T extends readonly unknown[] ? { [K in keyof T]: DeepOmit<T[K], TKey>; } : T extends object ? [keyof T] extends [never] ? T : { [P in keyof T as P extends symbol ? never : P extends TKey ? never : P]: DeepOmit<T[P], TKey>; } : T;
|
|
2035
1907
|
type DeepOmitKeptValue = ArrayBufferView | Blob | Date | FunctionLike | Map<unknown, unknown> | Primitive | Promise<unknown> | RegExp | Set<unknown>;
|
|
2036
|
-
//#endregion
|
|
2037
|
-
//#region src/util/types/DeepOptionalUndefined.d.ts
|
|
2038
1908
|
export type DeepOptionalUndefined<T> = T extends Date | FunctionLike | Primitive ? T : T extends unknown[] ? { [K in keyof T]: DeepOptionalUndefined<T[K]>; } : T extends object ? { [K in keyof T as undefined extends T[K] ? K : never]?: DeepOptionalUndefined<T[K]>; } & { [K in keyof T as undefined extends T[K] ? never : K]: DeepOptionalUndefined<T[K]>; } extends (infer O) ? { [K in keyof O]: O[K]; } : never : T;
|
|
2039
|
-
//#endregion
|
|
2040
|
-
//#region src/models/shared/ToData.d.ts
|
|
2041
1909
|
export type ToData<T> = DeepOptionalUndefined<DeepOmit<T, "toJSON">>;
|
|
2042
|
-
//#endregion
|
|
2043
|
-
//#region src/models/text/DedentOptions.d.ts
|
|
2044
1910
|
export interface DedentOptions {
|
|
2045
1911
|
alignValues?: boolean;
|
|
2046
1912
|
escapeSpecialCharacters?: boolean;
|
|
2047
1913
|
trimWhitespace?: boolean;
|
|
2048
1914
|
}
|
|
2049
|
-
//#endregion
|
|
2050
|
-
//#region src/models/text/Dedent.d.ts
|
|
2051
1915
|
export interface Dedent {
|
|
2052
1916
|
(strings: string | TemplateStringsArray, ...values: unknown[]): string;
|
|
2053
1917
|
withOptions: (options: DedentOptions) => Dedent;
|
|
2054
1918
|
}
|
|
2055
|
-
//#endregion
|
|
2056
|
-
//#region src/models/zod/UniqueArraySchemaKey.d.ts
|
|
2057
1919
|
export type UniqueArraySchemaKey<TSchema extends z.ZodType> = TSchema extends z.ZodObject ? keyof TSchema["shape"] & string : keyof z.output<TSchema> & string;
|
|
2058
|
-
//#endregion
|
|
2059
|
-
//#region src/models/zod/CreateUniqueArraySchema.d.ts
|
|
2060
1920
|
export type CreateUniqueArraySchema = (<TOutput extends object, TInput, TSchema extends z.ZodType<TOutput, TInput>>(schema: TSchema, key: readonly UniqueArraySchemaKey<TSchema>[] | UniqueArraySchemaKey<TSchema>) => z.ZodArray<TSchema>) & (<TOutput extends Primitive, TInput, TSchema extends z.ZodType<TOutput, TInput>>(schema: TSchema) => z.ZodArray<TSchema>);
|
|
2061
|
-
//#endregion
|
|
2062
|
-
//#region src/services/app/constants.d.ts
|
|
2063
1921
|
export declare const MAX_READ_LIMIT = 1e3;
|
|
2064
1922
|
export declare const SITE_NAME = "Esposter";
|
|
2065
1923
|
export declare const KIBIBYTE: number;
|
|
2066
1924
|
export declare const GIBIBYTE: number;
|
|
2067
|
-
//#endregion
|
|
2068
|
-
//#region src/services/error/getResult.d.ts
|
|
2069
1925
|
export declare const getResult: <T>(callback: () => T) => Result<T, Error>;
|
|
2070
|
-
//#endregion
|
|
2071
|
-
//#region src/services/error/getResultAsync.d.ts
|
|
2072
1926
|
export declare const getResultAsync: <T>(callback: () => Promise<T>) => ResultAsync<T, Error>;
|
|
2073
|
-
//#endregion
|
|
2074
|
-
//#region src/services/error/reportFinalizerError.d.ts
|
|
2075
1927
|
export declare const reportFinalizerError: <T, E>(callbackResult: Result<T, E>, finalizerError: unknown) => void;
|
|
2076
|
-
//#endregion
|
|
2077
|
-
//#region src/services/error/toAppError.d.ts
|
|
2078
1928
|
export declare const toAppError: (error: unknown) => Error;
|
|
2079
|
-
//#endregion
|
|
2080
|
-
//#region src/services/error/withFinalizer.d.ts
|
|
2081
1929
|
export declare const withFinalizer: <T>(callback: () => T, finalizer?: () => void) => T;
|
|
2082
|
-
//#endregion
|
|
2083
|
-
//#region src/services/error/withFinalizerAsync.d.ts
|
|
2084
1930
|
export declare const withFinalizerAsync: <T>(callback: () => Promisable<T>, finalizer?: () => Promisable<void>) => Promise<T>;
|
|
2085
|
-
//#endregion
|
|
2086
|
-
//#region src/services/history/createHistory.d.ts
|
|
2087
1931
|
export declare const createHistory: <T>(limit: number) => History<T>;
|
|
2088
|
-
//#endregion
|
|
2089
|
-
//#region src/services/history/pushHistory.d.ts
|
|
2090
1932
|
export declare const pushHistory: <T>(history: History<T>, entry: T) => History<T>;
|
|
2091
|
-
//#endregion
|
|
2092
|
-
//#region src/services/history/redoHistory.d.ts
|
|
2093
1933
|
export declare const redoHistory: <T>(history: History<T>) => HistoryStep<T>;
|
|
2094
|
-
//#endregion
|
|
2095
|
-
//#region src/services/history/undoHistory.d.ts
|
|
2096
1934
|
export declare const undoHistory: <T>(history: History<T>) => HistoryStep<T>;
|
|
2097
|
-
//#endregion
|
|
2098
|
-
//#region src/services/indexedDb/getRequestError.d.ts
|
|
2099
1935
|
export declare const getRequestError: (request: IDBRequest) => DOMException;
|
|
2100
|
-
//#endregion
|
|
2101
|
-
//#region src/services/indexedDb/getTransactionDone.d.ts
|
|
2102
1936
|
export declare const getTransactionDone: (transaction: IDBTransaction) => Promise<void>;
|
|
2103
|
-
//#endregion
|
|
2104
|
-
//#region src/services/indexedDb/getTransactionObjectStore.d.ts
|
|
2105
1937
|
export declare const getTransactionObjectStore: <TSchema extends DatabaseSchema, TMode extends IDBTransactionMode>(transaction: IDBTransaction) => <TStoreName extends DatabaseStoreName<TSchema>>(name: TStoreName) => DatabaseObjectStore<TSchema, TStoreName, TMode>;
|
|
2106
|
-
//#endregion
|
|
2107
|
-
//#region src/services/indexedDb/openDatabase.d.ts
|
|
2108
1938
|
export declare const openDatabase: <TSchema extends DatabaseSchema = DatabaseSchema>(name: string, version: number, options?: DatabaseOpenOptions<TSchema>) => Promise<Database<TSchema>>;
|
|
2109
|
-
//#endregion
|
|
2110
|
-
//#region src/services/indexedDb/requestToPromise.d.ts
|
|
2111
1939
|
export declare const requestToPromise: <TResult>(request: IDBRequest) => Promise<TResult>;
|
|
2112
|
-
//#endregion
|
|
2113
|
-
//#region src/services/indexedDb/wrapDatabase.d.ts
|
|
2114
1940
|
export declare const wrapDatabase: <TSchema extends DatabaseSchema = DatabaseSchema>(database: IDBDatabase) => Database<TSchema>;
|
|
2115
|
-
//#endregion
|
|
2116
|
-
//#region src/services/indexedDb/wrapIndex.d.ts
|
|
2117
1941
|
export declare const wrapIndex: <TSchema extends DatabaseSchema, TStoreName extends DatabaseStoreName<TSchema>, TIndexName extends DatabaseIndexName<TSchema, TStoreName>>(index: IDBIndex) => DatabaseIndex<TSchema, TStoreName, TIndexName>;
|
|
2118
|
-
//#endregion
|
|
2119
|
-
//#region src/services/indexedDb/wrapObjectStore.d.ts
|
|
2120
1942
|
export declare const wrapObjectStore: <TSchema extends DatabaseSchema, TStoreName extends DatabaseStoreName<TSchema>, TMode extends IDBTransactionMode>(objectStore: IDBObjectStore) => DatabaseObjectStore<TSchema, TStoreName, TMode>;
|
|
2121
|
-
//#endregion
|
|
2122
|
-
//#region src/services/indexedDb/wrapTransaction.d.ts
|
|
2123
1943
|
export declare const wrapTransaction: <TSchema extends DatabaseSchema, TStoreName extends DatabaseStoreName<TSchema>, TMode extends IDBTransactionMode>(transaction: IDBTransaction) => DatabaseTransaction<TSchema, TStoreName, TMode>;
|
|
2124
|
-
//#endregion
|
|
2125
|
-
//#region src/services/indexedDb/wrapUpgradeDatabase.d.ts
|
|
2126
1944
|
export declare const wrapUpgradeDatabase: <TSchema extends DatabaseSchema = DatabaseSchema>(database: IDBDatabase) => UpgradeDatabase<TSchema>;
|
|
2127
|
-
//#endregion
|
|
2128
|
-
//#region src/services/indexedDb/wrapUpgradeTransaction.d.ts
|
|
2129
1945
|
export declare const wrapUpgradeTransaction: <TSchema extends DatabaseSchema>(transaction: IDBTransaction) => DatabaseTransaction<TSchema, DatabaseStoreName<TSchema>, "versionchange">;
|
|
2130
|
-
//#endregion
|
|
2131
|
-
//#region src/services/jsonPatch/addJsonValue.d.ts
|
|
2132
1946
|
export declare const addJsonValue: (document: unknown, path: string, value: unknown) => ApplyPatchesResult<unknown>;
|
|
2133
|
-
//#endregion
|
|
2134
|
-
//#region src/services/jsonPatch/applyPatch.d.ts
|
|
2135
1947
|
export declare const applyPatch: (document: unknown, operation: JsonPatchOperation) => ApplyPatchesResult<unknown>;
|
|
2136
|
-
//#endregion
|
|
2137
|
-
//#region src/services/jsonPatch/applyPatches.d.ts
|
|
2138
1948
|
export declare const applyPatches: <T>(document: T, operations: JsonPatchOperation[]) => ApplyPatchesResult<T>;
|
|
2139
|
-
//#endregion
|
|
2140
|
-
//#region src/services/jsonPatch/constants.d.ts
|
|
2141
1949
|
export declare const APPEND_SEGMENT = "-";
|
|
2142
1950
|
export declare const JSON_POINTER_REGEX: RegExp;
|
|
2143
|
-
//#endregion
|
|
2144
|
-
//#region src/services/jsonPatch/parseArrayIndex.d.ts
|
|
2145
1951
|
export declare const parseArrayIndex: (segment: string, maxIndex: number) => number | undefined;
|
|
2146
|
-
//#endregion
|
|
2147
|
-
//#region src/services/jsonPatch/parseJsonPointer.d.ts
|
|
2148
1952
|
export declare const parseJsonPointer: (pointer: string) => string[];
|
|
2149
|
-
//#endregion
|
|
2150
|
-
//#region src/services/jsonPatch/readJsonValue.d.ts
|
|
2151
1953
|
export declare const readJsonValue: (document: unknown, segments: string[]) => unknown;
|
|
2152
|
-
//#endregion
|
|
2153
|
-
//#region src/services/jsonPatch/removeJsonValue.d.ts
|
|
2154
1954
|
export declare const removeJsonValue: (document: unknown, path: string) => ApplyPatchesResult<unknown>;
|
|
2155
|
-
//#endregion
|
|
2156
|
-
//#region src/services/jsonPatch/toJsonPointer.d.ts
|
|
2157
1955
|
export declare const toJsonPointer: (segments: string[]) => string;
|
|
2158
|
-
//#endregion
|
|
2159
|
-
//#region src/services/jsonPatch/updateJsonValue.d.ts
|
|
2160
1956
|
export declare const updateJsonValue: (document: unknown, segments: string[], update: (value: unknown) => unknown) => unknown;
|
|
2161
|
-
//#endregion
|
|
2162
|
-
//#region src/services/message/constants.d.ts
|
|
2163
1957
|
export declare const MENTION_ID_ATTRIBUTE = "data-id";
|
|
2164
1958
|
export declare const MENTION_ITEM_TYPE_ATTRIBUTE = "data-mention-type";
|
|
2165
1959
|
export declare const MENTION_LABEL_ATTRIBUTE = "data-label";
|
|
@@ -2172,14 +1966,10 @@ export declare const CUSTOM_EMOJI_ID_ATTRIBUTE = "data-custom-emoji-id";
|
|
|
2172
1966
|
export declare const CUSTOM_EMOJI_NAME_ATTRIBUTE = "data-custom-emoji-name";
|
|
2173
1967
|
export declare const SPOILER_ATTRIBUTE = "data-spoiler";
|
|
2174
1968
|
export declare const SPOILER_SELECTOR: string;
|
|
2175
|
-
|
|
2176
|
-
|
|
1969
|
+
export declare const checkIsOnlyReactor: (userIds: string[], userId: string) => boolean;
|
|
1970
|
+
export declare const getUpdatedUserIds: (userIds: string[], newUserId: string) => string[];
|
|
2177
1971
|
export declare const getMentions: (message: string) => HTMLElement[];
|
|
2178
|
-
//#endregion
|
|
2179
|
-
//#region src/services/mime/charset.d.ts
|
|
2180
1972
|
export declare const charset: (type: string) => false | string;
|
|
2181
|
-
//#endregion
|
|
2182
|
-
//#region src/services/mime/constants.d.ts
|
|
2183
1973
|
export declare const MEDIA_TYPE_REGEX: RegExp;
|
|
2184
1974
|
export declare const PATH_SEPARATOR_REGEX: RegExp;
|
|
2185
1975
|
export declare const TEXT_MEDIA_TYPE_REGEX: RegExp;
|
|
@@ -2191,53 +1981,22 @@ export declare const SourceScoreMap: ReadonlyMap<string, number>;
|
|
|
2191
1981
|
export declare const DEFAULT_SOURCE_SCORE = 30;
|
|
2192
1982
|
export declare const TypeScoreMap: ReadonlyMap<string, number>;
|
|
2193
1983
|
export declare const DEFAULT_TYPE_SCORE = 0;
|
|
2194
|
-
//#endregion
|
|
2195
|
-
//#region src/services/mime/contentType.d.ts
|
|
2196
1984
|
export declare const contentType: (value: string) => false | string;
|
|
2197
|
-
//#endregion
|
|
2198
|
-
//#region src/services/mime/extension.d.ts
|
|
2199
1985
|
export declare const extension: (type: string) => false | string;
|
|
2200
|
-
//#endregion
|
|
2201
|
-
//#region src/services/mime/getExtensionMimeTypeMap.d.ts
|
|
2202
1986
|
export declare const getExtensionMimeTypeMap: () => ReadonlyMap<string, string>;
|
|
2203
|
-
//#endregion
|
|
2204
|
-
//#region src/services/mime/getMediaType.d.ts
|
|
2205
1987
|
export declare const getMediaType: (value: string) => string;
|
|
2206
|
-
//#endregion
|
|
2207
|
-
//#region src/services/mime/getMimeScore.d.ts
|
|
2208
1988
|
export declare const getMimeScore: (mimeType: string, source?: string) => number;
|
|
2209
|
-
//#endregion
|
|
2210
|
-
//#region src/services/mime/getMimeTypeEntryMap.d.ts
|
|
2211
1989
|
export declare const getMimeTypeEntryMap: () => ReadonlyMap<string, MimeDatabaseEntry>;
|
|
2212
|
-
//#endregion
|
|
2213
|
-
//#region src/services/mime/lookup.d.ts
|
|
2214
1990
|
export declare const lookup: (path: string) => false | string;
|
|
2215
|
-
//#endregion
|
|
2216
|
-
//#region src/services/prettier/css.d.ts
|
|
2217
1991
|
export declare const css: typeof String.raw;
|
|
2218
|
-
//#endregion
|
|
2219
|
-
//#region src/services/prettier/html.d.ts
|
|
2220
1992
|
export declare const html: typeof String.raw;
|
|
2221
|
-
//#endregion
|
|
2222
|
-
//#region src/services/profanity/checkContainsProfanity.d.ts
|
|
2223
1993
|
export declare const checkContainsProfanity: (text: unknown, { isWholeWord }?: Partial<ProfanityOptions>) => boolean;
|
|
2224
|
-
//#endregion
|
|
2225
|
-
//#region src/services/profanity/englishProfaneWords.d.ts
|
|
2226
1994
|
export declare const englishProfaneWords: readonly string[];
|
|
2227
|
-
//#endregion
|
|
2228
|
-
//#region src/services/sanitizeHtml/checkIsAllowedUrl.d.ts
|
|
2229
1995
|
export declare const checkIsAllowedUrl: (url: string, allowedSchemes: string[]) => boolean;
|
|
2230
|
-
|
|
2231
|
-
//#region src/services/sanitizeHtml/checkIsUnsafeUrlCharacter.d.ts
|
|
1996
|
+
export declare const checkIsSourceAllowed: (element: DefaultTreeAdapterTypes.Element, allowedSources: SanitizePolicy["allowedSources"]) => boolean;
|
|
2232
1997
|
export declare const checkIsUnsafeUrlCharacter: (character: string) => boolean;
|
|
2233
|
-
//#endregion
|
|
2234
|
-
//#region src/services/sanitizeHtml/checkIsWhitespaceCharacter.d.ts
|
|
2235
1998
|
export declare const checkIsWhitespaceCharacter: (character: string) => boolean;
|
|
2236
|
-
//#endregion
|
|
2237
|
-
//#region src/services/sanitizeHtml/collectText.d.ts
|
|
2238
1999
|
export declare const collectText: (nodes: DefaultTreeAdapterTypes.ChildNode[], depth: number) => string;
|
|
2239
|
-
//#endregion
|
|
2240
|
-
//#region src/services/sanitizeHtml/constants.d.ts
|
|
2241
2000
|
export declare const HTML_NAMESPACE: html$1.NS;
|
|
2242
2001
|
export declare const DEFAULT_ALLOWED_TAGS: string[];
|
|
2243
2002
|
export declare const DEFAULT_LINK_ATTRIBUTES: string[];
|
|
@@ -2252,242 +2011,79 @@ export declare const MAX_NESTING_DEPTH = 256;
|
|
|
2252
2011
|
export declare const SRCSET_DESCRIPTOR_REGEX: RegExp;
|
|
2253
2012
|
export declare const ESCAPED_TEXT_CHARACTERS_REGEX: RegExp;
|
|
2254
2013
|
export declare const ESCAPED_ATTRIBUTE_CHARACTERS_REGEX: RegExp;
|
|
2255
|
-
export declare const SANITIZER_ADVISORY_WATCH_SINCE = "2026-10-
|
|
2256
|
-
//#endregion
|
|
2257
|
-
//#region src/services/sanitizeHtml/escapeAttribute.d.ts
|
|
2014
|
+
export declare const SANITIZER_ADVISORY_WATCH_SINCE = "2026-10-23";
|
|
2258
2015
|
export declare const escapeAttribute: (value: string) => string;
|
|
2259
|
-
//#endregion
|
|
2260
|
-
//#region src/services/sanitizeHtml/escapeCharacters.d.ts
|
|
2261
2016
|
export declare const escapeCharacters: (value: string, charactersRegex: RegExp, entities: Record<string, string>) => string;
|
|
2262
|
-
//#endregion
|
|
2263
|
-
//#region src/services/sanitizeHtml/escapeText.d.ts
|
|
2264
2017
|
export declare const escapeText: (text: string) => string;
|
|
2265
|
-
//#endregion
|
|
2266
|
-
//#region src/services/sanitizeHtml/filterAttributes.d.ts
|
|
2267
2018
|
export declare const filterAttributes: (element: DefaultTreeAdapterTypes.Element, policy: SanitizePolicy) => Record<string, string>;
|
|
2268
|
-
//#endregion
|
|
2269
|
-
//#region src/services/sanitizeHtml/filterClasses.d.ts
|
|
2270
2019
|
export declare const filterClasses: (value: string, patterns: string[] | undefined) => string | undefined;
|
|
2271
|
-
//#endregion
|
|
2272
|
-
//#region src/services/sanitizeHtml/filterHtml.d.ts
|
|
2273
2020
|
export declare const filterHtml: (html: string, policy: SanitizePolicy) => string;
|
|
2274
|
-
//#endregion
|
|
2275
|
-
//#region src/services/sanitizeHtml/filterSrcset.d.ts
|
|
2276
2021
|
export declare const filterSrcset: (value: string, allowedSchemes: string[]) => string | undefined;
|
|
2277
|
-
//#endregion
|
|
2278
|
-
//#region src/services/sanitizeHtml/filterStyle.d.ts
|
|
2279
2022
|
export declare const filterStyle: (value: string, rules: Record<string, RegExp[]> | undefined) => string | undefined;
|
|
2280
|
-
//#endregion
|
|
2281
|
-
//#region src/services/sanitizeHtml/getChildNodes.d.ts
|
|
2282
2023
|
export declare const getChildNodes: (element: DefaultTreeAdapterTypes.Element) => DefaultTreeAdapterTypes.ChildNode[];
|
|
2283
|
-
|
|
2284
|
-
//#region src/services/sanitizeHtml/matchesClassPattern.d.ts
|
|
2024
|
+
export declare const getTagPolicy: <T>(tagPolicies: Record<string, T>, tagName: string) => T | undefined;
|
|
2285
2025
|
export declare const matchesClassPattern: (className: string, pattern: string) => boolean;
|
|
2286
|
-
//#endregion
|
|
2287
|
-
//#region src/services/sanitizeHtml/renderNode.d.ts
|
|
2288
2026
|
export declare const renderNode: (node: DefaultTreeAdapterTypes.ChildNode, policy: SanitizePolicy, depth: number) => string;
|
|
2289
|
-
//#endregion
|
|
2290
|
-
//#region src/services/sanitizeHtml/sanitizeHtml.d.ts
|
|
2291
2027
|
export declare const sanitizeHtml: (html: string, options?: SanitizeHtmlOptions) => string;
|
|
2292
|
-
|
|
2293
|
-
//#region src/services/sanitizeHtml/sanitizeTextHtml.d.ts
|
|
2294
|
-
export declare const sanitizeTextHtml: (html: string) => string;
|
|
2295
|
-
//#endregion
|
|
2296
|
-
//#region src/services/shared/applyItemMetadataMixin.d.ts
|
|
2028
|
+
export declare const sanitizeTextHtml: (html: string, allowance?: TextHtmlAllowance) => string;
|
|
2297
2029
|
export declare const applyItemMetadataMixin: <TBase extends Class<object>>(Base: TBase) => ItemMetadataClass<TBase>;
|
|
2298
|
-
//#endregion
|
|
2299
|
-
//#region src/services/zod/createNormalizedStringSchema.d.ts
|
|
2300
2030
|
export declare const createNormalizedStringSchema: (maxLength: number, schema?: z.ZodString) => z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodString>;
|
|
2301
|
-
//#endregion
|
|
2302
|
-
//#region src/services/zod/createUniqueArraySchema.d.ts
|
|
2303
2031
|
export declare const createUniqueArraySchema: CreateUniqueArraySchema;
|
|
2304
|
-
//#endregion
|
|
2305
|
-
//#region src/services/zstd/constants.d.ts
|
|
2306
2032
|
export declare const DEFAULT_COMPRESSION_LEVEL = 12;
|
|
2307
2033
|
export declare const MIN_WINDOW_LOG = 10;
|
|
2308
2034
|
export declare const MAX_WINDOW_LOG = 27;
|
|
2309
|
-
//#endregion
|
|
2310
|
-
//#region src/services/zstd/getWindowLog.d.ts
|
|
2311
2035
|
export declare const getWindowLog: (dictionaryByteCount: number, inputByteCount: number) => number;
|
|
2312
|
-
//#endregion
|
|
2313
|
-
//#region src/test/constants.d.ts
|
|
2314
2036
|
export declare const ALL_SPECIAL_VALUES: {
|
|
2315
2037
|
isPlainObject: boolean;
|
|
2316
2038
|
value: unknown;
|
|
2317
2039
|
}[];
|
|
2318
|
-
//#endregion
|
|
2319
|
-
//#region src/util/array/chunk.d.ts
|
|
2320
2040
|
export declare const chunk: <T>(array: T[], size: number) => T[][];
|
|
2321
|
-
//#endregion
|
|
2322
|
-
//#region src/util/array/chunkBySerializedSize.d.ts
|
|
2323
2041
|
export declare const chunkBySerializedSize: <T>(items: T[], maxBytes: number, maxCount: number) => T[][];
|
|
2324
|
-
//#endregion
|
|
2325
|
-
//#region src/util/array/takeOne.d.ts
|
|
2326
2042
|
export declare const takeOne: TakeOne;
|
|
2327
|
-
//#endregion
|
|
2328
|
-
//#region src/util/array/takeRandom.d.ts
|
|
2329
2043
|
export declare const takeRandom: <T>(values: readonly T[], random: () => number) => T;
|
|
2330
|
-
//#endregion
|
|
2331
|
-
//#region src/util/date/getEndOfDay.d.ts
|
|
2332
2044
|
export declare const getEndOfDay: (date: Date) => Date;
|
|
2333
|
-
//#endregion
|
|
2334
|
-
//#region src/util/date/getZonedDateTime.d.ts
|
|
2335
2045
|
export declare const getZonedDateTime: (date: Date) => Temporal.ZonedDateTime;
|
|
2336
|
-
//#endregion
|
|
2337
|
-
//#region src/util/dom/checkIsNestedControl.d.ts
|
|
2338
2046
|
export declare const checkIsNestedControl: (event: MouseEvent) => boolean;
|
|
2339
|
-
//#endregion
|
|
2340
|
-
//#region src/util/dom/checkIsNestedInteraction.d.ts
|
|
2341
2047
|
export declare const checkIsNestedInteraction: (event: MouseEvent) => boolean;
|
|
2342
|
-
//#endregion
|
|
2343
|
-
//#region src/util/dom/downloadFile.d.ts
|
|
2344
2048
|
export declare const downloadFile: (filename: string, blobPart: BlobPart, type: string) => void;
|
|
2345
|
-
//#endregion
|
|
2346
|
-
//#region src/util/dom/downloadUrl.d.ts
|
|
2347
2049
|
export declare const downloadUrl: (url: string, filename: string) => void;
|
|
2348
|
-
//#endregion
|
|
2349
|
-
//#region src/util/environment/checkIsServer.d.ts
|
|
2350
2050
|
export declare const checkIsServer: () => boolean;
|
|
2351
|
-
//#endregion
|
|
2352
|
-
//#region src/util/function/getSynchronizedFunction.d.ts
|
|
2353
2051
|
export declare const getSynchronizedFunction: <TArgs extends unknown[]>(asyncFunction: (...args: TArgs) => Promise<unknown>) => ((...args: TArgs) => void);
|
|
2354
2052
|
export declare const waitForSynchronizedFunctions: () => Promise<void>;
|
|
2355
|
-
//#endregion
|
|
2356
|
-
//#region src/util/function/noop.d.ts
|
|
2357
2053
|
export declare const noop: () => void;
|
|
2358
|
-
//#endregion
|
|
2359
|
-
//#region src/util/id/constants.d.ts
|
|
2360
2054
|
export declare const ID_SEPARATOR = "|";
|
|
2361
|
-
//#endregion
|
|
2362
|
-
//#region src/util/id/uuid/constants.d.ts
|
|
2363
2055
|
export declare const UUIDV4_REGEX: RegExp;
|
|
2364
|
-
//#endregion
|
|
2365
|
-
//#region src/util/map/getOrCreate.d.ts
|
|
2366
2056
|
export declare const getOrCreate: <TKey, TValue>(map: Map<TKey, TValue>, key: TKey, create: () => TValue) => TValue;
|
|
2367
|
-
//#endregion
|
|
2368
|
-
//#region src/util/object/checkIsCustomMethod.d.ts
|
|
2369
2057
|
export declare const checkIsCustomMethod: (value: object, methodName: ObjectMethod) => boolean;
|
|
2370
|
-
//#endregion
|
|
2371
|
-
//#region src/util/object/checkIsDeepEqual.d.ts
|
|
2372
2058
|
export declare const checkIsDeepEqual: (first: unknown, second: unknown) => boolean;
|
|
2373
|
-
//#endregion
|
|
2374
|
-
//#region src/util/object/checkIsPlainObject.d.ts
|
|
2375
2059
|
export declare const checkIsPlainObject: (data: unknown) => data is Record<string, unknown>;
|
|
2376
|
-
//#endregion
|
|
2377
|
-
//#region src/util/object/checkIsSameBytes.d.ts
|
|
2378
2060
|
export declare const checkIsSameBytes: (first: ArrayBuffer | ArrayBufferView | SharedArrayBuffer, second: ArrayBuffer | ArrayBufferView | SharedArrayBuffer) => boolean;
|
|
2379
|
-
//#endregion
|
|
2380
|
-
//#region src/util/object/checkIsSameValueZero.d.ts
|
|
2381
2061
|
export declare const checkIsSameValueZero: (first: unknown, second: unknown) => boolean;
|
|
2382
|
-
//#endregion
|
|
2383
|
-
//#region src/util/object/clonePlainDeep.d.ts
|
|
2384
2062
|
export declare const clonePlainDeep: <T>(data: T) => T;
|
|
2385
|
-
//#endregion
|
|
2386
|
-
//#region src/util/object/getEnumerableKeys.d.ts
|
|
2387
2063
|
export declare const getEnumerableKeys: (value: object) => PropertyKey[];
|
|
2388
|
-
//#endregion
|
|
2389
|
-
//#region src/util/types/GetArrayProps.d.ts
|
|
2390
|
-
export type GetArrayProps<T extends unknown[], P extends string, D extends unknown[], R extends boolean> = (D extends [unknown, ...infer Rest] ? GetProperties<T[number], R extends true ? `${P}[number]` : `${P}.[number]`, Rest, false> : never) | {
|
|
2391
|
-
path: R extends true ? "length" : `${P}.length`;
|
|
2392
|
-
value: T["length"];
|
|
2393
|
-
};
|
|
2394
|
-
//#endregion
|
|
2395
|
-
//#region src/util/types/KnownKeys.d.ts
|
|
2396
|
-
export type KnownKeys<T> = { [K in keyof T as string extends K ? never : number extends K ? never : K]: T[K]; };
|
|
2397
|
-
//#endregion
|
|
2398
|
-
//#region src/util/types/GetObjectProps.d.ts
|
|
2399
|
-
export type GetObjectProps<T, P extends string, D extends unknown[], R extends boolean> = { [K in keyof KnownKeys<T> & (number | string)]: K extends `${number}` ? never : NonNullable<T[K]> extends FunctionLike ? never : (D extends [unknown, ...infer Rest] ? GetProperties<T[K], R extends true ? `${K}` : `${P}.${K}`, Rest, false> : never) | {
|
|
2400
|
-
path: R extends true ? `${K}` : `${P}.${K}`;
|
|
2401
|
-
value: T[K];
|
|
2402
|
-
}; }[keyof KnownKeys<T> & (number | string)];
|
|
2403
|
-
//#endregion
|
|
2404
|
-
//#region src/util/types/GetPrimitiveProps.d.ts
|
|
2405
|
-
export type GetPrimitiveProps<T, P extends string, D extends unknown[], R extends boolean> = T extends string ? {
|
|
2406
|
-
path: R extends true ? "length" : `${P}.length`;
|
|
2407
|
-
value: number;
|
|
2408
|
-
} : T extends symbol ? (D extends [unknown, ...infer Rest] ? GetProperties<string | undefined, R extends true ? "description" : `${P}.description`, Rest, false> : never) | {
|
|
2409
|
-
path: R extends true ? "description" : `${P}.description`;
|
|
2410
|
-
value: string | undefined;
|
|
2411
|
-
} : never;
|
|
2412
|
-
//#endregion
|
|
2413
|
-
//#region src/util/types/GetProperties.d.ts
|
|
2414
|
-
export type GetProperties<T, P extends string = "", D extends unknown[] = [unknown, unknown, unknown, unknown, unknown], R extends boolean = true> = [T] extends [never] ? never : D extends [] ? never : NonNullable<T> extends (infer O) ? O extends unknown[] ? GetArrayProps<O, P, D, R> : O extends object ? GetObjectProps<O, P, D, R> : GetPrimitiveProps<O, P, D, R> : never;
|
|
2415
|
-
//#endregion
|
|
2416
|
-
//#region src/util/types/GetPaths.d.ts
|
|
2417
|
-
export type GetPaths<T> = GetProperties<T> extends (infer U) ? (U extends {
|
|
2418
|
-
path: infer Path;
|
|
2419
|
-
} ? Path : never) : never;
|
|
2420
|
-
//#endregion
|
|
2421
|
-
//#region src/util/types/PropertyNames.d.ts
|
|
2422
|
-
export type PropertyNames<T> = { [P in GetPaths<T>]: P; };
|
|
2423
|
-
//#endregion
|
|
2424
|
-
//#region src/util/object/getPropertyNames.d.ts
|
|
2425
2064
|
export declare const getPropertyNames: <T>() => PropertyNames<T>;
|
|
2426
|
-
//#endregion
|
|
2427
|
-
//#region src/util/object/jsonDateParse.d.ts
|
|
2428
2065
|
export declare const jsonDateParse: <T = any>(text: string) => T;
|
|
2429
|
-
//#endregion
|
|
2430
|
-
//#region src/util/types/MergeObjectsStrict.d.ts
|
|
2431
2066
|
export type MergeObjectsStrict<T extends object[]> = T extends [infer TFirst, infer TSecond, ...infer TRemaining] ? TSecond extends { [K in keyof TSecond]: K extends keyof TFirst ? never : TSecond[K]; } ? TRemaining extends object[] ? MergeObjectsStrict<[TSecond, ...TRemaining]> & TFirst : TFirst & TSecond : never : T extends [infer TFirst] ? TFirst : never;
|
|
2432
|
-
//#endregion
|
|
2433
|
-
//#region src/util/object/mergeObjectsStrict.d.ts
|
|
2434
2067
|
export declare const mergeObjectsStrict: <T extends object[]>(...objects: T) => MergeObjectsStrict<T>;
|
|
2435
|
-
//#endregion
|
|
2436
|
-
//#region src/util/object/omitDeep.d.ts
|
|
2437
2068
|
export declare const omitDeep: <T, TKey extends string>(value: T, ...keys: TKey[]) => DeepOmit<T, TKey>;
|
|
2438
|
-
//#endregion
|
|
2439
|
-
//#region src/util/promise/createEvictingPromiseCache.d.ts
|
|
2440
2069
|
export declare const createEvictingPromiseCache: <TArguments extends unknown[], TValue>(getKey: (...args: TArguments) => string, load: (...args: TArguments) => Promise<TValue>) => ((...args: TArguments) => Promise<TValue>);
|
|
2441
|
-
//#endregion
|
|
2442
|
-
//#region src/util/promise/settleAll.d.ts
|
|
2443
2070
|
export declare const settleAll: <T>(tasks: (() => Promise<T>)[], concurrencyLimit?: number) => Promise<T[]>;
|
|
2444
|
-
//#endregion
|
|
2445
|
-
//#region src/util/reactivity/getRawData.d.ts
|
|
2446
2071
|
export declare const getRawData: <T>(data: T) => T;
|
|
2447
|
-
//#endregion
|
|
2448
|
-
//#region src/util/reactivity/toRawDeep.d.ts
|
|
2449
2072
|
export declare const toRawDeep: <T extends object>(data: T) => T;
|
|
2450
|
-
//#endregion
|
|
2451
|
-
//#region src/util/text/capitalize.d.ts
|
|
2452
2073
|
export declare const capitalize: (string: string) => string;
|
|
2453
|
-
//#endregion
|
|
2454
|
-
//#region src/util/text/dedent.d.ts
|
|
2455
2074
|
export declare const dedent: Dedent;
|
|
2456
|
-
//#endregion
|
|
2457
|
-
//#region src/util/text/encodeUrlSubDelimiters.d.ts
|
|
2458
2075
|
export declare const encodeUrlSubDelimiters: (value: string) => string;
|
|
2459
|
-
//#endregion
|
|
2460
|
-
//#region src/util/text/getDecodedUriComponent.d.ts
|
|
2461
2076
|
export declare const getDecodedUriComponent: (value: string, fallback: string) => string;
|
|
2462
|
-
//#endregion
|
|
2463
|
-
//#region src/util/text/normalizeString.d.ts
|
|
2464
2077
|
export declare const normalizeString: (value: string | undefined) => string;
|
|
2465
|
-
//#endregion
|
|
2466
|
-
//#region src/util/text/streamToText.d.ts
|
|
2467
2078
|
export declare const streamToText: (readable: NodeJS.ReadableStream) => Promise<string>;
|
|
2468
|
-
//#endregion
|
|
2469
|
-
//#region src/util/text/toKebabCase.d.ts
|
|
2470
2079
|
export declare const toKebabCase: <T extends string>(string: T) => KebabCase<T>;
|
|
2471
|
-
//#endregion
|
|
2472
|
-
//#region src/util/text/truncate.d.ts
|
|
2473
2080
|
export declare const truncate: (string: string, length: number) => string;
|
|
2474
|
-
//#endregion
|
|
2475
|
-
//#region src/util/text/uncapitalize.d.ts
|
|
2476
2081
|
export declare const uncapitalize: <T extends string>(string: T) => Uncapitalize<T>;
|
|
2477
|
-
//#endregion
|
|
2478
|
-
//#region src/util/time/constants.d.ts
|
|
2479
2082
|
export declare const MILLISECONDS_PER_SECOND = 1e3;
|
|
2480
|
-
|
|
2481
|
-
|
|
2083
|
+
export declare const createExponentialBackoff: (baseDelayMs: number, maxDelayMs: number) => (<T>(operation: () => Promise<T>) => Promise<T>);
|
|
2084
|
+
export declare const getExponentialBackoffDelayMs: (attempt: number, baseDelayMs: number, maxDelayMs: number) => number;
|
|
2482
2085
|
export declare const hrtime: (previousHrTime?: [number, number]) => [number, number];
|
|
2483
|
-
//#endregion
|
|
2484
|
-
//#region src/util/time/now.d.ts
|
|
2485
2086
|
export declare const now: () => string;
|
|
2486
|
-
//#endregion
|
|
2487
|
-
//#region src/util/time/sleep.d.ts
|
|
2488
2087
|
export declare const sleep: (durationMs: number) => Promise<void>;
|
|
2489
|
-
//#endregion
|
|
2490
|
-
//#region src/util/validation/exhaustiveGuard.d.ts
|
|
2491
2088
|
export declare const exhaustiveGuard: (value: never) => never;
|
|
2492
|
-
//#endregion
|
|
2493
2089
|
export {};
|