@esposter/shared 2.18.2 → 2.19.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/dist/index.d.ts +390 -76
- package/dist/index.js +1026 -942
- package/package.json +16 -16
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import { HTMLElement } from "node-html-parser";
|
|
3
2
|
|
|
3
|
+
//#region src/test/constants.d.ts
|
|
4
|
+
declare const AllSpecialValues: {
|
|
5
|
+
isPlainObject: boolean;
|
|
6
|
+
value: unknown;
|
|
7
|
+
}[];
|
|
8
|
+
//#endregion
|
|
4
9
|
//#region src/models/shared/Operation.d.ts
|
|
5
10
|
declare enum Operation {
|
|
6
11
|
Create = "Create",
|
|
@@ -8,7 +13,7 @@ declare enum Operation {
|
|
|
8
13
|
Push = "Push",
|
|
9
14
|
Read = "Read",
|
|
10
15
|
Unshift = "Unshift",
|
|
11
|
-
Update = "Update"
|
|
16
|
+
Update = "Update"
|
|
12
17
|
}
|
|
13
18
|
//#endregion
|
|
14
19
|
//#region src/models/error/InvalidOperationError.d.ts
|
|
@@ -17,13 +22,13 @@ declare class InvalidOperationError extends Error {
|
|
|
17
22
|
}
|
|
18
23
|
//#endregion
|
|
19
24
|
//#region src/models/error/NotFoundError.d.ts
|
|
20
|
-
declare class NotFoundError<T
|
|
21
|
-
constructor(name: T
|
|
25
|
+
declare class NotFoundError<T extends string = string> extends Error {
|
|
26
|
+
constructor(name: T, id: string);
|
|
22
27
|
}
|
|
23
28
|
//#endregion
|
|
24
29
|
//#region src/models/error/NotInitializedError.d.ts
|
|
25
|
-
declare class NotInitializedError<T
|
|
26
|
-
constructor(name: T
|
|
30
|
+
declare class NotInitializedError<T extends string = string> extends Error {
|
|
31
|
+
constructor(name: T);
|
|
27
32
|
}
|
|
28
33
|
//#endregion
|
|
29
34
|
//#region src/models/router/RoutePath.d.ts
|
|
@@ -39,6 +44,7 @@ declare const RoutePath: {
|
|
|
39
44
|
readonly Dungeons: "/dungeons";
|
|
40
45
|
readonly EmailEditor: "/email-editor";
|
|
41
46
|
readonly FlowchartEditor: "/flowchart-editor";
|
|
47
|
+
readonly FluidSimulator: "/fluid-simulator";
|
|
42
48
|
readonly Github: "https://github.com/Esposter/Esposter";
|
|
43
49
|
readonly Index: "/";
|
|
44
50
|
readonly Login: "/login";
|
|
@@ -58,7 +64,7 @@ declare const RoutePath: {
|
|
|
58
64
|
};
|
|
59
65
|
type RoutePath = typeof RoutePath;
|
|
60
66
|
//#endregion
|
|
61
|
-
//#region ../../node_modules/.pnpm/type-fest@5.3
|
|
67
|
+
//#region ../../node_modules/.pnpm/type-fest@5.4.3/node_modules/type-fest/source/primitive.d.ts
|
|
62
68
|
/**
|
|
63
69
|
Matches any [primitive value](https://developer.mozilla.org/en-US/docs/Glossary/Primitive).
|
|
64
70
|
|
|
@@ -66,18 +72,18 @@ Matches any [primitive value](https://developer.mozilla.org/en-US/docs/Glossary/
|
|
|
66
72
|
*/
|
|
67
73
|
type Primitive = null | undefined | string | number | boolean | symbol | bigint;
|
|
68
74
|
//#endregion
|
|
69
|
-
//#region ../../node_modules/.pnpm/type-fest@5.3
|
|
75
|
+
//#region ../../node_modules/.pnpm/type-fest@5.4.3/node_modules/type-fest/source/basic.d.ts
|
|
70
76
|
/**
|
|
71
77
|
Matches a [`class`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes).
|
|
72
78
|
|
|
73
79
|
@category Class
|
|
74
80
|
*/
|
|
75
|
-
type Class<T
|
|
76
|
-
prototype: Pick<T
|
|
77
|
-
new (...arguments_: Arguments): T
|
|
81
|
+
type Class<T, Arguments extends unknown[] = any[]> = {
|
|
82
|
+
prototype: Pick<T, keyof T>;
|
|
83
|
+
new (...arguments_: Arguments): T;
|
|
78
84
|
};
|
|
79
85
|
//#endregion
|
|
80
|
-
//#region ../../node_modules/.pnpm/type-fest@5.3
|
|
86
|
+
//#region ../../node_modules/.pnpm/type-fest@5.4.3/node_modules/type-fest/source/is-any.d.ts
|
|
81
87
|
/**
|
|
82
88
|
Returns a boolean for whether the given type is `any`.
|
|
83
89
|
|
|
@@ -106,9 +112,9 @@ const anyA = get(anyObject, 'a');
|
|
|
106
112
|
@category Type Guard
|
|
107
113
|
@category Utilities
|
|
108
114
|
*/
|
|
109
|
-
type IsAny<T
|
|
115
|
+
type IsAny<T> = 0 extends 1 & NoInfer<T> ? true : false;
|
|
110
116
|
//#endregion
|
|
111
|
-
//#region ../../node_modules/.pnpm/type-fest@5.3
|
|
117
|
+
//#region ../../node_modules/.pnpm/type-fest@5.4.3/node_modules/type-fest/source/is-optional-key-of.d.ts
|
|
112
118
|
/**
|
|
113
119
|
Returns a boolean for whether the given key is an optional key of type.
|
|
114
120
|
|
|
@@ -149,9 +155,9 @@ type T5 = IsOptionalKeyOf<User | Admin, 'surname'>;
|
|
|
149
155
|
@category Type Guard
|
|
150
156
|
@category Utilities
|
|
151
157
|
*/
|
|
152
|
-
type IsOptionalKeyOf<Type extends object, Key
|
|
158
|
+
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;
|
|
153
159
|
//#endregion
|
|
154
|
-
//#region ../../node_modules/.pnpm/type-fest@5.3
|
|
160
|
+
//#region ../../node_modules/.pnpm/type-fest@5.4.3/node_modules/type-fest/source/optional-keys-of.d.ts
|
|
155
161
|
/**
|
|
156
162
|
Extract all optional keys from the given type.
|
|
157
163
|
|
|
@@ -189,7 +195,7 @@ type OptionalKeysOf<Type extends object> = Type extends unknown // For distribut
|
|
|
189
195
|
? (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`
|
|
190
196
|
: never;
|
|
191
197
|
//#endregion
|
|
192
|
-
//#region ../../node_modules/.pnpm/type-fest@5.3
|
|
198
|
+
//#region ../../node_modules/.pnpm/type-fest@5.4.3/node_modules/type-fest/source/required-keys-of.d.ts
|
|
193
199
|
/**
|
|
194
200
|
Extract all required keys from the given type.
|
|
195
201
|
|
|
@@ -223,7 +229,7 @@ const validator3 = createValidation<User>('luckyNumber', value => value > 0);
|
|
|
223
229
|
type RequiredKeysOf<Type extends object> = Type extends unknown // For distributing `Type`
|
|
224
230
|
? Exclude<keyof Type, OptionalKeysOf<Type>> : never;
|
|
225
231
|
//#endregion
|
|
226
|
-
//#region ../../node_modules/.pnpm/type-fest@5.3
|
|
232
|
+
//#region ../../node_modules/.pnpm/type-fest@5.4.3/node_modules/type-fest/source/is-never.d.ts
|
|
227
233
|
/**
|
|
228
234
|
Returns a boolean for whether the given type is `never`.
|
|
229
235
|
|
|
@@ -264,22 +270,22 @@ type IsTrue<T> = T extends true ? true : false;
|
|
|
264
270
|
|
|
265
271
|
// When a distributive conditional is instantiated with `never`, the entire conditional results in `never`.
|
|
266
272
|
type A = IsTrue<never>;
|
|
267
|
-
|
|
273
|
+
//=> never
|
|
268
274
|
|
|
269
275
|
// If you don't want that behaviour, you can explicitly add an `IsNever` check before the distributive conditional.
|
|
270
276
|
type IsTrueFixed<T> =
|
|
271
277
|
IsNever<T> extends true ? false : T extends true ? true : false;
|
|
272
278
|
|
|
273
279
|
type B = IsTrueFixed<never>;
|
|
274
|
-
|
|
280
|
+
//=> false
|
|
275
281
|
```
|
|
276
282
|
|
|
277
283
|
@category Type Guard
|
|
278
284
|
@category Utilities
|
|
279
285
|
*/
|
|
280
|
-
type IsNever<T
|
|
286
|
+
type IsNever<T> = [T] extends [never] ? true : false;
|
|
281
287
|
//#endregion
|
|
282
|
-
//#region ../../node_modules/.pnpm/type-fest@5.3
|
|
288
|
+
//#region ../../node_modules/.pnpm/type-fest@5.4.3/node_modules/type-fest/source/if.d.ts
|
|
283
289
|
/**
|
|
284
290
|
An if-else-like type that resolves depending on whether the given `boolean` type is `true` or `false`.
|
|
285
291
|
|
|
@@ -374,7 +380,7 @@ type Works = IncludesWithoutIf<HundredZeroes, '1'>;
|
|
|
374
380
|
*/
|
|
375
381
|
type If<Type extends boolean, IfBranch, ElseBranch> = IsNever<Type> extends true ? ElseBranch : Type extends true ? IfBranch : ElseBranch;
|
|
376
382
|
//#endregion
|
|
377
|
-
//#region ../../node_modules/.pnpm/type-fest@5.3
|
|
383
|
+
//#region ../../node_modules/.pnpm/type-fest@5.4.3/node_modules/type-fest/source/internal/type.d.ts
|
|
378
384
|
/**
|
|
379
385
|
Matches any primitive, `void`, `Date`, or `RegExp` value.
|
|
380
386
|
*/
|
|
@@ -387,12 +393,12 @@ Needed to handle the case of a single call signature with properties.
|
|
|
387
393
|
Multiple call signatures cannot currently be supported due to a TypeScript limitation.
|
|
388
394
|
@see https://github.com/microsoft/TypeScript/issues/29732
|
|
389
395
|
*/
|
|
390
|
-
type HasMultipleCallSignatures<T
|
|
396
|
+
type HasMultipleCallSignatures<T extends (...arguments_: any[]) => unknown> = T extends {
|
|
391
397
|
(...arguments_: infer A): unknown;
|
|
392
398
|
(...arguments_: infer B): unknown;
|
|
393
399
|
} ? B extends A ? A extends B ? false : true : true : false;
|
|
394
400
|
//#endregion
|
|
395
|
-
//#region ../../node_modules/.pnpm/type-fest@5.3
|
|
401
|
+
//#region ../../node_modules/.pnpm/type-fest@5.4.3/node_modules/type-fest/source/simplify.d.ts
|
|
396
402
|
/**
|
|
397
403
|
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.
|
|
398
404
|
|
|
@@ -451,9 +457,9 @@ fn(someInterface as Simplify<SomeInterface>); // Good: transform an `interface`
|
|
|
451
457
|
@see {@link SimplifyDeep}
|
|
452
458
|
@category Object
|
|
453
459
|
*/
|
|
454
|
-
type Simplify<T
|
|
460
|
+
type Simplify<T> = { [KeyType in keyof T]: T[KeyType] } & {};
|
|
455
461
|
//#endregion
|
|
456
|
-
//#region ../../node_modules/.pnpm/type-fest@5.3
|
|
462
|
+
//#region ../../node_modules/.pnpm/type-fest@5.4.3/node_modules/type-fest/source/is-equal.d.ts
|
|
457
463
|
/**
|
|
458
464
|
Returns a boolean for whether the two given types are equal.
|
|
459
465
|
|
|
@@ -484,7 +490,7 @@ type IsEqual<A, B> = [A] extends [B] ? [B] extends [A] ? _IsEqual<A, B> : false
|
|
|
484
490
|
// This version fails the `equalWrappedTupleIntersectionToBeNeverAndNeverExpanded` test in `test-d/is-equal.ts`.
|
|
485
491
|
type _IsEqual<A, B> = (<G>() => G extends A & G | G ? 1 : 2) extends (<G>() => G extends B & G | G ? 1 : 2) ? true : false;
|
|
486
492
|
//#endregion
|
|
487
|
-
//#region ../../node_modules/.pnpm/type-fest@5.3
|
|
493
|
+
//#region ../../node_modules/.pnpm/type-fest@5.4.3/node_modules/type-fest/source/omit-index-signature.d.ts
|
|
488
494
|
/**
|
|
489
495
|
Omit any index signatures from the given object type, leaving only explicitly defined properties.
|
|
490
496
|
|
|
@@ -504,7 +510,7 @@ const indexed: Record<string, unknown> = {}; // Allowed
|
|
|
504
510
|
|
|
505
511
|
// @ts-expect-error
|
|
506
512
|
const keyed: Record<'foo', unknown> = {}; // Error
|
|
507
|
-
//
|
|
513
|
+
// TS2739: Type '{}' is missing the following properties from type 'Record<"foo" | "bar", unknown>': foo, bar
|
|
508
514
|
```
|
|
509
515
|
|
|
510
516
|
Instead of causing a type error like the above, you can also use a [conditional type](https://www.typescriptlang.org/docs/handbook/2/conditional-types.html) to test whether a type is assignable to another:
|
|
@@ -513,12 +519,16 @@ Instead of causing a type error like the above, you can also use a [conditional
|
|
|
513
519
|
type Indexed = {} extends Record<string, unknown>
|
|
514
520
|
? '✅ `{}` is assignable to `Record<string, unknown>`'
|
|
515
521
|
: '❌ `{}` is NOT assignable to `Record<string, unknown>`';
|
|
516
|
-
|
|
522
|
+
|
|
523
|
+
type IndexedResult = Indexed;
|
|
524
|
+
//=> '✅ `{}` is assignable to `Record<string, unknown>`'
|
|
517
525
|
|
|
518
526
|
type Keyed = {} extends Record<'foo' | 'bar', unknown>
|
|
519
527
|
? '✅ `{}` is assignable to `Record<\'foo\' | \'bar\', unknown>`'
|
|
520
528
|
: '❌ `{}` is NOT assignable to `Record<\'foo\' | \'bar\', unknown>`';
|
|
521
|
-
|
|
529
|
+
|
|
530
|
+
type KeyedResult = Keyed;
|
|
531
|
+
//=> '❌ `{}` is NOT assignable to `Record<\'foo\' | \'bar\', unknown>`'
|
|
522
532
|
```
|
|
523
533
|
|
|
524
534
|
Using a [mapped type](https://www.typescriptlang.org/docs/handbook/2/mapped-types.html#further-exploration), you can then check for each `KeyType` of `ObjectType`...
|
|
@@ -566,7 +576,7 @@ type Example = {
|
|
|
566
576
|
};
|
|
567
577
|
|
|
568
578
|
type ExampleWithoutIndexSignatures = OmitIndexSignature<Example>;
|
|
569
|
-
|
|
579
|
+
//=> {foo: 'bar'; qux?: 'baz'}
|
|
570
580
|
```
|
|
571
581
|
|
|
572
582
|
@see {@link PickIndexSignature}
|
|
@@ -574,7 +584,7 @@ type ExampleWithoutIndexSignatures = OmitIndexSignature<Example>;
|
|
|
574
584
|
*/
|
|
575
585
|
type OmitIndexSignature<ObjectType> = { [KeyType in keyof ObjectType as {} extends Record<KeyType, unknown> ? never : KeyType]: ObjectType[KeyType] };
|
|
576
586
|
//#endregion
|
|
577
|
-
//#region ../../node_modules/.pnpm/type-fest@5.3
|
|
587
|
+
//#region ../../node_modules/.pnpm/type-fest@5.4.3/node_modules/type-fest/source/pick-index-signature.d.ts
|
|
578
588
|
/**
|
|
579
589
|
Pick only index signatures from the given object type, leaving out all explicitly defined properties.
|
|
580
590
|
|
|
@@ -622,10 +632,9 @@ type ExampleIndexSignature = PickIndexSignature<Example>;
|
|
|
622
632
|
*/
|
|
623
633
|
type PickIndexSignature<ObjectType> = { [KeyType in keyof ObjectType as {} extends Record<KeyType, unknown> ? KeyType : never]: ObjectType[KeyType] };
|
|
624
634
|
//#endregion
|
|
625
|
-
//#region ../../node_modules/.pnpm/type-fest@5.3
|
|
635
|
+
//#region ../../node_modules/.pnpm/type-fest@5.4.3/node_modules/type-fest/source/merge.d.ts
|
|
626
636
|
// Merges two objects without worrying about index signatures.
|
|
627
|
-
type SimpleMerge<Destination, Source> = { [Key in keyof Destination as Key extends keyof Source ? never : Key]: Destination[Key] } & Source
|
|
628
|
-
|
|
637
|
+
type SimpleMerge<Destination, Source> = Simplify<{ [Key in keyof Destination as Key extends keyof Source ? never : Key]: Destination[Key] } & Source>;
|
|
629
638
|
/**
|
|
630
639
|
Merge two types into a new type. Keys of the second type overrides keys of the first type.
|
|
631
640
|
|
|
@@ -648,7 +657,7 @@ type Bar = {
|
|
|
648
657
|
};
|
|
649
658
|
|
|
650
659
|
export type FooBar = Merge<Foo, Bar>;
|
|
651
|
-
|
|
660
|
+
//=> {
|
|
652
661
|
// [x: string]: unknown;
|
|
653
662
|
// [x: number]: number;
|
|
654
663
|
// [x: symbol]: unknown;
|
|
@@ -658,11 +667,19 @@ export type FooBar = Merge<Foo, Bar>;
|
|
|
658
667
|
// }
|
|
659
668
|
```
|
|
660
669
|
|
|
670
|
+
Note: If you want a merge type that more accurately reflects the runtime behavior of object spread or `Object.assign`, refer to the {@link ObjectMerge} type.
|
|
671
|
+
|
|
672
|
+
@see {@link ObjectMerge}
|
|
661
673
|
@category Object
|
|
662
674
|
*/
|
|
663
|
-
type Merge<Destination, Source> =
|
|
675
|
+
type Merge<Destination, Source> = Destination extends unknown // For distributing `Destination`
|
|
676
|
+
? Source extends unknown // For distributing `Source`
|
|
677
|
+
? If<IsEqual<Destination, Source>, Destination, _Merge<Destination, Source>> : never // Should never happen
|
|
678
|
+
: never;
|
|
679
|
+
// Should never happen
|
|
680
|
+
type _Merge<Destination, Source> = Simplify<SimpleMerge<PickIndexSignature<Destination>, PickIndexSignature<Source>> & SimpleMerge<OmitIndexSignature<Destination>, OmitIndexSignature<Source>>>;
|
|
664
681
|
//#endregion
|
|
665
|
-
//#region ../../node_modules/.pnpm/type-fest@5.3
|
|
682
|
+
//#region ../../node_modules/.pnpm/type-fest@5.4.3/node_modules/type-fest/source/internal/object.d.ts
|
|
666
683
|
/**
|
|
667
684
|
Merges user specified options with default options.
|
|
668
685
|
|
|
@@ -717,7 +734,7 @@ type Result = ApplyDefaultOptions<PathsOptions, DefaultPathsOptions, SpecifiedOp
|
|
|
717
734
|
*/
|
|
718
735
|
type ApplyDefaultOptions<Options extends object, Defaults extends Simplify<Omit<Required<Options>, RequiredKeysOf<Options>> & Partial<Record<RequiredKeysOf<Options>, never>>>, SpecifiedOptions extends Options> = If<IsAny<SpecifiedOptions>, Defaults, If<IsNever<SpecifiedOptions>, Defaults, Simplify<Merge<Defaults, { [Key in keyof SpecifiedOptions as Key extends OptionalKeysOf<Options> ? undefined extends SpecifiedOptions[Key] ? never : Key : Key]: SpecifiedOptions[Key] }> & Required<Options>>>>;
|
|
719
736
|
//#endregion
|
|
720
|
-
//#region ../../node_modules/.pnpm/type-fest@5.3
|
|
737
|
+
//#region ../../node_modules/.pnpm/type-fest@5.4.3/node_modules/type-fest/source/except.d.ts
|
|
721
738
|
/**
|
|
722
739
|
Filter out keys from an object.
|
|
723
740
|
|
|
@@ -745,7 +762,7 @@ type Filtered = Filter<'bar', 'foo'>;
|
|
|
745
762
|
|
|
746
763
|
@see {Except}
|
|
747
764
|
*/
|
|
748
|
-
type Filter<KeyType
|
|
765
|
+
type Filter<KeyType, ExcludeType> = IsEqual<KeyType, ExcludeType> extends true ? never : (KeyType extends ExcludeType ? never : KeyType);
|
|
749
766
|
type ExceptOptions = {
|
|
750
767
|
/**
|
|
751
768
|
Disallow assigning non-specified properties.
|
|
@@ -757,7 +774,6 @@ type ExceptOptions = {
|
|
|
757
774
|
type DefaultExceptOptions = {
|
|
758
775
|
requireExactProps: false;
|
|
759
776
|
};
|
|
760
|
-
|
|
761
777
|
/**
|
|
762
778
|
Create a type from an object type without certain keys.
|
|
763
779
|
|
|
@@ -781,14 +797,14 @@ type FooWithoutA = Except<Foo, 'a'>;
|
|
|
781
797
|
|
|
782
798
|
// @ts-expect-error
|
|
783
799
|
const fooWithoutA: FooWithoutA = {a: 1, b: '2'};
|
|
784
|
-
|
|
800
|
+
// errors: 'a' does not exist in type '{ b: string; }'
|
|
785
801
|
|
|
786
802
|
type FooWithoutB = Except<Foo, 'b', {requireExactProps: true}>;
|
|
787
|
-
//=> {a: number} & Partial<Record<
|
|
803
|
+
//=> {a: number} & Partial<Record<'b', never>>
|
|
788
804
|
|
|
789
805
|
// @ts-expect-error
|
|
790
806
|
const fooWithoutB: FooWithoutB = {a: 1, b: '2'};
|
|
791
|
-
|
|
807
|
+
// errors at 'b': Type 'string' is not assignable to type 'undefined'.
|
|
792
808
|
|
|
793
809
|
// The `Omit` utility type doesn't work when omitting specific keys from objects containing index signatures.
|
|
794
810
|
|
|
@@ -803,12 +819,12 @@ type UserData = {
|
|
|
803
819
|
|
|
804
820
|
// `Omit` clearly doesn't behave as expected in this case:
|
|
805
821
|
type PostPayload = Omit<UserData, 'email'>;
|
|
806
|
-
//=> {
|
|
822
|
+
//=> {[x: string]: string; [x: number]: string}
|
|
807
823
|
|
|
808
824
|
// In situations like this, `Except` works better.
|
|
809
825
|
// It simply removes the `email` key while preserving all the other keys.
|
|
810
826
|
type PostPayloadFixed = Except<UserData, 'email'>;
|
|
811
|
-
//=> {
|
|
827
|
+
//=> {[x: string]: string; name: string; role: 'admin' | 'user'}
|
|
812
828
|
```
|
|
813
829
|
|
|
814
830
|
@category Object
|
|
@@ -816,7 +832,7 @@ type PostPayloadFixed = Except<UserData, 'email'>;
|
|
|
816
832
|
type Except<ObjectType, KeysType extends keyof ObjectType, Options extends ExceptOptions = {}> = _Except<ObjectType, KeysType, ApplyDefaultOptions<ExceptOptions, DefaultExceptOptions, Options>>;
|
|
817
833
|
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>> : {});
|
|
818
834
|
//#endregion
|
|
819
|
-
//#region ../../node_modules/.pnpm/type-fest@5.3
|
|
835
|
+
//#region ../../node_modules/.pnpm/type-fest@5.4.3/node_modules/type-fest/source/required-deep.d.ts
|
|
820
836
|
/**
|
|
821
837
|
Create a type from another type with all keys and nested keys set to required.
|
|
822
838
|
|
|
@@ -858,19 +874,20 @@ Note that types containing overloaded functions are not made deeply required due
|
|
|
858
874
|
@category Set
|
|
859
875
|
@category Map
|
|
860
876
|
*/
|
|
861
|
-
type RequiredDeep<T
|
|
877
|
+
type RequiredDeep<T> = T extends BuiltIns ? T : T extends Map<infer KeyType, infer ValueType> ? Map<RequiredDeep<KeyType>, RequiredDeep<ValueType>> : T extends Set<infer ItemType> ? Set<RequiredDeep<ItemType>> : T extends ReadonlyMap<infer KeyType, infer ValueType> ? ReadonlyMap<RequiredDeep<KeyType>, RequiredDeep<ValueType>> : T extends ReadonlySet<infer ItemType> ? ReadonlySet<RequiredDeep<ItemType>> : T extends WeakMap<infer KeyType, infer ValueType> ? WeakMap<RequiredDeep<KeyType>, RequiredDeep<ValueType>> : T extends WeakSet<infer ItemType> ? WeakSet<RequiredDeep<ItemType>> : T extends Promise<infer ValueType> ? Promise<RequiredDeep<ValueType>> : T extends ((...arguments_: any[]) => unknown) ? IsNever<keyof T> extends true ? T : HasMultipleCallSignatures<T> extends true ? T : ((...arguments_: Parameters<T>) => ReturnType<T>) & RequiredObjectDeep<T> : T extends object ? Simplify<RequiredObjectDeep<T>> // `Simplify` to prevent `RequiredObjectDeep` from appearing in the resulting type
|
|
878
|
+
: unknown;
|
|
862
879
|
type RequiredObjectDeep<ObjectType extends object> = { [KeyType in keyof ObjectType]-?: RequiredDeep<ObjectType[KeyType]> };
|
|
863
880
|
//#endregion
|
|
864
881
|
//#region src/util/types/PropertyNames.d.ts
|
|
865
|
-
type PropertyNames<T
|
|
882
|
+
type PropertyNames<T> = RequiredDeep<{ [P in keyof T]: P }>;
|
|
866
883
|
//#endregion
|
|
867
884
|
//#region src/models/shared/ItemEntityType.d.ts
|
|
868
|
-
interface ItemEntityType<T
|
|
869
|
-
type: T
|
|
885
|
+
interface ItemEntityType<T extends string> {
|
|
886
|
+
type: T;
|
|
870
887
|
}
|
|
871
888
|
declare const ItemEntityTypePropertyNames: PropertyNames<ItemEntityType<string>>;
|
|
872
|
-
declare const createItemEntityTypeSchema: <T
|
|
873
|
-
type: T
|
|
889
|
+
declare const createItemEntityTypeSchema: <T extends z.ZodType<string>>(schema: T) => z.ZodObject<{
|
|
890
|
+
type: T;
|
|
874
891
|
}>;
|
|
875
892
|
//#endregion
|
|
876
893
|
//#region src/models/shared/ItemMetadata.d.ts
|
|
@@ -891,23 +908,29 @@ declare abstract class Serializable {
|
|
|
891
908
|
toJSON(): string;
|
|
892
909
|
}
|
|
893
910
|
//#endregion
|
|
911
|
+
//#region src/models/shared/TakeOne.d.ts
|
|
912
|
+
interface TakeOne {
|
|
913
|
+
<T extends readonly unknown[]>(values: T, index?: number): T[number];
|
|
914
|
+
<T extends Record<PropertyKey, unknown>>(values: T, index: keyof T): T[keyof T];
|
|
915
|
+
}
|
|
916
|
+
//#endregion
|
|
894
917
|
//#region src/util/types/DeepOmitArray.d.ts
|
|
895
918
|
type DeepOmitArray<TArray extends unknown[], TKey> = { [P in keyof TArray]: DeepOmit<TArray[P], TKey> };
|
|
896
919
|
//#endregion
|
|
897
920
|
//#region src/util/types/DeepOmit.d.ts
|
|
898
|
-
type DeepOmit<T
|
|
921
|
+
type DeepOmit<T, TKey> = T extends Primitive ? T : { [P in Exclude<keyof T, TKey>]: T[P] extends infer TP ? TP extends Date | Function | Primitive ? TP : TP extends unknown[] ? DeepOmitArray<TP, TKey> : Record<string, unknown> extends TP ? TP : DeepOmit<TP, TKey> : never };
|
|
899
922
|
//#endregion
|
|
900
923
|
//#region src/util/types/DeepOptionalProperties.d.ts
|
|
901
|
-
type DeepOptionalProperties<T
|
|
924
|
+
type DeepOptionalProperties<T> = { [K in keyof T as undefined extends T[K] ? K : never]?: DeepOptionalProperties<T[K]> };
|
|
902
925
|
//#endregion
|
|
903
926
|
//#region src/util/types/DeepRequiredProperties.d.ts
|
|
904
|
-
type DeepRequiredProperties<T
|
|
927
|
+
type DeepRequiredProperties<T> = { [K in keyof T as undefined extends T[K] ? never : K]: DeepRequiredProperties<T[K]> };
|
|
905
928
|
//#endregion
|
|
906
929
|
//#region src/util/types/DeepOptionalUndefined.d.ts
|
|
907
|
-
type DeepOptionalUndefined<T
|
|
930
|
+
type DeepOptionalUndefined<T> = T extends ((...args: unknown[]) => unknown) ? T : T extends (infer U)[] ? DeepOptionalUndefined<U>[] : T extends readonly (infer U)[] ? readonly DeepOptionalUndefined<U>[] : T extends Date ? T : T extends object ? keyof T extends never ? never : DeepOptionalProperties<T> extends Record<never, unknown> ? DeepRequiredProperties<T> : DeepRequiredProperties<T> extends Record<never, unknown> ? DeepOptionalProperties<T> : DeepOptionalProperties<T> & DeepRequiredProperties<T> : T;
|
|
908
931
|
//#endregion
|
|
909
932
|
//#region src/models/shared/ToData.d.ts
|
|
910
|
-
type ToData<T
|
|
933
|
+
type ToData<T extends Serializable> = DeepOptionalUndefined<DeepOmit<T, "toJSON">>;
|
|
911
934
|
//#endregion
|
|
912
935
|
//#region src/models/shared/WithMetadata.d.ts
|
|
913
936
|
interface WithMetadata<TBase extends Class<NonNullable<unknown>>> {
|
|
@@ -924,6 +947,294 @@ declare const MENTION_LABEL_ATTRIBUTE = "data-label";
|
|
|
924
947
|
declare const MENTION_TYPE_ATTRIBUTE = "data-type";
|
|
925
948
|
declare const MENTION_TYPE = "mention";
|
|
926
949
|
//#endregion
|
|
950
|
+
//#region ../../node_modules/.pnpm/node-html-parser@7.0.2/node_modules/node-html-parser/dist/void-tag.d.ts
|
|
951
|
+
declare class VoidTag {
|
|
952
|
+
addClosingSlash: boolean;
|
|
953
|
+
private voidTags;
|
|
954
|
+
constructor(addClosingSlash?: boolean, tags?: string[]);
|
|
955
|
+
formatNode(tag: string, attrs: string, innerHTML: string): string;
|
|
956
|
+
isVoidElement(tag: string): boolean;
|
|
957
|
+
}
|
|
958
|
+
//#endregion
|
|
959
|
+
//#region ../../node_modules/.pnpm/node-html-parser@7.0.2/node_modules/node-html-parser/dist/nodes/type.d.ts
|
|
960
|
+
declare enum NodeType {
|
|
961
|
+
ELEMENT_NODE = 1,
|
|
962
|
+
TEXT_NODE = 3,
|
|
963
|
+
COMMENT_NODE = 8
|
|
964
|
+
}
|
|
965
|
+
//#endregion
|
|
966
|
+
//#region ../../node_modules/.pnpm/node-html-parser@7.0.2/node_modules/node-html-parser/dist/nodes/node.d.ts
|
|
967
|
+
/**
|
|
968
|
+
* Node Class as base class for TextNode and HTMLElement.
|
|
969
|
+
*/
|
|
970
|
+
declare abstract class Node {
|
|
971
|
+
parentNode: HTMLElement;
|
|
972
|
+
abstract rawTagName: string;
|
|
973
|
+
abstract nodeType: NodeType;
|
|
974
|
+
childNodes: Node[];
|
|
975
|
+
range: readonly [number, number];
|
|
976
|
+
abstract text: string;
|
|
977
|
+
abstract rawText: string;
|
|
978
|
+
abstract toString(): string;
|
|
979
|
+
abstract clone(): Node;
|
|
980
|
+
constructor(parentNode?: HTMLElement, range?: [number, number]);
|
|
981
|
+
/**
|
|
982
|
+
* Remove current node
|
|
983
|
+
*/
|
|
984
|
+
remove(): this;
|
|
985
|
+
get innerText(): string;
|
|
986
|
+
get textContent(): string;
|
|
987
|
+
set textContent(val: string);
|
|
988
|
+
}
|
|
989
|
+
//#endregion
|
|
990
|
+
//#region ../../node_modules/.pnpm/node-html-parser@7.0.2/node_modules/node-html-parser/dist/nodes/html.d.ts
|
|
991
|
+
interface KeyAttributes {
|
|
992
|
+
id?: string;
|
|
993
|
+
class?: string;
|
|
994
|
+
}
|
|
995
|
+
interface Attributes {
|
|
996
|
+
[key: string]: string;
|
|
997
|
+
}
|
|
998
|
+
interface RawAttributes {
|
|
999
|
+
[key: string]: string;
|
|
1000
|
+
}
|
|
1001
|
+
type InsertPosition = 'beforebegin' | 'afterbegin' | 'beforeend' | 'afterend';
|
|
1002
|
+
type NodeInsertable = Node | string;
|
|
1003
|
+
declare class DOMTokenList {
|
|
1004
|
+
private _set;
|
|
1005
|
+
private _afterUpdate;
|
|
1006
|
+
private _validate;
|
|
1007
|
+
constructor(valuesInit?: string[], afterUpdate?: (t: DOMTokenList) => void);
|
|
1008
|
+
add(c: string): void;
|
|
1009
|
+
replace(c1: string, c2: string): void;
|
|
1010
|
+
remove(c: string): void;
|
|
1011
|
+
toggle(c: string): void;
|
|
1012
|
+
contains(c: string): boolean;
|
|
1013
|
+
get length(): number;
|
|
1014
|
+
values(): IterableIterator<string>;
|
|
1015
|
+
get value(): string[];
|
|
1016
|
+
toString(): string;
|
|
1017
|
+
}
|
|
1018
|
+
/**
|
|
1019
|
+
* HTMLElement, which contains a set of children.
|
|
1020
|
+
*
|
|
1021
|
+
* Note: this is a minimalist implementation, no complete tree
|
|
1022
|
+
* structure provided (no parentNode, nextSibling,
|
|
1023
|
+
* previousSibling etc).
|
|
1024
|
+
* @class HTMLElement
|
|
1025
|
+
* @extends {Node}
|
|
1026
|
+
*/
|
|
1027
|
+
declare class HTMLElement extends Node {
|
|
1028
|
+
rawAttrs: string;
|
|
1029
|
+
private voidTag;
|
|
1030
|
+
private _attrs;
|
|
1031
|
+
private _rawAttrs;
|
|
1032
|
+
private _parseOptions;
|
|
1033
|
+
private _id;
|
|
1034
|
+
rawTagName: string;
|
|
1035
|
+
classList: DOMTokenList;
|
|
1036
|
+
/**
|
|
1037
|
+
* Node Type declaration.
|
|
1038
|
+
*/
|
|
1039
|
+
nodeType: NodeType;
|
|
1040
|
+
/**
|
|
1041
|
+
* Quote attribute values
|
|
1042
|
+
* @param attr attribute value
|
|
1043
|
+
* @returns {string} quoted value
|
|
1044
|
+
*/
|
|
1045
|
+
private quoteAttribute;
|
|
1046
|
+
/**
|
|
1047
|
+
* Creates an instance of HTMLElement.
|
|
1048
|
+
* @param keyAttrs id and class attribute
|
|
1049
|
+
* @param [rawAttrs] attributes in string
|
|
1050
|
+
*
|
|
1051
|
+
* @memberof HTMLElement
|
|
1052
|
+
*/
|
|
1053
|
+
constructor(tagName: string, keyAttrs: KeyAttributes, rawAttrs?: string, parentNode?: HTMLElement, range?: [number, number], voidTag?: VoidTag, _parseOptions?: Partial<Options>);
|
|
1054
|
+
/**
|
|
1055
|
+
* Remove Child element from childNodes array
|
|
1056
|
+
* @param {HTMLElement} node node to remove
|
|
1057
|
+
*/
|
|
1058
|
+
removeChild(node: Node): this;
|
|
1059
|
+
/**
|
|
1060
|
+
* Exchanges given child with new child
|
|
1061
|
+
* @param {HTMLElement} oldNode node to exchange
|
|
1062
|
+
* @param {HTMLElement} newNode new node
|
|
1063
|
+
*/
|
|
1064
|
+
exchangeChild(oldNode: Node, newNode: Node): this;
|
|
1065
|
+
get tagName(): string;
|
|
1066
|
+
set tagName(newname: string);
|
|
1067
|
+
get localName(): string;
|
|
1068
|
+
get isVoidElement(): boolean;
|
|
1069
|
+
get id(): string;
|
|
1070
|
+
set id(newid: string);
|
|
1071
|
+
/**
|
|
1072
|
+
* Get escpaed (as-it) text value of current node and its children.
|
|
1073
|
+
* @return {string} text content
|
|
1074
|
+
*/
|
|
1075
|
+
get rawText(): string;
|
|
1076
|
+
get textContent(): string;
|
|
1077
|
+
set textContent(val: string);
|
|
1078
|
+
/**
|
|
1079
|
+
* Get unescaped text value of current node and its children.
|
|
1080
|
+
* @return {string} text content
|
|
1081
|
+
*/
|
|
1082
|
+
get text(): string;
|
|
1083
|
+
/**
|
|
1084
|
+
* Get structured Text (with '\n' etc.)
|
|
1085
|
+
* @return {string} structured text
|
|
1086
|
+
*/
|
|
1087
|
+
get structuredText(): string;
|
|
1088
|
+
toString(): string;
|
|
1089
|
+
get innerHTML(): string;
|
|
1090
|
+
set innerHTML(content: string);
|
|
1091
|
+
set_content(content: string | Node | Node[], options?: Partial<Options>): this;
|
|
1092
|
+
replaceWith(...nodes: (string | Node)[]): this;
|
|
1093
|
+
get outerHTML(): string;
|
|
1094
|
+
/**
|
|
1095
|
+
* Trim element from right (in block) after seeing pattern in a TextNode.
|
|
1096
|
+
* @param {RegExp} pattern pattern to find
|
|
1097
|
+
* @return {HTMLElement} reference to current node
|
|
1098
|
+
*/
|
|
1099
|
+
trimRight(pattern: RegExp): this;
|
|
1100
|
+
/**
|
|
1101
|
+
* Get DOM structure
|
|
1102
|
+
* @return {string} structure
|
|
1103
|
+
*/
|
|
1104
|
+
get structure(): string;
|
|
1105
|
+
/**
|
|
1106
|
+
* Remove whitespaces in this sub tree.
|
|
1107
|
+
* @return {HTMLElement} pointer to this
|
|
1108
|
+
*/
|
|
1109
|
+
removeWhitespace(): this;
|
|
1110
|
+
/**
|
|
1111
|
+
* Query CSS selector to find matching nodes.
|
|
1112
|
+
* @param {string} selector Simplified CSS selector
|
|
1113
|
+
* @return {HTMLElement[]} matching elements
|
|
1114
|
+
*/
|
|
1115
|
+
querySelectorAll(selector: string): HTMLElement[];
|
|
1116
|
+
/**
|
|
1117
|
+
* Query CSS Selector to find matching node.
|
|
1118
|
+
* @param {string} selector Simplified CSS selector
|
|
1119
|
+
* @return {(HTMLElement|null)} matching node
|
|
1120
|
+
*/
|
|
1121
|
+
querySelector(selector: string): HTMLElement | null;
|
|
1122
|
+
/**
|
|
1123
|
+
* find elements by their tagName
|
|
1124
|
+
* @param {string} tagName the tagName of the elements to select
|
|
1125
|
+
*/
|
|
1126
|
+
getElementsByTagName(tagName: string): Array<HTMLElement>;
|
|
1127
|
+
/**
|
|
1128
|
+
* find element by it's id
|
|
1129
|
+
* @param {string} id the id of the element to select
|
|
1130
|
+
* @returns {HTMLElement | null} the element with the given id or null if not found
|
|
1131
|
+
*/
|
|
1132
|
+
getElementById(id: string): HTMLElement | null;
|
|
1133
|
+
/**
|
|
1134
|
+
* traverses the Element and its parents (heading toward the document root) until it finds a node that matches the provided selector string. Will return itself or the matching ancestor. If no such element exists, it returns null.
|
|
1135
|
+
* @param selector a DOMString containing a selector list
|
|
1136
|
+
* @returns {HTMLElement | null} the element with the given id or null if not found
|
|
1137
|
+
*/
|
|
1138
|
+
closest(selector: string): HTMLElement | null;
|
|
1139
|
+
/**
|
|
1140
|
+
* Append a child node to childNodes
|
|
1141
|
+
* @param {Node} node node to append
|
|
1142
|
+
* @return {Node} node appended
|
|
1143
|
+
*/
|
|
1144
|
+
appendChild<T extends Node = Node>(node: T): T;
|
|
1145
|
+
/**
|
|
1146
|
+
* Get attributes
|
|
1147
|
+
* @access private
|
|
1148
|
+
* @return {Object} parsed and unescaped attributes
|
|
1149
|
+
*/
|
|
1150
|
+
get attrs(): Attributes;
|
|
1151
|
+
get attributes(): Record<string, string>;
|
|
1152
|
+
/**
|
|
1153
|
+
* Get escaped (as-is) attributes
|
|
1154
|
+
* @return {Object} parsed attributes
|
|
1155
|
+
*/
|
|
1156
|
+
get rawAttributes(): RawAttributes;
|
|
1157
|
+
removeAttribute(key: string): this;
|
|
1158
|
+
hasAttribute(key: string): boolean;
|
|
1159
|
+
/**
|
|
1160
|
+
* Get an attribute
|
|
1161
|
+
* @return {string | undefined} value of the attribute; or undefined if not exist
|
|
1162
|
+
*/
|
|
1163
|
+
getAttribute(key: string): string | undefined;
|
|
1164
|
+
/**
|
|
1165
|
+
* Set an attribute value to the HTMLElement
|
|
1166
|
+
* @param {string} key The attribute name
|
|
1167
|
+
* @param {string} value The value to set, or null / undefined to remove an attribute
|
|
1168
|
+
*/
|
|
1169
|
+
setAttribute(key: string, value: string): this;
|
|
1170
|
+
/**
|
|
1171
|
+
* Replace all the attributes of the HTMLElement by the provided attributes
|
|
1172
|
+
* @param {Attributes} attributes the new attribute set
|
|
1173
|
+
*/
|
|
1174
|
+
setAttributes(attributes: Attributes): this;
|
|
1175
|
+
insertAdjacentHTML(where: InsertPosition, html: string): this;
|
|
1176
|
+
/** Prepend nodes or strings to this node's children. */
|
|
1177
|
+
prepend(...insertable: NodeInsertable[]): void;
|
|
1178
|
+
/** Append nodes or strings to this node's children. */
|
|
1179
|
+
append(...insertable: NodeInsertable[]): void;
|
|
1180
|
+
/** Insert nodes or strings before this node. */
|
|
1181
|
+
before(...insertable: NodeInsertable[]): void;
|
|
1182
|
+
/** Insert nodes or strings after this node. */
|
|
1183
|
+
after(...insertable: NodeInsertable[]): void;
|
|
1184
|
+
get nextSibling(): Node | null;
|
|
1185
|
+
get nextElementSibling(): HTMLElement | null;
|
|
1186
|
+
get previousSibling(): Node | null;
|
|
1187
|
+
get previousElementSibling(): HTMLElement | null;
|
|
1188
|
+
/** Get all childNodes of type {@link HTMLElement}. */
|
|
1189
|
+
get children(): HTMLElement[];
|
|
1190
|
+
/**
|
|
1191
|
+
* Get the first child node.
|
|
1192
|
+
* @return The first child or undefined if none exists.
|
|
1193
|
+
*/
|
|
1194
|
+
get firstChild(): Node | undefined;
|
|
1195
|
+
/**
|
|
1196
|
+
* Get the first child node of type {@link HTMLElement}.
|
|
1197
|
+
* @return The first child element or undefined if none exists.
|
|
1198
|
+
*/
|
|
1199
|
+
get firstElementChild(): HTMLElement | undefined;
|
|
1200
|
+
/**
|
|
1201
|
+
* Get the last child node.
|
|
1202
|
+
* @return The last child or undefined if none exists.
|
|
1203
|
+
*/
|
|
1204
|
+
get lastChild(): Node | undefined;
|
|
1205
|
+
/**
|
|
1206
|
+
* Get the last child node of type {@link HTMLElement}.
|
|
1207
|
+
* @return The last child element or undefined if none exists.
|
|
1208
|
+
*/
|
|
1209
|
+
get lastElementChild(): HTMLElement | undefined;
|
|
1210
|
+
get childElementCount(): number;
|
|
1211
|
+
get classNames(): string;
|
|
1212
|
+
/** Clone this Node */
|
|
1213
|
+
clone(): Node;
|
|
1214
|
+
}
|
|
1215
|
+
interface Options {
|
|
1216
|
+
lowerCaseTagName?: boolean;
|
|
1217
|
+
comment?: boolean;
|
|
1218
|
+
/**
|
|
1219
|
+
* @see PR #215 for explanation
|
|
1220
|
+
*/
|
|
1221
|
+
fixNestedATags?: boolean;
|
|
1222
|
+
parseNoneClosedTags?: boolean;
|
|
1223
|
+
blockTextElements: {
|
|
1224
|
+
[tag: string]: boolean;
|
|
1225
|
+
};
|
|
1226
|
+
voidTag?: {
|
|
1227
|
+
/**
|
|
1228
|
+
* options, default value is ['area', 'base', 'br', 'col', 'embed', 'hr', 'img', 'input', 'link', 'meta', 'param', 'source', 'track', 'wbr']
|
|
1229
|
+
*/
|
|
1230
|
+
tags?: string[];
|
|
1231
|
+
/**
|
|
1232
|
+
* void tag serialisation, add a final slash <br/>
|
|
1233
|
+
*/
|
|
1234
|
+
closingSlash?: boolean;
|
|
1235
|
+
};
|
|
1236
|
+
}
|
|
1237
|
+
//#endregion
|
|
927
1238
|
//#region src/services/message/getMentions.d.ts
|
|
928
1239
|
declare const getMentions: (message: string) => HTMLElement[];
|
|
929
1240
|
//#endregion
|
|
@@ -939,6 +1250,9 @@ declare const applyItemMetadataMixin: <TBase extends Class<NonNullable<unknown>>
|
|
|
939
1250
|
//#region src/services/survey/constants.d.ts
|
|
940
1251
|
declare const SURVEY_DISPLAY_NAME = "Surveyer";
|
|
941
1252
|
//#endregion
|
|
1253
|
+
//#region src/util/array/takeOne.d.ts
|
|
1254
|
+
declare const takeOne: TakeOne;
|
|
1255
|
+
//#endregion
|
|
942
1256
|
//#region src/util/environment/getIsServer.d.ts
|
|
943
1257
|
declare const getIsServer: () => boolean;
|
|
944
1258
|
//#endregion
|
|
@@ -946,7 +1260,7 @@ declare const getIsServer: () => boolean;
|
|
|
946
1260
|
declare const ID_SEPARATOR = "|";
|
|
947
1261
|
//#endregion
|
|
948
1262
|
//#region src/util/object/getPropertyNames.d.ts
|
|
949
|
-
declare const getPropertyNames: <T
|
|
1263
|
+
declare const getPropertyNames: <T>() => PropertyNames<T>;
|
|
950
1264
|
//#endregion
|
|
951
1265
|
//#region src/util/object/isPlainObject.d.ts
|
|
952
1266
|
declare const isPlainObject: (data: unknown) => data is object;
|
|
@@ -955,16 +1269,16 @@ declare const isPlainObject: (data: unknown) => data is object;
|
|
|
955
1269
|
declare const jsonDateParse: (text: string) => any;
|
|
956
1270
|
//#endregion
|
|
957
1271
|
//#region src/util/types/MergeObjectsStrict.d.ts
|
|
958
|
-
type MergeObjectsStrict<T
|
|
1272
|
+
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;
|
|
959
1273
|
//#endregion
|
|
960
1274
|
//#region src/util/object/mergeObjectsStrict.d.ts
|
|
961
|
-
declare const mergeObjectsStrict: <T
|
|
1275
|
+
declare const mergeObjectsStrict: <T extends object[]>(...objects: T) => MergeObjectsStrict<T>;
|
|
962
1276
|
//#endregion
|
|
963
1277
|
//#region src/util/reactivity/getRawData.d.ts
|
|
964
|
-
declare const getRawData: <T
|
|
1278
|
+
declare const getRawData: <T>(data: T) => T;
|
|
965
1279
|
//#endregion
|
|
966
1280
|
//#region src/util/reactivity/toRawDeep.d.ts
|
|
967
|
-
declare const toRawDeep: <T
|
|
1281
|
+
declare const toRawDeep: <T extends object>(data: T) => T;
|
|
968
1282
|
//#endregion
|
|
969
1283
|
//#region src/util/regex/escapeRegExp.d.ts
|
|
970
1284
|
declare const escapeRegExp: (string: string) => string;
|
|
@@ -979,13 +1293,13 @@ declare const streamToText: (readable: NodeJS.ReadableStream) => Promise<string>
|
|
|
979
1293
|
type CamelToKebab<S extends string> = S extends `${infer T}${infer U}` ? U extends Uncapitalize<U> ? `${Uncapitalize<T>}${CamelToKebab<U>}` : `${Uncapitalize<T>}-${CamelToKebab<U>}` : S;
|
|
980
1294
|
//#endregion
|
|
981
1295
|
//#region src/util/text/toKebabCase.d.ts
|
|
982
|
-
declare const toKebabCase: <T
|
|
1296
|
+
declare const toKebabCase: <T extends string>(string: T) => CamelToKebab<T>;
|
|
983
1297
|
//#endregion
|
|
984
1298
|
//#region src/util/text/truncate.d.ts
|
|
985
1299
|
declare const truncate: (string: string, length: number) => string;
|
|
986
1300
|
//#endregion
|
|
987
1301
|
//#region src/util/text/uncapitalize.d.ts
|
|
988
|
-
declare const uncapitalize: <T
|
|
1302
|
+
declare const uncapitalize: <T extends string>(string: T) => Uncapitalize<T>;
|
|
989
1303
|
//#endregion
|
|
990
1304
|
//#region src/util/time/hrtime.d.ts
|
|
991
1305
|
declare const hrtime: (previousHrTime?: [number, number]) => [number, number];
|
|
@@ -994,10 +1308,10 @@ declare const hrtime: (previousHrTime?: [number, number]) => [number, number];
|
|
|
994
1308
|
declare const now: () => string;
|
|
995
1309
|
//#endregion
|
|
996
1310
|
//#region src/util/types/FunctionProperties.d.ts
|
|
997
|
-
type FunctionProperties<T
|
|
1311
|
+
type FunctionProperties<T> = { [K in keyof T]: T[K] extends Function ? K : never };
|
|
998
1312
|
//#endregion
|
|
999
1313
|
//#region src/util/types/ExcludeFunctionProperties.d.ts
|
|
1000
|
-
type ExcludeFunctionProperties<T
|
|
1314
|
+
type ExcludeFunctionProperties<T> = Except<T, FunctionProperties<T>[keyof T]>;
|
|
1001
1315
|
//#endregion
|
|
1002
1316
|
//#region src/util/types/KebabToCamel.d.ts
|
|
1003
1317
|
type KebabToCamel<S extends string> = S extends `${infer T}-${infer U}` ? `${T}${Capitalize<KebabToCamel<U>>}` : S;
|
|
@@ -1006,25 +1320,25 @@ type KebabToCamel<S extends string> = S extends `${infer T}-${infer U}` ? `${T}$
|
|
|
1006
1320
|
type MapValue<BaseType> = BaseType extends Map<unknown, infer ValueType> ? ValueType : never;
|
|
1007
1321
|
//#endregion
|
|
1008
1322
|
//#region src/util/types/PartialByKeys.d.ts
|
|
1009
|
-
type PartialByKeys<T
|
|
1323
|
+
type PartialByKeys<T, K extends keyof T = keyof T> = Except<T, K> & Partial<Pick<T, Extract<keyof T, K>>>;
|
|
1010
1324
|
//#endregion
|
|
1011
1325
|
//#region src/util/types/TupleSplitHead.d.ts
|
|
1012
|
-
type TupleSplitHead<T
|
|
1326
|
+
type TupleSplitHead<T extends unknown[], N extends number> = T["length"] extends N ? T : T extends [...infer R, unknown] ? TupleSplitHead<R, N> : never;
|
|
1013
1327
|
//#endregion
|
|
1014
1328
|
//#region src/util/types/TupleSplitTail.d.ts
|
|
1015
|
-
type TupleSplitTail<T
|
|
1329
|
+
type TupleSplitTail<T, N extends number, O extends unknown[] = []> = O["length"] extends N ? T : T extends [infer F, ...infer R] ? TupleSplitTail<[...R], N, [...O, F]> : never;
|
|
1016
1330
|
//#endregion
|
|
1017
1331
|
//#region src/util/types/TupleSplit.d.ts
|
|
1018
|
-
type TupleSplit<T
|
|
1332
|
+
type TupleSplit<T extends unknown[], N extends number> = [TupleSplitHead<T, N>, TupleSplitTail<T, N>];
|
|
1019
1333
|
//#endregion
|
|
1020
1334
|
//#region src/util/types/SkipFirst.d.ts
|
|
1021
|
-
type SkipFirst<T
|
|
1335
|
+
type SkipFirst<T extends unknown[], N extends number> = TupleSplit<T, N>[1];
|
|
1022
1336
|
//#endregion
|
|
1023
1337
|
//#region src/util/types/TakeFirst.d.ts
|
|
1024
|
-
type TakeFirst<T
|
|
1338
|
+
type TakeFirst<T extends unknown[], N extends number> = TupleSplit<T, N>[0];
|
|
1025
1339
|
//#endregion
|
|
1026
1340
|
//#region src/util/types/TupleSlice.d.ts
|
|
1027
|
-
type TupleSlice<T
|
|
1341
|
+
type TupleSlice<T extends unknown[], S extends number, E extends number = T["length"]> = SkipFirst<TakeFirst<T, E>, S>;
|
|
1028
1342
|
//#endregion
|
|
1029
1343
|
//#region src/util/validation/exhaustiveGuard.d.ts
|
|
1030
1344
|
declare const exhaustiveGuard: (value: never) => never;
|
|
@@ -1036,4 +1350,4 @@ declare const UUIDV4_REGEX: RegExp;
|
|
|
1036
1350
|
//#region src/util/id/uuid/uuidValidateV4.d.ts
|
|
1037
1351
|
declare const uuidValidateV4: (uuid: string) => boolean;
|
|
1038
1352
|
//#endregion
|
|
1039
|
-
export { CamelToKebab, DeepOmit, DeepOmitArray, DeepOptionalProperties, DeepOptionalUndefined, DeepRequiredProperties, ExcludeFunctionProperties, FunctionProperties, ID_SEPARATOR, InvalidOperationError, ItemEntityType, ItemEntityTypePropertyNames, ItemMetadata, ItemMetadataPropertyNames, KebabToCamel, MENTION_ID_ATTRIBUTE, MENTION_LABEL_ATTRIBUTE, MENTION_TYPE, MENTION_TYPE_ATTRIBUTE, MapValue, MergeObjectsStrict, NIL, NotFoundError, NotInitializedError, Operation, PartialByKeys, PropertyNames, RoutePath, SITE_NAME, SURVEY_DISPLAY_NAME, Serializable, SkipFirst, TakeFirst, ToData, TupleSlice, TupleSplit, TupleSplitHead, TupleSplitTail, UUIDV4_REGEX, WithMetadata, applyItemMetadataMixin, capitalize, createItemEntityTypeSchema, css, escapeRegExp, exhaustiveGuard, getIsServer, getMentions, getPropertyNames, getRawData, hrtime, html, isPlainObject, itemMetadataSchema, jsonDateParse, mergeObjectsStrict, now, streamToText, toKebabCase, toRawDeep, truncate, uncapitalize, uuidValidateV4 };
|
|
1353
|
+
export { AllSpecialValues, CamelToKebab, DeepOmit, DeepOmitArray, DeepOptionalProperties, DeepOptionalUndefined, DeepRequiredProperties, ExcludeFunctionProperties, FunctionProperties, ID_SEPARATOR, InvalidOperationError, ItemEntityType, ItemEntityTypePropertyNames, ItemMetadata, ItemMetadataPropertyNames, KebabToCamel, MENTION_ID_ATTRIBUTE, MENTION_LABEL_ATTRIBUTE, MENTION_TYPE, MENTION_TYPE_ATTRIBUTE, MapValue, MergeObjectsStrict, NIL, NotFoundError, NotInitializedError, Operation, PartialByKeys, PropertyNames, RoutePath, SITE_NAME, SURVEY_DISPLAY_NAME, Serializable, SkipFirst, TakeFirst, TakeOne, ToData, TupleSlice, TupleSplit, TupleSplitHead, TupleSplitTail, UUIDV4_REGEX, WithMetadata, applyItemMetadataMixin, capitalize, createItemEntityTypeSchema, css, escapeRegExp, exhaustiveGuard, getIsServer, getMentions, getPropertyNames, getRawData, hrtime, html, isPlainObject, itemMetadataSchema, jsonDateParse, mergeObjectsStrict, now, streamToText, takeOne, toKebabCase, toRawDeep, truncate, uncapitalize, uuidValidateV4 };
|