@esposter/shared 2.35.0 → 2.37.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/index.d.ts +109 -101
- package/dist/index.js +384 -256
- package/package.json +9 -9
- package/dist/magic-string.es-CDi1Mjxn.js +0 -1011
package/README.md
CHANGED
|
@@ -23,7 +23,7 @@ pnpm i @esposter/shared @vueuse/core vue zod
|
|
|
23
23
|
|
|
24
24
|
## <a name="documentation">📖 Documentation</a>
|
|
25
25
|
|
|
26
|
-
We highly recommend you take a look at the [documentation](https://esposter.com/docs/modules/
|
|
26
|
+
We highly recommend you take a look at the [documentation](https://esposter.com/docs/api/modules/_esposter_shared.html) to level up.
|
|
27
27
|
|
|
28
28
|
### Key Exports
|
|
29
29
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import baseSanitizeHtml from "sanitize-html";
|
|
3
|
-
declare const AllSpecialValues: {
|
|
3
|
+
export declare const AllSpecialValues: {
|
|
4
4
|
isPlainObject: boolean;
|
|
5
5
|
value: unknown;
|
|
6
6
|
}[];
|
|
7
|
-
declare class ForbiddenError extends Error {
|
|
7
|
+
export declare class ForbiddenError extends Error {
|
|
8
8
|
constructor(message: string);
|
|
9
9
|
}
|
|
10
|
-
declare enum Operation {
|
|
10
|
+
export declare enum Operation {
|
|
11
11
|
Create = "Create",
|
|
12
12
|
Delete = "Delete",
|
|
13
13
|
Push = "Push",
|
|
@@ -15,25 +15,28 @@ declare enum Operation {
|
|
|
15
15
|
Unshift = "Unshift",
|
|
16
16
|
Update = "Update"
|
|
17
17
|
}
|
|
18
|
-
declare class InvalidOperationError extends Error {
|
|
18
|
+
export declare class InvalidOperationError extends Error {
|
|
19
19
|
constructor(operation: Operation, name: string, message: string);
|
|
20
20
|
}
|
|
21
|
-
declare class NotFoundError<T extends string = string> extends Error {
|
|
21
|
+
export declare class NotFoundError<T extends string = string> extends Error {
|
|
22
22
|
constructor(name: T, id: string);
|
|
23
23
|
}
|
|
24
|
-
declare class NotInitializedError<T extends string = string> extends Error {
|
|
24
|
+
export declare class NotInitializedError<T extends string = string> extends Error {
|
|
25
25
|
constructor(name: T);
|
|
26
26
|
}
|
|
27
|
-
|
|
27
|
+
export declare class WordFilteredError extends Error {
|
|
28
|
+
constructor(message: string);
|
|
29
|
+
}
|
|
30
|
+
export interface ClassifiedMentions {
|
|
28
31
|
broadcastIds: string[];
|
|
29
32
|
regularUserIds: string[];
|
|
30
33
|
roleIds: string[];
|
|
31
34
|
}
|
|
32
|
-
declare enum MentionType {
|
|
35
|
+
export declare enum MentionType {
|
|
33
36
|
Role = "role",
|
|
34
37
|
User = "user"
|
|
35
38
|
}
|
|
36
|
-
declare const RoutePath: {
|
|
39
|
+
export declare const RoutePath: {
|
|
37
40
|
readonly About: "/about";
|
|
38
41
|
readonly Achievements: "/achievements";
|
|
39
42
|
readonly Anime: "/anime";
|
|
@@ -57,57 +60,63 @@ declare const RoutePath: {
|
|
|
57
60
|
readonly PostUpdate: (id: string) => string;
|
|
58
61
|
readonly PrivacyPolicy: "/privacy-policy";
|
|
59
62
|
readonly Resource: (id: string) => string;
|
|
60
|
-
readonly
|
|
61
|
-
readonly
|
|
62
|
-
readonly
|
|
63
|
-
readonly
|
|
63
|
+
readonly ResourceExplorer: "/resource-explorer";
|
|
64
|
+
readonly ResourceExplorerAll: "/resource-explorer/all";
|
|
65
|
+
readonly ResourceExplorerCreate: "/resource-explorer/create";
|
|
66
|
+
readonly ResourceExplorerCreateType: (type: string) => string;
|
|
67
|
+
readonly ResourceExplorerFavorites: "/resource-explorer/favorites";
|
|
68
|
+
readonly ResourceExplorerRecents: "/resource-explorer/recents";
|
|
69
|
+
readonly ResourceExplorerRecycleBin: "/resource-explorer/recycle-bin";
|
|
70
|
+
readonly ResourceExplorerTags: "/resource-explorer/tags";
|
|
71
|
+
readonly ResourceItems: (id: string) => string;
|
|
72
|
+
readonly User: (id: string) => string;
|
|
64
73
|
readonly UserSettings: "/user/settings";
|
|
65
74
|
readonly View: (type: string, id: string) => string;
|
|
66
75
|
};
|
|
67
|
-
type RoutePath = typeof RoutePath;
|
|
68
|
-
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) | {
|
|
76
|
+
export type RoutePath = typeof RoutePath;
|
|
77
|
+
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) | {
|
|
69
78
|
path: R extends true ? "length" : `${P}.length`;
|
|
70
79
|
value: T["length"];
|
|
71
80
|
};
|
|
72
|
-
type KnownKeys<T> = { [K in keyof T as string extends K ? never : number extends K ? never : K]: T[K]; };
|
|
73
|
-
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 Function ? never : (D extends [unknown, ...infer Rest] ? GetProperties<T[K], R extends true ? `${K}` : `${P}.${K}`, Rest, false> : never) | {
|
|
81
|
+
export type KnownKeys<T> = { [K in keyof T as string extends K ? never : number extends K ? never : K]: T[K]; };
|
|
82
|
+
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 Function ? never : (D extends [unknown, ...infer Rest] ? GetProperties<T[K], R extends true ? `${K}` : `${P}.${K}`, Rest, false> : never) | {
|
|
74
83
|
path: R extends true ? `${K}` : `${P}.${K}`;
|
|
75
84
|
value: T[K];
|
|
76
85
|
}; }[keyof KnownKeys<T> & (number | string)];
|
|
77
|
-
type GetPrimitiveProps<T, P extends string, D extends unknown[], R extends boolean> = T extends string ? {
|
|
86
|
+
export type GetPrimitiveProps<T, P extends string, D extends unknown[], R extends boolean> = T extends string ? {
|
|
78
87
|
path: R extends true ? "length" : `${P}.length`;
|
|
79
88
|
value: number;
|
|
80
89
|
} : T extends symbol ? (D extends [unknown, ...infer Rest] ? GetProperties<string | undefined, R extends true ? "description" : `${P}.description`, Rest, false> : never) | {
|
|
81
90
|
path: R extends true ? "description" : `${P}.description`;
|
|
82
91
|
value: string | undefined;
|
|
83
92
|
} : never;
|
|
84
|
-
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;
|
|
85
|
-
type GetPaths<T> = GetProperties<T> extends (infer U) ? (U extends {
|
|
93
|
+
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;
|
|
94
|
+
export type GetPaths<T> = GetProperties<T> extends (infer U) ? (U extends {
|
|
86
95
|
path: infer Path;
|
|
87
96
|
} ? Path : never) : never;
|
|
88
|
-
type PropertyNames<T> = { [P in GetPaths<T>]: P; };
|
|
89
|
-
interface ItemEntityType<T extends string> {
|
|
97
|
+
export type PropertyNames<T> = { [P in GetPaths<T>]: P; };
|
|
98
|
+
export interface ItemEntityType<T extends string> {
|
|
90
99
|
type: T;
|
|
91
100
|
}
|
|
92
|
-
declare const ItemEntityTypePropertyNames: PropertyNames<ItemEntityType<string>>;
|
|
93
|
-
declare const createItemEntityTypeSchema: <T extends z.ZodType<string>>(schema: T) => z.ZodObject<{
|
|
101
|
+
export declare const ItemEntityTypePropertyNames: PropertyNames<ItemEntityType<string>>;
|
|
102
|
+
export declare const createItemEntityTypeSchema: <T extends z.ZodType<string>>(schema: T) => z.ZodObject<{
|
|
94
103
|
type: T;
|
|
95
104
|
}>;
|
|
96
|
-
declare class ItemMetadata {
|
|
105
|
+
export declare class ItemMetadata {
|
|
97
106
|
createdAt: Date;
|
|
98
107
|
deletedAt: Date | null;
|
|
99
108
|
updatedAt: Date;
|
|
100
109
|
}
|
|
101
|
-
declare const ItemMetadataPropertyNames: PropertyNames<ItemMetadata>;
|
|
102
|
-
declare const itemMetadataSchema: z.ZodObject<{
|
|
110
|
+
export declare const ItemMetadataPropertyNames: PropertyNames<ItemMetadata>;
|
|
111
|
+
export declare const itemMetadataSchema: z.ZodObject<{
|
|
103
112
|
createdAt: z.ZodDate;
|
|
104
113
|
deletedAt: z.ZodNullable<z.ZodDate>;
|
|
105
114
|
updatedAt: z.ZodDate;
|
|
106
115
|
}>;
|
|
107
|
-
declare abstract class Serializable {
|
|
116
|
+
export declare abstract class Serializable {
|
|
108
117
|
toJSON(): this;
|
|
109
118
|
}
|
|
110
|
-
interface TakeOne {
|
|
119
|
+
export interface TakeOne {
|
|
111
120
|
<T extends readonly unknown[]>(values: T, index?: number): T[number];
|
|
112
121
|
<T extends object | Record<PropertyKey, unknown>>(values: T, index: keyof T): T[keyof T];
|
|
113
122
|
}
|
|
@@ -1862,16 +1871,19 @@ const rawCliOptions: KebabCasedProperties<CliOptions> = {
|
|
|
1862
1871
|
@category Template literal
|
|
1863
1872
|
*/
|
|
1864
1873
|
type KebabCase<Value, Options extends WordsOptions = {}> = DelimiterCase<Value, '-', ApplyDefaultOptions<WordsOptions, _DefaultDelimiterCaseOptions, Options>>;
|
|
1865
|
-
type DeepOmit<T, TKey extends PropertyKey> = [T] extends [Date | Function | Primitive] ? T : [Record<string, unknown>] extends [T] ? T : T extends object ? T extends unknown[] ? T extends readonly unknown[] ? { [K in keyof T]: DeepOmit<T[K], TKey>; } : DeepOmit<T[number], TKey>[] : { [P in keyof T as P extends TKey ? never : P]: DeepOmit<T[P], TKey>; } : T;
|
|
1866
|
-
type DeepOptionalUndefined<T> = T extends Date | Function | 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;
|
|
1867
|
-
type ToData<T> = DeepOptionalUndefined<DeepOmit<T, "toJSON">>;
|
|
1868
|
-
interface WithMetadata<TBase extends Class<NonNullable<unknown>>> {
|
|
1874
|
+
export type DeepOmit<T, TKey extends PropertyKey> = [T] extends [Date | Function | Primitive] ? T : [Record<string, unknown>] extends [T] ? T : T extends object ? T extends unknown[] ? T extends readonly unknown[] ? { [K in keyof T]: DeepOmit<T[K], TKey>; } : DeepOmit<T[number], TKey>[] : { [P in keyof T as P extends TKey ? never : P]: DeepOmit<T[P], TKey>; } : T;
|
|
1875
|
+
export type DeepOptionalUndefined<T> = T extends Date | Function | 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;
|
|
1876
|
+
export type ToData<T> = DeepOptionalUndefined<DeepOmit<T, "toJSON">>;
|
|
1877
|
+
export interface WithMetadata<TBase extends Class<NonNullable<unknown>>> {
|
|
1869
1878
|
new (...args: ConstructorParameters<TBase>): InstanceType<TBase> & ItemMetadata;
|
|
1870
1879
|
prototype: InstanceType<TBase> & ItemMetadata;
|
|
1871
1880
|
}
|
|
1872
|
-
declare const MAX_READ_LIMIT =
|
|
1873
|
-
declare const SITE_NAME = "Esposter";
|
|
1874
|
-
declare const
|
|
1881
|
+
export declare const MAX_READ_LIMIT = 1e3;
|
|
1882
|
+
export declare const SITE_NAME = "Esposter";
|
|
1883
|
+
export declare const KIBIBYTE: number;
|
|
1884
|
+
export declare const MEGABYTE: number;
|
|
1885
|
+
export declare const GIBIBYTE: number;
|
|
1886
|
+
export declare const createExponentialBackoff: (baseDelayMs: number, maxDelayMs: number) => (<T>(operation: () => Promise<T>) => Promise<T>);
|
|
1875
1887
|
interface ErrorConfig {
|
|
1876
1888
|
withStackTrace: boolean;
|
|
1877
1889
|
}
|
|
@@ -2167,20 +2179,19 @@ declare type Traverse<T, Depth extends number = 5> = Combine<T, Depth> extends [
|
|
|
2167
2179
|
declare type TraverseWithAllErrors<T, Depth extends number = 5> = Traverse<T, Depth> extends Result<infer Oks, infer Errs> ? Result<Oks, Errs[]> : never;
|
|
2168
2180
|
declare type CombineResults<T extends readonly Result<unknown, unknown>[]> = IsLiteralArray<T> extends 1 ? Traverse<T> : Result<ExtractOkTypes<T>, ExtractErrTypes<T>[number]>;
|
|
2169
2181
|
declare type CombineResultsWithAllErrorsArray<T extends readonly Result<unknown, unknown>[]> = IsLiteralArray<T> extends 1 ? TraverseWithAllErrors<T> : Result<ExtractOkTypes<T>, ExtractErrTypes<T>[number][]>;
|
|
2170
|
-
declare const getResult: <T>(fn: () => T) => Result<T, Error>;
|
|
2171
|
-
declare const getResultAsync: <T>(fn: () => Promise<T>) => ResultAsync<T, Error>;
|
|
2172
|
-
declare const toAppError: (error: unknown) => Error;
|
|
2173
|
-
declare const withFinalizer: <T>(fn: () => T, finalizer?: () => void) => T;
|
|
2174
|
-
declare const withFinalizerAsync: <T>(fn: () => Promisable<T>, finalizer?: () => Promisable<void>) => Promise<T>;
|
|
2175
|
-
declare const classifyMentions: (message: string) => ClassifiedMentions;
|
|
2176
|
-
declare const MENTION_ID_ATTRIBUTE = "data-id";
|
|
2177
|
-
declare const MENTION_ITEM_TYPE_ATTRIBUTE = "data-mention-type";
|
|
2178
|
-
declare const MENTION_LABEL_ATTRIBUTE = "data-label";
|
|
2179
|
-
declare const MENTION_TYPE_ATTRIBUTE = "data-type";
|
|
2180
|
-
declare const MENTION_TYPE = "mention";
|
|
2181
|
-
declare const MENTION_HERE_ID = "@here";
|
|
2182
|
-
declare const MENTION_EVERYONE_ID = "@everyone";
|
|
2183
|
-
//#region src/void-tag.d.ts
|
|
2182
|
+
export declare const getResult: <T>(fn: () => T) => Result<T, Error>;
|
|
2183
|
+
export declare const getResultAsync: <T>(fn: () => Promise<T>) => ResultAsync<T, Error>;
|
|
2184
|
+
export declare const toAppError: (error: unknown) => Error;
|
|
2185
|
+
export declare const withFinalizer: <T>(fn: () => T, finalizer?: () => void) => T;
|
|
2186
|
+
export declare const withFinalizerAsync: <T>(fn: () => Promisable<T>, finalizer?: () => Promisable<void>) => Promise<T>;
|
|
2187
|
+
export declare const classifyMentions: (message: string) => ClassifiedMentions;
|
|
2188
|
+
export declare const MENTION_ID_ATTRIBUTE = "data-id";
|
|
2189
|
+
export declare const MENTION_ITEM_TYPE_ATTRIBUTE = "data-mention-type";
|
|
2190
|
+
export declare const MENTION_LABEL_ATTRIBUTE = "data-label";
|
|
2191
|
+
export declare const MENTION_TYPE_ATTRIBUTE = "data-type";
|
|
2192
|
+
export declare const MENTION_TYPE = "mention";
|
|
2193
|
+
export declare const MENTION_HERE_ID = "@here";
|
|
2194
|
+
export declare const MENTION_EVERYONE_ID = "@everyone";
|
|
2184
2195
|
declare class VoidTag {
|
|
2185
2196
|
addClosingSlash: boolean;
|
|
2186
2197
|
private voidTags;
|
|
@@ -2188,15 +2199,11 @@ declare class VoidTag {
|
|
|
2188
2199
|
formatNode(tag: string, attrs: string, innerHTML: string): string;
|
|
2189
2200
|
isVoidElement(tag: string): boolean;
|
|
2190
2201
|
}
|
|
2191
|
-
//#endregion
|
|
2192
|
-
//#region src/nodes/type.d.ts
|
|
2193
2202
|
declare enum NodeType {
|
|
2194
2203
|
ELEMENT_NODE = 1,
|
|
2195
2204
|
TEXT_NODE = 3,
|
|
2196
2205
|
COMMENT_NODE = 8
|
|
2197
2206
|
}
|
|
2198
|
-
//#endregion
|
|
2199
|
-
//#region src/nodes/node.d.ts
|
|
2200
2207
|
/**
|
|
2201
2208
|
* Node Class as base class for TextNode and HTMLElement.
|
|
2202
2209
|
*/
|
|
@@ -2219,8 +2226,6 @@ declare abstract class Node {
|
|
|
2219
2226
|
get textContent(): string;
|
|
2220
2227
|
set textContent(val: string);
|
|
2221
2228
|
}
|
|
2222
|
-
//#endregion
|
|
2223
|
-
//#region src/nodes/html.d.ts
|
|
2224
2229
|
interface KeyAttributes {
|
|
2225
2230
|
id?: string;
|
|
2226
2231
|
class?: string;
|
|
@@ -2478,48 +2483,51 @@ interface Options {
|
|
|
2478
2483
|
};
|
|
2479
2484
|
closeAllByClosing?: boolean;
|
|
2480
2485
|
}
|
|
2481
|
-
declare const getMentions: (message: string) => HTMLElement[];
|
|
2482
|
-
declare const css: typeof String.raw;
|
|
2483
|
-
declare const html: typeof String.raw;
|
|
2484
|
-
declare const sanitizeHtml: (...[html, options]: Parameters<typeof baseSanitizeHtml>) => string;
|
|
2485
|
-
declare const sanitizeTextHtml: (html: string) => string;
|
|
2486
|
-
declare const applyItemMetadataMixin: <TBase extends Class<NonNullable<unknown>>>(Base: TBase) => WithMetadata<TBase>;
|
|
2487
|
-
declare const
|
|
2488
|
-
declare const
|
|
2489
|
-
declare const
|
|
2490
|
-
declare const
|
|
2491
|
-
declare const
|
|
2492
|
-
declare const
|
|
2493
|
-
declare const
|
|
2494
|
-
declare const
|
|
2495
|
-
|
|
2496
|
-
declare const
|
|
2497
|
-
declare const
|
|
2498
|
-
|
|
2499
|
-
declare const
|
|
2500
|
-
declare const
|
|
2501
|
-
declare const
|
|
2502
|
-
declare const
|
|
2503
|
-
declare const
|
|
2504
|
-
declare const
|
|
2505
|
-
declare const
|
|
2506
|
-
declare const
|
|
2507
|
-
declare const
|
|
2508
|
-
declare const
|
|
2509
|
-
|
|
2510
|
-
|
|
2511
|
-
|
|
2512
|
-
|
|
2513
|
-
|
|
2514
|
-
|
|
2515
|
-
type
|
|
2516
|
-
type
|
|
2517
|
-
type
|
|
2518
|
-
type
|
|
2519
|
-
|
|
2520
|
-
type
|
|
2521
|
-
type
|
|
2522
|
-
|
|
2523
|
-
declare const
|
|
2524
|
-
|
|
2525
|
-
export
|
|
2486
|
+
export declare const getMentions: (message: string) => HTMLElement[];
|
|
2487
|
+
export declare const css: typeof String.raw;
|
|
2488
|
+
export declare const html: typeof String.raw;
|
|
2489
|
+
export declare const sanitizeHtml: (...[html, options]: Parameters<typeof baseSanitizeHtml>) => string;
|
|
2490
|
+
export declare const sanitizeTextHtml: (html: string) => string;
|
|
2491
|
+
export declare const applyItemMetadataMixin: <TBase extends Class<NonNullable<unknown>>>(Base: TBase) => WithMetadata<TBase>;
|
|
2492
|
+
export declare const chunk: <T>(array: T[], size: number) => T[][];
|
|
2493
|
+
export declare const chunkBySerializedSize: <T>(items: T[], maxBytes: number, maxCount: number) => T[][];
|
|
2494
|
+
export declare const takeOne: TakeOne;
|
|
2495
|
+
export declare const getIsServer: () => boolean;
|
|
2496
|
+
export declare const noop: () => void;
|
|
2497
|
+
export declare const ID_SEPARATOR = "|";
|
|
2498
|
+
export declare const UUID_LENGTH = 36;
|
|
2499
|
+
export declare const getOrCreate: <TKey, TValue>(map: Map<TKey, TValue>, key: TKey, create: () => TValue) => TValue;
|
|
2500
|
+
export declare const checkIsPlainObject: (data: unknown) => data is object;
|
|
2501
|
+
export declare const getPropertyNames: <T>() => PropertyNames<T>;
|
|
2502
|
+
export declare const jsonDateParse: <T = any>(text: string) => T;
|
|
2503
|
+
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;
|
|
2504
|
+
export declare const mergeObjectsStrict: <T extends object[]>(...objects: T) => MergeObjectsStrict<T>;
|
|
2505
|
+
export declare const settleAll: <T>(tasks: (() => Promise<T>)[], concurrencyLimit?: number) => Promise<T[]>;
|
|
2506
|
+
export declare const getRawData: <T>(data: T) => T;
|
|
2507
|
+
export declare const toRawDeep: <T extends object>(data: T) => T;
|
|
2508
|
+
export declare const capitalize: (string: string) => string;
|
|
2509
|
+
export declare const encodeUrlSubDelimiters: (value: string) => string;
|
|
2510
|
+
export declare const getDecodedUriComponent: (value: string, fallback: string) => string;
|
|
2511
|
+
export declare const normalizeString: (value: null | string | undefined) => string;
|
|
2512
|
+
export declare const createNormalizedStringSchema: (maxLength: number, schema?: z.ZodString) => z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodString>;
|
|
2513
|
+
export declare const streamToText: (readable: NodeJS.ReadableStream) => Promise<string>;
|
|
2514
|
+
export declare const toKebabCase: <T extends string>(string: T) => KebabCase<T>;
|
|
2515
|
+
export declare const truncate: (string: string, length: number) => string;
|
|
2516
|
+
export declare const uncapitalize: <T extends string>(string: T) => Uncapitalize<T>;
|
|
2517
|
+
export declare const hrtime: (previousHrTime?: [number, number]) => [number, number];
|
|
2518
|
+
export declare const now: () => string;
|
|
2519
|
+
export declare const sleep: (durationMs: number) => Promise<void>;
|
|
2520
|
+
export type BuildTuple<N extends number, T = unknown, R extends unknown[] = []> = R["length"] extends N ? R : BuildTuple<N, T, [...R, T]>;
|
|
2521
|
+
export type FunctionProperties<T> = { [K in keyof T]: T[K] extends Function ? K : never; };
|
|
2522
|
+
export type ExcludeFunctionProperties<T> = Except<T, FunctionProperties<T>[keyof T]>;
|
|
2523
|
+
export type MapValue<BaseType> = BaseType extends Map<unknown, infer ValueType> ? ValueType : never;
|
|
2524
|
+
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, []];
|
|
2525
|
+
export type SkipFirst<T extends unknown[], N extends number> = TupleSplit<T, N>[1];
|
|
2526
|
+
export type TakeFirst<T extends unknown[], N extends number> = TupleSplit<T, N>[0];
|
|
2527
|
+
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>;
|
|
2528
|
+
export declare const exhaustiveGuard: (value: never) => never;
|
|
2529
|
+
export type CreateUniqueArraySchema = (<TOutput extends object, TInput, TSchema extends z.ZodType<TOutput, TInput>>(schema: TSchema, key: UniqueArraySchemaKey<TSchema>) => z.ZodArray<TSchema>) & (<TSchema extends z.ZodType>(schema: TSchema) => z.ZodArray<TSchema>);
|
|
2530
|
+
export type UniqueArraySchemaKey<TSchema extends z.ZodType> = TSchema extends z.ZodObject ? keyof TSchema["shape"] & string : keyof z.output<TSchema> & string;
|
|
2531
|
+
export declare const createUniqueArraySchema: CreateUniqueArraySchema;
|
|
2532
|
+
export declare const UUIDV4_REGEX: RegExp;
|
|
2533
|
+
export declare const uuidValidateV4: (uuid: string) => boolean;
|