mol_data_all 1.1.1778 → 1.1.1780
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/package.json +1 -1
- package/web.d.ts +242 -0
- package/web.d.ts.map +1 -1
package/package.json
CHANGED
package/web.d.ts
CHANGED
|
@@ -1,3 +1,245 @@
|
|
|
1
|
+
declare let _$_: {
|
|
2
|
+
new (): {};
|
|
3
|
+
} & typeof globalThis;
|
|
4
|
+
declare class $ extends _$_ {
|
|
5
|
+
}
|
|
6
|
+
declare namespace $ {
|
|
7
|
+
export type $ = typeof $$;
|
|
8
|
+
export class $$ extends $ {
|
|
9
|
+
static $: $;
|
|
10
|
+
}
|
|
11
|
+
namespace $$ {
|
|
12
|
+
type $$ = $;
|
|
13
|
+
}
|
|
14
|
+
export {};
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
declare namespace $ {
|
|
18
|
+
type $mol_data_value<Input = any, Output = any> = (val: Input) => Output;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
declare namespace $ {
|
|
22
|
+
function $mol_data_setup<Value extends $mol_data_value, Config = never>(value: Value, config: Config): Value & {
|
|
23
|
+
config: Config;
|
|
24
|
+
Value: ReturnType<Value>;
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
declare namespace $ {
|
|
29
|
+
function $mol_fail(error: any): never;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
declare namespace $ {
|
|
33
|
+
function $mol_func_name(this: $, func: Function): string;
|
|
34
|
+
function $mol_func_name_from<Target extends Function>(target: Target, source: Function): Target;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
declare namespace $ {
|
|
38
|
+
class $mol_error_mix<Cause extends {} = {}> extends AggregateError {
|
|
39
|
+
readonly cause: Cause;
|
|
40
|
+
name: string;
|
|
41
|
+
constructor(message: string, cause?: Cause, ...errors: readonly Error[]);
|
|
42
|
+
static [Symbol.toPrimitive](): string;
|
|
43
|
+
static toString(): string;
|
|
44
|
+
static make(...params: ConstructorParameters<typeof $mol_error_mix>): $mol_error_mix<{}>;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
declare namespace $ {
|
|
49
|
+
class $mol_data_error extends $mol_error_mix {
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
declare namespace $ {
|
|
54
|
+
function $mol_fail_hidden(error: any): never;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
declare namespace $ {
|
|
58
|
+
function $mol_data_array<Sub extends $mol_data_value>(sub: Sub): ((val: readonly Parameters<Sub>[0][]) => readonly ReturnType<Sub>[]) & {
|
|
59
|
+
config: Sub;
|
|
60
|
+
Value: readonly ReturnType<Sub>[];
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
declare namespace $ {
|
|
65
|
+
let $mol_data_boolean: (val: boolean) => boolean;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
declare namespace $ {
|
|
69
|
+
let $mol_compare_deep_cache: WeakMap<any, WeakMap<any, boolean>>;
|
|
70
|
+
function $mol_compare_deep<Value>(left: Value, right: Value): boolean;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
declare namespace $ {
|
|
74
|
+
function $mol_data_const<const Val>(ref: Val): ((val: Val) => Val) & {
|
|
75
|
+
config: Val;
|
|
76
|
+
Value: Val;
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
declare namespace $ {
|
|
81
|
+
let $mol_data_string: (val: string) => string;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
declare namespace $ {
|
|
85
|
+
function $mol_data_pattern(pattern: RegExp): ((val: string) => string) & {
|
|
86
|
+
config: RegExp;
|
|
87
|
+
Value: string;
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
declare namespace $ {
|
|
92
|
+
let $mol_data_email: ((val: string) => string) & {
|
|
93
|
+
config: RegExp;
|
|
94
|
+
Value: string;
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
declare namespace $ {
|
|
99
|
+
function $mol_data_enum<Dict extends Record<number | string, number | string>>(name: string, dict: Dict): ((value: Dict[keyof Dict]) => Dict[keyof Dict]) & {
|
|
100
|
+
config: {
|
|
101
|
+
name: string;
|
|
102
|
+
dict: Dict;
|
|
103
|
+
};
|
|
104
|
+
Value: Dict[keyof Dict];
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
declare namespace $ {
|
|
109
|
+
function $mol_data_instance<Instance extends new (...args: any[]) => any>(Instance: Instance): ((val: InstanceType<Instance>) => InstanceType<Instance>) & {
|
|
110
|
+
config: Instance;
|
|
111
|
+
Value: InstanceType<Instance>;
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
declare namespace $ {
|
|
116
|
+
let $mol_data_number: (val: number) => number;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
declare namespace $ {
|
|
120
|
+
function $mol_data_integer(val: number): number;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
declare namespace $ {
|
|
124
|
+
function $mol_data_range<Value>(from: Value, to: Value): ((val: Value) => Value) & {
|
|
125
|
+
config: Value[];
|
|
126
|
+
Value: Value;
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
declare namespace $ {
|
|
131
|
+
type $mol_data_tagged_type<Value, Tag extends PropertyKey> = Value & {
|
|
132
|
+
[Key in Tag]: Value;
|
|
133
|
+
};
|
|
134
|
+
type $mol_data_tagged_parser<Input, Output> = {
|
|
135
|
+
Value: Output;
|
|
136
|
+
} & ((val: $mol_data_tagged_type<Input, never>) => Output);
|
|
137
|
+
export function $mol_data_tagged<Config extends Record<string, $mol_data_value>>(config: Config): { [Type in keyof Config]: $mol_data_tagged_parser<Parameters<Config[Type]>[0], $mol_data_tagged_type<ReturnType<Config[Type]>, Type>>; };
|
|
138
|
+
export {};
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
declare namespace $ {
|
|
142
|
+
function $mol_data_nullable<Sub extends $mol_data_value>(sub: Sub): ((val: Parameters<Sub>[0] | null) => ReturnType<Sub> | null) & {
|
|
143
|
+
config: Sub;
|
|
144
|
+
Value: ReturnType<Sub> | null;
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
declare namespace $ {
|
|
149
|
+
function $mol_data_optional<Sub extends $mol_data_value, Fallback extends undefined | (() => ReturnType<Sub>)>(sub: Sub, fallback?: Fallback): ((val: Parameters<Sub>[0] | undefined) => ReturnType<Sub> | (Fallback extends undefined ? undefined : ReturnType<Extract<Fallback, () => any>>)) & {
|
|
150
|
+
config: {
|
|
151
|
+
sub: Sub;
|
|
152
|
+
fallback: Fallback | undefined;
|
|
153
|
+
};
|
|
154
|
+
Value: ReturnType<Sub> | (Fallback extends undefined ? undefined : ReturnType<Extract<Fallback, () => any>>);
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
declare namespace $ {
|
|
159
|
+
type $mol_type_equals<A, B> = (<X>() => X extends A ? 1 : 2) extends (<X>() => X extends B ? 1 : 2) ? unknown : never;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
declare namespace $ {
|
|
163
|
+
type $mol_type_merge<Intersection> = Intersection extends (...a: any[]) => any ? Intersection : Intersection extends new (...a: any[]) => any ? Intersection : Intersection extends object ? $mol_type_merge_object<Intersection> extends Intersection ? unknown extends $mol_type_equals<{
|
|
164
|
+
[Key in keyof Intersection]: Intersection[Key];
|
|
165
|
+
}, Intersection> ? Intersection : {
|
|
166
|
+
[Key in keyof Intersection]: $mol_type_merge<Intersection[Key]>;
|
|
167
|
+
} : Intersection : Intersection;
|
|
168
|
+
type $mol_type_merge_object<Intersection> = {
|
|
169
|
+
[Key in keyof Intersection]: Intersection[Key];
|
|
170
|
+
};
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
declare namespace $ {
|
|
174
|
+
type $mol_type_override<Base, Over> = Omit<Base, keyof Over> & Over;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
declare namespace $ {
|
|
178
|
+
type $mol_type_partial_undefined<Val> = $mol_type_merge<$mol_type_override<Partial<Val>, Pick<Val, {
|
|
179
|
+
[Field in keyof Val]: undefined extends Val[Field] ? never : Field;
|
|
180
|
+
}[keyof Val]>>>;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
declare namespace $ {
|
|
184
|
+
function $mol_data_record<Sub extends Record<string, $mol_data_value>>(sub: Sub): ((val: $mol_type_merge<$mol_type_override<Partial<{ [key in keyof Sub]: Parameters<Sub[key]>[0]; }>, Pick<{ [key in keyof Sub]: Parameters<Sub[key]>[0]; }, { [Field in keyof { [key in keyof Sub]: Parameters<Sub[key]>[0]; }]: undefined extends { [key in keyof Sub]: Parameters<Sub[key]>[0]; }[Field] ? never : Field; }[keyof Sub]>>>) => Readonly<$mol_type_merge<$mol_type_override<Partial<{ [key_1 in keyof Sub]: ReturnType<Sub[key_1]>; }>, Pick<{ [key_1 in keyof Sub]: ReturnType<Sub[key_1]>; }, { [Field_1 in keyof { [key_1 in keyof Sub]: ReturnType<Sub[key_1]>; }]: undefined extends { [key_1 in keyof Sub]: ReturnType<Sub[key_1]>; }[Field_1] ? never : Field_1; }[keyof Sub]>>>>) & {
|
|
185
|
+
config: Sub;
|
|
186
|
+
Value: Readonly<$mol_type_merge<$mol_type_override<Partial<{ [key in keyof Sub]: ReturnType<Sub[key]>; }>, Pick<{ [key in keyof Sub]: ReturnType<Sub[key]>; }, { [Field in keyof { [key in keyof Sub]: ReturnType<Sub[key]>; }]: undefined extends { [key in keyof Sub]: ReturnType<Sub[key]>; }[Field] ? never : Field; }[keyof Sub]>>>>;
|
|
187
|
+
};
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
declare namespace $ {
|
|
191
|
+
function $mol_data_dict<Sub extends $mol_data_value>(sub: Sub): ((val: Readonly<Record<string, ReturnType<Sub>>>) => Readonly<Record<string, ReturnType<Sub>>>) & {
|
|
192
|
+
config: Sub;
|
|
193
|
+
Value: Readonly<Record<string, ReturnType<Sub>>>;
|
|
194
|
+
};
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
declare namespace $ {
|
|
198
|
+
function $mol_data_variant<Sub extends $mol_data_value[]>(...sub: Sub): ((val: Parameters<Sub[number]>[0]) => ReturnType<Sub[number]>) & {
|
|
199
|
+
config: Sub;
|
|
200
|
+
Value: ReturnType<Sub[number]>;
|
|
201
|
+
};
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
declare namespace $ {
|
|
205
|
+
type $mol_type_unary_func = ((param: any) => any);
|
|
206
|
+
type $mol_type_unary_class = new (param: any) => any;
|
|
207
|
+
type $mol_type_unary = $mol_type_unary_func | $mol_type_unary_class;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
declare namespace $ {
|
|
211
|
+
type $mol_type_param<Func, Index extends number> = Func extends (...params: infer Params) => any ? Params[Index] : Func extends new (...params: infer Params2) => any ? Params2[Index] : never;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
declare namespace $ {
|
|
215
|
+
type $mol_type_tail<Tuple extends readonly any[]> = ((...tail: Tuple) => any) extends ((head: any, ...tail: infer Tail) => any) ? Tail : never;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
declare namespace $ {
|
|
219
|
+
function $mol_func_is_class<Func extends Function>(func: Func): func is Func & (new (...args: any[]) => any);
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
declare namespace $ {
|
|
223
|
+
type $mol_type_result<Func> = Func extends (...params: any) => infer Result ? Result : Func extends new (...params: any) => infer Result ? Result : never;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
declare namespace $ {
|
|
227
|
+
type $mol_type_foot<Tuple extends readonly any[]> = Tuple['length'] extends 0 ? never : Tuple[$mol_type_tail<Tuple>['length']];
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
declare namespace $ {
|
|
231
|
+
type Guard_value<Funcs extends $mol_type_unary[], Index extends keyof Funcs> = $mol_type_param<Index extends keyof $mol_type_tail<Funcs> ? $mol_type_tail<Funcs>[Index] : any, 0>;
|
|
232
|
+
type Guard<Funcs extends $mol_type_unary[]> = {
|
|
233
|
+
[Index in keyof Funcs]: (Funcs[Index] extends $mol_type_unary_func ? (input: $mol_type_param<Funcs[Index], 0>) => Guard_value<Funcs, Index> : new (input: $mol_type_param<Funcs[Index], 0>) => Guard_value<Funcs, Index>);
|
|
234
|
+
};
|
|
235
|
+
export function $mol_data_pipe<Funcs extends $mol_type_unary[]>(...funcs: Funcs & Guard<Funcs>): ((this: any, input: $mol_type_param<Funcs[0], 0>) => $mol_type_result<$mol_type_foot<Funcs>>) & {
|
|
236
|
+
config: {
|
|
237
|
+
funcs: Funcs & Guard<Funcs>;
|
|
238
|
+
};
|
|
239
|
+
Value: $mol_type_result<$mol_type_foot<Funcs>>;
|
|
240
|
+
};
|
|
241
|
+
export {};
|
|
242
|
+
}
|
|
1
243
|
|
|
2
244
|
export = $;
|
|
3
245
|
//# sourceMappingURL=web.d.ts.map
|
package/web.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[]}
|
|
1
|
+
{"version":3,"sources":["../../../../mam.d.ts","../../value/value.d.ts","../../setup/setup.d.ts","../../../fail/fail.d.ts","../../../func/name/name.d.ts","../../../error/mix/mix.d.ts","../../error/error.d.ts","../../../fail/hidden/hidden.d.ts","../../array/array.d.ts","../../boolean/boolean.d.ts","../../../compare/deep/deep.d.ts","../../const/const.d.ts","../../string/string.d.ts","../../pattern/pattern.d.ts","../../email/email.d.ts","../../enum/enum.d.ts","../../instance/instance.d.ts","../../number/number.d.ts","../../integer/integer.d.ts","../../range/range.d.ts","../../tagged/tagged.d.ts","../../nullable/nullable.d.ts","../../optional/optional.d.ts","../../../type/equals/equals.d.ts","../../../type/merge/merge.d.ts","../../../type/override/override.d.ts","../../../type/partial/undefined/undefined.d.ts","../../record/record.d.ts","../../dict/dict.d.ts","../../variant/variant.d.ts","../../../type/unary/unary.d.ts","../../../type/param/param.d.ts","../../../type/tail/tail.d.ts","../../../func/is/class/class.d.ts","../../../type/result/result.d.ts","../../../type/foot/foot.d.ts","../../pipe/pipe.d.ts"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACfA;AACA;AACA;AACA;ACHA;AACA;AACA;AACA;AACA;AACA;AACA;ACNA;AACA;AACA;AACA;ACHA;AACA;AACA;AACA;AACA;ACJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACVA;AACA;AACA;AACA;AACA;ACJA;AACA;AACA;AACA;ACHA;AACA;AACA;AACA;AACA;AACA;AACA;ACNA;AACA;AACA;AACA;ACHA;AACA;AACA;AACA;AACA;ACJA;AACA;AACA;AACA;AACA;AACA;AACA;ACNA;AACA;AACA;AACA;ACHA;AACA;AACA;AACA;AACA;AACA;AACA;ACNA;AACA;AACA;AACA;AACA;AACA;AACA;ACNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACTA;AACA;AACA;AACA;AACA;AACA;AACA;ACNA;AACA;AACA;AACA;ACHA;AACA;AACA;AACA;ACHA;AACA;AACA;AACA;AACA;AACA;AACA;ACNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACVA;AACA;AACA;AACA;AACA;AACA;AACA;ACNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACTA;AACA;AACA;AACA;ACHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACVA;AACA;AACA;AACA;ACHA;AACA;AACA;AACA;AACA;AACA;ACLA;AACA;AACA;AACA;AACA;AACA;AACA;ACNA;AACA;AACA;AACA;AACA;AACA;AACA;ACNA;AACA;AACA;AACA;AACA;AACA;AACA;ACNA;AACA;AACA;AACA;AACA;AACA;ACLA;AACA;AACA;AACA;ACHA;AACA;AACA;AACA;ACHA;AACA;AACA;AACA;ACHA;AACA;AACA;AACA;ACHA;AACA;AACA;AACA;ACHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","sourcesContent":[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null]}
|