mol_schema 0.0.23 → 0.0.25

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,15 +72,15 @@ 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
  }
@@ -189,13 +190,13 @@ declare namespace $ {
189
190
  };
190
191
  Pattern: Pattern;
191
192
  toString(): string;
192
- guard<Value>(value: Value): Value & string;
193
- 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"];
194
195
  default: string;
195
- 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"];
196
197
  [Symbol.toStringTag]: string;
197
198
  [$mol_key_handle](): string;
198
- [Symbol.hasInstance]<This extends typeof $mol_schema_any, Val_1>(this: This, val: Val_1): val is Val_1 & This["default"];
199
+ [Symbol.hasInstance]<This extends typeof $mol_schema_any, Value_2>(this: This, value: Value_2): value is Value_2 & This["default"];
199
200
  getPrototypeOf(o: any): any;
200
201
  getOwnPropertyDescriptor(o: any, p: PropertyKey): PropertyDescriptor | undefined;
201
202
  getOwnPropertyNames(o: any): string[];
@@ -243,7 +244,7 @@ declare namespace $ {
243
244
  }
244
245
 
245
246
  declare namespace $ {
246
- let $mol_schema_instance: <Class extends new (...args: Args) => any, Args extends any[]>(this: void, 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 : {
247
248
  new (value?: any): {
248
249
  constructor: Function;
249
250
  toString(): string;
@@ -255,13 +256,13 @@ declare namespace $ {
255
256
  };
256
257
  Class: Class;
257
258
  toString(): string;
258
- guard<Value>(value: Value): Value & InstanceType<Class>;
259
- default: InstanceType<Class>;
260
- 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"];
261
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"];
262
263
  [Symbol.toStringTag]: string;
263
264
  [$mol_key_handle](): string;
264
- [Symbol.hasInstance]<This extends typeof $mol_schema_any, Val_1>(this: This, val: Val_1): val is Val_1 & This["default"];
265
+ [Symbol.hasInstance]<This extends typeof $mol_schema_any, Value_2>(this: This, value: Value_2): value is Value_2 & This["default"];
265
266
  getPrototypeOf(o: any): any;
266
267
  getOwnPropertyDescriptor(o: any, p: PropertyKey): PropertyDescriptor | undefined;
267
268
  getOwnPropertyNames(o: any): string[];
@@ -309,16 +310,73 @@ declare namespace $ {
309
310
  }
310
311
 
311
312
  declare namespace $ {
312
- /**
313
- * Converts union of types to intersection of same types
314
- *
315
- * $mol_type_intersect< number | string > // number & string
316
- */
317
- type $mol_type_intersect<Union> = (Union extends any ? (_: Union) => void : never) extends ((_: infer Intersection) => void) ? Intersection : never;
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"];
329
+ [Symbol.toStringTag]: string;
330
+ [$mol_key_handle](): string;
331
+ [Symbol.hasInstance]<This extends typeof $mol_schema_any, Value_1>(this: This, value: Value_1): value is Value_1 & This["default"];
332
+ getPrototypeOf(o: any): any;
333
+ getOwnPropertyDescriptor(o: any, p: PropertyKey): PropertyDescriptor | undefined;
334
+ getOwnPropertyNames(o: any): string[];
335
+ create(o: object | null): any;
336
+ create(o: object | null, properties: PropertyDescriptorMap & ThisType<any>): any;
337
+ defineProperty<T>(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>): T;
338
+ defineProperties<T>(o: T, properties: PropertyDescriptorMap & ThisType<any>): T;
339
+ seal<T>(o: T): T;
340
+ freeze<T extends Function>(f: T): T;
341
+ freeze<T extends {
342
+ [idx: string]: U | null | undefined | object;
343
+ }, U extends string | bigint | number | boolean | symbol>(o: T): Readonly<T>;
344
+ freeze<T>(o: T): Readonly<T>;
345
+ preventExtensions<T>(o: T): T;
346
+ isSealed(o: any): boolean;
347
+ isFrozen(o: any): boolean;
348
+ isExtensible(o: any): boolean;
349
+ keys(o: object): string[];
350
+ keys(o: {}): string[];
351
+ assign<T extends {}, U>(target: T, source: U): T & U;
352
+ assign<T extends {}, U, V>(target: T, source1: U, source2: V): T & U & V;
353
+ assign<T extends {}, U, V, W>(target: T, source1: U, source2: V, source3: W): T & U & V & W;
354
+ assign(target: object, ...sources: any[]): any;
355
+ getOwnPropertySymbols(o: any): symbol[];
356
+ is(value1: any, value2: any): boolean;
357
+ setPrototypeOf(o: any, proto: object | null): any;
358
+ values<T>(o: {
359
+ [s: string]: T;
360
+ } | ArrayLike<T>): T[];
361
+ values(o: {}): any[];
362
+ entries<T>(o: {
363
+ [s: string]: T;
364
+ } | ArrayLike<T>): [string, T][];
365
+ entries(o: {}): [string, any][];
366
+ getOwnPropertyDescriptors<T>(o: T): { [P in keyof T]: TypedPropertyDescriptor<T[P]>; } & {
367
+ [x: string]: PropertyDescriptor;
368
+ };
369
+ fromEntries<T = any>(entries: Iterable<readonly [PropertyKey, T]>): {
370
+ [k: string]: T;
371
+ };
372
+ fromEntries(entries: Iterable<readonly any[]>): any;
373
+ hasOwn(o: object, v: PropertyKey): boolean;
374
+ groupBy<K extends PropertyKey, T>(items: Iterable<T>, keySelector: (item: T, index: number) => K): Partial<Record<K, T[]>>;
375
+ };
318
376
  }
319
377
 
320
378
  declare namespace $ {
321
- let $mol_schema_every: <Schemas extends readonly (typeof $mol_schema_any)[]>(this: void, Schemas: Schemas) => {
379
+ let $mol_schema_some: <Variants extends readonly (typeof $mol_schema_any)[]>(this: void, Variants: Variants) => {
322
380
  new (value?: any): {
323
381
  constructor: Function;
324
382
  toString(): string;
@@ -328,15 +386,15 @@ declare namespace $ {
328
386
  isPrototypeOf(v: Object): boolean;
329
387
  propertyIsEnumerable(v: PropertyKey): boolean;
330
388
  };
331
- Schemas: Schemas;
389
+ Variants: Variants;
332
390
  toString(): string;
333
- guard<Value>(value: Value): Value & $mol_type_intersect<Schemas[number]["default"]>;
334
- cast(value: unknown): $mol_type_intersect<Schemas[number]["default"]>;
335
- default: $mol_type_intersect<Schemas[number]["default"]>;
336
- check<This extends typeof $mol_schema_any, Val>(this: This, val: Val): val is Val & This["default"];
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"];
337
395
  [Symbol.toStringTag]: string;
338
396
  [$mol_key_handle](): string;
339
- [Symbol.hasInstance]<This extends typeof $mol_schema_any, Val_1>(this: This, val: Val_1): val is Val_1 & This["default"];
397
+ [Symbol.hasInstance]<This extends typeof $mol_schema_any, Value_2>(this: This, value: Value_2): value is Value_2 & This["default"];
340
398
  getPrototypeOf(o: any): any;
341
399
  getOwnPropertyDescriptor(o: any, p: PropertyKey): PropertyDescriptor | undefined;
342
400
  getOwnPropertyNames(o: any): string[];
@@ -384,7 +442,9 @@ declare namespace $ {
384
442
  }
385
443
 
386
444
  declare namespace $ {
387
- let $mol_schema_range: <Value extends number | bigint, Range extends [min: Value, max: Value]>(this: void, Range: Range) => {
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) => {
388
448
  new (value?: any): {
389
449
  constructor: Function;
390
450
  toString(): string;
@@ -394,15 +454,15 @@ declare namespace $ {
394
454
  isPrototypeOf(v: Object): boolean;
395
455
  propertyIsEnumerable(v: PropertyKey): boolean;
396
456
  };
397
- Range: Range;
457
+ Pair: Pair;
398
458
  toString(): string;
399
- guard<Value_1>(value: Value_1): Value_1 & Value & { [key in `$mol_schema_range_min=${Range[0]}`]: true; } & { [key_1 in `$mol_schema_range_max=${Range[1]}`]: true; };
400
- cast(val: Value): Value;
401
- default: Value & { [key in `$mol_schema_range_min=${Range[0]}`]: true; } & { [key_1 in `$mol_schema_range_max=${Range[1]}`]: true; };
402
- 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"];
403
463
  [Symbol.toStringTag]: string;
404
464
  [$mol_key_handle](): string;
405
- [Symbol.hasInstance]<This extends typeof $mol_schema_any, Val_1>(this: This, val: Val_1): val is Val_1 & This["default"];
465
+ [Symbol.hasInstance]<This extends typeof $mol_schema_any, Value_2>(this: This, value: Value_2): value is Value_2 & This["default"];
406
466
  getPrototypeOf(o: any): any;
407
467
  getOwnPropertyDescriptor(o: any, p: PropertyKey): PropertyDescriptor | undefined;
408
468
  getOwnPropertyNames(o: any): string[];
@@ -450,7 +510,7 @@ declare namespace $ {
450
510
  }
451
511
 
452
512
  declare namespace $ {
453
- const $mol_schema_positive_base: {
513
+ let $mol_schema_enum: <const Options extends readonly unknown[]>(this: void, Options: Options) => {
454
514
  new (value?: any): {
455
515
  constructor: Function;
456
516
  toString(): string;
@@ -460,23 +520,81 @@ declare namespace $ {
460
520
  isPrototypeOf(v: Object): boolean;
461
521
  propertyIsEnumerable(v: PropertyKey): boolean;
462
522
  };
463
- Range: [0, number];
523
+ Options: Options;
464
524
  toString(): string;
465
- guard<Value>(value: Value): (Value & (number | bigint)) & {
466
- "$mol_schema_range_min=0": true;
467
- } & {
468
- [x: `$mol_schema_range_max=${number}`]: true;
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"];
529
+ [Symbol.toStringTag]: string;
530
+ [$mol_key_handle](): string;
531
+ [Symbol.hasInstance]<This extends typeof $mol_schema_any, Value_2>(this: This, value: Value_2): value is Value_2 & This["default"];
532
+ getPrototypeOf(o: any): any;
533
+ getOwnPropertyDescriptor(o: any, p: PropertyKey): PropertyDescriptor | undefined;
534
+ getOwnPropertyNames(o: any): string[];
535
+ create(o: object | null): any;
536
+ create(o: object | null, properties: PropertyDescriptorMap & ThisType<any>): any;
537
+ defineProperty<T>(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>): T;
538
+ defineProperties<T>(o: T, properties: PropertyDescriptorMap & ThisType<any>): T;
539
+ seal<T>(o: T): T;
540
+ freeze<T extends Function>(f: T): T;
541
+ freeze<T extends {
542
+ [idx: string]: U | null | undefined | object;
543
+ }, U extends string | bigint | number | boolean | symbol>(o: T): Readonly<T>;
544
+ freeze<T>(o: T): Readonly<T>;
545
+ preventExtensions<T>(o: T): T;
546
+ isSealed(o: any): boolean;
547
+ isFrozen(o: any): boolean;
548
+ isExtensible(o: any): boolean;
549
+ keys(o: object): string[];
550
+ keys(o: {}): string[];
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;
554
+ assign(target: object, ...sources: any[]): any;
555
+ getOwnPropertySymbols(o: any): symbol[];
556
+ is(value1: any, value2: any): boolean;
557
+ setPrototypeOf(o: any, proto: object | null): any;
558
+ values<T>(o: {
559
+ [s: string]: T;
560
+ } | ArrayLike<T>): T[];
561
+ values(o: {}): any[];
562
+ entries<T>(o: {
563
+ [s: string]: T;
564
+ } | ArrayLike<T>): [string, T][];
565
+ entries(o: {}): [string, any][];
566
+ getOwnPropertyDescriptors<T>(o: T): { [P in keyof T]: TypedPropertyDescriptor<T[P]>; } & {
567
+ [x: string]: PropertyDescriptor;
469
568
  };
470
- cast(val: number | bigint): number | bigint;
471
- default: (number | bigint) & {
472
- "$mol_schema_range_min=0": true;
473
- } & {
474
- [x: `$mol_schema_range_max=${number}`]: true;
569
+ fromEntries<T = any>(entries: Iterable<readonly [PropertyKey, T]>): {
570
+ [k: string]: T;
571
+ };
572
+ fromEntries(entries: Iterable<readonly any[]>): any;
573
+ hasOwn(o: object, v: PropertyKey): boolean;
574
+ groupBy<K extends PropertyKey, T>(items: Iterable<T>, keySelector: (item: T, index: number) => K): Partial<Record<K, T[]>>;
575
+ };
576
+ }
577
+
578
+ declare namespace $ {
579
+ let $mol_schema_list: <Item extends typeof $mol_schema_any>(this: void, Item: Item) => {
580
+ new (value?: any): {
581
+ constructor: Function;
582
+ toString(): string;
583
+ toLocaleString(): string;
584
+ valueOf(): Object;
585
+ hasOwnProperty(v: PropertyKey): boolean;
586
+ isPrototypeOf(v: Object): boolean;
587
+ propertyIsEnumerable(v: PropertyKey): boolean;
475
588
  };
476
- check<This extends typeof $mol_schema_any, Val>(this: This, val: Val): val is Val & This["default"];
589
+ Item: Item;
590
+ toString(): string;
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"];
477
595
  [Symbol.toStringTag]: string;
478
596
  [$mol_key_handle](): string;
479
- [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"];
480
598
  getPrototypeOf(o: any): any;
481
599
  getOwnPropertyDescriptor(o: any, p: PropertyKey): PropertyDescriptor | undefined;
482
600
  getOwnPropertyNames(o: any): string[];
@@ -496,9 +614,9 @@ declare namespace $ {
496
614
  isExtensible(o: any): boolean;
497
615
  keys(o: object): string[];
498
616
  keys(o: {}): string[];
499
- assign<T extends {}, U>(target: T, source: U): T & U;
500
- assign<T extends {}, U, V>(target: T, source1: U, source2: V): T & U & V;
501
- 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;
502
620
  assign(target: object, ...sources: any[]): any;
503
621
  getOwnPropertySymbols(o: any): symbol[];
504
622
  is(value1: any, value2: any): boolean;
@@ -521,13 +639,13 @@ declare namespace $ {
521
639
  hasOwn(o: object, v: PropertyKey): boolean;
522
640
  groupBy<K extends PropertyKey, T>(items: Iterable<T>, keySelector: (item: T, index: number) => K): Partial<Record<K, T[]>>;
523
641
  };
524
- export class $mol_schema_positive extends $mol_schema_positive_base {
525
- }
526
- export {};
527
642
  }
528
643
 
529
644
  declare namespace $ {
530
- const $mol_schema_natural_base: {
645
+ type JSON = null | boolean | number | string | JSON[] | {
646
+ [key: string]: JSON;
647
+ };
648
+ const $mol_schema_json_base: {
531
649
  new (value?: any): {
532
650
  constructor: Function;
533
651
  toString(): string;
@@ -537,15 +655,15 @@ declare namespace $ {
537
655
  isPrototypeOf(v: Object): boolean;
538
656
  propertyIsEnumerable(v: PropertyKey): boolean;
539
657
  };
540
- 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;
541
662
  toString(): string;
542
- guard<Value>(value: Value): never;
543
- cast(value: unknown): never;
544
- default: never;
545
- 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"];
546
664
  [Symbol.toStringTag]: string;
547
665
  [$mol_key_handle](): string;
548
- [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"];
549
667
  getPrototypeOf(o: any): any;
550
668
  getOwnPropertyDescriptor(o: any, p: PropertyKey): PropertyDescriptor | undefined;
551
669
  getOwnPropertyNames(o: any): string[];
@@ -590,13 +708,22 @@ declare namespace $ {
590
708
  hasOwn(o: object, v: PropertyKey): boolean;
591
709
  groupBy<K extends PropertyKey, T>(items: Iterable<T>, keySelector: (item: T, index: number) => K): Partial<Record<K, T[]>>;
592
710
  };
593
- export class $mol_schema_natural extends $mol_schema_natural_base {
711
+ export class $mol_schema_json extends $mol_schema_json_base {
594
712
  }
595
713
  export {};
596
714
  }
597
715
 
598
716
  declare namespace $ {
599
- let $mol_schema_enum: <const Options extends readonly unknown[]>(this: void, 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) => {
600
727
  new (value?: any): {
601
728
  constructor: Function;
602
729
  toString(): string;
@@ -606,15 +733,15 @@ declare namespace $ {
606
733
  isPrototypeOf(v: Object): boolean;
607
734
  propertyIsEnumerable(v: PropertyKey): boolean;
608
735
  };
609
- Options: Options;
736
+ Schemas: Schemas;
610
737
  toString(): string;
611
- guard<Value>(value: Value): Value & Options[number];
612
- cast(val: unknown): Options[number];
613
- default: Options[number];
614
- 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"];
615
742
  [Symbol.toStringTag]: string;
616
743
  [$mol_key_handle](): string;
617
- [Symbol.hasInstance]<This extends typeof $mol_schema_any, Val_1>(this: This, val: Val_1): val is Val_1 & This["default"];
744
+ [Symbol.hasInstance]<This extends typeof $mol_schema_any, Value_2>(this: This, value: Value_2): value is Value_2 & This["default"];
618
745
  getPrototypeOf(o: any): any;
619
746
  getOwnPropertyDescriptor(o: any, p: PropertyKey): PropertyDescriptor | undefined;
620
747
  getOwnPropertyNames(o: any): string[];
@@ -662,7 +789,7 @@ declare namespace $ {
662
789
  }
663
790
 
664
791
  declare namespace $ {
665
- const $mol_schema_negative_base: {
792
+ let $mol_schema_range: <Value extends number | bigint, Range extends [min: Value, max: Value]>(this: void, Range: Range) => {
666
793
  new (value?: any): {
667
794
  constructor: Function;
668
795
  toString(): string;
@@ -672,23 +799,15 @@ declare namespace $ {
672
799
  isPrototypeOf(v: Object): boolean;
673
800
  propertyIsEnumerable(v: PropertyKey): boolean;
674
801
  };
675
- Range: [number, 0];
802
+ Range: Range;
676
803
  toString(): string;
677
- guard<Value>(value: Value): (Value & (number | bigint)) & {
678
- [x: `$mol_schema_range_min=${number}`]: true;
679
- } & {
680
- "$mol_schema_range_max=0": true;
681
- };
682
- cast(val: number | bigint): number | bigint;
683
- default: (number | bigint) & {
684
- [x: `$mol_schema_range_min=${number}`]: true;
685
- } & {
686
- "$mol_schema_range_max=0": true;
687
- };
688
- 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"];
689
808
  [Symbol.toStringTag]: string;
690
809
  [$mol_key_handle](): string;
691
- [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"];
692
811
  getPrototypeOf(o: any): any;
693
812
  getOwnPropertyDescriptor(o: any, p: PropertyKey): PropertyDescriptor | undefined;
694
813
  getOwnPropertyNames(o: any): string[];
@@ -708,9 +827,9 @@ declare namespace $ {
708
827
  isExtensible(o: any): boolean;
709
828
  keys(o: object): string[];
710
829
  keys(o: {}): string[];
711
- assign<T extends {}, U>(target: T, source: U): T & U;
712
- assign<T extends {}, U, V>(target: T, source1: U, source2: V): T & U & V;
713
- 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;
714
833
  assign(target: object, ...sources: any[]): any;
715
834
  getOwnPropertySymbols(o: any): symbol[];
716
835
  is(value1: any, value2: any): boolean;
@@ -733,13 +852,10 @@ declare namespace $ {
733
852
  hasOwn(o: object, v: PropertyKey): boolean;
734
853
  groupBy<K extends PropertyKey, T>(items: Iterable<T>, keySelector: (item: T, index: number) => K): Partial<Record<K, T[]>>;
735
854
  };
736
- export class $mol_schema_negative extends $mol_schema_negative_base {
737
- }
738
- export {};
739
855
  }
740
856
 
741
857
  declare namespace $ {
742
- let $mol_schema_some: <Variants extends readonly (typeof $mol_schema_any)[]>(this: void, Variants: Variants) => {
858
+ const $mol_schema_positive_base: {
743
859
  new (value?: any): {
744
860
  constructor: Function;
745
861
  toString(): string;
@@ -749,15 +865,19 @@ declare namespace $ {
749
865
  isPrototypeOf(v: Object): boolean;
750
866
  propertyIsEnumerable(v: PropertyKey): boolean;
751
867
  };
752
- Variants: Variants;
868
+ Range: [0, number];
753
869
  toString(): string;
754
- guard<Value>(value: Value): Value & Variants[number]["default"];
755
- cast(value: unknown): Variants[number]["default"];
756
- default: Variants[number]["default"];
757
- 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"];
758
878
  [Symbol.toStringTag]: string;
759
879
  [$mol_key_handle](): string;
760
- [Symbol.hasInstance]<This extends typeof $mol_schema_any, Val_1>(this: This, val: Val_1): val is Val_1 & This["default"];
880
+ [Symbol.hasInstance]<This extends typeof $mol_schema_any, Value>(this: This, value: Value): value is Value & This["default"];
761
881
  getPrototypeOf(o: any): any;
762
882
  getOwnPropertyDescriptor(o: any, p: PropertyKey): PropertyDescriptor | undefined;
763
883
  getOwnPropertyNames(o: any): string[];
@@ -777,9 +897,9 @@ declare namespace $ {
777
897
  isExtensible(o: any): boolean;
778
898
  keys(o: object): string[];
779
899
  keys(o: {}): string[];
780
- assign<T extends {}, U_1>(target: T, source: U_1): T & U_1;
781
- assign<T extends {}, U_2, V>(target: T, source1: U_2, source2: V): T & U_2 & V;
782
- assign<T extends {}, U_3, V_1, W>(target: T, source1: U_3, source2: V_1, source3: W): T & U_3 & V_1 & W;
900
+ assign<T extends {}, U>(target: T, source: U): T & U;
901
+ assign<T extends {}, U, V>(target: T, source1: U, source2: V): T & U & V;
902
+ assign<T extends {}, U, V, W>(target: T, source1: U, source2: V, source3: W): T & U & V & W;
783
903
  assign(target: object, ...sources: any[]): any;
784
904
  getOwnPropertySymbols(o: any): symbol[];
785
905
  is(value1: any, value2: any): boolean;
@@ -802,10 +922,13 @@ declare namespace $ {
802
922
  hasOwn(o: object, v: PropertyKey): boolean;
803
923
  groupBy<K extends PropertyKey, T>(items: Iterable<T>, keySelector: (item: T, index: number) => K): Partial<Record<K, T[]>>;
804
924
  };
925
+ export class $mol_schema_positive extends $mol_schema_positive_base {
926
+ }
927
+ export {};
805
928
  }
806
929
 
807
930
  declare namespace $ {
808
- let $mol_schema_maybe: <Some extends typeof $mol_schema_any>(this: void, Some: Some) => {
931
+ const $mol_schema_natural_base: {
809
932
  new (value?: any): {
810
933
  constructor: Function;
811
934
  toString(): string;
@@ -815,312 +938,70 @@ declare namespace $ {
815
938
  isPrototypeOf(v: Object): boolean;
816
939
  propertyIsEnumerable(v: PropertyKey): boolean;
817
940
  };
818
- Some: Some;
941
+ Schemas: (typeof $mol_schema_integer | typeof $mol_schema_positive)[];
819
942
  toString(): string;
820
- Variants: (Some | {
821
- new (value?: any): {
822
- constructor: Function;
823
- toString(): string;
824
- toLocaleString(): string;
825
- valueOf(): Object;
826
- hasOwnProperty(v: PropertyKey): boolean;
827
- isPrototypeOf(v: Object): boolean;
828
- propertyIsEnumerable(v: PropertyKey): boolean;
829
- };
830
- Options: readonly [undefined, null];
831
- toString(): string;
832
- guard<Value>(value: Value): Value & (null | undefined);
833
- cast(val: unknown): null | undefined;
834
- default: null | undefined;
835
- check<This extends typeof $mol_schema_any, Val>(this: This, val: Val): val is Val & This["default"];
836
- [Symbol.toStringTag]: string;
837
- [$mol_key_handle](): string;
838
- [Symbol.hasInstance]<This extends typeof $mol_schema_any, Val_1>(this: This, val: Val_1): val is Val_1 & This["default"];
839
- getPrototypeOf(o: any): any;
840
- getOwnPropertyDescriptor(o: any, p: PropertyKey): PropertyDescriptor | undefined;
841
- getOwnPropertyNames(o: any): string[];
842
- create(o: object | null): any;
843
- create(o: object | null, properties: PropertyDescriptorMap & ThisType<any>): any;
844
- defineProperty<T>(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>): T;
845
- defineProperties<T>(o: T, properties: PropertyDescriptorMap & ThisType<any>): T;
846
- seal<T>(o: T): T;
847
- freeze<T extends Function>(f: T): T;
848
- freeze<T extends {
849
- [idx: string]: U | null | undefined | object;
850
- }, U extends string | bigint | number | boolean | symbol>(o: T): Readonly<T>;
851
- freeze<T>(o: T): Readonly<T>;
852
- preventExtensions<T>(o: T): T;
853
- isSealed(o: any): boolean;
854
- isFrozen(o: any): boolean;
855
- isExtensible(o: any): boolean;
856
- keys(o: object): string[];
857
- keys(o: {}): string[];
858
- assign<T extends {}, U_1>(target: T, source: U_1): T & U_1;
859
- assign<T extends {}, U_2, V>(target: T, source1: U_2, source2: V): T & U_2 & V;
860
- assign<T extends {}, U_3, V_1, W>(target: T, source1: U_3, source2: V_1, source3: W): T & U_3 & V_1 & W;
861
- assign(target: object, ...sources: any[]): any;
862
- getOwnPropertySymbols(o: any): symbol[];
863
- is(value1: any, value2: any): boolean;
864
- setPrototypeOf(o: any, proto: object | null): any;
865
- values<T>(o: {
866
- [s: string]: T;
867
- } | ArrayLike<T>): T[];
868
- values(o: {}): any[];
869
- entries<T>(o: {
870
- [s: string]: T;
871
- } | ArrayLike<T>): [string, T][];
872
- entries(o: {}): [string, any][];
873
- getOwnPropertyDescriptors<T>(o: T): { [P in keyof T]: TypedPropertyDescriptor<T[P]>; } & {
874
- [x: string]: PropertyDescriptor;
875
- };
876
- fromEntries<T = any>(entries: Iterable<readonly [PropertyKey, T]>): {
877
- [k: string]: T;
878
- };
879
- fromEntries(entries: Iterable<readonly any[]>): any;
880
- hasOwn(o: object, v: PropertyKey): boolean;
881
- groupBy<K extends PropertyKey, T>(items: Iterable<T>, keySelector: (item: T, index: number) => K): Partial<Record<K, T[]>>;
882
- })[];
883
- guard<Value>(value: Value): Value & (Some | {
884
- new (value?: any): {
885
- constructor: Function;
886
- toString(): string;
887
- toLocaleString(): string;
888
- valueOf(): Object;
889
- hasOwnProperty(v: PropertyKey): boolean;
890
- isPrototypeOf(v: Object): boolean;
891
- propertyIsEnumerable(v: PropertyKey): boolean;
892
- };
893
- Options: readonly [undefined, null];
894
- toString(): string;
895
- guard<Value_1>(value: Value_1): Value_1 & (null | undefined);
896
- cast(val: unknown): null | undefined;
897
- default: null | undefined;
898
- check<This extends typeof $mol_schema_any, Val>(this: This, val: Val): val is Val & This["default"];
899
- [Symbol.toStringTag]: string;
900
- [$mol_key_handle](): string;
901
- [Symbol.hasInstance]<This extends typeof $mol_schema_any, Val_1>(this: This, val: Val_1): val is Val_1 & This["default"];
902
- getPrototypeOf(o: any): any;
903
- getOwnPropertyDescriptor(o: any, p: PropertyKey): PropertyDescriptor | undefined;
904
- getOwnPropertyNames(o: any): string[];
905
- create(o: object | null): any;
906
- create(o: object | null, properties: PropertyDescriptorMap & ThisType<any>): any;
907
- defineProperty<T_1>(o: T_1, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>): T_1;
908
- defineProperties<T_1>(o: T_1, properties: PropertyDescriptorMap & ThisType<any>): T_1;
909
- seal<T_1>(o: T_1): T_1;
910
- freeze<T_1 extends Function>(f: T_1): T_1;
911
- freeze<T_1 extends {
912
- [idx: string]: U | null | undefined | object;
913
- }, U extends string | bigint | number | boolean | symbol>(o: T_1): Readonly<T_1>;
914
- freeze<T_1>(o: T_1): Readonly<T_1>;
915
- preventExtensions<T_1>(o: T_1): T_1;
916
- isSealed(o: any): boolean;
917
- isFrozen(o: any): boolean;
918
- isExtensible(o: any): boolean;
919
- keys(o: object): string[];
920
- keys(o: {}): string[];
921
- assign<T_1 extends {}, U_1>(target: T_1, source: U_1): T_1 & U_1;
922
- assign<T_1 extends {}, U_2, V>(target: T_1, source1: U_2, source2: V): T_1 & U_2 & V;
923
- assign<T_1 extends {}, U_3, V_1, W>(target: T_1, source1: U_3, source2: V_1, source3: W): T_1 & U_3 & V_1 & W;
924
- assign(target: object, ...sources: any[]): any;
925
- getOwnPropertySymbols(o: any): symbol[];
926
- is(value1: any, value2: any): boolean;
927
- setPrototypeOf(o: any, proto: object | null): any;
928
- values<T_1>(o: {
929
- [s: string]: T_1;
930
- } | ArrayLike<T_1>): T_1[];
931
- values(o: {}): any[];
932
- entries<T_1>(o: {
933
- [s: string]: T_1;
934
- } | ArrayLike<T_1>): [string, T_1][];
935
- entries(o: {}): [string, any][];
936
- getOwnPropertyDescriptors<T_1>(o: T_1): { [P in keyof T_1]: TypedPropertyDescriptor<T_1[P]>; } & {
937
- [x: string]: PropertyDescriptor;
938
- };
939
- fromEntries<T_1 = any>(entries: Iterable<readonly [PropertyKey, T_1]>): {
940
- [k: string]: T_1;
941
- };
942
- fromEntries(entries: Iterable<readonly any[]>): any;
943
- hasOwn(o: object, v: PropertyKey): boolean;
944
- groupBy<K extends PropertyKey, T>(items: Iterable<T>, keySelector: (item: T, index: number) => K): Partial<Record<K, T[]>>;
945
- })["default"];
946
- cast(value: unknown): (Some | {
947
- new (value?: any): {
948
- constructor: Function;
949
- toString(): string;
950
- toLocaleString(): string;
951
- valueOf(): Object;
952
- hasOwnProperty(v: PropertyKey): boolean;
953
- isPrototypeOf(v: Object): boolean;
954
- propertyIsEnumerable(v: PropertyKey): boolean;
955
- };
956
- Options: readonly [undefined, null];
957
- toString(): string;
958
- guard<Value>(value: Value): Value & (null | undefined);
959
- cast(val: unknown): null | undefined;
960
- default: null | undefined;
961
- check<This extends typeof $mol_schema_any, Val>(this: This, val: Val): val is Val & This["default"];
962
- [Symbol.toStringTag]: string;
963
- [$mol_key_handle](): string;
964
- [Symbol.hasInstance]<This extends typeof $mol_schema_any, Val_1>(this: This, val: Val_1): val is Val_1 & This["default"];
965
- getPrototypeOf(o: any): any;
966
- getOwnPropertyDescriptor(o: any, p: PropertyKey): PropertyDescriptor | undefined;
967
- getOwnPropertyNames(o: any): string[];
968
- create(o: object | null): any;
969
- create(o: object | null, properties: PropertyDescriptorMap & ThisType<any>): any;
970
- defineProperty<T_1>(o: T_1, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>): T_1;
971
- defineProperties<T_1>(o: T_1, properties: PropertyDescriptorMap & ThisType<any>): T_1;
972
- seal<T_1>(o: T_1): T_1;
973
- freeze<T_1 extends Function>(f: T_1): T_1;
974
- freeze<T_1 extends {
975
- [idx: string]: U | null | undefined | object;
976
- }, U extends string | bigint | number | boolean | symbol>(o: T_1): Readonly<T_1>;
977
- freeze<T_1>(o: T_1): Readonly<T_1>;
978
- preventExtensions<T_1>(o: T_1): T_1;
979
- isSealed(o: any): boolean;
980
- isFrozen(o: any): boolean;
981
- isExtensible(o: any): boolean;
982
- keys(o: object): string[];
983
- keys(o: {}): string[];
984
- assign<T_1 extends {}, U_1>(target: T_1, source: U_1): T_1 & U_1;
985
- assign<T_1 extends {}, U_2, V>(target: T_1, source1: U_2, source2: V): T_1 & U_2 & V;
986
- assign<T_1 extends {}, U_3, V_1, W>(target: T_1, source1: U_3, source2: V_1, source3: W): T_1 & U_3 & V_1 & W;
987
- assign(target: object, ...sources: any[]): any;
988
- getOwnPropertySymbols(o: any): symbol[];
989
- is(value1: any, value2: any): boolean;
990
- setPrototypeOf(o: any, proto: object | null): any;
991
- values<T_1>(o: {
992
- [s: string]: T_1;
993
- } | ArrayLike<T_1>): T_1[];
994
- values(o: {}): any[];
995
- entries<T_1>(o: {
996
- [s: string]: T_1;
997
- } | ArrayLike<T_1>): [string, T_1][];
998
- entries(o: {}): [string, any][];
999
- getOwnPropertyDescriptors<T_1>(o: T_1): { [P in keyof T_1]: TypedPropertyDescriptor<T_1[P]>; } & {
1000
- [x: string]: PropertyDescriptor;
1001
- };
1002
- fromEntries<T_1 = any>(entries: Iterable<readonly [PropertyKey, T_1]>): {
1003
- [k: string]: T_1;
1004
- };
1005
- fromEntries(entries: Iterable<readonly any[]>): any;
1006
- hasOwn(o: object, v: PropertyKey): boolean;
1007
- groupBy<K extends PropertyKey, T>(items: Iterable<T>, keySelector: (item: T, index: number) => K): Partial<Record<K, T[]>>;
1008
- })["default"];
1009
- default: (Some | {
1010
- new (value?: any): {
1011
- constructor: Function;
1012
- toString(): string;
1013
- toLocaleString(): string;
1014
- valueOf(): Object;
1015
- hasOwnProperty(v: PropertyKey): boolean;
1016
- isPrototypeOf(v: Object): boolean;
1017
- propertyIsEnumerable(v: PropertyKey): boolean;
1018
- };
1019
- Options: readonly [undefined, null];
1020
- toString(): string;
1021
- guard<Value>(value: Value): Value & (null | undefined);
1022
- cast(val: unknown): null | undefined;
1023
- default: null | undefined;
1024
- check<This extends typeof $mol_schema_any, Val>(this: This, val: Val): val is Val & This["default"];
1025
- [Symbol.toStringTag]: string;
1026
- [$mol_key_handle](): string;
1027
- [Symbol.hasInstance]<This extends typeof $mol_schema_any, Val_1>(this: This, val: Val_1): val is Val_1 & This["default"];
1028
- getPrototypeOf(o: any): any;
1029
- getOwnPropertyDescriptor(o: any, p: PropertyKey): PropertyDescriptor | undefined;
1030
- getOwnPropertyNames(o: any): string[];
1031
- create(o: object | null): any;
1032
- create(o: object | null, properties: PropertyDescriptorMap & ThisType<any>): any;
1033
- defineProperty<T_1>(o: T_1, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>): T_1;
1034
- defineProperties<T_1>(o: T_1, properties: PropertyDescriptorMap & ThisType<any>): T_1;
1035
- seal<T_1>(o: T_1): T_1;
1036
- freeze<T_1 extends Function>(f: T_1): T_1;
1037
- freeze<T_1 extends {
1038
- [idx: string]: U | null | undefined | object;
1039
- }, U extends string | bigint | number | boolean | symbol>(o: T_1): Readonly<T_1>;
1040
- freeze<T_1>(o: T_1): Readonly<T_1>;
1041
- preventExtensions<T_1>(o: T_1): T_1;
1042
- isSealed(o: any): boolean;
1043
- isFrozen(o: any): boolean;
1044
- isExtensible(o: any): boolean;
1045
- keys(o: object): string[];
1046
- keys(o: {}): string[];
1047
- assign<T_1 extends {}, U_1>(target: T_1, source: U_1): T_1 & U_1;
1048
- assign<T_1 extends {}, U_2, V>(target: T_1, source1: U_2, source2: V): T_1 & U_2 & V;
1049
- assign<T_1 extends {}, U_3, V_1, W>(target: T_1, source1: U_3, source2: V_1, source3: W): T_1 & U_3 & V_1 & W;
1050
- assign(target: object, ...sources: any[]): any;
1051
- getOwnPropertySymbols(o: any): symbol[];
1052
- is(value1: any, value2: any): boolean;
1053
- setPrototypeOf(o: any, proto: object | null): any;
1054
- values<T_1>(o: {
1055
- [s: string]: T_1;
1056
- } | ArrayLike<T_1>): T_1[];
1057
- values(o: {}): any[];
1058
- entries<T_1>(o: {
1059
- [s: string]: T_1;
1060
- } | ArrayLike<T_1>): [string, T_1][];
1061
- entries(o: {}): [string, any][];
1062
- getOwnPropertyDescriptors<T_1>(o: T_1): { [P in keyof T_1]: TypedPropertyDescriptor<T_1[P]>; } & {
1063
- [x: string]: PropertyDescriptor;
1064
- };
1065
- fromEntries<T_1 = any>(entries: Iterable<readonly [PropertyKey, T_1]>): {
1066
- [k: string]: T_1;
1067
- };
1068
- fromEntries(entries: Iterable<readonly any[]>): any;
1069
- hasOwn(o: object, v: PropertyKey): boolean;
1070
- groupBy<K extends PropertyKey, T>(items: Iterable<T>, keySelector: (item: T, index: number) => K): Partial<Record<K, T[]>>;
1071
- })["default"];
1072
- 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"];
1073
951
  [Symbol.toStringTag]: string;
1074
952
  [$mol_key_handle](): string;
1075
- [Symbol.hasInstance]<This extends typeof $mol_schema_any, Val_1>(this: This, val: Val_1): val is Val_1 & This["default"];
953
+ [Symbol.hasInstance]<This extends typeof $mol_schema_any, Value>(this: This, value: Value): value is Value & This["default"];
1076
954
  getPrototypeOf(o: any): any;
1077
955
  getOwnPropertyDescriptor(o: any, p: PropertyKey): PropertyDescriptor | undefined;
1078
956
  getOwnPropertyNames(o: any): string[];
1079
957
  create(o: object | null): any;
1080
958
  create(o: object | null, properties: PropertyDescriptorMap & ThisType<any>): any;
1081
- defineProperty<T_1>(o: T_1, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>): T_1;
1082
- defineProperties<T_1>(o: T_1, properties: PropertyDescriptorMap & ThisType<any>): T_1;
1083
- seal<T_1>(o: T_1): T_1;
1084
- freeze<T_1 extends Function>(f: T_1): T_1;
1085
- freeze<T_1 extends {
959
+ defineProperty<T>(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>): T;
960
+ defineProperties<T>(o: T, properties: PropertyDescriptorMap & ThisType<any>): T;
961
+ seal<T>(o: T): T;
962
+ freeze<T extends Function>(f: T): T;
963
+ freeze<T extends {
1086
964
  [idx: string]: U | null | undefined | object;
1087
- }, U extends string | bigint | number | boolean | symbol>(o: T_1): Readonly<T_1>;
1088
- freeze<T_1>(o: T_1): Readonly<T_1>;
1089
- preventExtensions<T_1>(o: T_1): T_1;
965
+ }, U extends string | bigint | number | boolean | symbol>(o: T): Readonly<T>;
966
+ freeze<T>(o: T): Readonly<T>;
967
+ preventExtensions<T>(o: T): T;
1090
968
  isSealed(o: any): boolean;
1091
969
  isFrozen(o: any): boolean;
1092
970
  isExtensible(o: any): boolean;
1093
971
  keys(o: object): string[];
1094
972
  keys(o: {}): string[];
1095
- assign<T_1 extends {}, U_1>(target: T_1, source: U_1): T_1 & U_1;
1096
- assign<T_1 extends {}, U_2, V>(target: T_1, source1: U_2, source2: V): T_1 & U_2 & V;
1097
- assign<T_1 extends {}, U_3, V_1, W>(target: T_1, source1: U_3, source2: V_1, source3: W): T_1 & U_3 & V_1 & W;
973
+ assign<T extends {}, U>(target: T, source: U): T & U;
974
+ assign<T extends {}, U, V>(target: T, source1: U, source2: V): T & U & V;
975
+ assign<T extends {}, U, V, W>(target: T, source1: U, source2: V, source3: W): T & U & V & W;
1098
976
  assign(target: object, ...sources: any[]): any;
1099
977
  getOwnPropertySymbols(o: any): symbol[];
1100
978
  is(value1: any, value2: any): boolean;
1101
979
  setPrototypeOf(o: any, proto: object | null): any;
1102
- values<T_1>(o: {
1103
- [s: string]: T_1;
1104
- } | ArrayLike<T_1>): T_1[];
980
+ values<T>(o: {
981
+ [s: string]: T;
982
+ } | ArrayLike<T>): T[];
1105
983
  values(o: {}): any[];
1106
- entries<T_1>(o: {
1107
- [s: string]: T_1;
1108
- } | ArrayLike<T_1>): [string, T_1][];
984
+ entries<T>(o: {
985
+ [s: string]: T;
986
+ } | ArrayLike<T>): [string, T][];
1109
987
  entries(o: {}): [string, any][];
1110
- getOwnPropertyDescriptors<T_1>(o: T_1): { [P in keyof T_1]: TypedPropertyDescriptor<T_1[P]>; } & {
988
+ getOwnPropertyDescriptors<T>(o: T): { [P in keyof T]: TypedPropertyDescriptor<T[P]>; } & {
1111
989
  [x: string]: PropertyDescriptor;
1112
990
  };
1113
- fromEntries<T_1 = any>(entries: Iterable<readonly [PropertyKey, T_1]>): {
1114
- [k: string]: T_1;
991
+ fromEntries<T = any>(entries: Iterable<readonly [PropertyKey, T]>): {
992
+ [k: string]: T;
1115
993
  };
1116
994
  fromEntries(entries: Iterable<readonly any[]>): any;
1117
995
  hasOwn(o: object, v: PropertyKey): boolean;
1118
996
  groupBy<K extends PropertyKey, T>(items: Iterable<T>, keySelector: (item: T, index: number) => K): Partial<Record<K, T[]>>;
1119
997
  };
998
+ export class $mol_schema_natural extends $mol_schema_natural_base {
999
+ }
1000
+ export {};
1120
1001
  }
1121
1002
 
1122
1003
  declare namespace $ {
1123
- let $mol_schema_list: <Item extends typeof $mol_schema_any>(this: void, Item: Item) => {
1004
+ const $mol_schema_negative_base: {
1124
1005
  new (value?: any): {
1125
1006
  constructor: Function;
1126
1007
  toString(): string;
@@ -1130,15 +1011,19 @@ declare namespace $ {
1130
1011
  isPrototypeOf(v: Object): boolean;
1131
1012
  propertyIsEnumerable(v: PropertyKey): boolean;
1132
1013
  };
1133
- Item: Item;
1014
+ Range: [number, 0];
1134
1015
  toString(): string;
1135
- guard<Value>(value: Value): Value & readonly Item["default"][];
1136
- cast(value: unknown): readonly Item["default"][];
1137
- default: readonly Item["default"][];
1138
- 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"];
1139
1024
  [Symbol.toStringTag]: string;
1140
1025
  [$mol_key_handle](): string;
1141
- [Symbol.hasInstance]<This extends typeof $mol_schema_any, Val_1>(this: This, val: Val_1): val is Val_1 & This["default"];
1026
+ [Symbol.hasInstance]<This extends typeof $mol_schema_any, Value>(this: This, value: Value): value is Value & This["default"];
1142
1027
  getPrototypeOf(o: any): any;
1143
1028
  getOwnPropertyDescriptor(o: any, p: PropertyKey): PropertyDescriptor | undefined;
1144
1029
  getOwnPropertyNames(o: any): string[];
@@ -1158,9 +1043,9 @@ declare namespace $ {
1158
1043
  isExtensible(o: any): boolean;
1159
1044
  keys(o: object): string[];
1160
1045
  keys(o: {}): string[];
1161
- assign<T extends {}, U_1>(target: T, source: U_1): T & U_1;
1162
- assign<T extends {}, U_2, V>(target: T, source1: U_2, source2: V): T & U_2 & V;
1163
- assign<T extends {}, U_3, V_1, W>(target: T, source1: U_3, source2: V_1, source3: W): T & U_3 & V_1 & W;
1046
+ assign<T extends {}, U>(target: T, source: U): T & U;
1047
+ assign<T extends {}, U, V>(target: T, source1: U, source2: V): T & U & V;
1048
+ assign<T extends {}, U, V, W>(target: T, source1: U, source2: V, source3: W): T & U & V & W;
1164
1049
  assign(target: object, ...sources: any[]): any;
1165
1050
  getOwnPropertySymbols(o: any): symbol[];
1166
1051
  is(value1: any, value2: any): boolean;
@@ -1183,12 +1068,13 @@ declare namespace $ {
1183
1068
  hasOwn(o: object, v: PropertyKey): boolean;
1184
1069
  groupBy<K extends PropertyKey, T>(items: Iterable<T>, keySelector: (item: T, index: number) => K): Partial<Record<K, T[]>>;
1185
1070
  };
1071
+ export class $mol_schema_negative extends $mol_schema_negative_base {
1072
+ }
1073
+ export {};
1186
1074
  }
1187
1075
 
1188
1076
  declare namespace $ {
1189
- let $mol_schema_dict: <Pair extends [Key: typeof $mol_schema_any & {
1190
- default: PropertyKey;
1191
- }, Val: typeof $mol_schema_any]>(this: void, Pair: Pair) => {
1077
+ let $mol_schema_maybe: <Some extends typeof $mol_schema_any>(this: void, Some: Some) => {
1192
1078
  new (value?: any): {
1193
1079
  constructor: Function;
1194
1080
  toString(): string;
@@ -1198,15 +1084,15 @@ declare namespace $ {
1198
1084
  isPrototypeOf(v: Object): boolean;
1199
1085
  propertyIsEnumerable(v: PropertyKey): boolean;
1200
1086
  };
1201
- Pair: Pair;
1087
+ Some: Some;
1202
1088
  toString(): string;
1203
- guard<Value>(value: Value): Value & Record<Pair[0]["default"], Pair[1]["default"]>;
1204
- cast(value: unknown): Record<Pair[0]["default"], Pair[1]["default"]>;
1205
- default: Record<Pair[0]["default"], Pair[1]["default"]>;
1206
- check<This extends typeof $mol_schema_any, Val>(this: This, val: Val): val is Val & 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"];
1207
1093
  [Symbol.toStringTag]: string;
1208
1094
  [$mol_key_handle](): string;
1209
- [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"];
1210
1096
  getPrototypeOf(o: any): any;
1211
1097
  getOwnPropertyDescriptor(o: any, p: PropertyKey): PropertyDescriptor | undefined;
1212
1098
  getOwnPropertyNames(o: any): string[];
@@ -1266,13 +1152,13 @@ declare namespace $ {
1266
1152
  };
1267
1153
  Fields: Fields;
1268
1154
  toString(): string;
1269
- guard<Value>(value: Value): Value & { readonly [key in keyof Fields]: Fields[key]["default"]; };
1270
- cast(value: unknown): { readonly [key in keyof Fields]: Fields[key]["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"];
1271
1157
  default: { readonly [key in keyof Fields]: Fields[key]["default"]; };
1272
- check<This extends typeof $mol_schema_any, Val>(this: This, val: Val): val is Val & This["default"];
1158
+ check<This extends typeof $mol_schema_any, Value_1>(this: This, value: Value_1): value is Value_1 & This["default"];
1273
1159
  [Symbol.toStringTag]: string;
1274
1160
  [$mol_key_handle](): string;
1275
- [Symbol.hasInstance]<This extends typeof $mol_schema_any, Val_1>(this: This, val: Val_1): val is Val_1 & This["default"];
1161
+ [Symbol.hasInstance]<This extends typeof $mol_schema_any, Value_2>(this: This, value: Value_2): value is Value_2 & This["default"];
1276
1162
  getPrototypeOf(o: any): any;
1277
1163
  getOwnPropertyDescriptor(o: any, p: PropertyKey): PropertyDescriptor | undefined;
1278
1164
  getOwnPropertyNames(o: any): string[];
@@ -1332,19 +1218,15 @@ declare namespace $ {
1332
1218
  };
1333
1219
  Fields: Fields;
1334
1220
  toString(): string;
1335
- guard<Value>(value: Value): Value & {
1336
- readonly [x: string]: any;
1337
- };
1338
- cast(value: unknown): {
1339
- readonly [x: string]: any;
1340
- };
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"];
1341
1223
  default: {
1342
1224
  readonly [x: string]: any;
1343
1225
  };
1344
- 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"];
1345
1227
  [Symbol.toStringTag]: string;
1346
1228
  [$mol_key_handle](): string;
1347
- [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"];
1348
1230
  getPrototypeOf(o: any): any;
1349
1231
  getOwnPropertyDescriptor(o: any, p: PropertyKey): PropertyDescriptor | undefined;
1350
1232
  getOwnPropertyNames(o: any): string[];