@esposter/shared 4.0.0 → 4.1.1
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/dist/index.d.ts +326 -126
- package/dist/index.js +1378 -74
- package/package.json +12 -11
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { Result, ResultAsync } from "neverthrow";
|
|
3
3
|
import { HTMLElement } from "node-html-parser";
|
|
4
|
-
import
|
|
4
|
+
import { DefaultTreeAdapterTypes, html as html$1 } from "parse5";
|
|
5
5
|
//#region src/models/error/ForbiddenError.d.ts
|
|
6
6
|
export declare class ForbiddenError extends Error {
|
|
7
7
|
constructor(message: string);
|
|
@@ -37,12 +37,129 @@ export declare class WordFilteredError extends Error {
|
|
|
37
37
|
constructor(message: string);
|
|
38
38
|
}
|
|
39
39
|
//#endregion
|
|
40
|
+
//#region src/models/eventEmitter/EventListenerEntry.d.ts
|
|
41
|
+
export interface EventListenerEntry<TEventMap> {
|
|
42
|
+
isOnce: boolean;
|
|
43
|
+
listener: TEventMap[keyof TEventMap];
|
|
44
|
+
}
|
|
45
|
+
//#endregion
|
|
46
|
+
//#region src/models/eventEmitter/EventListenerMap.d.ts
|
|
47
|
+
export type EventListenerMap<TEventMap> = { [TEvent in keyof TEventMap]: (...args: never[]) => void; };
|
|
48
|
+
//#endregion
|
|
49
|
+
//#region src/models/eventEmitter/TypedEventEmitter.d.ts
|
|
50
|
+
export declare class TypedEventEmitter<TEventMap extends EventListenerMap<TEventMap>> {
|
|
51
|
+
#private;
|
|
52
|
+
emit<TEvent extends keyof TEventMap>(event: TEvent, ...args: Parameters<TEventMap[TEvent]>): boolean;
|
|
53
|
+
off<TEvent extends keyof TEventMap>(event: TEvent, listener: TEventMap[TEvent]): void;
|
|
54
|
+
on<TEvent extends keyof TEventMap>(event: TEvent, listener: TEventMap[TEvent]): void;
|
|
55
|
+
once<TEvent extends keyof TEventMap>(event: TEvent, listener: TEventMap[TEvent]): void;
|
|
56
|
+
removeAllListeners(event?: keyof TEventMap): void;
|
|
57
|
+
}
|
|
58
|
+
//#endregion
|
|
59
|
+
//#region src/models/indexedDb/DatabaseStoreSchema.d.ts
|
|
60
|
+
export interface DatabaseStoreSchema {
|
|
61
|
+
indexes: Record<string, IDBValidKey>;
|
|
62
|
+
key: IDBValidKey;
|
|
63
|
+
value: unknown;
|
|
64
|
+
}
|
|
65
|
+
//#endregion
|
|
66
|
+
//#region src/models/indexedDb/DatabaseSchema.d.ts
|
|
67
|
+
export type DatabaseSchema = Record<string, DatabaseStoreSchema>;
|
|
68
|
+
//#endregion
|
|
69
|
+
//#region src/models/indexedDb/DatabaseStoreName.d.ts
|
|
70
|
+
export type DatabaseStoreName<TSchema extends DatabaseSchema> = [LiteralKeys<TSchema>] extends [never] ? string : LiteralKeys<TSchema>;
|
|
71
|
+
type LiteralKeys<TSchema> = keyof { [TKey in keyof TSchema as string extends TKey ? never : TKey]: TKey; } & string;
|
|
72
|
+
//#endregion
|
|
73
|
+
//#region src/models/indexedDb/DatabaseIndexName.d.ts
|
|
74
|
+
export type DatabaseIndexName<TSchema extends DatabaseSchema, TStoreName extends DatabaseStoreName<TSchema>> = string extends keyof TSchema[TStoreName]["indexes"] ? string : keyof TSchema[TStoreName]["indexes"] & string;
|
|
75
|
+
//#endregion
|
|
76
|
+
//#region src/models/indexedDb/DatabaseIndexCreator.d.ts
|
|
77
|
+
export interface DatabaseIndexCreator<TSchema extends DatabaseSchema, TStoreName extends DatabaseStoreName<TSchema>> {
|
|
78
|
+
createIndex: (name: DatabaseIndexName<TSchema, TStoreName>, keyPath: string | string[], options?: IDBIndexParameters) => void;
|
|
79
|
+
}
|
|
80
|
+
//#endregion
|
|
81
|
+
//#region src/models/indexedDb/DatabaseIndexKey.d.ts
|
|
82
|
+
export type DatabaseIndexKey<TSchema extends DatabaseSchema, TStoreName extends DatabaseStoreName<TSchema>, TIndexName extends DatabaseIndexName<TSchema, TStoreName>> = TSchema[TStoreName]["indexes"][TIndexName];
|
|
83
|
+
//#endregion
|
|
84
|
+
//#region src/models/indexedDb/DatabaseIndex.d.ts
|
|
85
|
+
export interface DatabaseIndex<TSchema extends DatabaseSchema, TStoreName extends DatabaseStoreName<TSchema>, TIndexName extends DatabaseIndexName<TSchema, TStoreName>> {
|
|
86
|
+
getAll: (query?: DatabaseIndexKey<TSchema, TStoreName, TIndexName> | IDBKeyRange | null, count?: number) => Promise<TSchema[TStoreName]["value"][]>;
|
|
87
|
+
getAllKeys: (query?: DatabaseIndexKey<TSchema, TStoreName, TIndexName> | IDBKeyRange | null, count?: number) => Promise<TSchema[TStoreName]["key"][]>;
|
|
88
|
+
}
|
|
89
|
+
//#endregion
|
|
90
|
+
//#region src/models/indexedDb/DatabaseObjectStoreReader.d.ts
|
|
91
|
+
export interface DatabaseObjectStoreReader<TSchema extends DatabaseSchema, TStoreName extends DatabaseStoreName<TSchema>> {
|
|
92
|
+
get: (key: TSchema[TStoreName]["key"]) => Promise<TSchema[TStoreName]["value"] | undefined>;
|
|
93
|
+
getAll: (query?: IDBKeyRange | null | TSchema[TStoreName]["key"], count?: number) => Promise<TSchema[TStoreName]["value"][]>;
|
|
94
|
+
getAllKeys: (query?: IDBKeyRange | null | TSchema[TStoreName]["key"], count?: number) => Promise<TSchema[TStoreName]["key"][]>;
|
|
95
|
+
index: <TIndexName extends DatabaseIndexName<TSchema, TStoreName>>(name: TIndexName) => DatabaseIndex<TSchema, TStoreName, TIndexName>;
|
|
96
|
+
}
|
|
97
|
+
//#endregion
|
|
98
|
+
//#region src/models/indexedDb/DatabaseObjectStoreWriter.d.ts
|
|
99
|
+
export interface DatabaseObjectStoreWriter<TSchema extends DatabaseSchema, TStoreName extends DatabaseStoreName<TSchema>> {
|
|
100
|
+
delete: (query: IDBKeyRange | TSchema[TStoreName]["key"]) => Promise<void>;
|
|
101
|
+
put: (value: TSchema[TStoreName]["value"], key?: TSchema[TStoreName]["key"]) => Promise<TSchema[TStoreName]["key"]>;
|
|
102
|
+
}
|
|
103
|
+
//#endregion
|
|
104
|
+
//#region src/models/indexedDb/DatabaseObjectStore.d.ts
|
|
105
|
+
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));
|
|
106
|
+
//#endregion
|
|
107
|
+
//#region src/models/indexedDb/DatabaseTransaction.d.ts
|
|
108
|
+
export interface DatabaseTransaction<TSchema extends DatabaseSchema, TStoreName extends DatabaseStoreName<TSchema>, TMode extends IDBTransactionMode> {
|
|
109
|
+
done: Promise<void>;
|
|
110
|
+
objectStore: <TName extends TStoreName>(name: TName) => DatabaseObjectStore<TSchema, TName, TMode>;
|
|
111
|
+
}
|
|
112
|
+
//#endregion
|
|
113
|
+
//#region src/models/indexedDb/Database.d.ts
|
|
114
|
+
export interface Database<TSchema extends DatabaseSchema = DatabaseSchema> {
|
|
115
|
+
close: () => void;
|
|
116
|
+
delete: <TStoreName extends DatabaseStoreName<TSchema>>(storeName: TStoreName, query: IDBKeyRange | TSchema[TStoreName]["key"]) => Promise<void>;
|
|
117
|
+
get: <TStoreName extends DatabaseStoreName<TSchema>>(storeName: TStoreName, key: TSchema[TStoreName]["key"]) => Promise<TSchema[TStoreName]["value"] | undefined>;
|
|
118
|
+
getAll: <TStoreName extends DatabaseStoreName<TSchema>>(storeName: TStoreName, query?: IDBKeyRange | null | TSchema[TStoreName]["key"], count?: number) => Promise<TSchema[TStoreName]["value"][]>;
|
|
119
|
+
getAllKeys: <TStoreName extends DatabaseStoreName<TSchema>>(storeName: TStoreName, query?: IDBKeyRange | null | TSchema[TStoreName]["key"], count?: number) => Promise<TSchema[TStoreName]["key"][]>;
|
|
120
|
+
readonly name: string;
|
|
121
|
+
put: <TStoreName extends DatabaseStoreName<TSchema>>(storeName: TStoreName, value: TSchema[TStoreName]["value"], key?: TSchema[TStoreName]["key"]) => Promise<TSchema[TStoreName]["key"]>;
|
|
122
|
+
transaction: <TStoreName extends DatabaseStoreName<TSchema>, TMode extends IDBTransactionMode = "readonly">(storeNames: readonly TStoreName[] | TStoreName, mode?: TMode, options?: IDBTransactionOptions) => DatabaseTransaction<TSchema, TStoreName, TMode>;
|
|
123
|
+
}
|
|
124
|
+
//#endregion
|
|
125
|
+
//#region src/models/indexedDb/UpgradeDatabase.d.ts
|
|
126
|
+
export interface UpgradeDatabase<TSchema extends DatabaseSchema = DatabaseSchema> extends Database<TSchema> {
|
|
127
|
+
createObjectStore: <TStoreName extends DatabaseStoreName<TSchema>>(name: TStoreName, options?: IDBObjectStoreParameters) => DatabaseObjectStore<TSchema, TStoreName, "versionchange">;
|
|
128
|
+
}
|
|
129
|
+
//#endregion
|
|
130
|
+
//#region src/models/indexedDb/DatabaseOpenOptions.d.ts
|
|
131
|
+
export interface DatabaseOpenOptions<TSchema extends DatabaseSchema = DatabaseSchema> {
|
|
132
|
+
blocked?: (currentVersion: number, blockedVersion: null | number) => void;
|
|
133
|
+
blocking?: (currentVersion: number, blockedVersion: null | number) => void;
|
|
134
|
+
terminated?: () => void;
|
|
135
|
+
upgrade?: (database: UpgradeDatabase<TSchema>, oldVersion: number, newVersion: null | number, transaction: DatabaseTransaction<TSchema, DatabaseStoreName<TSchema>, "versionchange">) => void;
|
|
136
|
+
}
|
|
137
|
+
//#endregion
|
|
40
138
|
//#region src/models/message/MentionType.d.ts
|
|
41
139
|
export declare enum MentionType {
|
|
42
140
|
Role = "role",
|
|
43
141
|
User = "user"
|
|
44
142
|
}
|
|
45
143
|
//#endregion
|
|
144
|
+
//#region src/models/mime/MimeDatabaseEntry.d.ts
|
|
145
|
+
export interface MimeDatabaseEntry {
|
|
146
|
+
charset?: string;
|
|
147
|
+
compressible?: boolean;
|
|
148
|
+
extensions?: string[];
|
|
149
|
+
source?: string;
|
|
150
|
+
}
|
|
151
|
+
//#endregion
|
|
152
|
+
//#region src/models/object/ObjectMethod.d.ts
|
|
153
|
+
export declare enum ObjectMethod {
|
|
154
|
+
ToString = "toString",
|
|
155
|
+
ValueOf = "valueOf"
|
|
156
|
+
}
|
|
157
|
+
//#endregion
|
|
158
|
+
//#region src/models/profanity/ProfanityOptions.d.ts
|
|
159
|
+
export interface ProfanityOptions {
|
|
160
|
+
isWholeWord: boolean;
|
|
161
|
+
}
|
|
162
|
+
//#endregion
|
|
46
163
|
//#region src/models/reactivity/MaybeReactive.d.ts
|
|
47
164
|
export interface MaybeReactive {
|
|
48
165
|
__v_raw?: unknown;
|
|
@@ -90,6 +207,28 @@ export declare const RoutePath: {
|
|
|
90
207
|
};
|
|
91
208
|
export type RoutePath = typeof RoutePath;
|
|
92
209
|
//#endregion
|
|
210
|
+
//#region src/models/sanitizeHtml/AttributesTransformer.d.ts
|
|
211
|
+
export type AttributesTransformer = (attributes: Record<string, string>) => Record<string, string>;
|
|
212
|
+
//#endregion
|
|
213
|
+
//#region src/models/sanitizeHtml/SanitizeHtmlOptions.d.ts
|
|
214
|
+
export interface SanitizeHtmlOptions {
|
|
215
|
+
allowedAttributes?: Record<string, string[]>;
|
|
216
|
+
allowedClasses?: Record<string, string[]>;
|
|
217
|
+
allowedStyles?: Record<string, Record<string, RegExp[]>>;
|
|
218
|
+
allowedTags?: string[];
|
|
219
|
+
transformAttributes?: Record<string, AttributesTransformer>;
|
|
220
|
+
}
|
|
221
|
+
//#endregion
|
|
222
|
+
//#region src/models/sanitizeHtml/SanitizePolicy.d.ts
|
|
223
|
+
export interface SanitizePolicy {
|
|
224
|
+
allowedAttributes: Record<string, string[]>;
|
|
225
|
+
allowedClasses: Record<string, string[]>;
|
|
226
|
+
allowedSchemes: string[];
|
|
227
|
+
allowedStyles: Record<string, Record<string, RegExp[]>>;
|
|
228
|
+
allowedTags: string[];
|
|
229
|
+
transformAttributes: Record<string, AttributesTransformer>;
|
|
230
|
+
}
|
|
231
|
+
//#endregion
|
|
93
232
|
//#region src/models/shared/ItemEntityType.d.ts
|
|
94
233
|
export interface ItemEntityType<T extends string> {
|
|
95
234
|
type: T;
|
|
@@ -1536,106 +1675,6 @@ type _AllExtend<TArray extends UnknownArray, Type, Options extends Required<AllE
|
|
|
1536
1675
|
// If target `Type` is also `never`, or is `any`, or `strictNever` is disabled, recurse further.
|
|
1537
1676
|
_AllExtend<Rest, Type, Options> : false : First extends Type ? _AllExtend<Rest, Type, Options> : false : true;
|
|
1538
1677
|
//#endregion
|
|
1539
|
-
//#region ../../node_modules/.pnpm/type-fest@5.10.0/node_modules/type-fest/source/except.d.ts
|
|
1540
|
-
/**
|
|
1541
|
-
Filter out keys from an object.
|
|
1542
|
-
|
|
1543
|
-
Returns `never` if `Exclude` is strictly equal to `Key`.
|
|
1544
|
-
Returns `never` if `Key` extends `Exclude`.
|
|
1545
|
-
Returns `Key` otherwise.
|
|
1546
|
-
|
|
1547
|
-
@example
|
|
1548
|
-
```
|
|
1549
|
-
type Filtered = Filter<'foo', 'foo'>;
|
|
1550
|
-
//=> never
|
|
1551
|
-
```
|
|
1552
|
-
|
|
1553
|
-
@example
|
|
1554
|
-
```
|
|
1555
|
-
type Filtered = Filter<'bar', string>;
|
|
1556
|
-
//=> never
|
|
1557
|
-
```
|
|
1558
|
-
|
|
1559
|
-
@example
|
|
1560
|
-
```
|
|
1561
|
-
type Filtered = Filter<'bar', 'foo'>;
|
|
1562
|
-
//=> 'bar'
|
|
1563
|
-
```
|
|
1564
|
-
|
|
1565
|
-
@see {Except}
|
|
1566
|
-
*/
|
|
1567
|
-
type Filter<KeyType, ExcludeType> = IsEqual<KeyType, ExcludeType> extends true ? never : (KeyType extends ExcludeType ? never : KeyType);
|
|
1568
|
-
type ExceptOptions = {
|
|
1569
|
-
/**
|
|
1570
|
-
Disallow assigning non-specified properties.
|
|
1571
|
-
|
|
1572
|
-
Note that any omitted properties in the resulting type will be present in autocomplete as `undefined`.
|
|
1573
|
-
|
|
1574
|
-
@default false
|
|
1575
|
-
*/
|
|
1576
|
-
requireExactProps?: boolean;
|
|
1577
|
-
};
|
|
1578
|
-
type DefaultExceptOptions = {
|
|
1579
|
-
requireExactProps: false;
|
|
1580
|
-
};
|
|
1581
|
-
/**
|
|
1582
|
-
Create a type from an object type without certain keys.
|
|
1583
|
-
|
|
1584
|
-
We recommend setting the `requireExactProps` option to `true`.
|
|
1585
|
-
|
|
1586
|
-
This type is a stricter version of [`Omit`](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-5.html#the-omit-helper-type). The `Omit` type does not restrict the omitted keys to be keys present on the given type, while `Except` does. The benefits of a stricter type are avoiding typos and allowing the compiler to pick up on rename refactors automatically.
|
|
1587
|
-
|
|
1588
|
-
This type was proposed to the TypeScript team, which declined it, saying they prefer that libraries implement stricter versions of the built-in types ([microsoft/TypeScript#30825](https://github.com/microsoft/TypeScript/issues/30825#issuecomment-523668235)).
|
|
1589
|
-
|
|
1590
|
-
@example
|
|
1591
|
-
```
|
|
1592
|
-
import type {Except} from 'type-fest';
|
|
1593
|
-
|
|
1594
|
-
type Foo = {
|
|
1595
|
-
a: number;
|
|
1596
|
-
b: string;
|
|
1597
|
-
};
|
|
1598
|
-
|
|
1599
|
-
type FooWithoutA = Except<Foo, 'a'>;
|
|
1600
|
-
//=> {b: string}
|
|
1601
|
-
|
|
1602
|
-
// @ts-expect-error
|
|
1603
|
-
const fooWithoutA: FooWithoutA = {a: 1, b: '2'};
|
|
1604
|
-
// errors: 'a' does not exist in type '{ b: string; }'
|
|
1605
|
-
|
|
1606
|
-
type FooWithoutB = Except<Foo, 'b', {requireExactProps: true}>;
|
|
1607
|
-
//=> {a: number} & Partial<Record<'b', never>>
|
|
1608
|
-
|
|
1609
|
-
// @ts-expect-error
|
|
1610
|
-
const fooWithoutB: FooWithoutB = {a: 1, b: '2'};
|
|
1611
|
-
// errors at 'b': Type 'string' is not assignable to type 'undefined'.
|
|
1612
|
-
|
|
1613
|
-
// The `Omit` utility type doesn't work when omitting specific keys from objects containing index signatures.
|
|
1614
|
-
|
|
1615
|
-
// Consider the following example:
|
|
1616
|
-
|
|
1617
|
-
type UserData = {
|
|
1618
|
-
[metadata: string]: string;
|
|
1619
|
-
email: string;
|
|
1620
|
-
name: string;
|
|
1621
|
-
role: 'admin' | 'user';
|
|
1622
|
-
};
|
|
1623
|
-
|
|
1624
|
-
// `Omit` clearly doesn't behave as expected in this case:
|
|
1625
|
-
type PostPayload = Omit<UserData, 'email'>;
|
|
1626
|
-
//=> {[x: string]: string; [x: number]: string}
|
|
1627
|
-
|
|
1628
|
-
// In situations like this, `Except` works better.
|
|
1629
|
-
// It simply removes the `email` key while preserving all the other keys.
|
|
1630
|
-
type PostPayloadFixed = Except<UserData, 'email'>;
|
|
1631
|
-
//=> {[x: string]: string; name: string; role: 'admin' | 'user'}
|
|
1632
|
-
```
|
|
1633
|
-
|
|
1634
|
-
@category Object
|
|
1635
|
-
*/
|
|
1636
|
-
type Except<ObjectType, KeysType extends keyof ObjectType, Options extends ExceptOptions = {}> = _Except<ObjectType, KeysType, ApplyDefaultOptions<ExceptOptions, DefaultExceptOptions, Options>>;
|
|
1637
|
-
type _Except<ObjectType, KeysType extends keyof ObjectType, Options extends Required<ExceptOptions>> = { [KeyType in keyof ObjectType as Filter<KeyType, KeysType>]: ObjectType[KeyType]; } & (Options['requireExactProps'] extends true ? Partial<Record<KeysType, never>> : {});
|
|
1638
|
-
//#endregion
|
|
1639
1678
|
//#region ../../node_modules/.pnpm/type-fest@5.10.0/node_modules/type-fest/source/promisable.d.ts
|
|
1640
1679
|
/**
|
|
1641
1680
|
Create a type that represents either the value or the value wrapped in `PromiseLike`.
|
|
@@ -1947,7 +1986,8 @@ export interface TakeOne {
|
|
|
1947
1986
|
export type FunctionLike = ((...args: never) => unknown) | (abstract new (...args: never) => unknown);
|
|
1948
1987
|
//#endregion
|
|
1949
1988
|
//#region src/util/types/DeepOmit.d.ts
|
|
1950
|
-
export type DeepOmit<T, TKey extends PropertyKey> =
|
|
1989
|
+
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;
|
|
1990
|
+
type DeepOmitKeptValue = ArrayBufferView | Blob | Date | FunctionLike | Map<unknown, unknown> | Primitive | Promise<unknown> | RegExp | Set<unknown>;
|
|
1951
1991
|
//#endregion
|
|
1952
1992
|
//#region src/util/types/DeepOptionalUndefined.d.ts
|
|
1953
1993
|
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;
|
|
@@ -1955,6 +1995,19 @@ export type DeepOptionalUndefined<T> = T extends Date | FunctionLike | Primitive
|
|
|
1955
1995
|
//#region src/models/shared/ToData.d.ts
|
|
1956
1996
|
export type ToData<T> = DeepOptionalUndefined<DeepOmit<T, "toJSON">>;
|
|
1957
1997
|
//#endregion
|
|
1998
|
+
//#region src/models/text/DedentOptions.d.ts
|
|
1999
|
+
export interface DedentOptions {
|
|
2000
|
+
alignValues?: boolean;
|
|
2001
|
+
escapeSpecialCharacters?: boolean;
|
|
2002
|
+
trimWhitespace?: boolean;
|
|
2003
|
+
}
|
|
2004
|
+
//#endregion
|
|
2005
|
+
//#region src/models/text/Dedent.d.ts
|
|
2006
|
+
export interface Dedent {
|
|
2007
|
+
(strings: string | TemplateStringsArray, ...values: unknown[]): string;
|
|
2008
|
+
withOptions: (options: DedentOptions) => Dedent;
|
|
2009
|
+
}
|
|
2010
|
+
//#endregion
|
|
1958
2011
|
//#region src/models/zod/UniqueArraySchemaKey.d.ts
|
|
1959
2012
|
export type UniqueArraySchemaKey<TSchema extends z.ZodType> = TSchema extends z.ZodObject ? keyof TSchema["shape"] & string : keyof z.output<TSchema> & string;
|
|
1960
2013
|
//#endregion
|
|
@@ -1973,6 +2026,9 @@ export declare const getResult: <T>(callback: () => T) => Result<T, Error>;
|
|
|
1973
2026
|
//#region src/services/error/getResultAsync.d.ts
|
|
1974
2027
|
export declare const getResultAsync: <T>(callback: () => Promise<T>) => ResultAsync<T, Error>;
|
|
1975
2028
|
//#endregion
|
|
2029
|
+
//#region src/services/error/reportFinalizerError.d.ts
|
|
2030
|
+
export declare const reportFinalizerError: <T, E>(callbackResult: Result<T, E>, finalizerError: unknown) => void;
|
|
2031
|
+
//#endregion
|
|
1976
2032
|
//#region src/services/error/toAppError.d.ts
|
|
1977
2033
|
export declare const toAppError: (error: unknown) => Error;
|
|
1978
2034
|
//#endregion
|
|
@@ -1982,6 +2038,39 @@ export declare const withFinalizer: <T>(callback: () => T, finalizer?: () => voi
|
|
|
1982
2038
|
//#region src/services/error/withFinalizerAsync.d.ts
|
|
1983
2039
|
export declare const withFinalizerAsync: <T>(callback: () => Promisable<T>, finalizer?: () => Promisable<void>) => Promise<T>;
|
|
1984
2040
|
//#endregion
|
|
2041
|
+
//#region src/services/indexedDb/getRequestError.d.ts
|
|
2042
|
+
export declare const getRequestError: (request: IDBRequest) => DOMException;
|
|
2043
|
+
//#endregion
|
|
2044
|
+
//#region src/services/indexedDb/getTransactionDone.d.ts
|
|
2045
|
+
export declare const getTransactionDone: (transaction: IDBTransaction) => Promise<void>;
|
|
2046
|
+
//#endregion
|
|
2047
|
+
//#region src/services/indexedDb/getTransactionObjectStore.d.ts
|
|
2048
|
+
export declare const getTransactionObjectStore: <TSchema extends DatabaseSchema, TMode extends IDBTransactionMode>(transaction: IDBTransaction) => <TStoreName extends DatabaseStoreName<TSchema>>(name: TStoreName) => DatabaseObjectStore<TSchema, TStoreName, TMode>;
|
|
2049
|
+
//#endregion
|
|
2050
|
+
//#region src/services/indexedDb/openDatabase.d.ts
|
|
2051
|
+
export declare const openDatabase: <TSchema extends DatabaseSchema = DatabaseSchema>(name: string, version: number, options?: DatabaseOpenOptions<TSchema>) => Promise<Database<TSchema>>;
|
|
2052
|
+
//#endregion
|
|
2053
|
+
//#region src/services/indexedDb/requestToPromise.d.ts
|
|
2054
|
+
export declare const requestToPromise: <TResult>(request: IDBRequest) => Promise<TResult>;
|
|
2055
|
+
//#endregion
|
|
2056
|
+
//#region src/services/indexedDb/wrapDatabase.d.ts
|
|
2057
|
+
export declare const wrapDatabase: <TSchema extends DatabaseSchema = DatabaseSchema>(database: IDBDatabase) => Database<TSchema>;
|
|
2058
|
+
//#endregion
|
|
2059
|
+
//#region src/services/indexedDb/wrapIndex.d.ts
|
|
2060
|
+
export declare const wrapIndex: <TSchema extends DatabaseSchema, TStoreName extends DatabaseStoreName<TSchema>, TIndexName extends DatabaseIndexName<TSchema, TStoreName>>(index: IDBIndex) => DatabaseIndex<TSchema, TStoreName, TIndexName>;
|
|
2061
|
+
//#endregion
|
|
2062
|
+
//#region src/services/indexedDb/wrapObjectStore.d.ts
|
|
2063
|
+
export declare const wrapObjectStore: <TSchema extends DatabaseSchema, TStoreName extends DatabaseStoreName<TSchema>, TMode extends IDBTransactionMode>(objectStore: IDBObjectStore) => DatabaseObjectStore<TSchema, TStoreName, TMode>;
|
|
2064
|
+
//#endregion
|
|
2065
|
+
//#region src/services/indexedDb/wrapTransaction.d.ts
|
|
2066
|
+
export declare const wrapTransaction: <TSchema extends DatabaseSchema, TStoreName extends DatabaseStoreName<TSchema>, TMode extends IDBTransactionMode>(transaction: IDBTransaction) => DatabaseTransaction<TSchema, TStoreName, TMode>;
|
|
2067
|
+
//#endregion
|
|
2068
|
+
//#region src/services/indexedDb/wrapUpgradeDatabase.d.ts
|
|
2069
|
+
export declare const wrapUpgradeDatabase: <TSchema extends DatabaseSchema = DatabaseSchema>(database: IDBDatabase) => UpgradeDatabase<TSchema>;
|
|
2070
|
+
//#endregion
|
|
2071
|
+
//#region src/services/indexedDb/wrapUpgradeTransaction.d.ts
|
|
2072
|
+
export declare const wrapUpgradeTransaction: <TSchema extends DatabaseSchema>(transaction: IDBTransaction) => DatabaseTransaction<TSchema, DatabaseStoreName<TSchema>, "versionchange">;
|
|
2073
|
+
//#endregion
|
|
1985
2074
|
//#region src/services/message/constants.d.ts
|
|
1986
2075
|
export declare const MENTION_ID_ATTRIBUTE = "data-id";
|
|
1987
2076
|
export declare const MENTION_ITEM_TYPE_ATTRIBUTE = "data-mention-type";
|
|
@@ -1993,18 +2082,125 @@ export declare const MENTION_HERE_ID = "@here";
|
|
|
1993
2082
|
export declare const MENTION_EVERYONE_ID = "@everyone";
|
|
1994
2083
|
export declare const CUSTOM_EMOJI_ID_ATTRIBUTE = "data-custom-emoji-id";
|
|
1995
2084
|
export declare const CUSTOM_EMOJI_NAME_ATTRIBUTE = "data-custom-emoji-name";
|
|
2085
|
+
export declare const SPOILER_ATTRIBUTE = "data-spoiler";
|
|
2086
|
+
export declare const SPOILER_SELECTOR: string;
|
|
1996
2087
|
//#endregion
|
|
1997
2088
|
//#region src/services/message/getMentions.d.ts
|
|
1998
2089
|
export declare const getMentions: (message: string) => HTMLElement[];
|
|
1999
2090
|
//#endregion
|
|
2091
|
+
//#region src/services/mime/charset.d.ts
|
|
2092
|
+
export declare const charset: (type: string) => false | string;
|
|
2093
|
+
//#endregion
|
|
2094
|
+
//#region src/services/mime/constants.d.ts
|
|
2095
|
+
export declare const MEDIA_TYPE_REGEX: RegExp;
|
|
2096
|
+
export declare const PATH_SEPARATOR_REGEX: RegExp;
|
|
2097
|
+
export declare const TEXT_MEDIA_TYPE_REGEX: RegExp;
|
|
2098
|
+
export declare const CHARSET_PARAMETER_REGEX: RegExp;
|
|
2099
|
+
export declare const DEFAULT_TEXT_CHARSET = "UTF-8";
|
|
2100
|
+
export declare const FacetScoreMap: ReadonlyMap<string, number>;
|
|
2101
|
+
export declare const DEFAULT_FACET_SCORE = 900;
|
|
2102
|
+
export declare const SourceScoreMap: ReadonlyMap<string, number>;
|
|
2103
|
+
export declare const DEFAULT_SOURCE_SCORE = 30;
|
|
2104
|
+
export declare const TypeScoreMap: ReadonlyMap<string, number>;
|
|
2105
|
+
export declare const DEFAULT_TYPE_SCORE = 0;
|
|
2106
|
+
//#endregion
|
|
2107
|
+
//#region src/services/mime/contentType.d.ts
|
|
2108
|
+
export declare const contentType: (value: string) => false | string;
|
|
2109
|
+
//#endregion
|
|
2110
|
+
//#region src/services/mime/extension.d.ts
|
|
2111
|
+
export declare const extension: (type: string) => false | string;
|
|
2112
|
+
//#endregion
|
|
2113
|
+
//#region src/services/mime/getExtensionMimeTypeMap.d.ts
|
|
2114
|
+
export declare const getExtensionMimeTypeMap: () => ReadonlyMap<string, string>;
|
|
2115
|
+
//#endregion
|
|
2116
|
+
//#region src/services/mime/getMediaType.d.ts
|
|
2117
|
+
export declare const getMediaType: (value: string) => string;
|
|
2118
|
+
//#endregion
|
|
2119
|
+
//#region src/services/mime/getMimeScore.d.ts
|
|
2120
|
+
export declare const getMimeScore: (mimeType: string, source?: string) => number;
|
|
2121
|
+
//#endregion
|
|
2122
|
+
//#region src/services/mime/getMimeTypeEntryMap.d.ts
|
|
2123
|
+
export declare const getMimeTypeEntryMap: () => ReadonlyMap<string, MimeDatabaseEntry>;
|
|
2124
|
+
//#endregion
|
|
2125
|
+
//#region src/services/mime/lookup.d.ts
|
|
2126
|
+
export declare const lookup: (path: string) => false | string;
|
|
2127
|
+
//#endregion
|
|
2000
2128
|
//#region src/services/prettier/css.d.ts
|
|
2001
2129
|
export declare const css: typeof String.raw;
|
|
2002
2130
|
//#endregion
|
|
2003
2131
|
//#region src/services/prettier/html.d.ts
|
|
2004
2132
|
export declare const html: typeof String.raw;
|
|
2005
2133
|
//#endregion
|
|
2134
|
+
//#region src/services/profanity/checkContainsProfanity.d.ts
|
|
2135
|
+
export declare const checkContainsProfanity: (text: unknown, { isWholeWord }?: Partial<ProfanityOptions>) => boolean;
|
|
2136
|
+
//#endregion
|
|
2137
|
+
//#region src/services/profanity/englishProfaneWords.d.ts
|
|
2138
|
+
export declare const englishProfaneWords: readonly string[];
|
|
2139
|
+
//#endregion
|
|
2140
|
+
//#region src/services/sanitizeHtml/checkIsAllowedUrl.d.ts
|
|
2141
|
+
export declare const checkIsAllowedUrl: (url: string, allowedSchemes: string[]) => boolean;
|
|
2142
|
+
//#endregion
|
|
2143
|
+
//#region src/services/sanitizeHtml/checkIsUnsafeUrlCharacter.d.ts
|
|
2144
|
+
export declare const checkIsUnsafeUrlCharacter: (character: string) => boolean;
|
|
2145
|
+
//#endregion
|
|
2146
|
+
//#region src/services/sanitizeHtml/checkIsWhitespaceCharacter.d.ts
|
|
2147
|
+
export declare const checkIsWhitespaceCharacter: (character: string) => boolean;
|
|
2148
|
+
//#endregion
|
|
2149
|
+
//#region src/services/sanitizeHtml/collectText.d.ts
|
|
2150
|
+
export declare const collectText: (nodes: DefaultTreeAdapterTypes.ChildNode[], depth: number) => string;
|
|
2151
|
+
//#endregion
|
|
2152
|
+
//#region src/services/sanitizeHtml/constants.d.ts
|
|
2153
|
+
export declare const HTML_NAMESPACE: html$1.NS;
|
|
2154
|
+
export declare const DEFAULT_ALLOWED_TAGS: string[];
|
|
2155
|
+
export declare const DEFAULT_LINK_ATTRIBUTES: string[];
|
|
2156
|
+
export declare const DEFAULT_ALLOWED_ATTRIBUTES: Record<string, string[]>;
|
|
2157
|
+
export declare const DEFAULT_ALLOWED_SCHEMES: string[];
|
|
2158
|
+
export declare const NON_TEXT_TAGS: string[];
|
|
2159
|
+
export declare const VOID_TAGS: string[];
|
|
2160
|
+
export declare const URL_ATTRIBUTES: string[];
|
|
2161
|
+
export declare const SRCSET_ATTRIBUTE = "srcset";
|
|
2162
|
+
export declare const IMPORTANT_REGEX: RegExp;
|
|
2163
|
+
export declare const MAX_NESTING_DEPTH = 256;
|
|
2164
|
+
export declare const SRCSET_DESCRIPTOR_REGEX: RegExp;
|
|
2165
|
+
export declare const ESCAPED_TEXT_CHARACTERS_REGEX: RegExp;
|
|
2166
|
+
export declare const ESCAPED_ATTRIBUTE_CHARACTERS_REGEX: RegExp;
|
|
2167
|
+
export declare const SANITIZER_ADVISORY_WATCH_SINCE = "2026-10-11";
|
|
2168
|
+
//#endregion
|
|
2169
|
+
//#region src/services/sanitizeHtml/escapeAttribute.d.ts
|
|
2170
|
+
export declare const escapeAttribute: (value: string) => string;
|
|
2171
|
+
//#endregion
|
|
2172
|
+
//#region src/services/sanitizeHtml/escapeCharacters.d.ts
|
|
2173
|
+
export declare const escapeCharacters: (value: string, charactersRegex: RegExp, entities: Record<string, string>) => string;
|
|
2174
|
+
//#endregion
|
|
2175
|
+
//#region src/services/sanitizeHtml/escapeText.d.ts
|
|
2176
|
+
export declare const escapeText: (text: string) => string;
|
|
2177
|
+
//#endregion
|
|
2178
|
+
//#region src/services/sanitizeHtml/filterAttributes.d.ts
|
|
2179
|
+
export declare const filterAttributes: (element: DefaultTreeAdapterTypes.Element, policy: SanitizePolicy) => Record<string, string>;
|
|
2180
|
+
//#endregion
|
|
2181
|
+
//#region src/services/sanitizeHtml/filterClasses.d.ts
|
|
2182
|
+
export declare const filterClasses: (value: string, patterns: string[] | undefined) => string | undefined;
|
|
2183
|
+
//#endregion
|
|
2184
|
+
//#region src/services/sanitizeHtml/filterHtml.d.ts
|
|
2185
|
+
export declare const filterHtml: (html: string, policy: SanitizePolicy) => string;
|
|
2186
|
+
//#endregion
|
|
2187
|
+
//#region src/services/sanitizeHtml/filterSrcset.d.ts
|
|
2188
|
+
export declare const filterSrcset: (value: string, allowedSchemes: string[]) => string | undefined;
|
|
2189
|
+
//#endregion
|
|
2190
|
+
//#region src/services/sanitizeHtml/filterStyle.d.ts
|
|
2191
|
+
export declare const filterStyle: (value: string, rules: Record<string, RegExp[]> | undefined) => string | undefined;
|
|
2192
|
+
//#endregion
|
|
2193
|
+
//#region src/services/sanitizeHtml/getChildNodes.d.ts
|
|
2194
|
+
export declare const getChildNodes: (element: DefaultTreeAdapterTypes.Element) => DefaultTreeAdapterTypes.ChildNode[];
|
|
2195
|
+
//#endregion
|
|
2196
|
+
//#region src/services/sanitizeHtml/matchesClassPattern.d.ts
|
|
2197
|
+
export declare const matchesClassPattern: (className: string, pattern: string) => boolean;
|
|
2198
|
+
//#endregion
|
|
2199
|
+
//#region src/services/sanitizeHtml/renderNode.d.ts
|
|
2200
|
+
export declare const renderNode: (node: DefaultTreeAdapterTypes.ChildNode, policy: SanitizePolicy, depth: number) => string;
|
|
2201
|
+
//#endregion
|
|
2006
2202
|
//#region src/services/sanitizeHtml/sanitizeHtml.d.ts
|
|
2007
|
-
export declare const sanitizeHtml: (
|
|
2203
|
+
export declare const sanitizeHtml: (html: string, options?: SanitizeHtmlOptions) => string;
|
|
2008
2204
|
//#endregion
|
|
2009
2205
|
//#region src/services/sanitizeHtml/sanitizeTextHtml.d.ts
|
|
2010
2206
|
export declare const sanitizeTextHtml: (html: string) => string;
|
|
@@ -2069,8 +2265,23 @@ export declare const UUIDV4_REGEX: RegExp;
|
|
|
2069
2265
|
//#region src/util/map/getOrCreate.d.ts
|
|
2070
2266
|
export declare const getOrCreate: <TKey, TValue>(map: Map<TKey, TValue>, key: TKey, create: () => TValue) => TValue;
|
|
2071
2267
|
//#endregion
|
|
2268
|
+
//#region src/util/object/checkIsCustomMethod.d.ts
|
|
2269
|
+
export declare const checkIsCustomMethod: (value: object, methodName: ObjectMethod) => boolean;
|
|
2270
|
+
//#endregion
|
|
2271
|
+
//#region src/util/object/checkIsDeepEqual.d.ts
|
|
2272
|
+
export declare const checkIsDeepEqual: (first: unknown, second: unknown) => boolean;
|
|
2273
|
+
//#endregion
|
|
2072
2274
|
//#region src/util/object/checkIsPlainObject.d.ts
|
|
2073
|
-
export declare const checkIsPlainObject: (data: unknown) => data is
|
|
2275
|
+
export declare const checkIsPlainObject: (data: unknown) => data is Record<string, unknown>;
|
|
2276
|
+
//#endregion
|
|
2277
|
+
//#region src/util/object/checkIsSameBytes.d.ts
|
|
2278
|
+
export declare const checkIsSameBytes: (first: ArrayBuffer | ArrayBufferView | SharedArrayBuffer, second: ArrayBuffer | ArrayBufferView | SharedArrayBuffer) => boolean;
|
|
2279
|
+
//#endregion
|
|
2280
|
+
//#region src/util/object/checkIsSameValueZero.d.ts
|
|
2281
|
+
export declare const checkIsSameValueZero: (first: unknown, second: unknown) => boolean;
|
|
2282
|
+
//#endregion
|
|
2283
|
+
//#region src/util/object/getEnumerableKeys.d.ts
|
|
2284
|
+
export declare const getEnumerableKeys: (value: object) => PropertyKey[];
|
|
2074
2285
|
//#endregion
|
|
2075
2286
|
//#region src/util/types/GetArrayProps.d.ts
|
|
2076
2287
|
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) | {
|
|
@@ -2119,6 +2330,12 @@ export type MergeObjectsStrict<T extends object[]> = T extends [infer TFirst, in
|
|
|
2119
2330
|
//#region src/util/object/mergeObjectsStrict.d.ts
|
|
2120
2331
|
export declare const mergeObjectsStrict: <T extends object[]>(...objects: T) => MergeObjectsStrict<T>;
|
|
2121
2332
|
//#endregion
|
|
2333
|
+
//#region src/util/object/omitDeep.d.ts
|
|
2334
|
+
export declare const omitDeep: <T, TKey extends string>(value: T, ...keys: TKey[]) => DeepOmit<T, TKey>;
|
|
2335
|
+
//#endregion
|
|
2336
|
+
//#region src/util/promise/createEvictingPromiseCache.d.ts
|
|
2337
|
+
export declare const createEvictingPromiseCache: <TArguments extends unknown[], TValue>(getKey: (...args: TArguments) => string, load: (...args: TArguments) => Promise<TValue>) => ((...args: TArguments) => Promise<TValue>);
|
|
2338
|
+
//#endregion
|
|
2122
2339
|
//#region src/util/promise/settleAll.d.ts
|
|
2123
2340
|
export declare const settleAll: <T>(tasks: (() => Promise<T>)[], concurrencyLimit?: number) => Promise<T[]>;
|
|
2124
2341
|
//#endregion
|
|
@@ -2131,6 +2348,9 @@ export declare const toRawDeep: <T extends object>(data: T) => T;
|
|
|
2131
2348
|
//#region src/util/text/capitalize.d.ts
|
|
2132
2349
|
export declare const capitalize: (string: string) => string;
|
|
2133
2350
|
//#endregion
|
|
2351
|
+
//#region src/util/text/dedent.d.ts
|
|
2352
|
+
export declare const dedent: Dedent;
|
|
2353
|
+
//#endregion
|
|
2134
2354
|
//#region src/util/text/encodeUrlSubDelimiters.d.ts
|
|
2135
2355
|
export declare const encodeUrlSubDelimiters: (value: string) => string;
|
|
2136
2356
|
//#endregion
|
|
@@ -2161,27 +2381,7 @@ export declare const now: () => string;
|
|
|
2161
2381
|
//#region src/util/time/sleep.d.ts
|
|
2162
2382
|
export declare const sleep: (durationMs: number) => Promise<void>;
|
|
2163
2383
|
//#endregion
|
|
2164
|
-
//#region src/util/types/BuildTuple.d.ts
|
|
2165
|
-
export type BuildTuple<N extends number, T = unknown, R extends unknown[] = []> = R["length"] extends N ? R : BuildTuple<N, T, [...R, T]>;
|
|
2166
|
-
//#endregion
|
|
2167
|
-
//#region src/util/types/FunctionProperties.d.ts
|
|
2168
|
-
export type FunctionProperties<T> = { [K in keyof T]: T[K] extends FunctionLike ? K : never; };
|
|
2169
|
-
//#endregion
|
|
2170
|
-
//#region src/util/types/ExcludeFunctionProperties.d.ts
|
|
2171
|
-
export type ExcludeFunctionProperties<T> = Except<T, FunctionProperties<T>[keyof T]>;
|
|
2172
|
-
//#endregion
|
|
2173
|
-
//#region src/util/types/TupleSplit.d.ts
|
|
2174
|
-
export type TupleSplit<T extends unknown[], N extends number> = T extends [...BuildTuple<N>, ...infer R] ? [T extends [...infer H, ...R] ? H : BuildTuple<N, T[number]>, R] : [T, []];
|
|
2175
|
-
//#endregion
|
|
2176
|
-
//#region src/util/types/SkipFirst.d.ts
|
|
2177
|
-
export type SkipFirst<T extends unknown[], N extends number> = TupleSplit<T, N>[1];
|
|
2178
|
-
//#endregion
|
|
2179
|
-
//#region src/util/types/TakeFirst.d.ts
|
|
2180
|
-
export type TakeFirst<T extends unknown[], N extends number> = TupleSplit<T, N>[0];
|
|
2181
|
-
//#endregion
|
|
2182
|
-
//#region src/util/types/TupleSlice.d.ts
|
|
2183
|
-
export type TupleSlice<T extends unknown[], S extends number, E extends number = T["length"]> = E extends T["length"] ? SkipFirst<T, S> : SkipFirst<TakeFirst<T, E>, S>;
|
|
2184
|
-
//#endregion
|
|
2185
2384
|
//#region src/util/validation/exhaustiveGuard.d.ts
|
|
2186
2385
|
export declare const exhaustiveGuard: (value: never) => never;
|
|
2187
|
-
//#endregion
|
|
2386
|
+
//#endregion
|
|
2387
|
+
export {};
|