mol_schema 0.0.22 → 0.0.24

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/node.d.ts CHANGED
@@ -30,12 +30,13 @@ declare namespace $ {
30
30
  static [$mol_key_handle](): string;
31
31
  /** Short user-readable identity. */
32
32
  static toString(): string;
33
- /** Type-guard that checks value by schema. */
34
- static check<This extends typeof $mol_schema_any, Val>(this: This, val: Val): val is Val & This['default'];
35
- static [Symbol.hasInstance]<This extends typeof $mol_schema_any, Val>(this: This, val: Val): val is Val & This['default'];
36
- /** Strict parse. Fails of wrong values. */
37
- static guard<Value>(value: Value): Value;
38
- /** Relaxed cast. Normalizes wrong values. */
33
+ /** Type-predicate that checks value by schema. */
34
+ static check<This extends typeof $mol_schema_any, Value>(this: This, value: Value): value is Value & This['default'];
35
+ /** `instanceof` support */
36
+ static [Symbol.hasInstance]<This extends typeof $mol_schema_any, Value>(this: This, value: Value): value is Value & This['default'];
37
+ /** Type-parser that fails of wrong values. */
38
+ static guard<This extends typeof $mol_schema_any, Value>(this: This, value: Value): Value & This['default'];
39
+ /** Type-caster that normalizes wrong values. */
39
40
  static cast<This extends typeof $mol_schema_any>(this: This, value: unknown): This['default'];
40
41
  /** Default value which conforms schema. */
41
42
  static default: unknown;
@@ -48,7 +49,7 @@ declare namespace $ {
48
49
 
49
50
  declare namespace $ {
50
51
  class $mol_schema_float extends $mol_schema_any {
51
- static guard<Value>(value: Value): Value & typeof this.default;
52
+ static guard<This extends typeof $mol_schema_any, Value>(this: This, value: Value): Value & This['default'];
52
53
  static default: number;
53
54
  }
54
55
  }
@@ -56,14 +57,14 @@ declare namespace $ {
56
57
  declare namespace $ {
57
58
  class $mol_schema_integer extends $mol_schema_float {
58
59
  $mol_schema_integer: boolean;
59
- static guard<Value>(value: Value): Value & number & $mol_schema_integer;
60
+ static guard<This extends typeof $mol_schema_any, Value>(this: This, value: Value): Value & This['default'];
60
61
  static default: number & $mol_schema_integer;
61
62
  }
62
63
  }
63
64
 
64
65
  declare namespace $ {
65
66
  class $mol_schema_bigint extends $mol_schema_any {
66
- static guard<Value>(value: Value): Value & typeof this.default;
67
+ static guard<This extends typeof $mol_schema_any, Value>(this: This, value: Value): Value & This['default'];
67
68
  static cast<This extends typeof $mol_schema_any>(this: This, value: unknown): This['default'];
68
69
  static default: bigint;
69
70
  }
@@ -71,19 +72,95 @@ declare namespace $ {
71
72
 
72
73
  declare namespace $ {
73
74
  class $mol_schema_boolean extends $mol_schema_any {
74
- static guard<Value>(value: Value): Value & typeof this.default;
75
+ static guard<This extends typeof $mol_schema_any, Value>(this: This, value: Value): Value & This['default'];
75
76
  static default: boolean;
76
77
  }
77
78
  }
78
79
 
79
80
  declare namespace $ {
80
81
  class $mol_schema_string extends $mol_schema_any {
81
- static guard<Value>(value: Value): Value & typeof this.default;
82
- static cast(value: unknown): typeof this.default;
82
+ static guard<This extends typeof $mol_schema_any, Value>(this: This, value: Value): Value & This['default'];
83
+ static cast<This extends typeof $mol_schema_any>(this: This, value: unknown): This['default'];
83
84
  static default: string;
84
85
  }
85
86
  }
86
87
 
88
+ declare namespace $ {
89
+ const $mol_ambient_ref: unique symbol;
90
+ /** @deprecated use $ instead */
91
+ type $mol_ambient_context = $;
92
+ function $mol_ambient(this: $ | void, overrides: Partial<$>): $;
93
+ }
94
+
95
+ declare namespace $ {
96
+ /**
97
+ * Proxy that delegates all to lazy returned target.
98
+ *
99
+ * $mol_delegate( Array.prototype , ()=> fetch_array() )
100
+ */
101
+ function $mol_delegate<Value extends object>(proto: Value, target: () => Value): Value;
102
+ }
103
+
104
+ declare namespace $ {
105
+ const $mol_owning_map: WeakMap<any, any>;
106
+ function $mol_owning_allow<Having>(having: Having): having is Having & {
107
+ destructor(): void;
108
+ };
109
+ function $mol_owning_get<Having, Owner extends object>(having: Having, Owner?: {
110
+ new (): Owner;
111
+ }): Owner | null;
112
+ function $mol_owning_check<Owner, Having>(owner: Owner, having: Having): having is Having & {
113
+ destructor(): void;
114
+ };
115
+ function $mol_owning_catch<Owner, Having>(owner: Owner, having: Having): boolean;
116
+ }
117
+
118
+ declare namespace $ {
119
+ function $mol_fail_hidden(error: any): never;
120
+ }
121
+
122
+ declare namespace $ {
123
+ type $mol_type_writable<T> = {
124
+ -readonly [P in keyof T]: T[P];
125
+ };
126
+ }
127
+
128
+ declare namespace $ {
129
+ class $mol_object2 {
130
+ static $: $;
131
+ [Symbol.toStringTag]: string;
132
+ [$mol_ambient_ref]: $;
133
+ get $(): $;
134
+ set $(next: $);
135
+ static create<Instance>(this: new (init?: (instance: any) => void) => Instance, init?: (instance: $mol_type_writable<Instance>) => void): Instance;
136
+ static [Symbol.toPrimitive](): any;
137
+ static toString(): any;
138
+ static toJSON(): any;
139
+ static [$mol_key_handle](): any;
140
+ destructor(): void;
141
+ static destructor(): void;
142
+ [Symbol.dispose](): void;
143
+ toString(): string;
144
+ }
145
+ }
146
+
147
+ declare namespace $ {
148
+ class $mol_wrapper extends $mol_object2 {
149
+ static wrap: (task: (...ags: any[]) => any) => (...ags: any[]) => any;
150
+ static run<Result>(task: () => Result): Result;
151
+ static func<Args extends any[], Result, Host = void>(func: (this: Host, ...args: Args) => Result): (this: Host, ...args: Args) => Result;
152
+ static get class(): <Class extends new (...args: any[]) => any>(Class: Class) => Class;
153
+ static get method(): (obj: object, name: PropertyKey, descr?: TypedPropertyDescriptor<any>) => TypedPropertyDescriptor<any>;
154
+ static get field(): <Host extends object, Field extends keyof Host, Args extends any[], Result>(obj: Host, name: Field, descr?: TypedPropertyDescriptor<Result>) => TypedPropertyDescriptor<Result>;
155
+ }
156
+ }
157
+
158
+ declare namespace $ {
159
+ class $mol_memo extends $mol_wrapper {
160
+ static wrap<This extends object, Value>(task: (this: This, next?: Value) => Value): (this: This, next?: Value) => Value | undefined;
161
+ }
162
+ }
163
+
87
164
  declare namespace $ {
88
165
  /** Generates unique identifier. */
89
166
  function $mol_guid(length?: number, exists?: (id: string) => boolean): string;
@@ -95,7 +172,13 @@ declare namespace $ {
95
172
  }
96
173
 
97
174
  declare namespace $ {
98
- function $mol_schema_pattern<Pattern extends RegExp>(Pattern: Pattern): {
175
+ class $mol_memo_key extends $mol_wrapper {
176
+ static wrap<This extends object, Key, Value>(task: (this: This, key: Key, next?: Value) => Value): (this: This, key: Key, next?: Value) => Value | undefined;
177
+ }
178
+ }
179
+
180
+ declare namespace $ {
181
+ let $mol_schema_pattern: <Pattern extends RegExp>(this: void, Pattern: Pattern) => {
99
182
  new (value?: any): {
100
183
  constructor: Function;
101
184
  toString(): string;
@@ -107,13 +190,13 @@ declare namespace $ {
107
190
  };
108
191
  Pattern: Pattern;
109
192
  toString(): string;
110
- guard<Value>(value: Value): Value & string;
111
- cast(value: unknown): string;
193
+ guard<This extends typeof $mol_schema_any, Value>(this: This, value: Value): Value & This["default"];
194
+ cast<This extends typeof $mol_schema_any>(this: This, value: unknown): This["default"];
112
195
  default: string;
113
- check<This extends typeof $mol_schema_any, Val>(this: This, val: Val): val is Val & This["default"];
196
+ check<This extends typeof $mol_schema_any, Value_1>(this: This, value: Value_1): value is Value_1 & This["default"];
114
197
  [Symbol.toStringTag]: string;
115
198
  [$mol_key_handle](): string;
116
- [Symbol.hasInstance]<This extends typeof $mol_schema_any, Val>(this: This, val: Val): val is Val & This["default"];
199
+ [Symbol.hasInstance]<This extends typeof $mol_schema_any, Value_2>(this: This, value: Value_2): value is Value_2 & This["default"];
117
200
  getPrototypeOf(o: any): any;
118
201
  getOwnPropertyDescriptor(o: any, p: PropertyKey): PropertyDescriptor | undefined;
119
202
  getOwnPropertyNames(o: any): string[];
@@ -133,9 +216,9 @@ declare namespace $ {
133
216
  isExtensible(o: any): boolean;
134
217
  keys(o: object): string[];
135
218
  keys(o: {}): string[];
136
- assign<T extends {}, U>(target: T, source: U): T & U;
137
- assign<T extends {}, U, V>(target: T, source1: U, source2: V): T & U & V;
138
- assign<T extends {}, U, V, W>(target: T, source1: U, source2: V, source3: W): T & U & V & W;
219
+ assign<T extends {}, U_1>(target: T, source: U_1): T & U_1;
220
+ assign<T extends {}, U_2, V>(target: T, source1: U_2, source2: V): T & U_2 & V;
221
+ assign<T extends {}, U_3, V_1, W>(target: T, source1: U_3, source2: V_1, source3: W): T & U_3 & V_1 & W;
139
222
  assign(target: object, ...sources: any[]): any;
140
223
  getOwnPropertySymbols(o: any): symbol[];
141
224
  is(value1: any, value2: any): boolean;
@@ -161,7 +244,7 @@ declare namespace $ {
161
244
  }
162
245
 
163
246
  declare namespace $ {
164
- function $mol_schema_instance<Class extends new (...args: Args) => any, Args extends any[]>(Class: Class, ...args: Args): Class extends typeof $mol_schema_any ? Class : {
247
+ let $mol_schema_instance: <Class extends new (...args: any[]) => any>(this: void, Class: Class) => Class extends typeof $mol_schema_any ? Class : {
165
248
  new (value?: any): {
166
249
  constructor: Function;
167
250
  toString(): string;
@@ -173,13 +256,79 @@ declare namespace $ {
173
256
  };
174
257
  Class: Class;
175
258
  toString(): string;
176
- guard<Value>(value: Value): Value & InstanceType<Class>;
177
- default: InstanceType<Class>;
178
- check<This extends typeof $mol_schema_any, Val>(this: This, val: Val): val is Val & This["default"];
259
+ guard<This extends typeof $mol_schema_any, Value>(this: This, value: Value): Value & This["default"];
179
260
  cast<This extends typeof $mol_schema_any>(this: This, value: unknown): This["default"];
261
+ default: InstanceType<Class>;
262
+ check<This extends typeof $mol_schema_any, Value_1>(this: This, value: Value_1): value is Value_1 & This["default"];
263
+ [Symbol.toStringTag]: string;
264
+ [$mol_key_handle](): string;
265
+ [Symbol.hasInstance]<This extends typeof $mol_schema_any, Value_2>(this: This, value: Value_2): value is Value_2 & This["default"];
266
+ getPrototypeOf(o: any): any;
267
+ getOwnPropertyDescriptor(o: any, p: PropertyKey): PropertyDescriptor | undefined;
268
+ getOwnPropertyNames(o: any): string[];
269
+ create(o: object | null): any;
270
+ create(o: object | null, properties: PropertyDescriptorMap & ThisType<any>): any;
271
+ defineProperty<T>(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>): T;
272
+ defineProperties<T>(o: T, properties: PropertyDescriptorMap & ThisType<any>): T;
273
+ seal<T>(o: T): T;
274
+ freeze<T extends Function>(f: T): T;
275
+ freeze<T extends {
276
+ [idx: string]: U | null | undefined | object;
277
+ }, U extends string | bigint | number | boolean | symbol>(o: T): Readonly<T>;
278
+ freeze<T>(o: T): Readonly<T>;
279
+ preventExtensions<T>(o: T): T;
280
+ isSealed(o: any): boolean;
281
+ isFrozen(o: any): boolean;
282
+ isExtensible(o: any): boolean;
283
+ keys(o: object): string[];
284
+ keys(o: {}): string[];
285
+ assign<T extends {}, U_1>(target: T, source: U_1): T & U_1;
286
+ assign<T extends {}, U_2, V>(target: T, source1: U_2, source2: V): T & U_2 & V;
287
+ assign<T extends {}, U_3, V_1, W>(target: T, source1: U_3, source2: V_1, source3: W): T & U_3 & V_1 & W;
288
+ assign(target: object, ...sources: any[]): any;
289
+ getOwnPropertySymbols(o: any): symbol[];
290
+ is(value1: any, value2: any): boolean;
291
+ setPrototypeOf(o: any, proto: object | null): any;
292
+ values<T>(o: {
293
+ [s: string]: T;
294
+ } | ArrayLike<T>): T[];
295
+ values(o: {}): any[];
296
+ entries<T>(o: {
297
+ [s: string]: T;
298
+ } | ArrayLike<T>): [string, T][];
299
+ entries(o: {}): [string, any][];
300
+ getOwnPropertyDescriptors<T>(o: T): { [P in keyof T]: TypedPropertyDescriptor<T[P]>; } & {
301
+ [x: string]: PropertyDescriptor;
302
+ };
303
+ fromEntries<T = any>(entries: Iterable<readonly [PropertyKey, T]>): {
304
+ [k: string]: T;
305
+ };
306
+ fromEntries(entries: Iterable<readonly any[]>): any;
307
+ hasOwn(o: object, v: PropertyKey): boolean;
308
+ groupBy<K extends PropertyKey, T>(items: Iterable<T>, keySelector: (item: T, index: number) => K): Partial<Record<K, T[]>>;
309
+ };
310
+ }
311
+
312
+ declare namespace $ {
313
+ function $mol_schema_lazy<Value>(Schema: () => any): {
314
+ new (value?: any): {
315
+ constructor: Function;
316
+ toString(): string;
317
+ toLocaleString(): string;
318
+ valueOf(): Object;
319
+ hasOwnProperty(v: PropertyKey): boolean;
320
+ isPrototypeOf(v: Object): boolean;
321
+ propertyIsEnumerable(v: PropertyKey): boolean;
322
+ };
323
+ Schema: (this: void) => any;
324
+ guard<Val>(value: Val): Val & Value;
325
+ cast<Val>(value: Val): Value;
326
+ get default(): Value;
327
+ toString(): string;
328
+ check<This extends typeof $mol_schema_any, Value_1>(this: This, value: Value_1): value is Value_1 & This["default"];
180
329
  [Symbol.toStringTag]: string;
181
330
  [$mol_key_handle](): string;
182
- [Symbol.hasInstance]<This extends typeof $mol_schema_any, Val>(this: This, val: Val): val is Val & This["default"];
331
+ [Symbol.hasInstance]<This extends typeof $mol_schema_any, Value_1>(this: This, value: Value_1): value is Value_1 & This["default"];
183
332
  getPrototypeOf(o: any): any;
184
333
  getOwnPropertyDescriptor(o: any, p: PropertyKey): PropertyDescriptor | undefined;
185
334
  getOwnPropertyNames(o: any): string[];
@@ -227,16 +376,75 @@ declare namespace $ {
227
376
  }
228
377
 
229
378
  declare namespace $ {
230
- /**
231
- * Converts union of types to intersection of same types
232
- *
233
- * $mol_type_intersect< number | string > // number & string
234
- */
235
- type $mol_type_intersect<Union> = (Union extends any ? (_: Union) => void : never) extends ((_: infer Intersection) => void) ? Intersection : never;
379
+ let $mol_schema_some: <Variants extends readonly (typeof $mol_schema_any)[]>(this: void, Variants: Variants) => {
380
+ new (value?: any): {
381
+ constructor: Function;
382
+ toString(): string;
383
+ toLocaleString(): string;
384
+ valueOf(): Object;
385
+ hasOwnProperty(v: PropertyKey): boolean;
386
+ isPrototypeOf(v: Object): boolean;
387
+ propertyIsEnumerable(v: PropertyKey): boolean;
388
+ };
389
+ Variants: Variants;
390
+ toString(): string;
391
+ guard<This extends typeof $mol_schema_any, Value>(this: This, value: Value): Value & This["default"];
392
+ cast<This extends typeof $mol_schema_any>(this: This, value: unknown): This["default"];
393
+ default: Variants[number]["default"];
394
+ check<This extends typeof $mol_schema_any, Value_1>(this: This, value: Value_1): value is Value_1 & This["default"];
395
+ [Symbol.toStringTag]: string;
396
+ [$mol_key_handle](): string;
397
+ [Symbol.hasInstance]<This extends typeof $mol_schema_any, Value_2>(this: This, value: Value_2): value is Value_2 & This["default"];
398
+ getPrototypeOf(o: any): any;
399
+ getOwnPropertyDescriptor(o: any, p: PropertyKey): PropertyDescriptor | undefined;
400
+ getOwnPropertyNames(o: any): string[];
401
+ create(o: object | null): any;
402
+ create(o: object | null, properties: PropertyDescriptorMap & ThisType<any>): any;
403
+ defineProperty<T>(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>): T;
404
+ defineProperties<T>(o: T, properties: PropertyDescriptorMap & ThisType<any>): T;
405
+ seal<T>(o: T): T;
406
+ freeze<T extends Function>(f: T): T;
407
+ freeze<T extends {
408
+ [idx: string]: U | null | undefined | object;
409
+ }, U extends string | bigint | number | boolean | symbol>(o: T): Readonly<T>;
410
+ freeze<T>(o: T): Readonly<T>;
411
+ preventExtensions<T>(o: T): T;
412
+ isSealed(o: any): boolean;
413
+ isFrozen(o: any): boolean;
414
+ isExtensible(o: any): boolean;
415
+ keys(o: object): string[];
416
+ keys(o: {}): string[];
417
+ assign<T extends {}, U_1>(target: T, source: U_1): T & U_1;
418
+ assign<T extends {}, U_2, V>(target: T, source1: U_2, source2: V): T & U_2 & V;
419
+ assign<T extends {}, U_3, V_1, W>(target: T, source1: U_3, source2: V_1, source3: W): T & U_3 & V_1 & W;
420
+ assign(target: object, ...sources: any[]): any;
421
+ getOwnPropertySymbols(o: any): symbol[];
422
+ is(value1: any, value2: any): boolean;
423
+ setPrototypeOf(o: any, proto: object | null): any;
424
+ values<T>(o: {
425
+ [s: string]: T;
426
+ } | ArrayLike<T>): T[];
427
+ values(o: {}): any[];
428
+ entries<T>(o: {
429
+ [s: string]: T;
430
+ } | ArrayLike<T>): [string, T][];
431
+ entries(o: {}): [string, any][];
432
+ getOwnPropertyDescriptors<T>(o: T): { [P in keyof T]: TypedPropertyDescriptor<T[P]>; } & {
433
+ [x: string]: PropertyDescriptor;
434
+ };
435
+ fromEntries<T = any>(entries: Iterable<readonly [PropertyKey, T]>): {
436
+ [k: string]: T;
437
+ };
438
+ fromEntries(entries: Iterable<readonly any[]>): any;
439
+ hasOwn(o: object, v: PropertyKey): boolean;
440
+ groupBy<K extends PropertyKey, T>(items: Iterable<T>, keySelector: (item: T, index: number) => K): Partial<Record<K, T[]>>;
441
+ };
236
442
  }
237
443
 
238
444
  declare namespace $ {
239
- function $mol_schema_every<Schemas extends readonly (typeof $mol_schema_any)[]>(Schemas: Schemas): {
445
+ let $mol_schema_dict: <Pair extends [Key: typeof $mol_schema_any & {
446
+ default: PropertyKey;
447
+ }, Val: typeof $mol_schema_any]>(this: void, Pair: Pair) => {
240
448
  new (value?: any): {
241
449
  constructor: Function;
242
450
  toString(): string;
@@ -246,15 +454,15 @@ declare namespace $ {
246
454
  isPrototypeOf(v: Object): boolean;
247
455
  propertyIsEnumerable(v: PropertyKey): boolean;
248
456
  };
249
- Schemas: Schemas;
457
+ Pair: Pair;
250
458
  toString(): string;
251
- guard<Value>(value: Value): Value & $mol_type_intersect<Schemas[number]["default"]>;
252
- cast(value: unknown): $mol_type_intersect<Schemas[number]["default"]>;
253
- default: $mol_type_intersect<Schemas[number]["default"]>;
254
- check<This extends typeof $mol_schema_any, Val>(this: This, val: Val): val is Val & This["default"];
459
+ guard<This extends typeof $mol_schema_any, Value>(this: This, value: Value): Value & This["default"];
460
+ cast<This extends typeof $mol_schema_any>(this: This, value: unknown): This["default"];
461
+ default: Record<Pair[0]["default"], Pair[1]["default"]>;
462
+ check<This extends typeof $mol_schema_any, Value_1>(this: This, value: Value_1): value is Value_1 & This["default"];
255
463
  [Symbol.toStringTag]: string;
256
464
  [$mol_key_handle](): string;
257
- [Symbol.hasInstance]<This extends typeof $mol_schema_any, Val>(this: This, val: Val): val is Val & This["default"];
465
+ [Symbol.hasInstance]<This extends typeof $mol_schema_any, Value_2>(this: This, value: Value_2): value is Value_2 & This["default"];
258
466
  getPrototypeOf(o: any): any;
259
467
  getOwnPropertyDescriptor(o: any, p: PropertyKey): PropertyDescriptor | undefined;
260
468
  getOwnPropertyNames(o: any): string[];
@@ -274,9 +482,9 @@ declare namespace $ {
274
482
  isExtensible(o: any): boolean;
275
483
  keys(o: object): string[];
276
484
  keys(o: {}): string[];
277
- assign<T extends {}, U>(target: T, source: U): T & U;
278
- assign<T extends {}, U, V>(target: T, source1: U, source2: V): T & U & V;
279
- assign<T extends {}, U, V, W>(target: T, source1: U, source2: V, source3: W): T & U & V & W;
485
+ assign<T extends {}, U_1>(target: T, source: U_1): T & U_1;
486
+ assign<T extends {}, U_2, V>(target: T, source1: U_2, source2: V): T & U_2 & V;
487
+ assign<T extends {}, U_3, V_1, W>(target: T, source1: U_3, source2: V_1, source3: W): T & U_3 & V_1 & W;
280
488
  assign(target: object, ...sources: any[]): any;
281
489
  getOwnPropertySymbols(o: any): symbol[];
282
490
  is(value1: any, value2: any): boolean;
@@ -302,7 +510,7 @@ declare namespace $ {
302
510
  }
303
511
 
304
512
  declare namespace $ {
305
- function $mol_schema_range<Value extends number | bigint, Min extends Value, Max extends Value>(Min: Min, Max: Max): {
513
+ let $mol_schema_enum: <const Options extends readonly unknown[]>(this: void, Options: Options) => {
306
514
  new (value?: any): {
307
515
  constructor: Function;
308
516
  toString(): string;
@@ -312,16 +520,15 @@ declare namespace $ {
312
520
  isPrototypeOf(v: Object): boolean;
313
521
  propertyIsEnumerable(v: PropertyKey): boolean;
314
522
  };
315
- Min: Min;
316
- Max: Max;
523
+ Options: Options;
317
524
  toString(): string;
318
- guard<Value_1>(value: Value_1): Value_1 & Value & { [key in `$mol_schema_range_min=${Min}`]: true; } & { [key_1 in `$mol_schema_range_max=${Max}`]: true; };
319
- cast(val: Value): Value;
320
- default: Value & { [key in `$mol_schema_range_min=${Min}`]: true; } & { [key in `$mol_schema_range_max=${Max}`]: true; };
321
- check<This extends typeof $mol_schema_any, Val>(this: This, val: Val): val is Val & This["default"];
525
+ guard<This extends typeof $mol_schema_any, Value>(this: This, value: Value): Value & This["default"];
526
+ cast<This extends typeof $mol_schema_any>(this: This, value: unknown): This["default"];
527
+ default: Options[number];
528
+ check<This extends typeof $mol_schema_any, Value_1>(this: This, value: Value_1): value is Value_1 & This["default"];
322
529
  [Symbol.toStringTag]: string;
323
530
  [$mol_key_handle](): string;
324
- [Symbol.hasInstance]<This extends typeof $mol_schema_any, Val>(this: This, val: Val): val is Val & This["default"];
531
+ [Symbol.hasInstance]<This extends typeof $mol_schema_any, Value_2>(this: This, value: Value_2): value is Value_2 & This["default"];
325
532
  getPrototypeOf(o: any): any;
326
533
  getOwnPropertyDescriptor(o: any, p: PropertyKey): PropertyDescriptor | undefined;
327
534
  getOwnPropertyNames(o: any): string[];
@@ -341,9 +548,9 @@ declare namespace $ {
341
548
  isExtensible(o: any): boolean;
342
549
  keys(o: object): string[];
343
550
  keys(o: {}): string[];
344
- assign<T extends {}, U>(target: T, source: U): T & U;
345
- assign<T extends {}, U, V>(target: T, source1: U, source2: V): T & U & V;
346
- assign<T extends {}, U, V, W>(target: T, source1: U, source2: V, source3: W): T & U & V & W;
551
+ assign<T extends {}, U_1>(target: T, source: U_1): T & U_1;
552
+ assign<T extends {}, U_2, V>(target: T, source1: U_2, source2: V): T & U_2 & V;
553
+ assign<T extends {}, U_3, V_1, W>(target: T, source1: U_3, source2: V_1, source3: W): T & U_3 & V_1 & W;
347
554
  assign(target: object, ...sources: any[]): any;
348
555
  getOwnPropertySymbols(o: any): symbol[];
349
556
  is(value1: any, value2: any): boolean;
@@ -369,7 +576,7 @@ declare namespace $ {
369
576
  }
370
577
 
371
578
  declare namespace $ {
372
- const $mol_schema_positive_base: {
579
+ let $mol_schema_list: <Item extends typeof $mol_schema_any>(this: void, Item: Item) => {
373
580
  new (value?: any): {
374
581
  constructor: Function;
375
582
  toString(): string;
@@ -379,20 +586,15 @@ declare namespace $ {
379
586
  isPrototypeOf(v: Object): boolean;
380
587
  propertyIsEnumerable(v: PropertyKey): boolean;
381
588
  };
382
- Min: 0;
383
- Max: number;
589
+ Item: Item;
384
590
  toString(): string;
385
- guard<Value>(value: Value): (Value & (number | bigint)) & {
386
- "$mol_schema_range_min=0": true;
387
- } & {
388
- [x: `$mol_schema_range_max=${number}`]: true;
389
- };
390
- cast(val: number | bigint): number | bigint;
391
- default: Value & { [key in `$mol_schema_range_min=${Min}`]: true; } & { [key in `$mol_schema_range_max=${Max}`]: true; };
392
- check<This extends typeof $mol_schema_any, Val>(this: This, val: Val): val is Val & This["default"];
591
+ guard<This extends typeof $mol_schema_any, Value>(this: This, value: Value): Value & This["default"];
592
+ cast<This extends typeof $mol_schema_any>(this: This, value: unknown): This["default"];
593
+ default: readonly Item["default"][];
594
+ check<This extends typeof $mol_schema_any, Value_1>(this: This, value: Value_1): value is Value_1 & This["default"];
393
595
  [Symbol.toStringTag]: string;
394
596
  [$mol_key_handle](): string;
395
- [Symbol.hasInstance]<This extends typeof $mol_schema_any, Val>(this: This, val: Val): val is Val & This["default"];
597
+ [Symbol.hasInstance]<This extends typeof $mol_schema_any, Value_2>(this: This, value: Value_2): value is Value_2 & This["default"];
396
598
  getPrototypeOf(o: any): any;
397
599
  getOwnPropertyDescriptor(o: any, p: PropertyKey): PropertyDescriptor | undefined;
398
600
  getOwnPropertyNames(o: any): string[];
@@ -412,9 +614,9 @@ declare namespace $ {
412
614
  isExtensible(o: any): boolean;
413
615
  keys(o: object): string[];
414
616
  keys(o: {}): string[];
415
- assign<T extends {}, U>(target: T, source: U): T & U;
416
- assign<T extends {}, U, V>(target: T, source1: U, source2: V): T & U & V;
417
- assign<T extends {}, U, V, W>(target: T, source1: U, source2: V, source3: W): T & U & V & W;
617
+ assign<T extends {}, U_1>(target: T, source: U_1): T & U_1;
618
+ assign<T extends {}, U_2, V>(target: T, source1: U_2, source2: V): T & U_2 & V;
619
+ assign<T extends {}, U_3, V_1, W>(target: T, source1: U_3, source2: V_1, source3: W): T & U_3 & V_1 & W;
418
620
  assign(target: object, ...sources: any[]): any;
419
621
  getOwnPropertySymbols(o: any): symbol[];
420
622
  is(value1: any, value2: any): boolean;
@@ -437,13 +639,13 @@ declare namespace $ {
437
639
  hasOwn(o: object, v: PropertyKey): boolean;
438
640
  groupBy<K extends PropertyKey, T>(items: Iterable<T>, keySelector: (item: T, index: number) => K): Partial<Record<K, T[]>>;
439
641
  };
440
- export class $mol_schema_positive extends $mol_schema_positive_base {
441
- }
442
- export {};
443
642
  }
444
643
 
445
644
  declare namespace $ {
446
- const $mol_schema_natural_base: {
645
+ type JSON = null | boolean | number | string | JSON[] | {
646
+ [key: string]: JSON;
647
+ };
648
+ const $mol_schema_json_base: {
447
649
  new (value?: any): {
448
650
  constructor: Function;
449
651
  toString(): string;
@@ -453,15 +655,15 @@ declare namespace $ {
453
655
  isPrototypeOf(v: Object): boolean;
454
656
  propertyIsEnumerable(v: PropertyKey): boolean;
455
657
  };
456
- Schemas: (typeof $mol_schema_integer | typeof $mol_schema_positive)[];
658
+ Schema: (this: void) => any;
659
+ guard<Val>(value: Val): Val & JSON;
660
+ cast<Val>(value: Val): JSON;
661
+ get default(): JSON;
457
662
  toString(): string;
458
- guard<Value>(value: Value): never;
459
- cast(value: unknown): never;
460
- default: $mol_type_intersect<Schemas[number]["default"]>;
461
- check<This extends typeof $mol_schema_any, Val>(this: This, val: Val): val is Val & This["default"];
663
+ check<This extends typeof $mol_schema_any, Value>(this: This, value: Value): value is Value & This["default"];
462
664
  [Symbol.toStringTag]: string;
463
665
  [$mol_key_handle](): string;
464
- [Symbol.hasInstance]<This extends typeof $mol_schema_any, Val>(this: This, val: Val): val is Val & This["default"];
666
+ [Symbol.hasInstance]<This extends typeof $mol_schema_any, Value>(this: This, value: Value): value is Value & This["default"];
465
667
  getPrototypeOf(o: any): any;
466
668
  getOwnPropertyDescriptor(o: any, p: PropertyKey): PropertyDescriptor | undefined;
467
669
  getOwnPropertyNames(o: any): string[];
@@ -506,13 +708,22 @@ declare namespace $ {
506
708
  hasOwn(o: object, v: PropertyKey): boolean;
507
709
  groupBy<K extends PropertyKey, T>(items: Iterable<T>, keySelector: (item: T, index: number) => K): Partial<Record<K, T[]>>;
508
710
  };
509
- export class $mol_schema_natural extends $mol_schema_natural_base {
711
+ export class $mol_schema_json extends $mol_schema_json_base {
510
712
  }
511
713
  export {};
512
714
  }
513
715
 
514
716
  declare namespace $ {
515
- function $mol_schema_enum<const Options extends readonly unknown[]>(Options: Options): {
717
+ /**
718
+ * Converts union of types to intersection of same types
719
+ *
720
+ * $mol_type_intersect< number | string > // number & string
721
+ */
722
+ type $mol_type_intersect<Union> = (Union extends any ? (_: Union) => void : never) extends ((_: infer Intersection) => void) ? Intersection : never;
723
+ }
724
+
725
+ declare namespace $ {
726
+ let $mol_schema_every: <Schemas extends readonly (typeof $mol_schema_any)[]>(this: void, Schemas: Schemas) => {
516
727
  new (value?: any): {
517
728
  constructor: Function;
518
729
  toString(): string;
@@ -522,15 +733,15 @@ declare namespace $ {
522
733
  isPrototypeOf(v: Object): boolean;
523
734
  propertyIsEnumerable(v: PropertyKey): boolean;
524
735
  };
525
- Options: Options;
736
+ Schemas: Schemas;
526
737
  toString(): string;
527
- guard<Value>(value: Value): Value & Options[number];
528
- cast(val: unknown): Options[number];
529
- default: Options[number];
530
- check<This extends typeof $mol_schema_any, Val>(this: This, val: Val): val is Val & This["default"];
738
+ guard<This extends typeof $mol_schema_any, Value>(this: This, value: Value): Value & This["default"];
739
+ cast<This extends typeof $mol_schema_any>(this: This, value: unknown): This["default"];
740
+ default: $mol_type_intersect<Schemas[number]["default"]>;
741
+ check<This extends typeof $mol_schema_any, Value_1>(this: This, value: Value_1): value is Value_1 & This["default"];
531
742
  [Symbol.toStringTag]: string;
532
743
  [$mol_key_handle](): string;
533
- [Symbol.hasInstance]<This extends typeof $mol_schema_any, Val>(this: This, val: Val): val is Val & This["default"];
744
+ [Symbol.hasInstance]<This extends typeof $mol_schema_any, Value_2>(this: This, value: Value_2): value is Value_2 & This["default"];
534
745
  getPrototypeOf(o: any): any;
535
746
  getOwnPropertyDescriptor(o: any, p: PropertyKey): PropertyDescriptor | undefined;
536
747
  getOwnPropertyNames(o: any): string[];
@@ -550,9 +761,9 @@ declare namespace $ {
550
761
  isExtensible(o: any): boolean;
551
762
  keys(o: object): string[];
552
763
  keys(o: {}): string[];
553
- assign<T extends {}, U>(target: T, source: U): T & U;
554
- assign<T extends {}, U, V>(target: T, source1: U, source2: V): T & U & V;
555
- assign<T extends {}, U, V, W>(target: T, source1: U, source2: V, source3: W): T & U & V & W;
764
+ assign<T extends {}, U_1>(target: T, source: U_1): T & U_1;
765
+ assign<T extends {}, U_2, V>(target: T, source1: U_2, source2: V): T & U_2 & V;
766
+ assign<T extends {}, U_3, V_1, W>(target: T, source1: U_3, source2: V_1, source3: W): T & U_3 & V_1 & W;
556
767
  assign(target: object, ...sources: any[]): any;
557
768
  getOwnPropertySymbols(o: any): symbol[];
558
769
  is(value1: any, value2: any): boolean;
@@ -578,7 +789,7 @@ declare namespace $ {
578
789
  }
579
790
 
580
791
  declare namespace $ {
581
- const $mol_schema_negative_base: {
792
+ let $mol_schema_range: <Value extends number | bigint, Range extends [min: Value, max: Value]>(this: void, Range: Range) => {
582
793
  new (value?: any): {
583
794
  constructor: Function;
584
795
  toString(): string;
@@ -588,20 +799,15 @@ declare namespace $ {
588
799
  isPrototypeOf(v: Object): boolean;
589
800
  propertyIsEnumerable(v: PropertyKey): boolean;
590
801
  };
591
- Min: number;
592
- Max: 0;
802
+ Range: Range;
593
803
  toString(): string;
594
- guard<Value>(value: Value): (Value & (number | bigint)) & {
595
- [x: `$mol_schema_range_min=${number}`]: true;
596
- } & {
597
- "$mol_schema_range_max=0": true;
598
- };
599
- cast(val: number | bigint): number | bigint;
600
- default: Value & { [key in `$mol_schema_range_min=${Min}`]: true; } & { [key in `$mol_schema_range_max=${Max}`]: true; };
601
- check<This extends typeof $mol_schema_any, Val>(this: This, val: Val): val is Val & This["default"];
804
+ guard<This extends typeof $mol_schema_any, Val>(this: This, value: Val): Val & This["default"];
805
+ cast<This extends typeof $mol_schema_any>(this: This, value: Value): This["default"];
806
+ default: Range[0] & { [key in `$mol_schema_range_min=${Range[0]}`]: true; } & { [key_1 in `$mol_schema_range_max=${Range[1]}`]: true; };
807
+ check<This extends typeof $mol_schema_any, Value_1>(this: This, value: Value_1): value is Value_1 & This["default"];
602
808
  [Symbol.toStringTag]: string;
603
809
  [$mol_key_handle](): string;
604
- [Symbol.hasInstance]<This extends typeof $mol_schema_any, Val>(this: This, val: Val): val is Val & This["default"];
810
+ [Symbol.hasInstance]<This extends typeof $mol_schema_any, Value_2>(this: This, value: Value_2): value is Value_2 & This["default"];
605
811
  getPrototypeOf(o: any): any;
606
812
  getOwnPropertyDescriptor(o: any, p: PropertyKey): PropertyDescriptor | undefined;
607
813
  getOwnPropertyNames(o: any): string[];
@@ -621,9 +827,9 @@ declare namespace $ {
621
827
  isExtensible(o: any): boolean;
622
828
  keys(o: object): string[];
623
829
  keys(o: {}): string[];
624
- assign<T extends {}, U>(target: T, source: U): T & U;
625
- assign<T extends {}, U, V>(target: T, source1: U, source2: V): T & U & V;
626
- assign<T extends {}, U, V, W>(target: T, source1: U, source2: V, source3: W): T & U & V & W;
830
+ assign<T extends {}, U_1>(target: T, source: U_1): T & U_1;
831
+ assign<T extends {}, U_2, V>(target: T, source1: U_2, source2: V): T & U_2 & V;
832
+ assign<T extends {}, U_3, V_1, W>(target: T, source1: U_3, source2: V_1, source3: W): T & U_3 & V_1 & W;
627
833
  assign(target: object, ...sources: any[]): any;
628
834
  getOwnPropertySymbols(o: any): symbol[];
629
835
  is(value1: any, value2: any): boolean;
@@ -646,13 +852,10 @@ declare namespace $ {
646
852
  hasOwn(o: object, v: PropertyKey): boolean;
647
853
  groupBy<K extends PropertyKey, T>(items: Iterable<T>, keySelector: (item: T, index: number) => K): Partial<Record<K, T[]>>;
648
854
  };
649
- export class $mol_schema_negative extends $mol_schema_negative_base {
650
- }
651
- export {};
652
855
  }
653
856
 
654
857
  declare namespace $ {
655
- function $mol_schema_some<Variants extends readonly (typeof $mol_schema_any)[]>(Variants: Variants): {
858
+ const $mol_schema_positive_base: {
656
859
  new (value?: any): {
657
860
  constructor: Function;
658
861
  toString(): string;
@@ -662,15 +865,19 @@ declare namespace $ {
662
865
  isPrototypeOf(v: Object): boolean;
663
866
  propertyIsEnumerable(v: PropertyKey): boolean;
664
867
  };
665
- Variants: Variants;
868
+ Range: [0, number];
666
869
  toString(): string;
667
- guard<Value>(value: Value): Value & Variants[number]["default"];
668
- cast(value: unknown): Variants[number]["default"];
669
- default: Variants[number]["default"];
670
- check<This extends typeof $mol_schema_any, Val>(this: This, val: Val): val is Val & This["default"];
870
+ guard<This extends typeof $mol_schema_any, Val>(this: This, value: Val): Val & This["default"];
871
+ cast<This extends typeof $mol_schema_any>(this: This, value: number | bigint): This["default"];
872
+ default: 0 & {
873
+ "$mol_schema_range_min=0": true;
874
+ } & {
875
+ [x: `$mol_schema_range_max=${number}`]: true;
876
+ };
877
+ check<This extends typeof $mol_schema_any, Value>(this: This, value: Value): value is Value & This["default"];
671
878
  [Symbol.toStringTag]: string;
672
879
  [$mol_key_handle](): string;
673
- [Symbol.hasInstance]<This extends typeof $mol_schema_any, Val>(this: This, val: Val): val is Val & This["default"];
880
+ [Symbol.hasInstance]<This extends typeof $mol_schema_any, Value>(this: This, value: Value): value is Value & This["default"];
674
881
  getPrototypeOf(o: any): any;
675
882
  getOwnPropertyDescriptor(o: any, p: PropertyKey): PropertyDescriptor | undefined;
676
883
  getOwnPropertyNames(o: any): string[];
@@ -715,10 +922,13 @@ declare namespace $ {
715
922
  hasOwn(o: object, v: PropertyKey): boolean;
716
923
  groupBy<K extends PropertyKey, T>(items: Iterable<T>, keySelector: (item: T, index: number) => K): Partial<Record<K, T[]>>;
717
924
  };
925
+ export class $mol_schema_positive extends $mol_schema_positive_base {
926
+ }
927
+ export {};
718
928
  }
719
929
 
720
930
  declare namespace $ {
721
- function $mol_schema_maybe<Some extends typeof $mol_schema_any>(Some: Some): {
931
+ const $mol_schema_natural_base: {
722
932
  new (value?: any): {
723
933
  constructor: Function;
724
934
  toString(): string;
@@ -728,202 +938,19 @@ declare namespace $ {
728
938
  isPrototypeOf(v: Object): boolean;
729
939
  propertyIsEnumerable(v: PropertyKey): boolean;
730
940
  };
731
- Some: Some;
941
+ Schemas: (typeof $mol_schema_integer | typeof $mol_schema_positive)[];
732
942
  toString(): string;
733
- Variants: (Some | {
734
- new (value?: any): {
735
- constructor: Function;
736
- toString(): string;
737
- toLocaleString(): string;
738
- valueOf(): Object;
739
- hasOwnProperty(v: PropertyKey): boolean;
740
- isPrototypeOf(v: Object): boolean;
741
- propertyIsEnumerable(v: PropertyKey): boolean;
742
- };
743
- Options: readonly [undefined, null];
744
- toString(): string;
745
- guard<Value>(value: Value): Value & (null | undefined);
746
- cast(val: unknown): null | undefined;
747
- default: Options[number];
748
- check<This extends typeof $mol_schema_any, Val>(this: This, val: Val): val is Val & This["default"];
749
- [Symbol.toStringTag]: string;
750
- [$mol_key_handle](): string;
751
- [Symbol.hasInstance]<This extends typeof $mol_schema_any, Val>(this: This, val: Val): val is Val & This["default"];
752
- getPrototypeOf(o: any): any;
753
- getOwnPropertyDescriptor(o: any, p: PropertyKey): PropertyDescriptor | undefined;
754
- getOwnPropertyNames(o: any): string[];
755
- create(o: object | null): any;
756
- create(o: object | null, properties: PropertyDescriptorMap & ThisType<any>): any;
757
- defineProperty<T>(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>): T;
758
- defineProperties<T>(o: T, properties: PropertyDescriptorMap & ThisType<any>): T;
759
- seal<T>(o: T): T;
760
- freeze<T extends Function>(f: T): T;
761
- freeze<T extends {
762
- [idx: string]: U | null | undefined | object;
763
- }, U extends string | bigint | number | boolean | symbol>(o: T): Readonly<T>;
764
- freeze<T>(o: T): Readonly<T>;
765
- preventExtensions<T>(o: T): T;
766
- isSealed(o: any): boolean;
767
- isFrozen(o: any): boolean;
768
- isExtensible(o: any): boolean;
769
- keys(o: object): string[];
770
- keys(o: {}): string[];
771
- assign<T extends {}, U>(target: T, source: U): T & U;
772
- assign<T extends {}, U, V>(target: T, source1: U, source2: V): T & U & V;
773
- assign<T extends {}, U, V, W>(target: T, source1: U, source2: V, source3: W): T & U & V & W;
774
- assign(target: object, ...sources: any[]): any;
775
- getOwnPropertySymbols(o: any): symbol[];
776
- is(value1: any, value2: any): boolean;
777
- setPrototypeOf(o: any, proto: object | null): any;
778
- values<T>(o: {
779
- [s: string]: T;
780
- } | ArrayLike<T>): T[];
781
- values(o: {}): any[];
782
- entries<T>(o: {
783
- [s: string]: T;
784
- } | ArrayLike<T>): [string, T][];
785
- entries(o: {}): [string, any][];
786
- getOwnPropertyDescriptors<T>(o: T): { [P in keyof T]: TypedPropertyDescriptor<T[P]>; } & {
787
- [x: string]: PropertyDescriptor;
788
- };
789
- fromEntries<T = any>(entries: Iterable<readonly [PropertyKey, T]>): {
790
- [k: string]: T;
791
- };
792
- fromEntries(entries: Iterable<readonly any[]>): any;
793
- hasOwn(o: object, v: PropertyKey): boolean;
794
- groupBy<K extends PropertyKey, T>(items: Iterable<T>, keySelector: (item: T, index: number) => K): Partial<Record<K, T[]>>;
795
- })[];
796
- guard<Value>(value: Value): Value & (Some | {
797
- new (value?: any): {
798
- constructor: Function;
799
- toString(): string;
800
- toLocaleString(): string;
801
- valueOf(): Object;
802
- hasOwnProperty(v: PropertyKey): boolean;
803
- isPrototypeOf(v: Object): boolean;
804
- propertyIsEnumerable(v: PropertyKey): boolean;
805
- };
806
- Options: readonly [undefined, null];
807
- toString(): string;
808
- guard<Value_1>(value: Value_1): Value_1 & (null | undefined);
809
- cast(val: unknown): null | undefined;
810
- default: Options[number];
811
- check<This extends typeof $mol_schema_any, Val>(this: This, val: Val): val is Val & This["default"];
812
- [Symbol.toStringTag]: string;
813
- [$mol_key_handle](): string;
814
- [Symbol.hasInstance]<This extends typeof $mol_schema_any, Val_1>(this: This, val: Val_1): val is Val_1 & This["default"];
815
- getPrototypeOf(o: any): any;
816
- getOwnPropertyDescriptor(o: any, p: PropertyKey): PropertyDescriptor | undefined;
817
- getOwnPropertyNames(o: any): string[];
818
- create(o: object | null): any;
819
- create(o: object | null, properties: PropertyDescriptorMap & ThisType<any>): any;
820
- defineProperty<T>(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>): T;
821
- defineProperties<T>(o: T, properties: PropertyDescriptorMap & ThisType<any>): T;
822
- seal<T>(o: T): T;
823
- freeze<T extends Function>(f: T): T;
824
- freeze<T extends {
825
- [idx: string]: U | null | undefined | object;
826
- }, U extends string | bigint | number | boolean | symbol>(o: T): Readonly<T>;
827
- freeze<T>(o: T): Readonly<T>;
828
- preventExtensions<T>(o: T): T;
829
- isSealed(o: any): boolean;
830
- isFrozen(o: any): boolean;
831
- isExtensible(o: any): boolean;
832
- keys(o: object): string[];
833
- keys(o: {}): string[];
834
- assign<T extends {}, U_1>(target: T, source: U_1): T & U_1;
835
- assign<T extends {}, U_2, V>(target: T, source1: U_2, source2: V): T & U_2 & V;
836
- assign<T extends {}, U_3, V_1, W>(target: T, source1: U_3, source2: V_1, source3: W): T & U_3 & V_1 & W;
837
- assign(target: object, ...sources: any[]): any;
838
- getOwnPropertySymbols(o: any): symbol[];
839
- is(value1: any, value2: any): boolean;
840
- setPrototypeOf(o: any, proto: object | null): any;
841
- values<T>(o: {
842
- [s: string]: T;
843
- } | ArrayLike<T>): T[];
844
- values(o: {}): any[];
845
- entries<T>(o: {
846
- [s: string]: T;
847
- } | ArrayLike<T>): [string, T][];
848
- entries(o: {}): [string, any][];
849
- getOwnPropertyDescriptors<T>(o: T): { [P in keyof T]: TypedPropertyDescriptor<T[P]>; } & {
850
- [x: string]: PropertyDescriptor;
851
- };
852
- fromEntries<T = any>(entries: Iterable<readonly [PropertyKey, T]>): {
853
- [k: string]: T;
854
- };
855
- fromEntries(entries: Iterable<readonly any[]>): any;
856
- hasOwn(o: object, v: PropertyKey): boolean;
857
- groupBy<K extends PropertyKey, T>(items: Iterable<T>, keySelector: (item: T, index: number) => K): Partial<Record<K, T[]>>;
858
- })["default"];
859
- cast(value: unknown): (Some | {
860
- new (value?: any): {
861
- constructor: Function;
862
- toString(): string;
863
- toLocaleString(): string;
864
- valueOf(): Object;
865
- hasOwnProperty(v: PropertyKey): boolean;
866
- isPrototypeOf(v: Object): boolean;
867
- propertyIsEnumerable(v: PropertyKey): boolean;
868
- };
869
- Options: readonly [undefined, null];
870
- toString(): string;
871
- guard<Value>(value: Value): Value & (null | undefined);
872
- cast(val: unknown): null | undefined;
873
- default: Options[number];
874
- check<This extends typeof $mol_schema_any, Val>(this: This, val: Val): val is Val & This["default"];
875
- [Symbol.toStringTag]: string;
876
- [$mol_key_handle](): string;
877
- [Symbol.hasInstance]<This extends typeof $mol_schema_any, Val>(this: This, val: Val): val is Val & This["default"];
878
- getPrototypeOf(o: any): any;
879
- getOwnPropertyDescriptor(o: any, p: PropertyKey): PropertyDescriptor | undefined;
880
- getOwnPropertyNames(o: any): string[];
881
- create(o: object | null): any;
882
- create(o: object | null, properties: PropertyDescriptorMap & ThisType<any>): any;
883
- defineProperty<T>(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>): T;
884
- defineProperties<T>(o: T, properties: PropertyDescriptorMap & ThisType<any>): T;
885
- seal<T>(o: T): T;
886
- freeze<T extends Function>(f: T): T;
887
- freeze<T extends {
888
- [idx: string]: U | null | undefined | object;
889
- }, U extends string | bigint | number | boolean | symbol>(o: T): Readonly<T>;
890
- freeze<T>(o: T): Readonly<T>;
891
- preventExtensions<T>(o: T): T;
892
- isSealed(o: any): boolean;
893
- isFrozen(o: any): boolean;
894
- isExtensible(o: any): boolean;
895
- keys(o: object): string[];
896
- keys(o: {}): string[];
897
- assign<T extends {}, U>(target: T, source: U): T & U;
898
- assign<T extends {}, U, V>(target: T, source1: U, source2: V): T & U & V;
899
- assign<T extends {}, U, V, W>(target: T, source1: U, source2: V, source3: W): T & U & V & W;
900
- assign(target: object, ...sources: any[]): any;
901
- getOwnPropertySymbols(o: any): symbol[];
902
- is(value1: any, value2: any): boolean;
903
- setPrototypeOf(o: any, proto: object | null): any;
904
- values<T>(o: {
905
- [s: string]: T;
906
- } | ArrayLike<T>): T[];
907
- values(o: {}): any[];
908
- entries<T>(o: {
909
- [s: string]: T;
910
- } | ArrayLike<T>): [string, T][];
911
- entries(o: {}): [string, any][];
912
- getOwnPropertyDescriptors<T>(o: T): { [P in keyof T]: TypedPropertyDescriptor<T[P]>; } & {
913
- [x: string]: PropertyDescriptor;
914
- };
915
- fromEntries<T = any>(entries: Iterable<readonly [PropertyKey, T]>): {
916
- [k: string]: T;
917
- };
918
- fromEntries(entries: Iterable<readonly any[]>): any;
919
- hasOwn(o: object, v: PropertyKey): boolean;
920
- groupBy<K extends PropertyKey, T>(items: Iterable<T>, keySelector: (item: T, index: number) => K): Partial<Record<K, T[]>>;
921
- })["default"];
922
- default: Variants[number]["default"];
923
- check<This extends typeof $mol_schema_any, Val>(this: This, val: Val): val is Val & This["default"];
943
+ guard<This extends typeof $mol_schema_any, Value>(this: This, value: Value): Value & This["default"];
944
+ cast<This extends typeof $mol_schema_any>(this: This, value: unknown): This["default"];
945
+ default: $mol_schema_integer & 0 & {
946
+ "$mol_schema_range_min=0": true;
947
+ } & {
948
+ [x: `$mol_schema_range_max=${number}`]: true;
949
+ };
950
+ check<This extends typeof $mol_schema_any, Value>(this: This, value: Value): value is Value & This["default"];
924
951
  [Symbol.toStringTag]: string;
925
952
  [$mol_key_handle](): string;
926
- [Symbol.hasInstance]<This extends typeof $mol_schema_any, Val>(this: This, val: Val): val is Val & This["default"];
953
+ [Symbol.hasInstance]<This extends typeof $mol_schema_any, Value>(this: This, value: Value): value is Value & This["default"];
927
954
  getPrototypeOf(o: any): any;
928
955
  getOwnPropertyDescriptor(o: any, p: PropertyKey): PropertyDescriptor | undefined;
929
956
  getOwnPropertyNames(o: any): string[];
@@ -968,10 +995,13 @@ declare namespace $ {
968
995
  hasOwn(o: object, v: PropertyKey): boolean;
969
996
  groupBy<K extends PropertyKey, T>(items: Iterable<T>, keySelector: (item: T, index: number) => K): Partial<Record<K, T[]>>;
970
997
  };
998
+ export class $mol_schema_natural extends $mol_schema_natural_base {
999
+ }
1000
+ export {};
971
1001
  }
972
1002
 
973
1003
  declare namespace $ {
974
- function $mol_schema_list<Item extends typeof $mol_schema_any>(Item: Item): {
1004
+ const $mol_schema_negative_base: {
975
1005
  new (value?: any): {
976
1006
  constructor: Function;
977
1007
  toString(): string;
@@ -981,15 +1011,19 @@ declare namespace $ {
981
1011
  isPrototypeOf(v: Object): boolean;
982
1012
  propertyIsEnumerable(v: PropertyKey): boolean;
983
1013
  };
984
- Item: Item;
1014
+ Range: [number, 0];
985
1015
  toString(): string;
986
- guard<Value>(value: Value): Value & readonly Item["default"][];
987
- cast(value: unknown): readonly Item["default"][];
988
- default: readonly (Item["default"])[];
989
- check<This extends typeof $mol_schema_any, Val>(this: This, val: Val): val is Val & This["default"];
1016
+ guard<This extends typeof $mol_schema_any, Val>(this: This, value: Val): Val & This["default"];
1017
+ cast<This extends typeof $mol_schema_any>(this: This, value: number | bigint): This["default"];
1018
+ default: number & {
1019
+ [x: `$mol_schema_range_min=${number}`]: true;
1020
+ } & {
1021
+ "$mol_schema_range_max=0": true;
1022
+ };
1023
+ check<This extends typeof $mol_schema_any, Value>(this: This, value: Value): value is Value & This["default"];
990
1024
  [Symbol.toStringTag]: string;
991
1025
  [$mol_key_handle](): string;
992
- [Symbol.hasInstance]<This extends typeof $mol_schema_any, Val>(this: This, val: Val): val is Val & This["default"];
1026
+ [Symbol.hasInstance]<This extends typeof $mol_schema_any, Value>(this: This, value: Value): value is Value & This["default"];
993
1027
  getPrototypeOf(o: any): any;
994
1028
  getOwnPropertyDescriptor(o: any, p: PropertyKey): PropertyDescriptor | undefined;
995
1029
  getOwnPropertyNames(o: any): string[];
@@ -1034,12 +1068,13 @@ declare namespace $ {
1034
1068
  hasOwn(o: object, v: PropertyKey): boolean;
1035
1069
  groupBy<K extends PropertyKey, T>(items: Iterable<T>, keySelector: (item: T, index: number) => K): Partial<Record<K, T[]>>;
1036
1070
  };
1071
+ export class $mol_schema_negative extends $mol_schema_negative_base {
1072
+ }
1073
+ export {};
1037
1074
  }
1038
1075
 
1039
1076
  declare namespace $ {
1040
- function $mol_schema_dict<Key extends typeof $mol_schema_any & {
1041
- default: PropertyKey;
1042
- }, Val extends typeof $mol_schema_any>(Key: Key, Val: Val): {
1077
+ let $mol_schema_maybe: <Some extends typeof $mol_schema_any>(this: void, Some: Some) => {
1043
1078
  new (value?: any): {
1044
1079
  constructor: Function;
1045
1080
  toString(): string;
@@ -1049,16 +1084,15 @@ declare namespace $ {
1049
1084
  isPrototypeOf(v: Object): boolean;
1050
1085
  propertyIsEnumerable(v: PropertyKey): boolean;
1051
1086
  };
1052
- Key: Key;
1053
- Val: Val;
1087
+ Some: Some;
1054
1088
  toString(): string;
1055
- guard<Value>(value: Value): Value & Record<Key["default"], Val["default"]>;
1056
- cast(value: unknown): Record<Key["default"], Val["default"]>;
1057
- default: Record<Key["default"], Val["default"]>;
1058
- check<This extends typeof $mol_schema_any, Val_1>(this: This, val: Val_1): val is Val_1 & This["default"];
1089
+ guard<This extends typeof $mol_schema_any, Value>(this: This, value: Value): Value & This["default"];
1090
+ default: Some["default"] | null;
1091
+ check<This extends typeof $mol_schema_any, Value_1>(this: This, value: Value_1): value is Value_1 & This["default"];
1092
+ cast<This extends typeof $mol_schema_any>(this: This, value: unknown): This["default"];
1059
1093
  [Symbol.toStringTag]: string;
1060
1094
  [$mol_key_handle](): string;
1061
- [Symbol.hasInstance]<This extends typeof $mol_schema_any, Val_1>(this: This, val: Val_1): val is Val_1 & This["default"];
1095
+ [Symbol.hasInstance]<This extends typeof $mol_schema_any, Value_2>(this: This, value: Value_2): value is Value_2 & This["default"];
1062
1096
  getPrototypeOf(o: any): any;
1063
1097
  getOwnPropertyDescriptor(o: any, p: PropertyKey): PropertyDescriptor | undefined;
1064
1098
  getOwnPropertyNames(o: any): string[];
@@ -1078,9 +1112,9 @@ declare namespace $ {
1078
1112
  isExtensible(o: any): boolean;
1079
1113
  keys(o: object): string[];
1080
1114
  keys(o: {}): string[];
1081
- assign<T extends {}, U>(target: T, source: U): T & U;
1082
- assign<T extends {}, U, V>(target: T, source1: U, source2: V): T & U & V;
1083
- assign<T extends {}, U, V, W>(target: T, source1: U, source2: V, source3: W): T & U & V & W;
1115
+ assign<T extends {}, U_1>(target: T, source: U_1): T & U_1;
1116
+ assign<T extends {}, U_2, V>(target: T, source1: U_2, source2: V): T & U_2 & V;
1117
+ assign<T extends {}, U_3, V_1, W>(target: T, source1: U_3, source2: V_1, source3: W): T & U_3 & V_1 & W;
1084
1118
  assign(target: object, ...sources: any[]): any;
1085
1119
  getOwnPropertySymbols(o: any): symbol[];
1086
1120
  is(value1: any, value2: any): boolean;
@@ -1106,7 +1140,7 @@ declare namespace $ {
1106
1140
  }
1107
1141
 
1108
1142
  declare namespace $ {
1109
- function $mol_schema_record<Fields extends Record<string, typeof $mol_schema_any>>(Fields: Fields): {
1143
+ let $mol_schema_record: <Fields extends Record<string, typeof $mol_schema_any>>(this: void, Fields: Fields) => {
1110
1144
  new (value?: any): {
1111
1145
  constructor: Function;
1112
1146
  toString(): string;
@@ -1118,13 +1152,13 @@ declare namespace $ {
1118
1152
  };
1119
1153
  Fields: Fields;
1120
1154
  toString(): string;
1121
- guard<Value>(value: Value): Value & { readonly [key in keyof Fields]: Fields[key]["default"]; };
1122
- cast(value: unknown): { readonly [key in keyof Fields]: Fields[key]["default"]; };
1123
- default: { readonly [key in keyof typeof Fields]: (typeof Fields)[key]["default"]; };
1124
- check<This extends typeof $mol_schema_any, Val>(this: This, val: Val): val is Val & This["default"];
1155
+ guard<This extends typeof $mol_schema_any, Value>(this: This, value: Value): Value & This["default"];
1156
+ cast<This extends typeof $mol_schema_any>(this: This, value: unknown): This["default"];
1157
+ default: { readonly [key in keyof Fields]: Fields[key]["default"]; };
1158
+ check<This extends typeof $mol_schema_any, Value_1>(this: This, value: Value_1): value is Value_1 & This["default"];
1125
1159
  [Symbol.toStringTag]: string;
1126
1160
  [$mol_key_handle](): string;
1127
- [Symbol.hasInstance]<This extends typeof $mol_schema_any, Val>(this: This, val: Val): val is Val & This["default"];
1161
+ [Symbol.hasInstance]<This extends typeof $mol_schema_any, Value_2>(this: This, value: Value_2): value is Value_2 & This["default"];
1128
1162
  getPrototypeOf(o: any): any;
1129
1163
  getOwnPropertyDescriptor(o: any, p: PropertyKey): PropertyDescriptor | undefined;
1130
1164
  getOwnPropertyNames(o: any): string[];
@@ -1144,9 +1178,9 @@ declare namespace $ {
1144
1178
  isExtensible(o: any): boolean;
1145
1179
  keys(o: object): string[];
1146
1180
  keys(o: {}): string[];
1147
- assign<T extends {}, U>(target: T, source: U): T & U;
1148
- assign<T extends {}, U, V>(target: T, source1: U, source2: V): T & U & V;
1149
- assign<T extends {}, U, V, W>(target: T, source1: U, source2: V, source3: W): T & U & V & W;
1181
+ assign<T extends {}, U_1>(target: T, source: U_1): T & U_1;
1182
+ assign<T extends {}, U_2, V>(target: T, source1: U_2, source2: V): T & U_2 & V;
1183
+ assign<T extends {}, U_3, V_1, W>(target: T, source1: U_3, source2: V_1, source3: W): T & U_3 & V_1 & W;
1150
1184
  assign(target: object, ...sources: any[]): any;
1151
1185
  getOwnPropertySymbols(o: any): symbol[];
1152
1186
  is(value1: any, value2: any): boolean;
@@ -1184,17 +1218,15 @@ declare namespace $ {
1184
1218
  };
1185
1219
  Fields: Fields;
1186
1220
  toString(): string;
1187
- guard<Value>(value: Value): Value & {
1188
- readonly [x: string]: any;
1189
- };
1190
- cast(value: unknown): {
1221
+ guard<This extends typeof $mol_schema_any, Value>(this: This, value: Value): Value & This["default"];
1222
+ cast<This extends typeof $mol_schema_any>(this: This, value: unknown): This["default"];
1223
+ default: {
1191
1224
  readonly [x: string]: any;
1192
1225
  };
1193
- default: { readonly [key in keyof typeof Fields_1]: (typeof Fields_1)[key]["default"]; };
1194
- check<This extends typeof $mol_schema_any, Val>(this: This, val: Val): val is Val & This["default"];
1226
+ check<This extends typeof $mol_schema_any, Value>(this: This, value: Value): value is Value & This["default"];
1195
1227
  [Symbol.toStringTag]: string;
1196
1228
  [$mol_key_handle](): string;
1197
- [Symbol.hasInstance]<This extends typeof $mol_schema_any, Val>(this: This, val: Val): val is Val & This["default"];
1229
+ [Symbol.hasInstance]<This extends typeof $mol_schema_any, Value>(this: This, value: Value): value is Value & This["default"];
1198
1230
  getPrototypeOf(o: any): any;
1199
1231
  getOwnPropertyDescriptor(o: any, p: PropertyKey): PropertyDescriptor | undefined;
1200
1232
  getOwnPropertyNames(o: any): string[];