@xpadev-net/niconicomments 0.2.73 → 0.2.75

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.
Files changed (3) hide show
  1. package/dist/bundle.d.ts +1930 -1426
  2. package/dist/bundle.js +756 -783
  3. package/package.json +17 -14
package/dist/bundle.d.ts CHANGED
@@ -94,9 +94,9 @@ declare class FlashComment extends BaseComment {
94
94
  type: "spacer";
95
95
  char: string;
96
96
  charWidth: number;
97
- count: number;
98
97
  isButton?: boolean | undefined;
99
98
  font?: "defont" | "gulim" | "simsun" | undefined;
99
+ count: number;
100
100
  } | {
101
101
  type: "text";
102
102
  content: string;
@@ -156,7 +156,11 @@ declare const index_d$4_FlashComment: typeof FlashComment;
156
156
  type index_d$4_HTML5Comment = HTML5Comment;
157
157
  declare const index_d$4_HTML5Comment: typeof HTML5Comment;
158
158
  declare namespace index_d$4 {
159
- export { index_d$4_BaseComment as BaseComment, index_d$4_FlashComment as FlashComment, index_d$4_HTML5Comment as HTML5Comment };
159
+ export {
160
+ index_d$4_BaseComment as BaseComment,
161
+ index_d$4_FlashComment as FlashComment,
162
+ index_d$4_HTML5Comment as HTML5Comment,
163
+ };
160
164
  }
161
165
 
162
166
  type ConfigItem<T> = T | MultiConfigItem<T>;
@@ -269,7 +273,7 @@ type BaseConfig = {
269
273
  };
270
274
  };
271
275
  };
272
- type Config = Partial<BaseConfig>;
276
+ type Config$1 = Partial<BaseConfig>;
273
277
 
274
278
  type Position = {
275
279
  x: number;
@@ -321,1074 +325,1942 @@ interface CommentEventMap {
321
325
  }
322
326
 
323
327
  /**
324
- * Pipe action context type.
325
- */
326
- interface PipeActionContext {
327
- type: string;
328
- expects: string | null;
329
- message: ErrorMessage | undefined;
330
- requirement: unknown;
331
- }
332
- /**
333
- * Valid action result type.
328
+ * Fallback type.
334
329
  */
335
- interface ValidActionResult<TOutput> {
336
- /**
337
- * The pipe output.
338
- */
339
- output: TOutput;
340
- /**
341
- * The pipe issues.
342
- */
343
- issues?: undefined;
344
- }
330
+ type Fallback<TSchema extends BaseSchema<unknown, unknown, BaseIssue<unknown>>> = MaybeReadonly<InferOutput<TSchema>> | ((dataset?: OutputDataset<InferOutput<TSchema>, InferIssue<TSchema>>, config?: Config<InferIssue<TSchema>>) => MaybeReadonly<InferOutput<TSchema>>);
345
331
  /**
346
- * Invalid action result type.
332
+ * Schema with fallback type.
347
333
  */
348
- interface InvalidActionResult {
349
- /**
350
- * The pipe output.
351
- */
352
- output?: undefined;
334
+ type SchemaWithFallback<TSchema extends BaseSchema<unknown, unknown, BaseIssue<unknown>>, TFallback extends Fallback<TSchema>> = TSchema & {
353
335
  /**
354
- * The pipe issues.
336
+ * The fallback value.
355
337
  */
356
- issues: PipeActionIssues;
357
- }
338
+ readonly fallback: TFallback;
339
+ };
340
+
358
341
  /**
359
- * Pipe action result type.
342
+ * Fallback async type.
360
343
  */
361
- type PipeActionResult<TOutput> = ValidActionResult<TOutput> | InvalidActionResult;
344
+ type FallbackAsync<TSchema extends BaseSchema<unknown, unknown, BaseIssue<unknown>> | BaseSchemaAsync<unknown, unknown, BaseIssue<unknown>>> = MaybeReadonly<InferOutput<TSchema>> | ((dataset?: OutputDataset<InferOutput<TSchema>, InferIssue<TSchema>>, config?: Config<InferIssue<TSchema>>) => MaybePromise<MaybeReadonly<InferOutput<TSchema>>>);
362
345
  /**
363
- * Base validation type.
346
+ * Schema with fallback async type.
364
347
  */
365
- interface BaseValidation<TInput = any> {
348
+ type SchemaWithFallbackAsync<TSchema extends BaseSchema<unknown, unknown, BaseIssue<unknown>> | BaseSchemaAsync<unknown, unknown, BaseIssue<unknown>>, TFallback extends FallbackAsync<TSchema>> = Omit<TSchema, 'async' | '~standard' | '~run'> & {
366
349
  /**
367
- * The validation type.
368
- */
369
- type: string;
370
- /**
371
- * The expected property.
350
+ * The fallback value.
372
351
  */
373
- expects: string | null;
374
- /**
375
- * The error message.
376
- */
377
- message: ErrorMessage | undefined;
352
+ readonly fallback: TFallback;
378
353
  /**
379
354
  * Whether it's async.
380
355
  */
381
- async: false;
356
+ readonly async: true;
382
357
  /**
383
- * The validation requirement.
358
+ * The Standard Schema properties.
359
+ *
360
+ * @internal
384
361
  */
385
- requirement: unknown;
362
+ readonly '~standard': StandardProps<InferInput<TSchema>, InferOutput<TSchema>>;
386
363
  /**
387
- * Parses unknown input based on its requirement.
364
+ * Parses unknown input values.
388
365
  *
389
- * @param input The input to be parsed.
366
+ * @param dataset The input dataset.
367
+ * @param config The configuration.
390
368
  *
391
- * @returns The pipe action result.
369
+ * @returns The output dataset.
392
370
  *
393
371
  * @internal
394
372
  */
395
- _parse(input: TInput): PipeActionResult<TInput>;
396
- }
373
+ readonly '~run': (dataset: UnknownDataset, config: Config<BaseIssue<unknown>>) => Promise<OutputDataset<InferOutput<TSchema>, InferIssue<TSchema>>>;
374
+ };
375
+
397
376
  /**
398
- * Base validation async type.
377
+ * Schema with pipe type.
399
378
  */
400
- interface BaseValidationAsync<TInput = any> {
401
- /**
402
- * The validation type.
403
- */
404
- type: string;
405
- /**
406
- * The expected property.
407
- */
408
- expects: string | null;
409
- /**
410
- * The error message.
411
- */
412
- message: ErrorMessage | undefined;
379
+ type SchemaWithPipe<TPipe extends readonly [
380
+ BaseSchema<unknown, unknown, BaseIssue<unknown>>,
381
+ ...PipeItem<any, unknown, BaseIssue<unknown>>[]
382
+ ]> = Omit<FirstTupleItem<TPipe>, 'pipe' | '~standard' | '~run' | '~types'> & {
413
383
  /**
414
- * Whether it's async.
384
+ * The pipe items.
415
385
  */
416
- async: true;
386
+ readonly pipe: TPipe;
417
387
  /**
418
- * The validation requirement.
388
+ * The Standard Schema properties.
389
+ *
390
+ * @internal
419
391
  */
420
- requirement: unknown;
392
+ readonly '~standard': StandardProps<InferInput<FirstTupleItem<TPipe>>, InferOutput<LastTupleItem<TPipe>>>;
421
393
  /**
422
- * Parses unknown input based on its requirement.
394
+ * Parses unknown input values.
423
395
  *
424
- * @param input The input to be parsed.
396
+ * @param dataset The input dataset.
397
+ * @param config The configuration.
425
398
  *
426
- * @returns The pipe action result.
399
+ * @returns The output dataset.
427
400
  *
428
401
  * @internal
429
402
  */
430
- _parse(input: TInput): Promise<PipeActionResult<TInput>>;
431
- }
403
+ readonly '~run': (dataset: UnknownDataset, config: Config<BaseIssue<unknown>>) => OutputDataset<InferOutput<LastTupleItem<TPipe>>, InferIssue<TPipe[number]>>;
404
+ /**
405
+ * The input, output and issue type.
406
+ *
407
+ * @internal
408
+ */
409
+ readonly '~types'?: {
410
+ readonly input: InferInput<FirstTupleItem<TPipe>>;
411
+ readonly output: InferOutput<LastTupleItem<TPipe>>;
412
+ readonly issue: InferIssue<TPipe[number]>;
413
+ } | undefined;
414
+ };
415
+
432
416
  /**
433
- * Base transformation type.
417
+ * Schema with pipe async type.
434
418
  */
435
- interface BaseTransformation<TInput = any> {
419
+ type SchemaWithPipeAsync<TPipe extends readonly [
420
+ (BaseSchema<unknown, unknown, BaseIssue<unknown>> | BaseSchemaAsync<unknown, unknown, BaseIssue<unknown>>),
421
+ ...(PipeItem<any, unknown, BaseIssue<unknown>> | PipeItemAsync<any, unknown, BaseIssue<unknown>>)[]
422
+ ]> = Omit<FirstTupleItem<TPipe>, 'async' | 'pipe' | '~standard' | '~run' | '~types'> & {
436
423
  /**
437
- * The transformation type.
424
+ * The pipe items.
438
425
  */
439
- type: string;
426
+ readonly pipe: TPipe;
440
427
  /**
441
428
  * Whether it's async.
442
429
  */
443
- async: false;
430
+ readonly async: true;
444
431
  /**
445
- * Parses unknown input based on its requirement.
432
+ * The Standard Schema properties.
446
433
  *
447
- * @param input The input to be parsed.
434
+ * @internal
435
+ */
436
+ readonly '~standard': StandardProps<InferInput<FirstTupleItem<TPipe>>, InferOutput<LastTupleItem<TPipe>>>;
437
+ /**
438
+ * Parses unknown input values.
439
+ *
440
+ * @param dataset The input dataset.
441
+ * @param config The configuration.
448
442
  *
449
- * @returns The pipe action result.
443
+ * @returns The output dataset.
450
444
  *
451
445
  * @internal
452
446
  */
453
- _parse(input: TInput): PipeActionResult<TInput>;
454
- }
447
+ readonly '~run': (dataset: UnknownDataset, config: Config<BaseIssue<unknown>>) => Promise<OutputDataset<InferOutput<LastTupleItem<TPipe>>, InferIssue<TPipe[number]>>>;
448
+ /**
449
+ * The input, output and issue type.
450
+ *
451
+ * @internal
452
+ */
453
+ readonly '~types'?: {
454
+ readonly input: InferInput<FirstTupleItem<TPipe>>;
455
+ readonly output: InferOutput<LastTupleItem<TPipe>>;
456
+ readonly issue: InferIssue<TPipe[number]>;
457
+ } | undefined;
458
+ };
459
+
455
460
  /**
456
- * Base transformation async type.
461
+ * Base metadata interface.
457
462
  */
458
- interface BaseTransformationAsync<TInput = any> {
463
+ interface BaseMetadata<TInput> {
459
464
  /**
460
- * The transformation type.
465
+ * The object kind.
461
466
  */
462
- type: string;
467
+ readonly kind: 'metadata';
463
468
  /**
464
- * Whether it's async.
469
+ * The metadata type.
465
470
  */
466
- async: true;
471
+ readonly type: string;
467
472
  /**
468
- * Parses unknown input based on its requirement.
469
- *
470
- * @param input The input to be parsed.
471
- *
472
- * @returns The pipe action result.
473
+ * The metadata reference.
474
+ */
475
+ readonly reference: (...args: any[]) => BaseMetadata<any>;
476
+ /**
477
+ * The input, output and issue type.
473
478
  *
474
479
  * @internal
475
480
  */
476
- _parse(input: TInput): Promise<PipeActionResult<TInput>>;
481
+ readonly '~types'?: {
482
+ readonly input: TInput;
483
+ readonly output: TInput;
484
+ readonly issue: never;
485
+ } | undefined;
477
486
  }
478
- /**
479
- * Pipe type.
480
- */
481
- type Pipe<TInput> = (BaseValidation<TInput> | BaseTransformation<TInput>)[];
482
- /**
483
- * Pipe async type.
484
- */
485
- type PipeAsync<TInput> = (BaseValidation<TInput> | BaseValidationAsync<TInput> | BaseTransformation<TInput> | BaseTransformationAsync<TInput>)[];
486
487
 
487
488
  /**
488
- * Issue reason type.
489
- */
490
- type IssueReason = 'any' | 'array' | 'bigint' | 'blob' | 'boolean' | 'date' | 'intersect' | 'function' | 'instance' | 'map' | 'number' | 'object' | 'record' | 'set' | 'special' | 'string' | 'symbol' | 'tuple' | 'undefined' | 'union' | 'unknown' | 'variant' | 'type';
491
- /**
492
- * Unknown path item type.
489
+ * Unknown dataset interface.
493
490
  */
494
- interface UnknownPathItem {
495
- type: 'unknown';
496
- origin: 'key' | 'value';
497
- input: unknown;
498
- key: unknown;
491
+ interface UnknownDataset {
492
+ /**
493
+ * Whether is's typed.
494
+ */
495
+ typed?: false;
496
+ /**
497
+ * The dataset value.
498
+ */
499
499
  value: unknown;
500
+ /**
501
+ * The dataset issues.
502
+ */
503
+ issues?: undefined;
500
504
  }
501
505
  /**
502
- * Path item type.
506
+ * Success dataset interface.
503
507
  */
504
- type PathItem = ArrayPathItem | MapPathItem | ObjectPathItem | RecordPathItem | SetPathItem | TuplePathItem | UnknownPathItem;
505
- /**
506
- * Issue path type.
507
- */
508
- type IssuePath = [PathItem, ...PathItem[]];
509
- /**
510
- * Schema issue type.
511
- */
512
- interface SchemaIssue extends Omit<SchemaConfig, 'message'> {
508
+ interface SuccessDataset<TValue> {
513
509
  /**
514
- * The issue reason.
510
+ * Whether is's typed.
515
511
  */
516
- reason: IssueReason;
512
+ typed: true;
517
513
  /**
518
- * The context name.
514
+ * The dataset value.
519
515
  */
520
- context: string;
516
+ value: TValue;
521
517
  /**
522
- * The raw input data.
518
+ * The dataset issues.
523
519
  */
524
- input: unknown;
520
+ issues?: undefined;
521
+ }
522
+ /**
523
+ * Partial dataset interface.
524
+ */
525
+ interface PartialDataset<TValue, TIssue extends BaseIssue<unknown>> {
525
526
  /**
526
- * The expected input.
527
+ * Whether is's typed.
527
528
  */
528
- expected: string | null;
529
+ typed: true;
529
530
  /**
530
- * The received input.
531
+ * The dataset value.
531
532
  */
532
- received: string;
533
+ value: TValue;
533
534
  /**
534
- * The error message.
535
+ * The dataset issues.
535
536
  */
536
- message: string;
537
+ issues: [TIssue, ...TIssue[]];
538
+ }
539
+ /**
540
+ * Failure dataset interface.
541
+ */
542
+ interface FailureDataset<TIssue extends BaseIssue<unknown>> {
537
543
  /**
538
- * The validation requirement
544
+ * Whether is's typed.
539
545
  */
540
- requirement?: unknown;
546
+ typed: false;
541
547
  /**
542
- * The issue path.
548
+ * The dataset value.
543
549
  */
544
- path?: IssuePath;
550
+ value: unknown;
545
551
  /**
546
- * The sub issues.
552
+ * The dataset issues.
547
553
  */
548
- issues?: SchemaIssues;
554
+ issues: [TIssue, ...TIssue[]];
549
555
  }
550
556
  /**
551
- * Schema issues type.
557
+ * Output dataset type.
552
558
  */
553
- type SchemaIssues = [SchemaIssue, ...SchemaIssue[]];
554
- /**
555
- * Pipe action issue type.
556
- */
557
- interface PipeActionIssue {
558
- context: PipeActionContext;
559
- reference: Function;
560
- input: unknown;
561
- label: string;
562
- received?: string;
563
- path?: IssuePath;
564
- }
565
- /**
566
- * Pipe action issues type.
567
- */
568
- type PipeActionIssues = [PipeActionIssue, ...PipeActionIssue[]];
559
+ type OutputDataset<TValue, TIssue extends BaseIssue<unknown>> = SuccessDataset<TValue> | PartialDataset<TValue, TIssue> | FailureDataset<TIssue>;
569
560
 
570
561
  /**
571
- * Error message type.
572
- */
573
- type ErrorMessage = string | ((issue: SchemaIssue) => string);
574
- /**
575
- * The schema config type.
562
+ * The Standard Schema properties interface.
576
563
  */
577
- interface SchemaConfig {
564
+ interface StandardProps<TInput, TOutput> {
578
565
  /**
579
- * The selected language.
580
- */
581
- lang?: string;
582
- /**
583
- * The error message.
566
+ * The version number of the standard.
584
567
  */
585
- message?: ErrorMessage;
568
+ readonly version: 1;
586
569
  /**
587
- * Whether it was abort early.
570
+ * The vendor name of the schema library.
588
571
  */
589
- abortEarly?: boolean;
572
+ readonly vendor: 'valibot';
590
573
  /**
591
- * Whether the pipe was abort early.
574
+ * Validates unknown input values.
592
575
  */
593
- abortPipeEarly?: boolean;
576
+ readonly validate: (value: unknown) => StandardResult<TOutput> | Promise<StandardResult<TOutput>>;
594
577
  /**
595
- * Whether the pipe was skipped.
578
+ * Inferred types associated with the schema.
596
579
  */
597
- skipPipe?: boolean;
580
+ readonly types?: StandardTypes<TInput, TOutput> | undefined;
598
581
  }
599
-
600
582
  /**
601
- * Typed schema result type.
583
+ * The result interface of the validate function.
584
+ */
585
+ type StandardResult<TOutput> = StandardSuccessResult<TOutput> | StandardFailureResult;
586
+ /**
587
+ * The result interface if validation succeeds.
602
588
  */
603
- interface TypedSchemaResult<TOutput> {
589
+ interface StandardSuccessResult<TOutput> {
604
590
  /**
605
- * Whether is's typed.
591
+ * The typed output value.
606
592
  */
607
- typed: true;
593
+ readonly value: TOutput;
608
594
  /**
609
- * The parse output.
595
+ * The non-existent issues.
610
596
  */
611
- output: TOutput;
597
+ readonly issues?: undefined;
598
+ }
599
+ /**
600
+ * The result interface if validation fails.
601
+ */
602
+ interface StandardFailureResult {
612
603
  /**
613
- * The parse issues.
604
+ * The issues of failed validation.
614
605
  */
615
- issues?: SchemaIssues;
606
+ readonly issues: readonly StandardIssue[];
616
607
  }
617
608
  /**
618
- * Untyped schema result type.
609
+ * The issue interface of the failure output.
619
610
  */
620
- interface UntypedSchemaResult {
611
+ interface StandardIssue {
621
612
  /**
622
- * Whether is's typed.
613
+ * The error message of the issue.
623
614
  */
624
- typed: false;
615
+ readonly message: string;
625
616
  /**
626
- * The parse output.
617
+ * The path of the issue, if any.
627
618
  */
628
- output: unknown;
619
+ readonly path?: readonly (PropertyKey | StandardPathItem)[] | undefined;
620
+ }
621
+ /**
622
+ * The path item interface of the issue.
623
+ */
624
+ interface StandardPathItem {
629
625
  /**
630
- * The parse issues.
626
+ * The key of the path item.
631
627
  */
632
- issues: SchemaIssues;
628
+ readonly key: PropertyKey;
633
629
  }
634
630
  /**
635
- * Schema result type.
631
+ * The Standard Schema types interface.
636
632
  */
637
- type SchemaResult<TOutput> = TypedSchemaResult<TOutput> | UntypedSchemaResult;
633
+ interface StandardTypes<TInput, TOutput> {
634
+ /**
635
+ * The input type of the schema.
636
+ */
637
+ readonly input: TInput;
638
+ /**
639
+ * The output type of the schema.
640
+ */
641
+ readonly output: TOutput;
642
+ }
643
+
638
644
  /**
639
- * Base schema type.
645
+ * Base schema interface.
640
646
  */
641
- interface BaseSchema<TInput = any, TOutput = TInput> {
647
+ interface BaseSchema<TInput, TOutput, TIssue extends BaseIssue<unknown>> {
648
+ /**
649
+ * The object kind.
650
+ */
651
+ readonly kind: 'schema';
642
652
  /**
643
653
  * The schema type.
644
654
  */
645
- type: string;
655
+ readonly type: string;
656
+ /**
657
+ * The schema reference.
658
+ */
659
+ readonly reference: (...args: any[]) => BaseSchema<unknown, unknown, BaseIssue<unknown>>;
646
660
  /**
647
661
  * The expected property.
648
662
  */
649
- expects: string;
663
+ readonly expects: string;
650
664
  /**
651
665
  * Whether it's async.
652
666
  */
653
- async: false;
667
+ readonly async: false;
668
+ /**
669
+ * The Standard Schema properties.
670
+ *
671
+ * @internal
672
+ */
673
+ readonly '~standard': StandardProps<TInput, TOutput>;
654
674
  /**
655
- * Parses unknown input based on its schema.
675
+ * Parses unknown input values.
656
676
  *
657
- * @param input The input to be parsed.
658
- * @param config The parse configuration.
677
+ * @param dataset The input dataset.
678
+ * @param config The configuration.
659
679
  *
660
- * @returns The schema result.
680
+ * @returns The output dataset.
661
681
  *
662
682
  * @internal
663
683
  */
664
- _parse(input: unknown, config?: SchemaConfig): SchemaResult<TOutput>;
684
+ readonly '~run': (dataset: UnknownDataset, config: Config<BaseIssue<unknown>>) => OutputDataset<TOutput, TIssue>;
665
685
  /**
666
- * Input and output type.
686
+ * The input, output and issue type.
667
687
  *
668
688
  * @internal
669
689
  */
670
- _types?: {
671
- input: TInput;
672
- output: TOutput;
673
- };
690
+ readonly '~types'?: {
691
+ readonly input: TInput;
692
+ readonly output: TOutput;
693
+ readonly issue: TIssue;
694
+ } | undefined;
674
695
  }
675
696
  /**
676
- * Base schema async type.
697
+ * Base schema async interface.
677
698
  */
678
- interface BaseSchemaAsync<TInput = any, TOutput = TInput> {
699
+ interface BaseSchemaAsync<TInput, TOutput, TIssue extends BaseIssue<unknown>> extends Omit<BaseSchema<TInput, TOutput, TIssue>, 'reference' | 'async' | '~run'> {
679
700
  /**
680
- * The schema type.
681
- */
682
- type: string;
683
- /**
684
- * The expected property.
701
+ * The schema reference.
685
702
  */
686
- expects: string;
703
+ readonly reference: (...args: any[]) => BaseSchema<unknown, unknown, BaseIssue<unknown>> | BaseSchemaAsync<unknown, unknown, BaseIssue<unknown>>;
687
704
  /**
688
705
  * Whether it's async.
689
706
  */
690
- async: true;
707
+ readonly async: true;
691
708
  /**
692
- * Parses unknown input based on its schema.
709
+ * Parses unknown input values.
693
710
  *
694
- * @param input The input to be parsed.
695
- * @param config The parse configuration.
711
+ * @param dataset The input dataset.
712
+ * @param config The configuration.
696
713
  *
697
- * @returns The schema result.
698
- *
699
- * @internal
700
- */
701
- _parse(input: unknown, config?: SchemaConfig): Promise<SchemaResult<TOutput>>;
702
- /**
703
- * Input and output type.
714
+ * @returns The output dataset.
704
715
  *
705
716
  * @internal
706
717
  */
707
- _types?: {
708
- input: TInput;
709
- output: TOutput;
710
- };
718
+ readonly '~run': (dataset: UnknownDataset, config: Config<BaseIssue<unknown>>) => Promise<OutputDataset<TOutput, TIssue>>;
711
719
  }
712
- /**
713
- * Input inference type.
714
- */
715
- type Input<TSchema extends BaseSchema | BaseSchemaAsync> = NonNullable<TSchema['_types']>['input'];
716
- /**
717
- * Output inference type.
718
- */
719
- type Output<TSchema extends BaseSchema | BaseSchemaAsync> = NonNullable<TSchema['_types']>['output'];
720
-
721
- /**
722
- * Default type.
723
- */
724
- type Default<TSchema extends BaseSchema> = Input<TSchema> | (() => Input<TSchema> | undefined) | undefined;
725
- /**
726
- * Default async type.
727
- */
728
- type DefaultAsync<TSchema extends BaseSchema | BaseSchemaAsync> = Input<TSchema> | (() => Input<TSchema> | Promise<Input<TSchema> | undefined> | undefined) | undefined;
729
- /**
730
- * Maybe readonly type.
731
- */
732
- type MaybeReadonly<T> = T | Readonly<T>;
733
- /**
734
- * Resolve type.
735
- *
736
- * Hint: This type has no effect and is only used so that TypeScript displays
737
- * the final type in the preview instead of the utility types used.
738
- */
739
- type Resolve<T> = T;
740
- /**
741
- * Resolve object type.
742
- *
743
- * Hint: This type has no effect and is only used so that TypeScript displays
744
- * the final type in the preview instead of the utility types used.
745
- */
746
- type ResolveObject<T> = Resolve<{
747
- [k in keyof T]: T[k];
748
- }>;
749
720
 
750
721
  /**
751
- * Array schema type.
722
+ * Base transformation interface.
752
723
  */
753
- interface ArraySchema<TItem extends BaseSchema, TOutput = Output<TItem>[]> extends BaseSchema<Input<TItem>[], TOutput> {
724
+ interface BaseTransformation<TInput, TOutput, TIssue extends BaseIssue<unknown>> {
754
725
  /**
755
- * The schema type.
726
+ * The object kind.
756
727
  */
757
- type: 'array';
728
+ readonly kind: 'transformation';
758
729
  /**
759
- * The array item schema.
730
+ * The transformation type.
760
731
  */
761
- item: TItem;
732
+ readonly type: string;
762
733
  /**
763
- * The error message.
734
+ * The transformation reference.
764
735
  */
765
- message: ErrorMessage | undefined;
736
+ readonly reference: (...args: any[]) => BaseTransformation<any, any, BaseIssue<unknown>>;
766
737
  /**
767
- * The validation and transformation pipeline.
738
+ * Whether it's async.
768
739
  */
769
- pipe: Pipe<Output<TItem>[]> | undefined;
770
- }
771
-
772
- /**
773
- * Array path item type.
774
- */
775
- interface ArrayPathItem {
776
- type: 'array';
777
- origin: 'value';
778
- input: unknown[];
779
- key: number;
780
- value: unknown;
740
+ readonly async: false;
741
+ /**
742
+ * Transforms known input values.
743
+ *
744
+ * @param dataset The input dataset.
745
+ * @param config The configuration.
746
+ *
747
+ * @returns The output dataset.
748
+ *
749
+ * @internal
750
+ */
751
+ readonly '~run': (dataset: SuccessDataset<TInput>, config: Config<BaseIssue<unknown>>) => OutputDataset<TOutput, BaseIssue<unknown> | TIssue>;
752
+ /**
753
+ * The input, output and issue type.
754
+ *
755
+ * @internal
756
+ */
757
+ readonly '~types'?: {
758
+ readonly input: TInput;
759
+ readonly output: TOutput;
760
+ readonly issue: TIssue;
761
+ } | undefined;
781
762
  }
782
-
783
763
  /**
784
- * Boolean schema type.
764
+ * Base transformation async interface.
785
765
  */
786
- interface BooleanSchema<TOutput = boolean> extends BaseSchema<boolean, TOutput> {
766
+ interface BaseTransformationAsync<TInput, TOutput, TIssue extends BaseIssue<unknown>> extends Omit<BaseTransformation<TInput, TOutput, TIssue>, 'reference' | 'async' | '~run'> {
787
767
  /**
788
- * The schema type.
768
+ * The transformation reference.
789
769
  */
790
- type: 'boolean';
770
+ readonly reference: (...args: any[]) => BaseTransformation<any, any, BaseIssue<unknown>> | BaseTransformationAsync<any, any, BaseIssue<unknown>>;
791
771
  /**
792
- * The error message.
772
+ * Whether it's async.
793
773
  */
794
- message: ErrorMessage | undefined;
774
+ readonly async: true;
795
775
  /**
796
- * The validation and transformation pipeline.
776
+ * Transforms known input values.
777
+ *
778
+ * @param dataset The input dataset.
779
+ * @param config The configuration.
780
+ *
781
+ * @returns The output dataset.
782
+ *
783
+ * @internal
797
784
  */
798
- pipe: Pipe<boolean> | undefined;
785
+ readonly '~run': (dataset: SuccessDataset<TInput>, config: Config<BaseIssue<unknown>>) => Promise<OutputDataset<TOutput, BaseIssue<unknown> | TIssue>>;
799
786
  }
800
787
 
801
788
  /**
802
- * Enum type.
803
- */
804
- interface Enum {
805
- [key: string]: string | number;
806
- [key: number]: string;
807
- }
808
- /**
809
- * Native enum schema type.
789
+ * Base validation interface.
810
790
  */
811
- interface EnumSchema<TEnum extends Enum, TOutput = TEnum[keyof TEnum]> extends BaseSchema<TEnum[keyof TEnum], TOutput> {
791
+ interface BaseValidation<TInput, TOutput, TIssue extends BaseIssue<unknown>> {
812
792
  /**
813
- * The schema type.
793
+ * The object kind.
814
794
  */
815
- type: 'enum';
795
+ readonly kind: 'validation';
816
796
  /**
817
- * The enum value.
797
+ * The validation type.
818
798
  */
819
- enum: TEnum;
799
+ readonly type: string;
820
800
  /**
821
- * The error message.
801
+ * The validation reference.
802
+ */
803
+ readonly reference: (...args: any[]) => BaseValidation<any, any, BaseIssue<unknown>>;
804
+ /**
805
+ * The expected property.
806
+ */
807
+ readonly expects: string | null;
808
+ /**
809
+ * Whether it's async.
810
+ */
811
+ readonly async: false;
812
+ /**
813
+ * Validates known input values.
814
+ *
815
+ * @param dataset The input dataset.
816
+ * @param config The configuration.
817
+ *
818
+ * @returns The output dataset.
819
+ *
820
+ * @internal
821
+ */
822
+ readonly '~run': (dataset: OutputDataset<TInput, BaseIssue<unknown>>, config: Config<BaseIssue<unknown>>) => OutputDataset<TOutput, BaseIssue<unknown> | TIssue>;
823
+ /**
824
+ * The input, output and issue type.
825
+ *
826
+ * @internal
822
827
  */
823
- message: ErrorMessage | undefined;
828
+ readonly '~types'?: {
829
+ readonly input: TInput;
830
+ readonly output: TOutput;
831
+ readonly issue: TIssue;
832
+ } | undefined;
824
833
  }
825
-
826
834
  /**
827
- * Native enum schema async type.
835
+ * Base validation async interface.
828
836
  */
829
- interface EnumSchemaAsync<TEnum extends Enum, TOutput = TEnum[keyof TEnum]> extends BaseSchemaAsync<TEnum[keyof TEnum], TOutput> {
837
+ interface BaseValidationAsync<TInput, TOutput, TIssue extends BaseIssue<unknown>> extends Omit<BaseValidation<TInput, TOutput, TIssue>, 'reference' | 'async' | '~run'> {
830
838
  /**
831
- * The schema type.
839
+ * The validation reference.
832
840
  */
833
- type: 'enum';
841
+ readonly reference: (...args: any[]) => BaseValidation<any, any, BaseIssue<unknown>> | BaseValidationAsync<any, any, BaseIssue<unknown>>;
834
842
  /**
835
- * The enum value.
843
+ * Whether it's async.
836
844
  */
837
- enum: TEnum;
845
+ readonly async: true;
838
846
  /**
839
- * The error message.
847
+ * Validates known input values.
848
+ *
849
+ * @param dataset The input dataset.
850
+ * @param config The configuration.
851
+ *
852
+ * @returns The output dataset.
853
+ *
854
+ * @internal
840
855
  */
841
- message: ErrorMessage | undefined;
856
+ readonly '~run': (dataset: OutputDataset<TInput, BaseIssue<unknown>>, config: Config<BaseIssue<unknown>>) => Promise<OutputDataset<TOutput, BaseIssue<unknown> | TIssue>>;
842
857
  }
843
858
 
844
859
  /**
845
- * Intersect options async type.
860
+ * Infer input type.
846
861
  */
847
- type IntersectOptionsAsync = MaybeReadonly<[
848
- BaseSchema | BaseSchemaAsync,
849
- BaseSchema | BaseSchemaAsync,
850
- ...(BaseSchema[] | BaseSchemaAsync[])
851
- ]>;
852
-
862
+ type InferInput<TItem extends BaseSchema<unknown, unknown, BaseIssue<unknown>> | BaseSchemaAsync<unknown, unknown, BaseIssue<unknown>> | BaseValidation<any, unknown, BaseIssue<unknown>> | BaseValidationAsync<any, unknown, BaseIssue<unknown>> | BaseTransformation<any, unknown, BaseIssue<unknown>> | BaseTransformationAsync<any, unknown, BaseIssue<unknown>> | BaseMetadata<any>> = NonNullable<TItem['~types']>['input'];
853
863
  /**
854
- * Intersect input inference type.
864
+ * Infer output type.
855
865
  */
856
- type IntersectInput<TIntersectOptions extends IntersectOptions | IntersectOptionsAsync> = TIntersectOptions extends [
857
- BaseSchema<infer TInput1, any> | BaseSchemaAsync<infer TInput1, any>,
858
- ...infer TRest
859
- ] ? TRest extends IntersectOptions ? TInput1 & IntersectOutput<TRest> : TRest extends [
860
- BaseSchema<infer TInput2, any> | BaseSchemaAsync<infer TInput2, any>
861
- ] ? TInput1 & TInput2 : never : never;
866
+ type InferOutput<TItem extends BaseSchema<unknown, unknown, BaseIssue<unknown>> | BaseSchemaAsync<unknown, unknown, BaseIssue<unknown>> | BaseValidation<any, unknown, BaseIssue<unknown>> | BaseValidationAsync<any, unknown, BaseIssue<unknown>> | BaseTransformation<any, unknown, BaseIssue<unknown>> | BaseTransformationAsync<any, unknown, BaseIssue<unknown>> | BaseMetadata<any>> = NonNullable<TItem['~types']>['output'];
862
867
  /**
863
- * Intersect output inference type.
868
+ * Infer issue type.
864
869
  */
865
- type IntersectOutput<TIntersectOptions extends IntersectOptions | IntersectOptionsAsync> = TIntersectOptions extends [
866
- BaseSchema<any, infer TOutput1> | BaseSchemaAsync<any, infer TOutput1>,
867
- ...infer TRest
868
- ] ? TRest extends IntersectOptions ? TOutput1 & IntersectOutput<TRest> : TRest extends [
869
- BaseSchema<any, infer TOutput2> | BaseSchemaAsync<any, infer TOutput2>
870
- ] ? TOutput1 & TOutput2 : never : never;
871
-
870
+ type InferIssue<TItem extends BaseSchema<unknown, unknown, BaseIssue<unknown>> | BaseSchemaAsync<unknown, unknown, BaseIssue<unknown>> | BaseValidation<any, unknown, BaseIssue<unknown>> | BaseValidationAsync<any, unknown, BaseIssue<unknown>> | BaseTransformation<any, unknown, BaseIssue<unknown>> | BaseTransformationAsync<any, unknown, BaseIssue<unknown>> | BaseMetadata<any>> = NonNullable<TItem['~types']>['issue'];
872
871
  /**
873
- * Intersect options type.
872
+ * Constructs a type that is maybe readonly.
874
873
  */
875
- type IntersectOptions = MaybeReadonly<[
876
- BaseSchema,
877
- BaseSchema,
878
- ...BaseSchema[]
879
- ]>;
874
+ type MaybeReadonly<TValue> = TValue | Readonly<TValue>;
880
875
  /**
881
- * Intersect schema type.
876
+ * Constructs a type that is maybe a promise.
882
877
  */
883
- interface IntersectSchema<TOptions extends IntersectOptions, TOutput = IntersectOutput<TOptions>> extends BaseSchema<IntersectInput<TOptions>, TOutput> {
884
- /**
885
- * The schema type.
886
- */
887
- type: 'intersect';
888
- /**
889
- * The intersect options.
890
- */
891
- options: TOptions;
892
- /**
893
- * The error message.
894
- */
895
- message: ErrorMessage | undefined;
896
- /**
897
- * The validation and transformation pipeline.
898
- */
899
- pipe: Pipe<IntersectOutput<TOptions>> | undefined;
900
- }
901
-
878
+ type MaybePromise<TValue> = TValue | Promise<TValue>;
902
879
  /**
903
- * Literal type.
904
- */
905
- type Literal = number | string | boolean | symbol | bigint;
880
+ * Prettifies a type for better readability.
881
+ *
882
+ * Hint: This type has no effect and is only used so that TypeScript displays
883
+ * the final type in the preview instead of the utility types used.
884
+ */
885
+ type Prettify<TObject> = {
886
+ [TKey in keyof TObject]: TObject[TKey];
887
+ } & {};
888
+ /**
889
+ * Marks specific keys as optional.
890
+ */
891
+ type MarkOptional<TObject, TKeys extends keyof TObject> = {
892
+ [TKey in keyof TObject]?: unknown;
893
+ } & Omit<TObject, TKeys> & Partial<Pick<TObject, TKeys>>;
894
+ /**
895
+ * Extracts first tuple item.
896
+ */
897
+ type FirstTupleItem<TTuple extends readonly [unknown, ...unknown[]]> = TTuple[0];
898
+ /**
899
+ * Extracts last tuple item.
900
+ */
901
+ type LastTupleItem<TTuple extends readonly [unknown, ...unknown[]]> = TTuple[TTuple extends readonly [unknown, ...infer TRest] ? TRest['length'] : never];
902
+
903
+ /**
904
+ * Error message type.
905
+ */
906
+ type ErrorMessage<TIssue extends BaseIssue<unknown>> = ((issue: TIssue) => string) | string;
907
+ /**
908
+ * Default type.
909
+ */
910
+ type Default<TWrapped extends BaseSchema<unknown, unknown, BaseIssue<unknown>>, TInput extends null | undefined> = MaybeReadonly<InferInput<TWrapped> | TInput> | ((dataset?: UnknownDataset, config?: Config<InferIssue<TWrapped>>) => MaybeReadonly<InferInput<TWrapped> | TInput>) | undefined;
911
+ /**
912
+ * Default async type.
913
+ */
914
+ type DefaultAsync<TWrapped extends BaseSchema<unknown, unknown, BaseIssue<unknown>> | BaseSchemaAsync<unknown, unknown, BaseIssue<unknown>>, TInput extends null | undefined> = MaybeReadonly<InferInput<TWrapped> | TInput> | ((dataset?: UnknownDataset, config?: Config<InferIssue<TWrapped>>) => MaybePromise<MaybeReadonly<InferInput<TWrapped> | TInput>>) | undefined;
915
+ /**
916
+ * Default value type.
917
+ */
918
+ type DefaultValue<TDefault extends Default<BaseSchema<unknown, unknown, BaseIssue<unknown>>, null | undefined> | DefaultAsync<BaseSchema<unknown, unknown, BaseIssue<unknown>> | BaseSchemaAsync<unknown, unknown, BaseIssue<unknown>>, null | undefined>> = TDefault extends DefaultAsync<infer TWrapped extends BaseSchema<unknown, unknown, BaseIssue<unknown>> | BaseSchemaAsync<unknown, unknown, BaseIssue<unknown>>, infer TInput> ? TDefault extends (dataset?: UnknownDataset, config?: Config<InferIssue<TWrapped>>) => MaybePromise<InferInput<TWrapped> | TInput> ? Awaited<ReturnType<TDefault>> : TDefault : never;
919
+
920
+ /**
921
+ * Optional entry schema type.
922
+ */
923
+ type OptionalEntrySchema = ExactOptionalSchema<BaseSchema<unknown, unknown, BaseIssue<unknown>>, unknown> | NullishSchema<BaseSchema<unknown, unknown, BaseIssue<unknown>>, unknown> | OptionalSchema<BaseSchema<unknown, unknown, BaseIssue<unknown>>, unknown>;
924
+ /**
925
+ * Optional entry schema async type.
926
+ */
927
+ type OptionalEntrySchemaAsync = ExactOptionalSchemaAsync<BaseSchema<unknown, unknown, BaseIssue<unknown>> | BaseSchemaAsync<unknown, unknown, BaseIssue<unknown>>, unknown> | NullishSchemaAsync<BaseSchema<unknown, unknown, BaseIssue<unknown>> | BaseSchemaAsync<unknown, unknown, BaseIssue<unknown>>, unknown> | OptionalSchemaAsync<BaseSchema<unknown, unknown, BaseIssue<unknown>> | BaseSchemaAsync<unknown, unknown, BaseIssue<unknown>>, unknown>;
928
+ /**
929
+ * Object entries interface.
930
+ */
931
+ interface ObjectEntries {
932
+ [key: string]: BaseSchema<unknown, unknown, BaseIssue<unknown>> | SchemaWithFallback<BaseSchema<unknown, unknown, BaseIssue<unknown>>, unknown> | OptionalEntrySchema;
933
+ }
934
+ /**
935
+ * Object entries async interface.
936
+ */
937
+ interface ObjectEntriesAsync {
938
+ [key: string]: BaseSchema<unknown, unknown, BaseIssue<unknown>> | BaseSchemaAsync<unknown, unknown, BaseIssue<unknown>> | SchemaWithFallback<BaseSchema<unknown, unknown, BaseIssue<unknown>>, unknown> | SchemaWithFallbackAsync<BaseSchema<unknown, unknown, BaseIssue<unknown>> | BaseSchemaAsync<unknown, unknown, BaseIssue<unknown>>, unknown> | OptionalEntrySchema | OptionalEntrySchemaAsync;
939
+ }
940
+ /**
941
+ * Infer entries input type.
942
+ */
943
+ type InferEntriesInput<TEntries extends ObjectEntries | ObjectEntriesAsync> = {
944
+ -readonly [TKey in keyof TEntries]: InferInput<TEntries[TKey]>;
945
+ };
946
+ /**
947
+ * Infer entries output type.
948
+ */
949
+ type InferEntriesOutput<TEntries extends ObjectEntries | ObjectEntriesAsync> = {
950
+ -readonly [TKey in keyof TEntries]: InferOutput<TEntries[TKey]>;
951
+ };
952
+ /**
953
+ * Optional input keys type.
954
+ */
955
+ type OptionalInputKeys<TEntries extends ObjectEntries | ObjectEntriesAsync> = {
956
+ [TKey in keyof TEntries]: TEntries[TKey] extends OptionalEntrySchema | OptionalEntrySchemaAsync ? TKey : never;
957
+ }[keyof TEntries];
958
+ /**
959
+ * Optional output keys type.
960
+ */
961
+ type OptionalOutputKeys<TEntries extends ObjectEntries | ObjectEntriesAsync> = {
962
+ [TKey in keyof TEntries]: TEntries[TKey] extends OptionalEntrySchema | OptionalEntrySchemaAsync ? undefined extends TEntries[TKey]['default'] ? TKey : never : never;
963
+ }[keyof TEntries];
964
+ /**
965
+ * Input with question marks type.
966
+ */
967
+ type InputWithQuestionMarks<TEntries extends ObjectEntries | ObjectEntriesAsync, TObject extends InferEntriesInput<TEntries>> = MarkOptional<TObject, OptionalInputKeys<TEntries>>;
968
+ /**
969
+ * Output with question marks type.
970
+ */
971
+ type OutputWithQuestionMarks<TEntries extends ObjectEntries | ObjectEntriesAsync, TObject extends InferEntriesOutput<TEntries>> = MarkOptional<TObject, OptionalOutputKeys<TEntries>>;
972
+ /**
973
+ * Readonly output keys type.
974
+ */
975
+ type ReadonlyOutputKeys<TEntries extends ObjectEntries | ObjectEntriesAsync> = {
976
+ [TKey in keyof TEntries]: TEntries[TKey] extends SchemaWithPipe<infer TPipe> | SchemaWithPipeAsync<infer TPipe> ? ReadonlyAction<any> extends TPipe[number] ? TKey : never : never;
977
+ }[keyof TEntries];
978
+ /**
979
+ * Output with readonly type.
980
+ */
981
+ type OutputWithReadonly<TEntries extends ObjectEntries | ObjectEntriesAsync, TObject extends OutputWithQuestionMarks<TEntries, InferEntriesOutput<TEntries>>> = Readonly<TObject> & Pick<TObject, Exclude<keyof TObject, ReadonlyOutputKeys<TEntries>>>;
982
+ /**
983
+ * Infer object input type.
984
+ */
985
+ type InferObjectInput<TEntries extends ObjectEntries | ObjectEntriesAsync> = Prettify<InputWithQuestionMarks<TEntries, InferEntriesInput<TEntries>>>;
986
+ /**
987
+ * Infer object output type.
988
+ */
989
+ type InferObjectOutput<TEntries extends ObjectEntries | ObjectEntriesAsync> = Prettify<OutputWithReadonly<TEntries, OutputWithQuestionMarks<TEntries, InferEntriesOutput<TEntries>>>>;
990
+ /**
991
+ * Infer object issue type.
992
+ */
993
+ type InferObjectIssue<TEntries extends ObjectEntries | ObjectEntriesAsync> = InferIssue<TEntries[keyof TEntries]>;
994
+
995
+ /**
996
+ * Array path item interface.
997
+ */
998
+ interface ArrayPathItem {
999
+ /**
1000
+ * The path item type.
1001
+ */
1002
+ readonly type: 'array';
1003
+ /**
1004
+ * The path item origin.
1005
+ */
1006
+ readonly origin: 'value';
1007
+ /**
1008
+ * The path item input.
1009
+ */
1010
+ readonly input: MaybeReadonly<unknown[]>;
1011
+ /**
1012
+ * The path item key.
1013
+ */
1014
+ readonly key: number;
1015
+ /**
1016
+ * The path item value.
1017
+ */
1018
+ readonly value: unknown;
1019
+ }
1020
+ /**
1021
+ * Map path item interface.
1022
+ */
1023
+ interface MapPathItem {
1024
+ /**
1025
+ * The path item type.
1026
+ */
1027
+ readonly type: 'map';
1028
+ /**
1029
+ * The path item origin.
1030
+ */
1031
+ readonly origin: 'key' | 'value';
1032
+ /**
1033
+ * The path item input.
1034
+ */
1035
+ readonly input: Map<unknown, unknown>;
1036
+ /**
1037
+ * The path item key.
1038
+ */
1039
+ readonly key: unknown;
1040
+ /**
1041
+ * The path item value.
1042
+ */
1043
+ readonly value: unknown;
1044
+ }
1045
+ /**
1046
+ * Object path item interface.
1047
+ */
1048
+ interface ObjectPathItem {
1049
+ /**
1050
+ * The path item type.
1051
+ */
1052
+ readonly type: 'object';
1053
+ /**
1054
+ * The path item origin.
1055
+ */
1056
+ readonly origin: 'key' | 'value';
1057
+ /**
1058
+ * The path item input.
1059
+ */
1060
+ readonly input: Record<string, unknown>;
1061
+ /**
1062
+ * The path item key.
1063
+ */
1064
+ readonly key: string;
1065
+ /**
1066
+ * The path item value.
1067
+ */
1068
+ readonly value: unknown;
1069
+ }
1070
+ /**
1071
+ * Set path item interface.
1072
+ */
1073
+ interface SetPathItem {
1074
+ /**
1075
+ * The path item type.
1076
+ */
1077
+ readonly type: 'set';
1078
+ /**
1079
+ * The path item origin.
1080
+ */
1081
+ readonly origin: 'value';
1082
+ /**
1083
+ * The path item input.
1084
+ */
1085
+ readonly input: Set<unknown>;
1086
+ /**
1087
+ * The path item key.
1088
+ */
1089
+ readonly key: null;
1090
+ /**
1091
+ * The path item key.
1092
+ */
1093
+ readonly value: unknown;
1094
+ }
1095
+ /**
1096
+ * Unknown path item interface.
1097
+ */
1098
+ interface UnknownPathItem {
1099
+ /**
1100
+ * The path item type.
1101
+ */
1102
+ readonly type: 'unknown';
1103
+ /**
1104
+ * The path item origin.
1105
+ */
1106
+ readonly origin: 'key' | 'value';
1107
+ /**
1108
+ * The path item input.
1109
+ */
1110
+ readonly input: unknown;
1111
+ /**
1112
+ * The path item key.
1113
+ */
1114
+ readonly key: unknown;
1115
+ /**
1116
+ * The path item value.
1117
+ */
1118
+ readonly value: unknown;
1119
+ }
1120
+ /**
1121
+ * Issue path item type.
1122
+ */
1123
+ type IssuePathItem = ArrayPathItem | MapPathItem | ObjectPathItem | SetPathItem | UnknownPathItem;
1124
+ /**
1125
+ * Base issue interface.
1126
+ */
1127
+ interface BaseIssue<TInput> extends Config<BaseIssue<TInput>> {
1128
+ /**
1129
+ * The issue kind.
1130
+ */
1131
+ readonly kind: 'schema' | 'validation' | 'transformation';
1132
+ /**
1133
+ * The issue type.
1134
+ */
1135
+ readonly type: string;
1136
+ /**
1137
+ * The raw input data.
1138
+ */
1139
+ readonly input: TInput;
1140
+ /**
1141
+ * The expected property.
1142
+ */
1143
+ readonly expected: string | null;
1144
+ /**
1145
+ * The received property.
1146
+ */
1147
+ readonly received: string;
1148
+ /**
1149
+ * The error message.
1150
+ */
1151
+ readonly message: string;
1152
+ /**
1153
+ * The input requirement.
1154
+ */
1155
+ readonly requirement?: unknown | undefined;
1156
+ /**
1157
+ * The issue path.
1158
+ */
1159
+ readonly path?: [IssuePathItem, ...IssuePathItem[]] | undefined;
1160
+ /**
1161
+ * The sub issues.
1162
+ */
1163
+ readonly issues?: [BaseIssue<TInput>, ...BaseIssue<TInput>[]] | undefined;
1164
+ }
1165
+
1166
+ /**
1167
+ * Config interface.
1168
+ */
1169
+ interface Config<TIssue extends BaseIssue<unknown>> {
1170
+ /**
1171
+ * The selected language.
1172
+ */
1173
+ readonly lang?: string | undefined;
1174
+ /**
1175
+ * The error message.
1176
+ */
1177
+ readonly message?: ErrorMessage<TIssue> | undefined;
1178
+ /**
1179
+ * Whether it should be aborted early.
1180
+ */
1181
+ readonly abortEarly?: boolean | undefined;
1182
+ /**
1183
+ * Whether a pipe should be aborted early.
1184
+ */
1185
+ readonly abortPipeEarly?: boolean | undefined;
1186
+ }
1187
+
1188
+ /**
1189
+ * Pipe action type.
1190
+ */
1191
+ type PipeAction<TInput, TOutput, TIssue extends BaseIssue<unknown>> = BaseValidation<TInput, TOutput, TIssue> | BaseTransformation<TInput, TOutput, TIssue> | BaseMetadata<TInput>;
1192
+ /**
1193
+ * Pipe action async type.
1194
+ */
1195
+ type PipeActionAsync<TInput, TOutput, TIssue extends BaseIssue<unknown>> = BaseValidationAsync<TInput, TOutput, TIssue> | BaseTransformationAsync<TInput, TOutput, TIssue>;
1196
+ /**
1197
+ * Pipe item type.
1198
+ */
1199
+ type PipeItem<TInput, TOutput, TIssue extends BaseIssue<unknown>> = BaseSchema<TInput, TOutput, TIssue> | PipeAction<TInput, TOutput, TIssue>;
1200
+ /**
1201
+ * Pipe item async type.
1202
+ */
1203
+ type PipeItemAsync<TInput, TOutput, TIssue extends BaseIssue<unknown>> = BaseSchemaAsync<TInput, TOutput, TIssue> | PipeActionAsync<TInput, TOutput, TIssue>;
1204
+
1205
+ /**
1206
+ * Array issue interface.
1207
+ */
1208
+ interface ArrayIssue extends BaseIssue<unknown> {
1209
+ /**
1210
+ * The issue kind.
1211
+ */
1212
+ readonly kind: 'schema';
1213
+ /**
1214
+ * The issue type.
1215
+ */
1216
+ readonly type: 'array';
1217
+ /**
1218
+ * The expected property.
1219
+ */
1220
+ readonly expected: 'Array';
1221
+ }
1222
+
1223
+ /**
1224
+ * Array schema interface.
1225
+ */
1226
+ interface ArraySchema<TItem extends BaseSchema<unknown, unknown, BaseIssue<unknown>>, TMessage extends ErrorMessage<ArrayIssue> | undefined> extends BaseSchema<InferInput<TItem>[], InferOutput<TItem>[], ArrayIssue | InferIssue<TItem>> {
1227
+ /**
1228
+ * The schema type.
1229
+ */
1230
+ readonly type: 'array';
1231
+ /**
1232
+ * The schema reference.
1233
+ */
1234
+ readonly reference: typeof array;
1235
+ /**
1236
+ * The expected property.
1237
+ */
1238
+ readonly expects: 'Array';
1239
+ /**
1240
+ * The array item schema.
1241
+ */
1242
+ readonly item: TItem;
1243
+ /**
1244
+ * The error message.
1245
+ */
1246
+ readonly message: TMessage;
1247
+ }
1248
+ /**
1249
+ * Creates an array schema.
1250
+ *
1251
+ * @param item The item schema.
1252
+ *
1253
+ * @returns An array schema.
1254
+ */
1255
+ declare function array<const TItem extends BaseSchema<unknown, unknown, BaseIssue<unknown>>>(item: TItem): ArraySchema<TItem, undefined>;
1256
+ /**
1257
+ * Creates an array schema.
1258
+ *
1259
+ * @param item The item schema.
1260
+ * @param message The error message.
1261
+ *
1262
+ * @returns An array schema.
1263
+ */
1264
+ declare function array<const TItem extends BaseSchema<unknown, unknown, BaseIssue<unknown>>, const TMessage extends ErrorMessage<ArrayIssue> | undefined>(item: TItem, message: TMessage): ArraySchema<TItem, TMessage>;
1265
+
1266
+ /**
1267
+ * Boolean issue interface.
1268
+ */
1269
+ interface BooleanIssue extends BaseIssue<unknown> {
1270
+ /**
1271
+ * The issue kind.
1272
+ */
1273
+ readonly kind: 'schema';
1274
+ /**
1275
+ * The issue type.
1276
+ */
1277
+ readonly type: 'boolean';
1278
+ /**
1279
+ * The expected property.
1280
+ */
1281
+ readonly expected: 'boolean';
1282
+ }
1283
+ /**
1284
+ * Boolean schema interface.
1285
+ */
1286
+ interface BooleanSchema<TMessage extends ErrorMessage<BooleanIssue> | undefined> extends BaseSchema<boolean, boolean, BooleanIssue> {
1287
+ /**
1288
+ * The schema type.
1289
+ */
1290
+ readonly type: 'boolean';
1291
+ /**
1292
+ * The schema reference.
1293
+ */
1294
+ readonly reference: typeof boolean;
1295
+ /**
1296
+ * The expected property.
1297
+ */
1298
+ readonly expects: 'boolean';
1299
+ /**
1300
+ * The error message.
1301
+ */
1302
+ readonly message: TMessage;
1303
+ }
1304
+ /**
1305
+ * Creates a boolean schema.
1306
+ *
1307
+ * @returns A boolean schema.
1308
+ */
1309
+ declare function boolean(): BooleanSchema<undefined>;
1310
+ /**
1311
+ * Creates a boolean schema.
1312
+ *
1313
+ * @param message The error message.
1314
+ *
1315
+ * @returns A boolean schema.
1316
+ */
1317
+ declare function boolean<const TMessage extends ErrorMessage<BooleanIssue> | undefined>(message: TMessage): BooleanSchema<TMessage>;
1318
+
1319
+ /**
1320
+ * Exact optional schema interface.
1321
+ */
1322
+ interface ExactOptionalSchema<TWrapped extends BaseSchema<unknown, unknown, BaseIssue<unknown>>, TDefault extends Default<TWrapped, never>> extends BaseSchema<InferInput<TWrapped>, InferOutput<TWrapped>, InferIssue<TWrapped>> {
1323
+ /**
1324
+ * The schema type.
1325
+ */
1326
+ readonly type: 'exact_optional';
1327
+ /**
1328
+ * The schema reference.
1329
+ */
1330
+ readonly reference: typeof exactOptional;
1331
+ /**
1332
+ * The expected property.
1333
+ */
1334
+ readonly expects: TWrapped['expects'];
1335
+ /**
1336
+ * The wrapped schema.
1337
+ */
1338
+ readonly wrapped: TWrapped;
1339
+ /**
1340
+ * The default value.
1341
+ */
1342
+ readonly default: TDefault;
1343
+ }
1344
+ /**
1345
+ * Creates an exact optional schema.
1346
+ *
1347
+ * @param wrapped The wrapped schema.
1348
+ *
1349
+ * @returns An exact optional schema.
1350
+ */
1351
+ declare function exactOptional<const TWrapped extends BaseSchema<unknown, unknown, BaseIssue<unknown>>>(wrapped: TWrapped): ExactOptionalSchema<TWrapped, undefined>;
1352
+ /**
1353
+ * Creates an exact optional schema.
1354
+ *
1355
+ * @param wrapped The wrapped schema.
1356
+ * @param default_ The default value.
1357
+ *
1358
+ * @returns An exact optional schema.
1359
+ */
1360
+ declare function exactOptional<const TWrapped extends BaseSchema<unknown, unknown, BaseIssue<unknown>>, const TDefault extends Default<TWrapped, never>>(wrapped: TWrapped, default_: TDefault): ExactOptionalSchema<TWrapped, TDefault>;
1361
+
1362
+ /**
1363
+ * Exact optional schema async interface.
1364
+ */
1365
+ interface ExactOptionalSchemaAsync<TWrapped extends BaseSchema<unknown, unknown, BaseIssue<unknown>> | BaseSchemaAsync<unknown, unknown, BaseIssue<unknown>>, TDefault extends DefaultAsync<TWrapped, never>> extends BaseSchemaAsync<InferInput<TWrapped>, InferOutput<TWrapped>, InferIssue<TWrapped>> {
1366
+ /**
1367
+ * The schema type.
1368
+ */
1369
+ readonly type: 'exact_optional';
1370
+ /**
1371
+ * The schema reference.
1372
+ */
1373
+ readonly reference: typeof exactOptional | typeof exactOptionalAsync;
1374
+ /**
1375
+ * The expected property.
1376
+ */
1377
+ readonly expects: TWrapped['expects'];
1378
+ /**
1379
+ * The wrapped schema.
1380
+ */
1381
+ readonly wrapped: TWrapped;
1382
+ /**
1383
+ * The default value.
1384
+ */
1385
+ readonly default: TDefault;
1386
+ }
1387
+ /**
1388
+ * Creates an exact optional schema.
1389
+ *
1390
+ * @param wrapped The wrapped schema.
1391
+ *
1392
+ * @returns An exact optional schema.
1393
+ */
1394
+ declare function exactOptionalAsync<const TWrapped extends BaseSchema<unknown, unknown, BaseIssue<unknown>> | BaseSchemaAsync<unknown, unknown, BaseIssue<unknown>>>(wrapped: TWrapped): ExactOptionalSchemaAsync<TWrapped, undefined>;
1395
+ /**
1396
+ * Creates an exact optional schema.
1397
+ *
1398
+ * @param wrapped The wrapped schema.
1399
+ * @param default_ The default value.
1400
+ *
1401
+ * @returns An exact optional schema.
1402
+ */
1403
+ declare function exactOptionalAsync<const TWrapped extends BaseSchema<unknown, unknown, BaseIssue<unknown>> | BaseSchemaAsync<unknown, unknown, BaseIssue<unknown>>, const TDefault extends DefaultAsync<TWrapped, never>>(wrapped: TWrapped, default_: TDefault): ExactOptionalSchemaAsync<TWrapped, TDefault>;
1404
+
1405
+ /**
1406
+ * Intersect issue interface.
1407
+ */
1408
+ interface IntersectIssue extends BaseIssue<unknown> {
1409
+ /**
1410
+ * The issue kind.
1411
+ */
1412
+ readonly kind: 'schema';
1413
+ /**
1414
+ * The issue type.
1415
+ */
1416
+ readonly type: 'intersect';
1417
+ /**
1418
+ * The expected property.
1419
+ */
1420
+ readonly expected: string;
1421
+ }
1422
+ /**
1423
+ * Intersect options type.
1424
+ */
1425
+ type IntersectOptions = MaybeReadonly<BaseSchema<unknown, unknown, BaseIssue<unknown>>[]>;
1426
+ /**
1427
+ * Intersect options async type.
1428
+ */
1429
+ type IntersectOptionsAsync = MaybeReadonly<(BaseSchema<unknown, unknown, BaseIssue<unknown>> | BaseSchemaAsync<unknown, unknown, BaseIssue<unknown>>)[]>;
1430
+ /**
1431
+ * Infer option type.
1432
+ */
1433
+ type InferOption<TInput, TOutput> = BaseSchema<TInput, TOutput, BaseIssue<unknown>> | BaseSchemaAsync<TInput, TOutput, BaseIssue<unknown>>;
1434
+ /**
1435
+ * Infer intersect input type.
1436
+ */
1437
+ type InferIntersectInput<TOptions extends IntersectOptions | IntersectOptionsAsync> = TOptions extends readonly [
1438
+ InferOption<infer TInput, unknown>,
1439
+ ...infer TRest
1440
+ ] ? TRest extends readonly [
1441
+ InferOption<unknown, unknown>,
1442
+ ...InferOption<unknown, unknown>[]
1443
+ ] ? TInput & InferIntersectInput<TRest> : TInput : never;
1444
+ /**
1445
+ * Infer intersect output type.
1446
+ */
1447
+ type InferIntersectOutput<TOptions extends IntersectOptions | IntersectOptionsAsync> = TOptions extends readonly [
1448
+ InferOption<unknown, infer TOutput>,
1449
+ ...infer TRest
1450
+ ] ? TRest extends readonly [
1451
+ InferOption<unknown, unknown>,
1452
+ ...InferOption<unknown, unknown>[]
1453
+ ] ? TOutput & InferIntersectOutput<TRest> : TOutput : never;
906
1454
 
907
1455
  /**
908
- * Literal schema type.
1456
+ * Intersect schema interface.
909
1457
  */
910
- interface LiteralSchema<TLiteral extends Literal, TOutput = TLiteral> extends BaseSchema<TLiteral, TOutput> {
1458
+ interface IntersectSchema<TOptions extends IntersectOptions, TMessage extends ErrorMessage<IntersectIssue> | undefined> extends BaseSchema<InferIntersectInput<TOptions>, InferIntersectOutput<TOptions>, IntersectIssue | InferIssue<TOptions[number]>> {
911
1459
  /**
912
1460
  * The schema type.
913
1461
  */
914
- type: 'literal';
1462
+ readonly type: 'intersect';
915
1463
  /**
916
- * The literal value.
1464
+ * The schema reference.
1465
+ */
1466
+ readonly reference: typeof intersect;
1467
+ /**
1468
+ * The intersect options.
917
1469
  */
918
- literal: TLiteral;
1470
+ readonly options: TOptions;
919
1471
  /**
920
1472
  * The error message.
921
1473
  */
922
- message: ErrorMessage | undefined;
1474
+ readonly message: TMessage;
923
1475
  }
924
-
925
1476
  /**
926
- * Map path item type.
1477
+ * Creates an intersect schema.
1478
+ *
1479
+ * @param options The intersect options.
1480
+ *
1481
+ * @returns An intersect schema.
927
1482
  */
928
- interface MapPathItem {
929
- type: 'map';
930
- origin: 'key' | 'value';
931
- input: Map<unknown, unknown>;
932
- key: unknown;
933
- value: unknown;
934
- }
1483
+ declare function intersect<const TOptions extends IntersectOptions>(options: TOptions): IntersectSchema<TOptions, undefined>;
1484
+ /**
1485
+ * Creates an intersect schema.
1486
+ *
1487
+ * @param options The intersect options.
1488
+ * @param message The error message.
1489
+ *
1490
+ * @returns An intersect schema.
1491
+ */
1492
+ declare function intersect<const TOptions extends IntersectOptions, const TMessage extends ErrorMessage<IntersectIssue> | undefined>(options: TOptions, message: TMessage): IntersectSchema<TOptions, TMessage>;
935
1493
 
936
1494
  /**
937
- * Never schema type.
1495
+ * Literal type.
1496
+ */
1497
+ type Literal = bigint | boolean | number | string | symbol;
1498
+ /**
1499
+ * Literal issue interface.
938
1500
  */
939
- interface NeverSchema extends BaseSchema<never> {
1501
+ interface LiteralIssue extends BaseIssue<unknown> {
940
1502
  /**
941
- * The schema type.
1503
+ * The issue kind.
942
1504
  */
943
- type: 'never';
1505
+ readonly kind: 'schema';
944
1506
  /**
945
- * The error message.
1507
+ * The issue type.
1508
+ */
1509
+ readonly type: 'literal';
1510
+ /**
1511
+ * The expected property.
946
1512
  */
947
- message: ErrorMessage | undefined;
1513
+ readonly expected: string;
948
1514
  }
949
-
950
1515
  /**
951
- * Never schema async type.
1516
+ * Literal schema interface.
952
1517
  */
953
- interface NeverSchemaAsync extends BaseSchemaAsync<never> {
1518
+ interface LiteralSchema<TLiteral extends Literal, TMessage extends ErrorMessage<LiteralIssue> | undefined> extends BaseSchema<TLiteral, TLiteral, LiteralIssue> {
954
1519
  /**
955
1520
  * The schema type.
956
1521
  */
957
- type: 'never';
1522
+ readonly type: 'literal';
1523
+ /**
1524
+ * The schema reference.
1525
+ */
1526
+ readonly reference: typeof literal;
1527
+ /**
1528
+ * The literal value.
1529
+ */
1530
+ readonly literal: TLiteral;
958
1531
  /**
959
1532
  * The error message.
960
1533
  */
961
- message: ErrorMessage | undefined;
1534
+ readonly message: TMessage;
962
1535
  }
1536
+ /**
1537
+ * Creates a literal schema.
1538
+ *
1539
+ * @param literal_ The literal value.
1540
+ *
1541
+ * @returns A literal schema.
1542
+ */
1543
+ declare function literal<const TLiteral extends Literal>(literal_: TLiteral): LiteralSchema<TLiteral, undefined>;
1544
+ /**
1545
+ * Creates a literal schema.
1546
+ *
1547
+ * @param literal_ The literal value.
1548
+ * @param message The error message.
1549
+ *
1550
+ * @returns A literal schema.
1551
+ */
1552
+ declare function literal<const TLiteral extends Literal, const TMessage extends ErrorMessage<LiteralIssue> | undefined>(literal_: TLiteral, message: TMessage): LiteralSchema<TLiteral, TMessage>;
963
1553
 
964
1554
  /**
965
- * Nullable schema type.
1555
+ * Union issue interface.
966
1556
  */
967
- interface NullableSchema<TWrapped extends BaseSchema, TDefault extends Default<TWrapped> = undefined, TOutput = TDefault extends Input<TWrapped> | (() => Input<TWrapped>) ? Output<TWrapped> : Output<TWrapped> | null> extends BaseSchema<Input<TWrapped> | null, TOutput> {
1557
+ interface UnionIssue<TSubIssue extends BaseIssue<unknown>> extends BaseIssue<unknown> {
968
1558
  /**
969
- * The schema type.
1559
+ * The issue kind.
970
1560
  */
971
- type: 'nullable';
1561
+ readonly kind: 'schema';
972
1562
  /**
973
- * The wrapped schema.
1563
+ * The issue type.
974
1564
  */
975
- wrapped: TWrapped;
1565
+ readonly type: 'union';
976
1566
  /**
977
- * The default value.
1567
+ * The expected property.
978
1568
  */
979
- default: TDefault;
1569
+ readonly expected: string;
1570
+ /**
1571
+ * The sub issues.
1572
+ */
1573
+ readonly issues?: [TSubIssue, ...TSubIssue[]];
980
1574
  }
981
1575
 
982
1576
  /**
983
- * Number schema type.
1577
+ * Union options type.
1578
+ */
1579
+ type UnionOptions = MaybeReadonly<BaseSchema<unknown, unknown, BaseIssue<unknown>>[]>;
1580
+ /**
1581
+ * Union schema interface.
984
1582
  */
985
- interface NumberSchema<TOutput = number> extends BaseSchema<number, TOutput> {
1583
+ interface UnionSchema<TOptions extends UnionOptions, TMessage extends ErrorMessage<UnionIssue<InferIssue<TOptions[number]>>> | undefined> extends BaseSchema<InferInput<TOptions[number]>, InferOutput<TOptions[number]>, UnionIssue<InferIssue<TOptions[number]>> | InferIssue<TOptions[number]>> {
986
1584
  /**
987
1585
  * The schema type.
988
1586
  */
989
- type: 'number';
1587
+ readonly type: 'union';
990
1588
  /**
991
- * The error message.
1589
+ * The schema reference.
1590
+ */
1591
+ readonly reference: typeof union;
1592
+ /**
1593
+ * The union options.
992
1594
  */
993
- message: ErrorMessage | undefined;
1595
+ readonly options: TOptions;
994
1596
  /**
995
- * The validation and transformation pipeline.
1597
+ * The error message.
996
1598
  */
997
- pipe: Pipe<number> | undefined;
1599
+ readonly message: TMessage;
998
1600
  }
1601
+ /**
1602
+ * Creates an union schema.
1603
+ *
1604
+ * @param options The union options.
1605
+ *
1606
+ * @returns An union schema.
1607
+ */
1608
+ declare function union<const TOptions extends UnionOptions>(options: TOptions): UnionSchema<TOptions, undefined>;
1609
+ /**
1610
+ * Creates an union schema.
1611
+ *
1612
+ * @param options The union options.
1613
+ * @param message The error message.
1614
+ *
1615
+ * @returns An union schema.
1616
+ */
1617
+ declare function union<const TOptions extends UnionOptions, const TMessage extends ErrorMessage<UnionIssue<InferIssue<TOptions[number]>>> | undefined>(options: TOptions, message: TMessage): UnionSchema<TOptions, TMessage>;
1618
+
1619
+ /**
1620
+ * Infer nullable output type.
1621
+ */
1622
+ type InferNullableOutput<TWrapped extends BaseSchema<unknown, unknown, BaseIssue<unknown>> | BaseSchemaAsync<unknown, unknown, BaseIssue<unknown>>, TDefault extends DefaultAsync<TWrapped, null>> = undefined extends TDefault ? InferOutput<TWrapped> | null : InferOutput<TWrapped> | Extract<DefaultValue<TDefault>, null>;
999
1623
 
1000
1624
  /**
1001
- * Optional schema type.
1625
+ * Nullable schema interface.
1002
1626
  */
1003
- interface OptionalSchema<TWrapped extends BaseSchema, TDefault extends Default<TWrapped> = undefined, TOutput = TDefault extends Input<TWrapped> | (() => Input<TWrapped>) ? Output<TWrapped> : Output<TWrapped> | undefined> extends BaseSchema<Input<TWrapped> | undefined, TOutput> {
1627
+ interface NullableSchema<TWrapped extends BaseSchema<unknown, unknown, BaseIssue<unknown>>, TDefault extends Default<TWrapped, null>> extends BaseSchema<InferInput<TWrapped> | null, InferNullableOutput<TWrapped, TDefault>, InferIssue<TWrapped>> {
1004
1628
  /**
1005
1629
  * The schema type.
1006
1630
  */
1007
- type: 'optional';
1008
- /**
1009
- * The wrapped schema.
1010
- */
1011
- wrapped: TWrapped;
1631
+ readonly type: 'nullable';
1012
1632
  /**
1013
- * Returns the default value.
1633
+ * The schema reference.
1014
1634
  */
1015
- default: TDefault;
1016
- }
1017
-
1018
- /**
1019
- * Optional schema async type.
1020
- */
1021
- interface OptionalSchemaAsync<TWrapped extends BaseSchema | BaseSchemaAsync, TDefault extends DefaultAsync<TWrapped> = undefined, TOutput = TDefault extends Input<TWrapped> | (() => Input<TWrapped> | Promise<Input<TWrapped>>) ? Output<TWrapped> : Output<TWrapped> | undefined> extends BaseSchemaAsync<Input<TWrapped> | undefined, TOutput> {
1635
+ readonly reference: typeof nullable;
1022
1636
  /**
1023
- * The schema type.
1637
+ * The expected property.
1024
1638
  */
1025
- type: 'optional';
1639
+ readonly expects: `(${TWrapped['expects']} | null)`;
1026
1640
  /**
1027
1641
  * The wrapped schema.
1028
1642
  */
1029
- wrapped: TWrapped;
1643
+ readonly wrapped: TWrapped;
1030
1644
  /**
1031
- * Returns the default value.
1645
+ * The default value.
1032
1646
  */
1033
- default: TDefault;
1647
+ readonly default: TDefault;
1034
1648
  }
1035
-
1036
1649
  /**
1037
- * Object entries async type.
1650
+ * Creates a nullable schema.
1651
+ *
1652
+ * @param wrapped The wrapped schema.
1653
+ *
1654
+ * @returns A nullable schema.
1038
1655
  */
1039
- interface ObjectEntriesAsync {
1040
- [key: string]: BaseSchema | BaseSchemaAsync;
1041
- }
1042
-
1656
+ declare function nullable<const TWrapped extends BaseSchema<unknown, unknown, BaseIssue<unknown>>>(wrapped: TWrapped): NullableSchema<TWrapped, undefined>;
1043
1657
  /**
1044
- * Object path item type.
1658
+ * Creates a nullable schema.
1659
+ *
1660
+ * @param wrapped The wrapped schema.
1661
+ * @param default_ The default value.
1662
+ *
1663
+ * @returns A nullable schema.
1045
1664
  */
1046
- interface ObjectPathItem {
1047
- type: 'object';
1048
- origin: 'value';
1049
- input: Record<string, unknown>;
1050
- key: string;
1051
- value: unknown;
1052
- }
1665
+ declare function nullable<const TWrapped extends BaseSchema<unknown, unknown, BaseIssue<unknown>>, const TDefault extends Default<TWrapped, null>>(wrapped: TWrapped, default_: TDefault): NullableSchema<TWrapped, TDefault>;
1666
+
1053
1667
  /**
1054
- * Required object keys type.
1668
+ * Infer nullish output type.
1055
1669
  */
1056
- type RequiredKeys<TEntries extends ObjectEntries | ObjectEntriesAsync, TObject extends EntriesInput<TEntries> | EntriesOutput<TEntries>> = {
1057
- [TKey in keyof TEntries]: TEntries[TKey] extends OptionalSchema<any, any> | OptionalSchemaAsync<any, any> ? undefined extends TObject[TKey] ? never : TKey : TKey;
1058
- }[keyof TEntries];
1670
+ type InferNullishOutput<TWrapped extends BaseSchema<unknown, unknown, BaseIssue<unknown>> | BaseSchemaAsync<unknown, unknown, BaseIssue<unknown>>, TDefault extends DefaultAsync<TWrapped, null | undefined>> = undefined extends TDefault ? InferOutput<TWrapped> | null | undefined : InferOutput<TWrapped> | Extract<DefaultValue<TDefault>, null | undefined>;
1671
+
1059
1672
  /**
1060
- * Optional object keys type.
1673
+ * Nullish schema interface.
1061
1674
  */
1062
- type OptionalKeys<TEntries extends ObjectEntries | ObjectEntriesAsync, TObject extends EntriesInput<TEntries> | EntriesOutput<TEntries>> = {
1063
- [TKey in keyof TEntries]: TEntries[TKey] extends OptionalSchema<any, any> | OptionalSchemaAsync<any, any> ? undefined extends TObject[TKey] ? TKey : never : never;
1064
- }[keyof TEntries];
1675
+ interface NullishSchema<TWrapped extends BaseSchema<unknown, unknown, BaseIssue<unknown>>, TDefault extends Default<TWrapped, null | undefined>> extends BaseSchema<InferInput<TWrapped> | null | undefined, InferNullishOutput<TWrapped, TDefault>, InferIssue<TWrapped>> {
1676
+ /**
1677
+ * The schema type.
1678
+ */
1679
+ readonly type: 'nullish';
1680
+ /**
1681
+ * The schema reference.
1682
+ */
1683
+ readonly reference: typeof nullish;
1684
+ /**
1685
+ * The expected property.
1686
+ */
1687
+ readonly expects: `(${TWrapped['expects']} | null | undefined)`;
1688
+ /**
1689
+ * The wrapped schema.
1690
+ */
1691
+ readonly wrapped: TWrapped;
1692
+ /**
1693
+ * The default value.
1694
+ */
1695
+ readonly default: TDefault;
1696
+ }
1065
1697
  /**
1066
- * Entries input inference type.
1698
+ * Creates a nullish schema.
1699
+ *
1700
+ * @param wrapped The wrapped schema.
1701
+ *
1702
+ * @returns A nullish schema.
1067
1703
  */
1068
- type EntriesInput<TEntries extends ObjectEntries | ObjectEntriesAsync> = {
1069
- [TKey in keyof TEntries]: Input<TEntries[TKey]>;
1070
- };
1704
+ declare function nullish<const TWrapped extends BaseSchema<unknown, unknown, BaseIssue<unknown>>>(wrapped: TWrapped): NullishSchema<TWrapped, undefined>;
1071
1705
  /**
1072
- * Entries output inference type.
1706
+ * Creates a nullish schema.
1707
+ *
1708
+ * @param wrapped The wrapped schema.
1709
+ * @param default_ The default value.
1710
+ *
1711
+ * @returns A nullish schema.
1073
1712
  */
1074
- type EntriesOutput<TEntries extends ObjectEntries | ObjectEntriesAsync> = {
1075
- [TKey in keyof TEntries]: Output<TEntries[TKey]>;
1076
- };
1713
+ declare function nullish<const TWrapped extends BaseSchema<unknown, unknown, BaseIssue<unknown>>, const TDefault extends Default<TWrapped, null | undefined>>(wrapped: TWrapped, default_: TDefault): NullishSchema<TWrapped, TDefault>;
1714
+
1077
1715
  /**
1078
- * Object with question marks type.
1716
+ * Nullish schema async interface.
1079
1717
  */
1080
- type WithQuestionMarks<TEntries extends ObjectEntries | ObjectEntriesAsync, TObject extends EntriesInput<TEntries> | EntriesOutput<TEntries>> = Pick<TObject, RequiredKeys<TEntries, TObject>> & Partial<Pick<TObject, OptionalKeys<TEntries, TObject>>>;
1718
+ interface NullishSchemaAsync<TWrapped extends BaseSchema<unknown, unknown, BaseIssue<unknown>> | BaseSchemaAsync<unknown, unknown, BaseIssue<unknown>>, TDefault extends DefaultAsync<TWrapped, null | undefined>> extends BaseSchemaAsync<InferInput<TWrapped> | null | undefined, InferNullishOutput<TWrapped, TDefault>, InferIssue<TWrapped>> {
1719
+ /**
1720
+ * The schema type.
1721
+ */
1722
+ readonly type: 'nullish';
1723
+ /**
1724
+ * The schema reference.
1725
+ */
1726
+ readonly reference: typeof nullish | typeof nullishAsync;
1727
+ /**
1728
+ * The expected property.
1729
+ */
1730
+ readonly expects: `(${TWrapped['expects']} | null | undefined)`;
1731
+ /**
1732
+ * The wrapped schema.
1733
+ */
1734
+ readonly wrapped: TWrapped;
1735
+ /**
1736
+ * The default value.
1737
+ */
1738
+ readonly default: TDefault;
1739
+ }
1081
1740
  /**
1082
- * Object input inference type.
1741
+ * Creates a nullish schema.
1742
+ *
1743
+ * @param wrapped The wrapped schema.
1744
+ *
1745
+ * @returns A nullish schema.
1083
1746
  */
1084
- type ObjectInput<TEntries extends ObjectEntries | ObjectEntriesAsync, TRest extends BaseSchema | BaseSchemaAsync | undefined> = TRest extends undefined | NeverSchema | NeverSchemaAsync ? ResolveObject<WithQuestionMarks<TEntries, EntriesInput<TEntries>>> : TRest extends BaseSchema | BaseSchemaAsync ? ResolveObject<WithQuestionMarks<TEntries, EntriesInput<TEntries>>> & Record<string, Input<TRest>> : never;
1747
+ declare function nullishAsync<const TWrapped extends BaseSchema<unknown, unknown, BaseIssue<unknown>> | BaseSchemaAsync<unknown, unknown, BaseIssue<unknown>>>(wrapped: TWrapped): NullishSchemaAsync<TWrapped, undefined>;
1085
1748
  /**
1086
- * Object output inference type.
1749
+ * Creates a nullish schema.
1750
+ *
1751
+ * @param wrapped The wrapped schema.
1752
+ * @param default_ The default value.
1753
+ *
1754
+ * @returns A nullish schema.
1087
1755
  */
1088
- type ObjectOutput<TEntries extends ObjectEntries | ObjectEntriesAsync, TRest extends BaseSchema | BaseSchemaAsync | undefined> = TRest extends undefined | NeverSchema | NeverSchemaAsync ? ResolveObject<WithQuestionMarks<TEntries, EntriesOutput<TEntries>>> : TRest extends BaseSchema | BaseSchemaAsync ? ResolveObject<WithQuestionMarks<TEntries, EntriesOutput<TEntries>>> & Record<string, Output<TRest>> : never;
1756
+ declare function nullishAsync<const TWrapped extends BaseSchema<unknown, unknown, BaseIssue<unknown>> | BaseSchemaAsync<unknown, unknown, BaseIssue<unknown>>, const TDefault extends DefaultAsync<TWrapped, null | undefined>>(wrapped: TWrapped, default_: TDefault): NullishSchemaAsync<TWrapped, TDefault>;
1089
1757
 
1090
1758
  /**
1091
- * Object entries type.
1759
+ * Number issue interface.
1092
1760
  */
1093
- interface ObjectEntries {
1094
- [key: string]: BaseSchema;
1761
+ interface NumberIssue extends BaseIssue<unknown> {
1762
+ /**
1763
+ * The issue kind.
1764
+ */
1765
+ readonly kind: 'schema';
1766
+ /**
1767
+ * The issue type.
1768
+ */
1769
+ readonly type: 'number';
1770
+ /**
1771
+ * The expected property.
1772
+ */
1773
+ readonly expected: 'number';
1095
1774
  }
1096
1775
  /**
1097
- * Object schema type.
1776
+ * Number schema interface.
1098
1777
  */
1099
- interface ObjectSchema<TEntries extends ObjectEntries, TRest extends BaseSchema | undefined = undefined, TOutput = ObjectOutput<TEntries, TRest>> extends BaseSchema<ObjectInput<TEntries, TRest>, TOutput> {
1778
+ interface NumberSchema<TMessage extends ErrorMessage<NumberIssue> | undefined> extends BaseSchema<number, number, NumberIssue> {
1100
1779
  /**
1101
1780
  * The schema type.
1102
1781
  */
1103
- type: 'object';
1782
+ readonly type: 'number';
1104
1783
  /**
1105
- * The object entries schema.
1784
+ * The schema reference.
1106
1785
  */
1107
- entries: TEntries;
1786
+ readonly reference: typeof number;
1108
1787
  /**
1109
- * The object rest schema.
1788
+ * The expected property.
1110
1789
  */
1111
- rest: TRest;
1790
+ readonly expects: 'number';
1112
1791
  /**
1113
1792
  * The error message.
1114
1793
  */
1115
- message: ErrorMessage | undefined;
1116
- /**
1117
- * The validation and transformation pipeline.
1118
- */
1119
- pipe: Pipe<ObjectOutput<TEntries, TRest>> | undefined;
1794
+ readonly message: TMessage;
1120
1795
  }
1121
-
1122
1796
  /**
1123
- * Picklist options type.
1797
+ * Creates a number schema.
1798
+ *
1799
+ * @returns A number schema.
1800
+ */
1801
+ declare function number(): NumberSchema<undefined>;
1802
+ /**
1803
+ * Creates a number schema.
1804
+ *
1805
+ * @param message The error message.
1806
+ *
1807
+ * @returns A number schema.
1124
1808
  */
1125
- type PicklistOptions = MaybeReadonly<(string | number | bigint)[]>;
1809
+ declare function number<const TMessage extends ErrorMessage<NumberIssue> | undefined>(message: TMessage): NumberSchema<TMessage>;
1126
1810
 
1127
1811
  /**
1128
- * Picklist schema type.
1812
+ * Object issue interface.
1129
1813
  */
1130
- interface PicklistSchema<TOptions extends PicklistOptions, TOutput = TOptions[number]> extends BaseSchema<TOptions[number], TOutput> {
1814
+ interface ObjectIssue extends BaseIssue<unknown> {
1131
1815
  /**
1132
- * The schema type.
1816
+ * The issue kind.
1133
1817
  */
1134
- type: 'picklist';
1818
+ readonly kind: 'schema';
1135
1819
  /**
1136
- * The picklist options.
1820
+ * The issue type.
1137
1821
  */
1138
- options: TOptions;
1822
+ readonly type: 'object';
1139
1823
  /**
1140
- * The error message.
1824
+ * The expected property.
1141
1825
  */
1142
- message: ErrorMessage | undefined;
1826
+ readonly expected: 'Object' | `"${string}"`;
1143
1827
  }
1144
1828
 
1145
1829
  /**
1146
- * Picklist schema async type.
1830
+ * Object schema interface.
1147
1831
  */
1148
- interface PicklistSchemaAsync<TOptions extends PicklistOptions, TOutput = TOptions[number]> extends BaseSchemaAsync<TOptions[number], TOutput> {
1832
+ interface ObjectSchema<TEntries extends ObjectEntries, TMessage extends ErrorMessage<ObjectIssue> | undefined> extends BaseSchema<InferObjectInput<TEntries>, InferObjectOutput<TEntries>, ObjectIssue | InferObjectIssue<TEntries>> {
1149
1833
  /**
1150
1834
  * The schema type.
1151
1835
  */
1152
- type: 'picklist';
1836
+ readonly type: 'object';
1153
1837
  /**
1154
- * The picklist value.
1838
+ * The schema reference.
1155
1839
  */
1156
- options: TOptions;
1840
+ readonly reference: typeof object;
1841
+ /**
1842
+ * The expected property.
1843
+ */
1844
+ readonly expects: 'Object';
1845
+ /**
1846
+ * The entries schema.
1847
+ */
1848
+ readonly entries: TEntries;
1157
1849
  /**
1158
1850
  * The error message.
1159
1851
  */
1160
- message: ErrorMessage | undefined;
1852
+ readonly message: TMessage;
1161
1853
  }
1854
+ /**
1855
+ * Creates an object schema.
1856
+ *
1857
+ * Hint: This schema removes unknown entries. The output will only include the
1858
+ * entries you specify. To include unknown entries, use `looseObject`. To
1859
+ * return an issue for unknown entries, use `strictObject`. To include and
1860
+ * validate unknown entries, use `objectWithRest`.
1861
+ *
1862
+ * @param entries The entries schema.
1863
+ *
1864
+ * @returns An object schema.
1865
+ */
1866
+ declare function object<const TEntries extends ObjectEntries>(entries: TEntries): ObjectSchema<TEntries, undefined>;
1867
+ /**
1868
+ * Creates an object schema.
1869
+ *
1870
+ * Hint: This schema removes unknown entries. The output will only include the
1871
+ * entries you specify. To include unknown entries, use `looseObject`. To
1872
+ * return an issue for unknown entries, use `strictObject`. To include and
1873
+ * validate unknown entries, use `objectWithRest`.
1874
+ *
1875
+ * @param entries The entries schema.
1876
+ * @param message The error message.
1877
+ *
1878
+ * @returns An object schema.
1879
+ */
1880
+ declare function object<const TEntries extends ObjectEntries, const TMessage extends ErrorMessage<ObjectIssue> | undefined>(entries: TEntries, message: TMessage): ObjectSchema<TEntries, TMessage>;
1881
+
1882
+ /**
1883
+ * Infer optional output type.
1884
+ */
1885
+ type InferOptionalOutput<TWrapped extends BaseSchema<unknown, unknown, BaseIssue<unknown>> | BaseSchemaAsync<unknown, unknown, BaseIssue<unknown>>, TDefault extends DefaultAsync<TWrapped, undefined>> = undefined extends TDefault ? InferOutput<TWrapped> | undefined : InferOutput<TWrapped> | Extract<DefaultValue<TDefault>, undefined>;
1162
1886
 
1163
1887
  /**
1164
- * Special schema type.
1888
+ * Optional schema interface.
1165
1889
  */
1166
- interface SpecialSchema<TInput, TOutput = TInput> extends BaseSchema<TInput, TOutput> {
1890
+ interface OptionalSchema<TWrapped extends BaseSchema<unknown, unknown, BaseIssue<unknown>>, TDefault extends Default<TWrapped, undefined>> extends BaseSchema<InferInput<TWrapped> | undefined, InferOptionalOutput<TWrapped, TDefault>, InferIssue<TWrapped>> {
1167
1891
  /**
1168
1892
  * The schema type.
1169
1893
  */
1170
- type: 'special';
1894
+ readonly type: 'optional';
1171
1895
  /**
1172
- * The type check function.
1896
+ * The schema reference.
1173
1897
  */
1174
- check: (input: unknown) => boolean;
1898
+ readonly reference: typeof optional;
1175
1899
  /**
1176
- * The error message.
1900
+ * The expected property.
1177
1901
  */
1178
- message: ErrorMessage | undefined;
1902
+ readonly expects: `(${TWrapped['expects']} | undefined)`;
1179
1903
  /**
1180
- * The validation and transformation pipeline.
1904
+ * The wrapped schema.
1905
+ */
1906
+ readonly wrapped: TWrapped;
1907
+ /**
1908
+ * The default value.
1181
1909
  */
1182
- pipe: Pipe<TInput> | undefined;
1910
+ readonly default: TDefault;
1183
1911
  }
1912
+ /**
1913
+ * Creates an optional schema.
1914
+ *
1915
+ * @param wrapped The wrapped schema.
1916
+ *
1917
+ * @returns An optional schema.
1918
+ */
1919
+ declare function optional<const TWrapped extends BaseSchema<unknown, unknown, BaseIssue<unknown>>>(wrapped: TWrapped): OptionalSchema<TWrapped, undefined>;
1920
+ /**
1921
+ * Creates an optional schema.
1922
+ *
1923
+ * @param wrapped The wrapped schema.
1924
+ * @param default_ The default value.
1925
+ *
1926
+ * @returns An optional schema.
1927
+ */
1928
+ declare function optional<const TWrapped extends BaseSchema<unknown, unknown, BaseIssue<unknown>>, const TDefault extends Default<TWrapped, undefined>>(wrapped: TWrapped, default_: TDefault): OptionalSchema<TWrapped, TDefault>;
1184
1929
 
1185
1930
  /**
1186
- * Special schema async type.
1931
+ * Optional schema async interface.
1187
1932
  */
1188
- interface SpecialSchemaAsync<TInput, TOutput = TInput> extends BaseSchemaAsync<TInput, TOutput> {
1933
+ interface OptionalSchemaAsync<TWrapped extends BaseSchema<unknown, unknown, BaseIssue<unknown>> | BaseSchemaAsync<unknown, unknown, BaseIssue<unknown>>, TDefault extends DefaultAsync<TWrapped, undefined>> extends BaseSchemaAsync<InferInput<TWrapped> | undefined, InferOptionalOutput<TWrapped, TDefault>, InferIssue<TWrapped>> {
1189
1934
  /**
1190
1935
  * The schema type.
1191
1936
  */
1192
- type: 'special';
1937
+ readonly type: 'optional';
1193
1938
  /**
1194
- * The type check function.
1939
+ * The schema reference.
1195
1940
  */
1196
- check: (input: unknown) => boolean | Promise<boolean>;
1941
+ readonly reference: typeof optional | typeof optionalAsync;
1197
1942
  /**
1198
- * The error message.
1943
+ * The expected property.
1944
+ */
1945
+ readonly expects: `(${TWrapped['expects']} | undefined)`;
1946
+ /**
1947
+ * The wrapped schema.
1199
1948
  */
1200
- message: ErrorMessage | undefined;
1949
+ readonly wrapped: TWrapped;
1201
1950
  /**
1202
- * The validation and transformation pipeline.
1951
+ * The default value.
1203
1952
  */
1204
- pipe: PipeAsync<TInput> | undefined;
1953
+ readonly default: TDefault;
1205
1954
  }
1955
+ /**
1956
+ * Creates an optional schema.
1957
+ *
1958
+ * @param wrapped The wrapped schema.
1959
+ *
1960
+ * @returns An optional schema.
1961
+ */
1962
+ declare function optionalAsync<const TWrapped extends BaseSchema<unknown, unknown, BaseIssue<unknown>> | BaseSchemaAsync<unknown, unknown, BaseIssue<unknown>>>(wrapped: TWrapped): OptionalSchemaAsync<TWrapped, undefined>;
1963
+ /**
1964
+ * Creates an optional schema.
1965
+ *
1966
+ * @param wrapped The wrapped schema.
1967
+ * @param default_ The default value.
1968
+ *
1969
+ * @returns An optional schema.
1970
+ */
1971
+ declare function optionalAsync<const TWrapped extends BaseSchema<unknown, unknown, BaseIssue<unknown>> | BaseSchemaAsync<unknown, unknown, BaseIssue<unknown>>, const TDefault extends DefaultAsync<TWrapped, undefined>>(wrapped: TWrapped, default_: TDefault): OptionalSchemaAsync<TWrapped, TDefault>;
1206
1972
 
1207
1973
  /**
1208
- * String schema type.
1974
+ * Record issue interface.
1209
1975
  */
1210
- interface StringSchema<TOutput = string> extends BaseSchema<string, TOutput> {
1976
+ interface RecordIssue extends BaseIssue<unknown> {
1211
1977
  /**
1212
- * The schema type.
1978
+ * The issue kind.
1213
1979
  */
1214
- type: 'string';
1980
+ readonly kind: 'schema';
1215
1981
  /**
1216
- * The error message.
1982
+ * The issue type.
1217
1983
  */
1218
- message: ErrorMessage | undefined;
1984
+ readonly type: 'record';
1219
1985
  /**
1220
- * The validation and transformation pipeline.
1986
+ * The expected property.
1221
1987
  */
1222
- pipe: Pipe<string> | undefined;
1988
+ readonly expected: 'Object';
1223
1989
  }
1990
+ /**
1991
+ * Is literal type.
1992
+ */
1993
+ type IsLiteral<TKey extends string | number | symbol> = string extends TKey ? false : number extends TKey ? false : symbol extends TKey ? false : TKey extends Brand<string | number | symbol> ? false : true;
1994
+ /**
1995
+ * Optional keys type.
1996
+ */
1997
+ type OptionalKeys<TObject extends Record<string | number | symbol, unknown>> = {
1998
+ [TKey in keyof TObject]: IsLiteral<TKey> extends true ? TKey : never;
1999
+ }[keyof TObject];
2000
+ /**
2001
+ * With question marks type.
2002
+ *
2003
+ * Hint: We mark an entry as optional if we detect that its key is a literal
2004
+ * type. The reason for this is that it is not technically possible to detect
2005
+ * missing literal keys without restricting the key schema to `string`, `enum`
2006
+ * and `picklist`. However, if `enum` and `picklist` are used, it is better to
2007
+ * use `object` with `entriesFromList` because it already covers the needed
2008
+ * functionality. This decision also reduces the bundle size of `record`,
2009
+ * because it only needs to check the entries of the input and not any missing
2010
+ * keys.
2011
+ */
2012
+ type WithQuestionMarks<TObject extends Record<string | number | symbol, unknown>> = MarkOptional<TObject, OptionalKeys<TObject>>;
2013
+ /**
2014
+ * With readonly type.
2015
+ */
2016
+ type WithReadonly<TValue extends BaseSchema<unknown, unknown, BaseIssue<unknown>> | BaseSchemaAsync<unknown, unknown, BaseIssue<unknown>>, TObject extends WithQuestionMarks<Record<string | number | symbol, unknown>>> = TValue extends SchemaWithPipe<infer TPipe> | SchemaWithPipeAsync<infer TPipe> ? ReadonlyAction<any> extends TPipe[number] ? Readonly<TObject> : TObject : TObject;
2017
+ /**
2018
+ * Infer record input type.
2019
+ */
2020
+ type InferRecordInput<TKey extends BaseSchema<string, string | number | symbol, BaseIssue<unknown>> | BaseSchemaAsync<string, string | number | symbol, BaseIssue<unknown>>, TValue extends BaseSchema<unknown, unknown, BaseIssue<unknown>> | BaseSchemaAsync<unknown, unknown, BaseIssue<unknown>>> = Prettify<WithQuestionMarks<Record<InferInput<TKey>, InferInput<TValue>>>>;
2021
+ /**
2022
+ * Infer record output type.
2023
+ */
2024
+ type InferRecordOutput<TKey extends BaseSchema<string, string | number | symbol, BaseIssue<unknown>> | BaseSchemaAsync<string, string | number | symbol, BaseIssue<unknown>>, TValue extends BaseSchema<unknown, unknown, BaseIssue<unknown>> | BaseSchemaAsync<unknown, unknown, BaseIssue<unknown>>> = Prettify<WithReadonly<TValue, WithQuestionMarks<Record<InferOutput<TKey>, InferOutput<TValue>>>>>;
1224
2025
 
1225
2026
  /**
1226
- * String schema async type.
2027
+ * Record schema interface.
1227
2028
  */
1228
- interface StringSchemaAsync<TOutput = string> extends BaseSchemaAsync<string, TOutput> {
2029
+ interface RecordSchema<TKey extends BaseSchema<string, string | number | symbol, BaseIssue<unknown>>, TValue extends BaseSchema<unknown, unknown, BaseIssue<unknown>>, TMessage extends ErrorMessage<RecordIssue> | undefined> extends BaseSchema<InferRecordInput<TKey, TValue>, InferRecordOutput<TKey, TValue>, RecordIssue | InferIssue<TKey> | InferIssue<TValue>> {
1229
2030
  /**
1230
2031
  * The schema type.
1231
2032
  */
1232
- type: 'string';
2033
+ readonly type: 'record';
1233
2034
  /**
1234
- * The error message.
2035
+ * The schema reference.
2036
+ */
2037
+ readonly reference: typeof record;
2038
+ /**
2039
+ * The expected property.
2040
+ */
2041
+ readonly expects: 'Object';
2042
+ /**
2043
+ * The record key schema.
2044
+ */
2045
+ readonly key: TKey;
2046
+ /**
2047
+ * The record value schema.
1235
2048
  */
1236
- message: ErrorMessage | undefined;
2049
+ readonly value: TValue;
1237
2050
  /**
1238
- * The validation and transformation pipeline.
2051
+ * The error message.
1239
2052
  */
1240
- pipe: PipeAsync<string> | undefined;
2053
+ readonly message: TMessage;
1241
2054
  }
2055
+ /**
2056
+ * Creates a record schema.
2057
+ *
2058
+ * @param key The key schema.
2059
+ * @param value The value schema.
2060
+ *
2061
+ * @returns A record schema.
2062
+ */
2063
+ declare function record<const TKey extends BaseSchema<string, string | number | symbol, BaseIssue<unknown>>, const TValue extends BaseSchema<unknown, unknown, BaseIssue<unknown>>>(key: TKey, value: TValue): RecordSchema<TKey, TValue, undefined>;
2064
+ /**
2065
+ * Creates a record schema.
2066
+ *
2067
+ * @param key The key schema.
2068
+ * @param value The value schema.
2069
+ * @param message The error message.
2070
+ *
2071
+ * @returns A record schema.
2072
+ */
2073
+ declare function record<const TKey extends BaseSchema<string, string | number | symbol, BaseIssue<unknown>>, const TValue extends BaseSchema<unknown, unknown, BaseIssue<unknown>>, const TMessage extends ErrorMessage<RecordIssue> | undefined>(key: TKey, value: TValue, message: TMessage): RecordSchema<TKey, TValue, TMessage>;
1242
2074
 
1243
2075
  /**
1244
- * Union options type.
2076
+ * String issue interface.
1245
2077
  */
1246
- type UnionOptions = MaybeReadonly<BaseSchema[]>;
2078
+ interface StringIssue extends BaseIssue<unknown> {
2079
+ /**
2080
+ * The issue kind.
2081
+ */
2082
+ readonly kind: 'schema';
2083
+ /**
2084
+ * The issue type.
2085
+ */
2086
+ readonly type: 'string';
2087
+ /**
2088
+ * The expected property.
2089
+ */
2090
+ readonly expected: 'string';
2091
+ }
1247
2092
  /**
1248
- * Union schema type.
2093
+ * String schema interface.
1249
2094
  */
1250
- interface UnionSchema<TOptions extends UnionOptions, TOutput = Output<TOptions[number]>> extends BaseSchema<Input<TOptions[number]>, TOutput> {
2095
+ interface StringSchema<TMessage extends ErrorMessage<StringIssue> | undefined> extends BaseSchema<string, string, StringIssue> {
1251
2096
  /**
1252
2097
  * The schema type.
1253
2098
  */
1254
- type: 'union';
2099
+ readonly type: 'string';
1255
2100
  /**
1256
- * The union options.
2101
+ * The schema reference.
1257
2102
  */
1258
- options: TOptions;
2103
+ readonly reference: typeof string;
1259
2104
  /**
1260
- * The error message.
2105
+ * The expected property.
1261
2106
  */
1262
- message: ErrorMessage | undefined;
2107
+ readonly expects: 'string';
1263
2108
  /**
1264
- * The validation and transformation pipeline.
2109
+ * The error message.
1265
2110
  */
1266
- pipe: Pipe<Output<TOptions[number]>> | undefined;
2111
+ readonly message: TMessage;
1267
2112
  }
1268
-
1269
2113
  /**
1270
- * Union options async type.
2114
+ * Creates a string schema.
2115
+ *
2116
+ * @returns A string schema.
2117
+ */
2118
+ declare function string(): StringSchema<undefined>;
2119
+ /**
2120
+ * Creates a string schema.
2121
+ *
2122
+ * @param message The error message.
2123
+ *
2124
+ * @returns A string schema.
1271
2125
  */
1272
- type UnionOptionsAsync = MaybeReadonly<(BaseSchema | BaseSchemaAsync)[]>;
2126
+ declare function string<const TMessage extends ErrorMessage<StringIssue> | undefined>(message: TMessage): StringSchema<TMessage>;
2127
+
1273
2128
  /**
1274
- * Union schema async type.
2129
+ * Unknown schema interface.
1275
2130
  */
1276
- interface UnionSchemaAsync<TOptions extends UnionOptionsAsync, TOutput = Output<TOptions[number]>> extends BaseSchemaAsync<Input<TOptions[number]>, TOutput> {
1277
- /**
1278
- * The schema type.
1279
- */
1280
- type: 'union';
2131
+ interface UnknownSchema extends BaseSchema<unknown, unknown, never> {
1281
2132
  /**
1282
- * The union options.
2133
+ * The schema type.
1283
2134
  */
1284
- options: TOptions;
2135
+ readonly type: 'unknown';
1285
2136
  /**
1286
- * The error message.
2137
+ * The schema reference.
1287
2138
  */
1288
- message: ErrorMessage | undefined;
2139
+ readonly reference: typeof unknown;
1289
2140
  /**
1290
- * The validation and transformation pipeline.
2141
+ * The expected property.
1291
2142
  */
1292
- pipe: PipeAsync<Input<TOptions[number]>> | undefined;
2143
+ readonly expects: 'unknown';
1293
2144
  }
1294
-
1295
2145
  /**
1296
- * Record key async type.
2146
+ * Creates a unknown schema.
2147
+ *
2148
+ * @returns A unknown schema.
1297
2149
  */
1298
- type RecordKeyAsync = EnumSchema<any, string | number | symbol> | EnumSchemaAsync<any, string | number | symbol> | PicklistSchema<any, string | number | symbol> | PicklistSchemaAsync<any, string | number | symbol> | SpecialSchema<any, string | number | symbol> | SpecialSchemaAsync<any, string | number | symbol> | StringSchema<string | number | symbol> | StringSchemaAsync<string | number | symbol> | UnionSchema<any, string | number | symbol> | UnionSchemaAsync<any, string | number | symbol>;
2150
+ declare function unknown(): UnknownSchema;
1299
2151
 
1300
2152
  /**
1301
- * Record path item type.
2153
+ * Brand symbol.
1302
2154
  */
1303
- interface RecordPathItem {
1304
- type: 'record';
1305
- origin: 'key' | 'value';
1306
- input: Record<string | number | symbol, unknown>;
1307
- key: string | number | symbol;
1308
- value: unknown;
1309
- }
2155
+ declare const BrandSymbol: unique symbol;
1310
2156
  /**
1311
- * Partial key schema type.
2157
+ * Brand name type.
1312
2158
  */
1313
- type PartialKeySchema = PicklistSchema<any> | PicklistSchemaAsync<any> | EnumSchema<any> | EnumSchemaAsync<any> | UnionSchema<any> | UnionSchemaAsync<any>;
2159
+ type BrandName = string | number | symbol;
1314
2160
  /**
1315
- * Record input inference type.
2161
+ * Brand interface.
1316
2162
  */
1317
- type RecordInput<TKey extends RecordKey | RecordKeyAsync, TValue extends BaseSchema | BaseSchemaAsync> = ResolveObject<TKey extends PartialKeySchema ? Partial<Record<Input<TKey>, Input<TValue>>> : Record<Input<TKey>, Input<TValue>>>;
2163
+ interface Brand<TName extends BrandName> {
2164
+ [BrandSymbol]: {
2165
+ [TValue in TName]: TValue;
2166
+ };
2167
+ }
1318
2168
  /**
1319
- * Record output inference type.
2169
+ * Value input type.
1320
2170
  */
1321
- type RecordOutput<TKey extends RecordKey | RecordKeyAsync, TValue extends BaseSchema | BaseSchemaAsync> = ResolveObject<TKey extends PartialKeySchema ? Partial<Record<Output<TKey>, Output<TValue>>> : Record<Output<TKey>, Output<TValue>>>;
2171
+ type ValueInput = string | number | bigint | boolean | Date;
1322
2172
 
1323
2173
  /**
1324
- * Record key type.
2174
+ * Not value issue interface.
1325
2175
  */
1326
- type RecordKey = EnumSchema<any, string | number | symbol> | PicklistSchema<any, string | number | symbol> | SpecialSchema<any, string | number | symbol> | StringSchema<string | number | symbol> | UnionSchema<any, string | number | symbol>;
2176
+ interface NotValueIssue<TInput extends ValueInput, TRequirement extends TInput> extends BaseIssue<TInput> {
2177
+ /**
2178
+ * The issue kind.
2179
+ */
2180
+ readonly kind: 'validation';
2181
+ /**
2182
+ * The issue type.
2183
+ */
2184
+ readonly type: 'not_value';
2185
+ /**
2186
+ * The expected property.
2187
+ */
2188
+ readonly expected: `!${string}`;
2189
+ /**
2190
+ * The not required value.
2191
+ */
2192
+ readonly requirement: TRequirement;
2193
+ }
1327
2194
  /**
1328
- * Record schema type.
2195
+ * Not value action interface.
1329
2196
  */
1330
- interface RecordSchema<TKey extends RecordKey, TValue extends BaseSchema, TOutput = RecordOutput<TKey, TValue>> extends BaseSchema<RecordInput<TKey, TValue>, TOutput> {
2197
+ interface NotValueAction<TInput extends ValueInput, TRequirement extends TInput, TMessage extends ErrorMessage<NotValueIssue<TInput, TRequirement>> | undefined> extends BaseValidation<TInput, TInput, NotValueIssue<TInput, TRequirement>> {
1331
2198
  /**
1332
- * The schema type.
2199
+ * The action type.
1333
2200
  */
1334
- type: 'record';
2201
+ readonly type: 'not_value';
1335
2202
  /**
1336
- * The record key schema.
2203
+ * The action reference.
1337
2204
  */
1338
- key: TKey;
2205
+ readonly reference: typeof notValue;
1339
2206
  /**
1340
- * The record value schema.
2207
+ * The expected property.
1341
2208
  */
1342
- value: TValue;
2209
+ readonly expects: `!${string}`;
1343
2210
  /**
1344
- * The error message.
2211
+ * The not required value.
1345
2212
  */
1346
- message: ErrorMessage | undefined;
2213
+ readonly requirement: TRequirement;
1347
2214
  /**
1348
- * The validation and transformation pipeline.
2215
+ * The error message.
1349
2216
  */
1350
- pipe: Pipe<RecordOutput<TKey, TValue>> | undefined;
2217
+ readonly message: TMessage;
1351
2218
  }
1352
-
1353
2219
  /**
1354
- * Set path item type.
2220
+ * Creates a not value validation action.
2221
+ *
2222
+ * @param requirement The not required value.
2223
+ *
2224
+ * @returns A not value action.
1355
2225
  */
1356
- interface SetPathItem {
1357
- type: 'set';
1358
- origin: 'value';
1359
- input: Set<unknown>;
1360
- key: number;
1361
- value: unknown;
1362
- }
1363
-
2226
+ declare function notValue<TInput extends ValueInput, const TRequirement extends TInput>(requirement: TRequirement): NotValueAction<TInput, TRequirement, undefined>;
1364
2227
  /**
1365
- * Tuple path item type.
2228
+ * Creates a not value validation action.
2229
+ *
2230
+ * @param requirement The not required value.
2231
+ * @param message The error message.
2232
+ *
2233
+ * @returns A not value action.
1366
2234
  */
1367
- interface TuplePathItem {
1368
- type: 'tuple';
1369
- origin: 'value';
1370
- input: [unknown, ...unknown[]];
1371
- key: number;
1372
- value: unknown;
1373
- }
2235
+ declare function notValue<TInput extends ValueInput, const TRequirement extends TInput, const TMessage extends ErrorMessage<NotValueIssue<TInput, TRequirement>> | undefined>(requirement: TRequirement, message: TMessage): NotValueAction<TInput, TRequirement, TMessage>;
1374
2236
 
1375
2237
  /**
1376
- * Unknown schema type.
2238
+ * Readonly output type.
2239
+ */
2240
+ type ReadonlyOutput<TInput> = TInput extends Map<infer TKey, infer TValue> ? ReadonlyMap<TKey, TValue> : TInput extends Set<infer TValue> ? ReadonlySet<TValue> : Readonly<TInput>;
2241
+ /**
2242
+ * Readonly action interface.
1377
2243
  */
1378
- interface UnknownSchema<TOutput = unknown> extends BaseSchema<unknown, TOutput> {
2244
+ interface ReadonlyAction<TInput> extends BaseTransformation<TInput, ReadonlyOutput<TInput>, never> {
1379
2245
  /**
1380
- * The schema type.
2246
+ * The action type.
1381
2247
  */
1382
- type: 'unknown';
2248
+ readonly type: 'readonly';
1383
2249
  /**
1384
- * The validation and transformation pipeline.
2250
+ * The action reference.
1385
2251
  */
1386
- pipe: Pipe<unknown> | undefined;
2252
+ readonly reference: typeof readonly;
1387
2253
  }
2254
+ /**
2255
+ * Creates a readonly transformation action.
2256
+ *
2257
+ * @returns A readonly action.
2258
+ */
2259
+ declare function readonly<TInput>(): ReadonlyAction<TInput>;
1388
2260
 
1389
2261
  type Platform = "win7" | "win8_1" | "win" | "mac10_9" | "mac10_11" | "mac" | "other";
1390
- declare const ZHTML5Fonts: UnionSchema<(LiteralSchema<"defont", "defont"> | LiteralSchema<"mincho", "mincho"> | LiteralSchema<"gothic", "gothic">)[], "defont" | "mincho" | "gothic">;
1391
- type HTML5Fonts = Output<typeof ZHTML5Fonts>;
2262
+ declare const ZHTML5Fonts: UnionSchema<[LiteralSchema<"gothic", undefined>, LiteralSchema<"mincho", undefined>, LiteralSchema<"defont", undefined>], undefined>;
2263
+ type HTML5Fonts = InferOutput<typeof ZHTML5Fonts>;
1392
2264
  type FontItem = {
1393
2265
  font: string;
1394
2266
  offset: number;
@@ -1399,478 +2271,253 @@ type PlatformFont = {
1399
2271
  };
1400
2272
 
1401
2273
  declare const ZFormattedComment: ObjectSchema<{
1402
- id: OptionalSchema<NumberSchema<number>, 0, number>;
1403
- vpos: OptionalSchema<NumberSchema<number>, 0, number>;
1404
- content: OptionalSchema<StringSchema<string>, "", string>;
1405
- date: OptionalSchema<NumberSchema<number>, 0, number>;
1406
- date_usec: OptionalSchema<NumberSchema<number>, 0, number>;
1407
- owner: OptionalSchema<BooleanSchema<boolean>, false, boolean>;
1408
- premium: OptionalSchema<BooleanSchema<boolean>, false, boolean>;
1409
- mail: OptionalSchema<ArraySchema<StringSchema<string>, string[]>, never[], string[]>;
1410
- user_id: OptionalSchema<NumberSchema<number>, 0, number>;
1411
- layer: OptionalSchema<NumberSchema<number>, -1, number>;
1412
- is_my_post: OptionalSchema<BooleanSchema<boolean>, false, boolean>;
1413
- }, undefined, {
1414
- owner: boolean;
1415
- content: string;
1416
- id: number;
1417
- vpos: number;
1418
- date: number;
1419
- date_usec: number;
1420
- premium: boolean;
1421
- mail: string[];
1422
- user_id: number;
1423
- layer: number;
1424
- is_my_post: boolean;
1425
- }>;
1426
- type FormattedComment = Output<typeof ZFormattedComment>;
1427
- declare const ZFormattedLegacyComment: ObjectSchema<Omit<{
1428
- id: OptionalSchema<NumberSchema<number>, 0, number>;
1429
- vpos: OptionalSchema<NumberSchema<number>, 0, number>;
1430
- content: OptionalSchema<StringSchema<string>, "", string>;
1431
- date: OptionalSchema<NumberSchema<number>, 0, number>;
1432
- date_usec: OptionalSchema<NumberSchema<number>, 0, number>;
1433
- owner: OptionalSchema<BooleanSchema<boolean>, false, boolean>;
1434
- premium: OptionalSchema<BooleanSchema<boolean>, false, boolean>;
1435
- mail: OptionalSchema<ArraySchema<StringSchema<string>, string[]>, never[], string[]>;
1436
- user_id: OptionalSchema<NumberSchema<number>, 0, number>;
1437
- layer: OptionalSchema<NumberSchema<number>, -1, number>;
1438
- is_my_post: OptionalSchema<BooleanSchema<boolean>, false, boolean>;
1439
- }, "user_id" | "layer" | "is_my_post">, undefined, {
1440
- owner: boolean;
1441
- content: string;
1442
- id: number;
1443
- vpos: number;
1444
- date: number;
1445
- date_usec: number;
1446
- premium: boolean;
1447
- mail: string[];
1448
- }>;
1449
- type FormattedLegacyComment = Output<typeof ZFormattedLegacyComment>;
1450
- type formattedComment = FormattedComment;
1451
- type formattedLegacyComment = FormattedLegacyComment;
1452
-
1453
- declare const ZApiChat: ObjectSchema<{
1454
- thread: OptionalSchema<StringSchema<string>, "", string>;
1455
- no: OptionalSchema<NumberSchema<number>, 0, number>;
1456
- vpos: NumberSchema<number>;
1457
- date: OptionalSchema<NumberSchema<number>, 0, number>;
1458
- date_usec: OptionalSchema<NumberSchema<number>, 0, number>;
1459
- nicoru: OptionalSchema<NumberSchema<number>, 0, number>;
1460
- premium: OptionalSchema<NumberSchema<number>, 0, number>;
1461
- anonymity: OptionalSchema<NumberSchema<number>, 0, number>;
1462
- user_id: OptionalSchema<StringSchema<string>, "", string>;
1463
- mail: OptionalSchema<StringSchema<string>, "", string>;
1464
- content: StringSchema<string>;
1465
- deleted: OptionalSchema<NumberSchema<number>, 0, number>;
1466
- }, undefined, {
1467
- content: string;
1468
- vpos: number;
1469
- date: number;
1470
- date_usec: number;
1471
- premium: number;
1472
- mail: string;
1473
- user_id: string;
1474
- thread: string;
1475
- no: number;
1476
- nicoru: number;
1477
- anonymity: number;
1478
- deleted: number;
1479
- }>;
1480
- type ApiChat = Output<typeof ZApiChat>;
1481
- declare const ZRawApiResponse: UnionSchema<(ObjectSchema<{
1482
- chat: ObjectSchema<{
1483
- thread: OptionalSchema<StringSchema<string>, "", string>;
1484
- no: OptionalSchema<NumberSchema<number>, 0, number>;
1485
- vpos: NumberSchema<number>;
1486
- date: OptionalSchema<NumberSchema<number>, 0, number>;
1487
- date_usec: OptionalSchema<NumberSchema<number>, 0, number>;
1488
- nicoru: OptionalSchema<NumberSchema<number>, 0, number>;
1489
- premium: OptionalSchema<NumberSchema<number>, 0, number>;
1490
- anonymity: OptionalSchema<NumberSchema<number>, 0, number>;
1491
- user_id: OptionalSchema<StringSchema<string>, "", string>;
1492
- mail: OptionalSchema<StringSchema<string>, "", string>;
1493
- content: StringSchema<string>;
1494
- deleted: OptionalSchema<NumberSchema<number>, 0, number>;
1495
- }, undefined, {
2274
+ readonly id: OptionalSchema<NumberSchema<undefined>, 0>;
2275
+ readonly vpos: OptionalSchema<NumberSchema<undefined>, 0>;
2276
+ readonly content: OptionalSchema<StringSchema<undefined>, "">;
2277
+ readonly date: OptionalSchema<NumberSchema<undefined>, 0>;
2278
+ readonly date_usec: OptionalSchema<NumberSchema<undefined>, 0>;
2279
+ readonly owner: OptionalSchema<BooleanSchema<undefined>, false>;
2280
+ readonly premium: OptionalSchema<BooleanSchema<undefined>, false>;
2281
+ readonly mail: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, readonly []>;
2282
+ readonly user_id: OptionalSchema<NumberSchema<undefined>, 0>;
2283
+ readonly layer: OptionalSchema<NumberSchema<undefined>, -1>;
2284
+ readonly is_my_post: OptionalSchema<BooleanSchema<undefined>, false>;
2285
+ }, undefined>;
2286
+ type FormattedComment = InferOutput<typeof ZFormattedComment>;
2287
+ declare const ZFormattedLegacyComment: Omit<ObjectSchema<{
2288
+ readonly id: OptionalSchema<NumberSchema<undefined>, 0>;
2289
+ readonly vpos: OptionalSchema<NumberSchema<undefined>, 0>;
2290
+ readonly content: OptionalSchema<StringSchema<undefined>, "">;
2291
+ readonly date: OptionalSchema<NumberSchema<undefined>, 0>;
2292
+ readonly date_usec: OptionalSchema<NumberSchema<undefined>, 0>;
2293
+ readonly owner: OptionalSchema<BooleanSchema<undefined>, false>;
2294
+ readonly premium: OptionalSchema<BooleanSchema<undefined>, false>;
2295
+ readonly mail: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, readonly []>;
2296
+ readonly user_id: OptionalSchema<NumberSchema<undefined>, 0>;
2297
+ readonly layer: OptionalSchema<NumberSchema<undefined>, -1>;
2298
+ readonly is_my_post: OptionalSchema<BooleanSchema<undefined>, false>;
2299
+ }, undefined>, "~types" | "~run" | "~standard" | "entries"> & {
2300
+ readonly entries: Omit<{
2301
+ readonly id: OptionalSchema<NumberSchema<undefined>, 0>;
2302
+ readonly vpos: OptionalSchema<NumberSchema<undefined>, 0>;
2303
+ readonly content: OptionalSchema<StringSchema<undefined>, "">;
2304
+ readonly date: OptionalSchema<NumberSchema<undefined>, 0>;
2305
+ readonly date_usec: OptionalSchema<NumberSchema<undefined>, 0>;
2306
+ readonly owner: OptionalSchema<BooleanSchema<undefined>, false>;
2307
+ readonly premium: OptionalSchema<BooleanSchema<undefined>, false>;
2308
+ readonly mail: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, readonly []>;
2309
+ readonly user_id: OptionalSchema<NumberSchema<undefined>, 0>;
2310
+ readonly layer: OptionalSchema<NumberSchema<undefined>, -1>;
2311
+ readonly is_my_post: OptionalSchema<BooleanSchema<undefined>, false>;
2312
+ }, "user_id" | "layer" | "is_my_post">;
2313
+ readonly '~standard': StandardProps<{
2314
+ owner?: boolean | undefined;
2315
+ content?: string | undefined;
2316
+ id?: number | undefined;
2317
+ vpos?: number | undefined;
2318
+ date?: number | undefined;
2319
+ date_usec?: number | undefined;
2320
+ premium?: boolean | undefined;
2321
+ mail?: string[] | undefined;
2322
+ }, {
2323
+ owner: boolean;
1496
2324
  content: string;
2325
+ id: number;
1497
2326
  vpos: number;
1498
2327
  date: number;
1499
2328
  date_usec: number;
1500
- premium: number;
1501
- mail: string;
1502
- user_id: string;
1503
- thread: string;
1504
- no: number;
1505
- nicoru: number;
1506
- anonymity: number;
1507
- deleted: number;
2329
+ premium: boolean;
2330
+ mail: string[];
1508
2331
  }>;
1509
- }, undefined, {
1510
- chat: {
2332
+ readonly '~run': (dataset: UnknownDataset, config: Config<BaseIssue<unknown>>) => OutputDataset<{
2333
+ owner: boolean;
1511
2334
  content: string;
2335
+ id: number;
1512
2336
  vpos: number;
1513
2337
  date: number;
1514
2338
  date_usec: number;
1515
- premium: number;
1516
- mail: string;
1517
- user_id: string;
1518
- thread: string;
1519
- no: number;
1520
- nicoru: number;
1521
- anonymity: number;
1522
- deleted: number;
1523
- };
1524
- }> | RecordSchema<StringSchema<string>, UnknownSchema<unknown>, {
1525
- [x: string]: unknown;
1526
- }>)[], {
1527
- chat: {
1528
- content: string;
1529
- vpos: number;
1530
- date: number;
1531
- date_usec: number;
1532
- premium: number;
1533
- mail: string;
1534
- user_id: string;
1535
- thread: string;
1536
- no: number;
1537
- nicoru: number;
1538
- anonymity: number;
1539
- deleted: number;
1540
- };
1541
- } | {
1542
- [x: string]: unknown;
1543
- }>;
1544
- type RawApiResponse = Output<typeof ZRawApiResponse>;
2339
+ premium: boolean;
2340
+ mail: string[];
2341
+ }, StringIssue | NumberIssue | BooleanIssue | ObjectIssue | ArrayIssue>;
2342
+ readonly '~types'?: {
2343
+ readonly input: {
2344
+ owner?: boolean | undefined;
2345
+ content?: string | undefined;
2346
+ id?: number | undefined;
2347
+ vpos?: number | undefined;
2348
+ date?: number | undefined;
2349
+ date_usec?: number | undefined;
2350
+ premium?: boolean | undefined;
2351
+ mail?: string[] | undefined;
2352
+ };
2353
+ readonly output: {
2354
+ owner: boolean;
2355
+ content: string;
2356
+ id: number;
2357
+ vpos: number;
2358
+ date: number;
2359
+ date_usec: number;
2360
+ premium: boolean;
2361
+ mail: string[];
2362
+ };
2363
+ readonly issue: StringIssue | NumberIssue | BooleanIssue | ObjectIssue | ArrayIssue;
2364
+ } | undefined;
2365
+ };
2366
+ type FormattedLegacyComment = InferOutput<typeof ZFormattedLegacyComment>;
2367
+ type formattedComment = FormattedComment;
2368
+ type formattedLegacyComment = FormattedLegacyComment;
2369
+
2370
+ declare const ZApiChat: ObjectSchema<{
2371
+ readonly thread: OptionalSchema<StringSchema<undefined>, "">;
2372
+ readonly no: OptionalSchema<NumberSchema<undefined>, 0>;
2373
+ readonly vpos: NumberSchema<undefined>;
2374
+ readonly date: OptionalSchema<NumberSchema<undefined>, 0>;
2375
+ readonly date_usec: OptionalSchema<NumberSchema<undefined>, 0>;
2376
+ readonly nicoru: OptionalSchema<NumberSchema<undefined>, 0>;
2377
+ readonly premium: OptionalSchema<NumberSchema<undefined>, 0>;
2378
+ readonly anonymity: OptionalSchema<NumberSchema<undefined>, 0>;
2379
+ readonly user_id: OptionalSchema<StringSchema<undefined>, "">;
2380
+ readonly mail: OptionalSchema<StringSchema<undefined>, "">;
2381
+ readonly content: StringSchema<undefined>;
2382
+ readonly deleted: OptionalSchema<NumberSchema<undefined>, 0>;
2383
+ }, undefined>;
2384
+ type ApiChat = InferOutput<typeof ZApiChat>;
2385
+ declare const ZRawApiResponse: UnionSchema<[ObjectSchema<{
2386
+ readonly chat: ObjectSchema<{
2387
+ readonly thread: OptionalSchema<StringSchema<undefined>, "">;
2388
+ readonly no: OptionalSchema<NumberSchema<undefined>, 0>;
2389
+ readonly vpos: NumberSchema<undefined>;
2390
+ readonly date: OptionalSchema<NumberSchema<undefined>, 0>;
2391
+ readonly date_usec: OptionalSchema<NumberSchema<undefined>, 0>;
2392
+ readonly nicoru: OptionalSchema<NumberSchema<undefined>, 0>;
2393
+ readonly premium: OptionalSchema<NumberSchema<undefined>, 0>;
2394
+ readonly anonymity: OptionalSchema<NumberSchema<undefined>, 0>;
2395
+ readonly user_id: OptionalSchema<StringSchema<undefined>, "">;
2396
+ readonly mail: OptionalSchema<StringSchema<undefined>, "">;
2397
+ readonly content: StringSchema<undefined>;
2398
+ readonly deleted: OptionalSchema<NumberSchema<undefined>, 0>;
2399
+ }, undefined>;
2400
+ }, undefined>, RecordSchema<SchemaWithPipe<readonly [StringSchema<undefined>, NotValueAction<string, "chat", undefined>]>, UnknownSchema, undefined>], undefined>;
2401
+ type RawApiResponse = InferOutput<typeof ZRawApiResponse>;
1545
2402
  declare const ZApiPing: ObjectSchema<{
1546
- content: StringSchema<string>;
1547
- }, undefined, {
1548
- content: string;
1549
- }>;
1550
- type ApiPing = Output<typeof ZApiPing>;
2403
+ readonly content: StringSchema<undefined>;
2404
+ }, undefined>;
2405
+ type ApiPing = InferOutput<typeof ZApiPing>;
1551
2406
  declare const ZApiThread: ObjectSchema<{
1552
- resultcode: NumberSchema<number>;
1553
- thread: StringSchema<string>;
1554
- server_time: NumberSchema<number>;
1555
- ticket: StringSchema<string>;
1556
- revision: NumberSchema<number>;
1557
- }, undefined, {
1558
- thread: string;
1559
- resultcode: number;
1560
- server_time: number;
1561
- ticket: string;
1562
- revision: number;
1563
- }>;
1564
- type ApiThread = Output<typeof ZApiThread>;
2407
+ readonly resultcode: NumberSchema<undefined>;
2408
+ readonly thread: StringSchema<undefined>;
2409
+ readonly server_time: NumberSchema<undefined>;
2410
+ readonly ticket: StringSchema<undefined>;
2411
+ readonly revision: NumberSchema<undefined>;
2412
+ }, undefined>;
2413
+ type ApiThread = InferOutput<typeof ZApiThread>;
1565
2414
  declare const ZApiLeaf: ObjectSchema<{
1566
- thread: StringSchema<string>;
1567
- count: NumberSchema<number>;
1568
- }, undefined, {
1569
- count: number;
1570
- thread: string;
1571
- }>;
1572
- type ApiLeaf = Output<typeof ZApiLeaf>;
2415
+ readonly thread: StringSchema<undefined>;
2416
+ readonly count: NumberSchema<undefined>;
2417
+ }, undefined>;
2418
+ type ApiLeaf = InferOutput<typeof ZApiLeaf>;
1573
2419
  declare const ZApiGlobalNumRes: ObjectSchema<{
1574
- thread: StringSchema<string>;
1575
- num_res: NumberSchema<number>;
1576
- }, undefined, {
1577
- thread: string;
1578
- num_res: number;
1579
- }>;
1580
- type ApiGlobalNumRes = Output<typeof ZApiGlobalNumRes>;
2420
+ readonly thread: StringSchema<undefined>;
2421
+ readonly num_res: NumberSchema<undefined>;
2422
+ }, undefined>;
2423
+ type ApiGlobalNumRes = InferOutput<typeof ZApiGlobalNumRes>;
1581
2424
  type rawApiResponse = RawApiResponse;
1582
2425
 
1583
2426
  declare const ZOwnerComment: ObjectSchema<{
1584
- time: StringSchema<string>;
1585
- command: StringSchema<string>;
1586
- comment: StringSchema<string>;
1587
- }, undefined, {
1588
- time: string;
1589
- command: string;
1590
- comment: string;
1591
- }>;
1592
- type OwnerComment = Output<typeof ZOwnerComment>;
2427
+ readonly time: StringSchema<undefined>;
2428
+ readonly command: StringSchema<undefined>;
2429
+ readonly comment: StringSchema<undefined>;
2430
+ }, undefined>;
2431
+ type OwnerComment = InferOutput<typeof ZOwnerComment>;
1593
2432
  type ownerComment = OwnerComment;
1594
2433
 
1595
2434
  declare const ZV1Comment: ObjectSchema<{
1596
- id: StringSchema<string>;
1597
- no: NumberSchema<number>;
1598
- vposMs: NumberSchema<number>;
1599
- body: StringSchema<string>;
1600
- commands: ArraySchema<StringSchema<string>, string[]>;
1601
- userId: StringSchema<string>;
1602
- isPremium: BooleanSchema<boolean>;
1603
- score: NumberSchema<number>;
1604
- postedAt: StringSchema<string>;
1605
- nicoruCount: NumberSchema<number>;
1606
- nicoruId: NullableSchema<StringSchema<string>, undefined, string | null>;
1607
- source: StringSchema<string>;
1608
- isMyPost: BooleanSchema<boolean>;
1609
- }, undefined, {
1610
- id: string;
1611
- no: number;
1612
- vposMs: number;
1613
- body: string;
1614
- commands: string[];
1615
- userId: string;
1616
- isPremium: boolean;
1617
- score: number;
1618
- postedAt: string;
1619
- nicoruCount: number;
1620
- nicoruId: string | null;
1621
- source: string;
1622
- isMyPost: boolean;
1623
- }>;
1624
- type V1Comment = Output<typeof ZV1Comment>;
2435
+ readonly id: StringSchema<undefined>;
2436
+ readonly no: NumberSchema<undefined>;
2437
+ readonly vposMs: NumberSchema<undefined>;
2438
+ readonly body: StringSchema<undefined>;
2439
+ readonly commands: ArraySchema<StringSchema<undefined>, undefined>;
2440
+ readonly userId: StringSchema<undefined>;
2441
+ readonly isPremium: BooleanSchema<undefined>;
2442
+ readonly score: NumberSchema<undefined>;
2443
+ readonly postedAt: StringSchema<undefined>;
2444
+ readonly nicoruCount: NumberSchema<undefined>;
2445
+ readonly nicoruId: NullableSchema<StringSchema<undefined>, undefined>;
2446
+ readonly source: StringSchema<undefined>;
2447
+ readonly isMyPost: BooleanSchema<undefined>;
2448
+ }, undefined>;
2449
+ type V1Comment = InferOutput<typeof ZV1Comment>;
1625
2450
  declare const ZV1Thread: ObjectSchema<{
1626
- id: UnknownSchema<unknown>;
1627
- fork: StringSchema<string>;
1628
- commentCount: OptionalSchema<NumberSchema<number>, 0, number>;
1629
- comments: ArraySchema<ObjectSchema<{
1630
- id: StringSchema<string>;
1631
- no: NumberSchema<number>;
1632
- vposMs: NumberSchema<number>;
1633
- body: StringSchema<string>;
1634
- commands: ArraySchema<StringSchema<string>, string[]>;
1635
- userId: StringSchema<string>;
1636
- isPremium: BooleanSchema<boolean>;
1637
- score: NumberSchema<number>;
1638
- postedAt: StringSchema<string>;
1639
- nicoruCount: NumberSchema<number>;
1640
- nicoruId: NullableSchema<StringSchema<string>, undefined, string | null>;
1641
- source: StringSchema<string>;
1642
- isMyPost: BooleanSchema<boolean>;
1643
- }, undefined, {
1644
- id: string;
1645
- no: number;
1646
- vposMs: number;
1647
- body: string;
1648
- commands: string[];
1649
- userId: string;
1650
- isPremium: boolean;
1651
- score: number;
1652
- postedAt: string;
1653
- nicoruCount: number;
1654
- nicoruId: string | null;
1655
- source: string;
1656
- isMyPost: boolean;
1657
- }>, {
1658
- id: string;
1659
- no: number;
1660
- vposMs: number;
1661
- body: string;
1662
- commands: string[];
1663
- userId: string;
1664
- isPremium: boolean;
1665
- score: number;
1666
- postedAt: string;
1667
- nicoruCount: number;
1668
- nicoruId: string | null;
1669
- source: string;
1670
- isMyPost: boolean;
1671
- }[]>;
1672
- }, undefined, {
1673
- id: unknown;
1674
- fork: string;
1675
- commentCount: number;
1676
- comments: {
1677
- id: string;
1678
- no: number;
1679
- vposMs: number;
1680
- body: string;
1681
- commands: string[];
1682
- userId: string;
1683
- isPremium: boolean;
1684
- score: number;
1685
- postedAt: string;
1686
- nicoruCount: number;
1687
- nicoruId: string | null;
1688
- source: string;
1689
- isMyPost: boolean;
1690
- }[];
1691
- }>;
1692
- type V1Thread = Output<typeof ZV1Thread>;
2451
+ readonly id: UnknownSchema;
2452
+ readonly fork: StringSchema<undefined>;
2453
+ readonly commentCount: OptionalSchema<NumberSchema<undefined>, 0>;
2454
+ readonly comments: ArraySchema<ObjectSchema<{
2455
+ readonly id: StringSchema<undefined>;
2456
+ readonly no: NumberSchema<undefined>;
2457
+ readonly vposMs: NumberSchema<undefined>;
2458
+ readonly body: StringSchema<undefined>;
2459
+ readonly commands: ArraySchema<StringSchema<undefined>, undefined>;
2460
+ readonly userId: StringSchema<undefined>;
2461
+ readonly isPremium: BooleanSchema<undefined>;
2462
+ readonly score: NumberSchema<undefined>;
2463
+ readonly postedAt: StringSchema<undefined>;
2464
+ readonly nicoruCount: NumberSchema<undefined>;
2465
+ readonly nicoruId: NullableSchema<StringSchema<undefined>, undefined>;
2466
+ readonly source: StringSchema<undefined>;
2467
+ readonly isMyPost: BooleanSchema<undefined>;
2468
+ }, undefined>, undefined>;
2469
+ }, undefined>;
2470
+ type V1Thread = InferOutput<typeof ZV1Thread>;
1693
2471
  type v1Thread = V1Thread;
1694
2472
 
1695
2473
  declare const ZXml2jsChatItem: ObjectSchema<{
1696
- _: StringSchema<string>;
1697
- $: ObjectSchema<{
1698
- no: OptionalSchema<StringSchema<string>, undefined, string | undefined>;
1699
- vpos: StringSchema<string>;
1700
- date: OptionalSchema<StringSchema<string>, "0", string>;
1701
- date_usec: OptionalSchema<StringSchema<string>, "0", string>;
1702
- user_id: OptionalSchema<StringSchema<string>, undefined, string | undefined>;
1703
- owner: OptionalSchema<StringSchema<string>, "", string>;
1704
- premium: OptionalSchema<StringSchema<string>, "", string>;
1705
- mail: OptionalSchema<StringSchema<string>, "", string>;
1706
- }, undefined, {
1707
- owner: string;
1708
- vpos: string;
1709
- date: string;
1710
- date_usec: string;
1711
- premium: string;
1712
- mail: string;
1713
- user_id?: string | undefined;
1714
- no?: string | undefined;
1715
- }>;
1716
- }, undefined, {
1717
- _: string;
1718
- $: {
1719
- owner: string;
1720
- vpos: string;
1721
- date: string;
1722
- date_usec: string;
1723
- premium: string;
1724
- mail: string;
1725
- user_id?: string | undefined;
1726
- no?: string | undefined;
1727
- };
1728
- }>;
1729
- type Xml2jsChatItem = Output<typeof ZXml2jsChatItem>;
2474
+ readonly _: StringSchema<undefined>;
2475
+ readonly $: ObjectSchema<{
2476
+ readonly no: OptionalSchema<StringSchema<undefined>, undefined>;
2477
+ readonly vpos: StringSchema<undefined>;
2478
+ readonly date: OptionalSchema<StringSchema<undefined>, "0">;
2479
+ readonly date_usec: OptionalSchema<StringSchema<undefined>, "0">;
2480
+ readonly user_id: OptionalSchema<StringSchema<undefined>, undefined>;
2481
+ readonly owner: OptionalSchema<StringSchema<undefined>, "">;
2482
+ readonly premium: OptionalSchema<StringSchema<undefined>, "">;
2483
+ readonly mail: OptionalSchema<StringSchema<undefined>, "">;
2484
+ }, undefined>;
2485
+ }, undefined>;
2486
+ type Xml2jsChatItem = InferOutput<typeof ZXml2jsChatItem>;
1730
2487
  declare const ZXml2jsChat: ObjectSchema<{
1731
- chat: ArraySchema<ObjectSchema<{
1732
- _: StringSchema<string>;
1733
- $: ObjectSchema<{
1734
- no: OptionalSchema<StringSchema<string>, undefined, string | undefined>;
1735
- vpos: StringSchema<string>;
1736
- date: OptionalSchema<StringSchema<string>, "0", string>;
1737
- date_usec: OptionalSchema<StringSchema<string>, "0", string>;
1738
- user_id: OptionalSchema<StringSchema<string>, undefined, string | undefined>;
1739
- owner: OptionalSchema<StringSchema<string>, "", string>;
1740
- premium: OptionalSchema<StringSchema<string>, "", string>;
1741
- mail: OptionalSchema<StringSchema<string>, "", string>;
1742
- }, undefined, {
1743
- owner: string;
1744
- vpos: string;
1745
- date: string;
1746
- date_usec: string;
1747
- premium: string;
1748
- mail: string;
1749
- user_id?: string | undefined;
1750
- no?: string | undefined;
1751
- }>;
1752
- }, undefined, {
1753
- _: string;
1754
- $: {
1755
- owner: string;
1756
- vpos: string;
1757
- date: string;
1758
- date_usec: string;
1759
- premium: string;
1760
- mail: string;
1761
- user_id?: string | undefined;
1762
- no?: string | undefined;
1763
- };
1764
- }>, {
1765
- _: string;
1766
- $: {
1767
- owner: string;
1768
- vpos: string;
1769
- date: string;
1770
- date_usec: string;
1771
- premium: string;
1772
- mail: string;
1773
- user_id?: string | undefined;
1774
- no?: string | undefined;
1775
- };
1776
- }[]>;
1777
- }, undefined, {
1778
- chat: {
1779
- _: string;
1780
- $: {
1781
- owner: string;
1782
- vpos: string;
1783
- date: string;
1784
- date_usec: string;
1785
- premium: string;
1786
- mail: string;
1787
- user_id?: string | undefined;
1788
- no?: string | undefined;
1789
- };
1790
- }[];
1791
- }>;
1792
- type Xml2jsChat = Output<typeof ZXml2jsChat>;
2488
+ readonly chat: ArraySchema<ObjectSchema<{
2489
+ readonly _: StringSchema<undefined>;
2490
+ readonly $: ObjectSchema<{
2491
+ readonly no: OptionalSchema<StringSchema<undefined>, undefined>;
2492
+ readonly vpos: StringSchema<undefined>;
2493
+ readonly date: OptionalSchema<StringSchema<undefined>, "0">;
2494
+ readonly date_usec: OptionalSchema<StringSchema<undefined>, "0">;
2495
+ readonly user_id: OptionalSchema<StringSchema<undefined>, undefined>;
2496
+ readonly owner: OptionalSchema<StringSchema<undefined>, "">;
2497
+ readonly premium: OptionalSchema<StringSchema<undefined>, "">;
2498
+ readonly mail: OptionalSchema<StringSchema<undefined>, "">;
2499
+ }, undefined>;
2500
+ }, undefined>, undefined>;
2501
+ }, undefined>;
2502
+ type Xml2jsChat = InferOutput<typeof ZXml2jsChat>;
1793
2503
  declare const ZXml2jsPacket: ObjectSchema<{
1794
- packet: ObjectSchema<{
1795
- chat: ArraySchema<ObjectSchema<{
1796
- _: StringSchema<string>;
1797
- $: ObjectSchema<{
1798
- no: OptionalSchema<StringSchema<string>, undefined, string | undefined>;
1799
- vpos: StringSchema<string>;
1800
- date: OptionalSchema<StringSchema<string>, "0", string>;
1801
- date_usec: OptionalSchema<StringSchema<string>, "0", string>;
1802
- user_id: OptionalSchema<StringSchema<string>, undefined, string | undefined>;
1803
- owner: OptionalSchema<StringSchema<string>, "", string>;
1804
- premium: OptionalSchema<StringSchema<string>, "", string>;
1805
- mail: OptionalSchema<StringSchema<string>, "", string>;
1806
- }, undefined, {
1807
- owner: string;
1808
- vpos: string;
1809
- date: string;
1810
- date_usec: string;
1811
- premium: string;
1812
- mail: string;
1813
- user_id?: string | undefined;
1814
- no?: string | undefined;
1815
- }>;
1816
- }, undefined, {
1817
- _: string;
1818
- $: {
1819
- owner: string;
1820
- vpos: string;
1821
- date: string;
1822
- date_usec: string;
1823
- premium: string;
1824
- mail: string;
1825
- user_id?: string | undefined;
1826
- no?: string | undefined;
1827
- };
1828
- }>, {
1829
- _: string;
1830
- $: {
1831
- owner: string;
1832
- vpos: string;
1833
- date: string;
1834
- date_usec: string;
1835
- premium: string;
1836
- mail: string;
1837
- user_id?: string | undefined;
1838
- no?: string | undefined;
1839
- };
1840
- }[]>;
1841
- }, undefined, {
1842
- chat: {
1843
- _: string;
1844
- $: {
1845
- owner: string;
1846
- vpos: string;
1847
- date: string;
1848
- date_usec: string;
1849
- premium: string;
1850
- mail: string;
1851
- user_id?: string | undefined;
1852
- no?: string | undefined;
1853
- };
1854
- }[];
1855
- }>;
1856
- }, undefined, {
1857
- packet: {
1858
- chat: {
1859
- _: string;
1860
- $: {
1861
- owner: string;
1862
- vpos: string;
1863
- date: string;
1864
- date_usec: string;
1865
- premium: string;
1866
- mail: string;
1867
- user_id?: string | undefined;
1868
- no?: string | undefined;
1869
- };
1870
- }[];
1871
- };
1872
- }>;
1873
- type Xml2jsPacket = Output<typeof ZXml2jsPacket>;
2504
+ readonly packet: ObjectSchema<{
2505
+ readonly chat: ArraySchema<ObjectSchema<{
2506
+ readonly _: StringSchema<undefined>;
2507
+ readonly $: ObjectSchema<{
2508
+ readonly no: OptionalSchema<StringSchema<undefined>, undefined>;
2509
+ readonly vpos: StringSchema<undefined>;
2510
+ readonly date: OptionalSchema<StringSchema<undefined>, "0">;
2511
+ readonly date_usec: OptionalSchema<StringSchema<undefined>, "0">;
2512
+ readonly user_id: OptionalSchema<StringSchema<undefined>, undefined>;
2513
+ readonly owner: OptionalSchema<StringSchema<undefined>, "">;
2514
+ readonly premium: OptionalSchema<StringSchema<undefined>, "">;
2515
+ readonly mail: OptionalSchema<StringSchema<undefined>, "">;
2516
+ }, undefined>;
2517
+ }, undefined>, undefined>;
2518
+ }, undefined>;
2519
+ }, undefined>;
2520
+ type Xml2jsPacket = InferOutput<typeof ZXml2jsPacket>;
1874
2521
 
1875
2522
  interface IComment {
1876
2523
  comment: FormattedCommentWithSize;
@@ -1911,12 +2558,12 @@ type IPluginList = {
1911
2558
  canvas: IRenderer;
1912
2559
  }[];
1913
2560
 
1914
- declare const ZInputFormatType: UnionSchema<(LiteralSchema<"XMLDocument", "XMLDocument"> | LiteralSchema<"niconicome", "niconicome"> | LiteralSchema<"xml2js", "xml2js"> | LiteralSchema<"formatted", "formatted"> | LiteralSchema<"legacy", "legacy"> | LiteralSchema<"legacyOwner", "legacyOwner"> | LiteralSchema<"owner", "owner"> | LiteralSchema<"v1", "v1"> | LiteralSchema<"empty", "empty"> | LiteralSchema<"default", "default">)[], "default" | "XMLDocument" | "niconicome" | "xml2js" | "formatted" | "legacy" | "legacyOwner" | "owner" | "v1" | "empty">;
1915
- type InputFormatType = Output<typeof ZInputFormatType>;
2561
+ declare const ZInputFormatType: UnionSchema<[LiteralSchema<"XMLDocument", undefined>, LiteralSchema<"niconicome", undefined>, LiteralSchema<"xml2js", undefined>, LiteralSchema<"formatted", undefined>, LiteralSchema<"legacy", undefined>, LiteralSchema<"legacyOwner", undefined>, LiteralSchema<"owner", undefined>, LiteralSchema<"v1", undefined>, LiteralSchema<"empty", undefined>, LiteralSchema<"default", undefined>], undefined>;
2562
+ type InputFormatType = InferOutput<typeof ZInputFormatType>;
1916
2563
  type InputFormat = XMLDocument | Xml2jsPacket | FormattedComment[] | FormattedLegacyComment[] | RawApiResponse[] | OwnerComment[] | V1Thread[] | string | undefined;
1917
2564
  type ModeType = "default" | "html5" | "flash";
1918
2565
  type BaseOptions = {
1919
- config: Config;
2566
+ config: Config$1;
1920
2567
  debug: boolean;
1921
2568
  enableLegacyPiP: boolean;
1922
2569
  format: InputFormatType;
@@ -1987,6 +2634,7 @@ type FormattedCommentWithFont = {
1987
2634
  strokeColor?: string;
1988
2635
  wakuColor?: string;
1989
2636
  fillColor?: string;
2637
+ opacity?: number;
1990
2638
  full: boolean;
1991
2639
  ender: boolean;
1992
2640
  _live: boolean;
@@ -2027,6 +2675,7 @@ type ParseCommandAndNicoScriptResult = {
2027
2675
  strokeColor?: string;
2028
2676
  wakuColor?: string;
2029
2677
  fillColor?: string;
2678
+ opacity?: number;
2030
2679
  font: CommentFont;
2031
2680
  full: boolean;
2032
2681
  ender: boolean;
@@ -2035,260 +2684,96 @@ type ParseCommandAndNicoScriptResult = {
2035
2684
  long: number;
2036
2685
  button?: ButtonParams;
2037
2686
  };
2038
- declare const ZCommentFont: UnionSchema<(LiteralSchema<"defont", "defont"> | LiteralSchema<"mincho", "mincho"> | LiteralSchema<"gothic", "gothic"> | LiteralSchema<"gulim", "gulim"> | LiteralSchema<"simsun", "simsun">)[], "defont" | "mincho" | "gothic" | "gulim" | "simsun">;
2039
- type CommentFont = Output<typeof ZCommentFont>;
2040
- declare const ZCommentHTML5Font: UnionSchema<(LiteralSchema<"defont", "defont"> | LiteralSchema<"mincho", "mincho"> | LiteralSchema<"gothic", "gothic">)[], "defont" | "mincho" | "gothic">;
2041
- type CommentHTML5Font = Output<typeof ZCommentHTML5Font>;
2042
- declare const ZCommentFlashFont: UnionSchema<(LiteralSchema<"defont", "defont"> | LiteralSchema<"gulim", "gulim"> | LiteralSchema<"simsun", "simsun">)[], "defont" | "gulim" | "simsun">;
2043
- type CommentFlashFont = Output<typeof ZCommentFlashFont>;
2687
+ declare const ZCommentFont: UnionSchema<[LiteralSchema<"defont", undefined>, LiteralSchema<"mincho", undefined>, LiteralSchema<"gothic", undefined>, LiteralSchema<"gulim", undefined>, LiteralSchema<"simsun", undefined>], undefined>;
2688
+ type CommentFont = InferOutput<typeof ZCommentFont>;
2689
+ declare const ZCommentHTML5Font: UnionSchema<[LiteralSchema<"defont", undefined>, LiteralSchema<"mincho", undefined>, LiteralSchema<"gothic", undefined>], undefined>;
2690
+ type CommentHTML5Font = InferOutput<typeof ZCommentHTML5Font>;
2691
+ declare const ZCommentFlashFont: UnionSchema<[LiteralSchema<"defont", undefined>, LiteralSchema<"gulim", undefined>, LiteralSchema<"simsun", undefined>], undefined>;
2692
+ type CommentFlashFont = InferOutput<typeof ZCommentFlashFont>;
2044
2693
  declare const ZCommentContentItemSpacer: ObjectSchema<{
2045
- type: LiteralSchema<"spacer", "spacer">;
2046
- char: StringSchema<string>;
2047
- charWidth: NumberSchema<number>;
2048
- isButton: OptionalSchema<BooleanSchema<boolean>, undefined, boolean | undefined>;
2049
- font: OptionalSchema<UnionSchema<(LiteralSchema<"defont", "defont"> | LiteralSchema<"gulim", "gulim"> | LiteralSchema<"simsun", "simsun">)[], "defont" | "gulim" | "simsun">, undefined, "defont" | "gulim" | "simsun" | undefined>;
2050
- count: NumberSchema<number>;
2051
- }, undefined, {
2052
- type: "spacer";
2053
- char: string;
2054
- charWidth: number;
2055
- count: number;
2056
- isButton?: boolean | undefined;
2057
- font?: "defont" | "gulim" | "simsun" | undefined;
2058
- }>;
2694
+ readonly type: LiteralSchema<"spacer", undefined>;
2695
+ readonly char: StringSchema<undefined>;
2696
+ readonly charWidth: NumberSchema<undefined>;
2697
+ readonly isButton: OptionalSchema<BooleanSchema<undefined>, undefined>;
2698
+ readonly font: OptionalSchema<UnionSchema<[LiteralSchema<"defont", undefined>, LiteralSchema<"gulim", undefined>, LiteralSchema<"simsun", undefined>], undefined>, undefined>;
2699
+ readonly count: NumberSchema<undefined>;
2700
+ }, undefined>;
2059
2701
  declare const ZCommentContentItemText: ObjectSchema<{
2060
- type: LiteralSchema<"text", "text">;
2061
- content: StringSchema<string>;
2062
- slicedContent: ArraySchema<StringSchema<string>, string[]>;
2063
- isButton: OptionalSchema<BooleanSchema<boolean>, undefined, boolean | undefined>;
2064
- font: OptionalSchema<UnionSchema<(LiteralSchema<"defont", "defont"> | LiteralSchema<"gulim", "gulim"> | LiteralSchema<"simsun", "simsun">)[], "defont" | "gulim" | "simsun">, undefined, "defont" | "gulim" | "simsun" | undefined>;
2065
- width: OptionalSchema<ArraySchema<NumberSchema<number>, number[]>, undefined, number[] | undefined>;
2066
- }, undefined, {
2067
- type: "text";
2068
- content: string;
2069
- slicedContent: string[];
2070
- isButton?: boolean | undefined;
2071
- font?: "defont" | "gulim" | "simsun" | undefined;
2072
- width?: number[] | undefined;
2073
- }>;
2074
- type CommentContentItemText = Output<typeof ZCommentContentItemText>;
2075
- declare const ZCommentContentItem: UnionSchema<(ObjectSchema<{
2076
- type: LiteralSchema<"spacer", "spacer">;
2077
- char: StringSchema<string>;
2078
- charWidth: NumberSchema<number>;
2079
- isButton: OptionalSchema<BooleanSchema<boolean>, undefined, boolean | undefined>;
2080
- font: OptionalSchema<UnionSchema<(LiteralSchema<"defont", "defont"> | LiteralSchema<"gulim", "gulim"> | LiteralSchema<"simsun", "simsun">)[], "defont" | "gulim" | "simsun">, undefined, "defont" | "gulim" | "simsun" | undefined>;
2081
- count: NumberSchema<number>;
2082
- }, undefined, {
2083
- type: "spacer";
2084
- char: string;
2085
- charWidth: number;
2086
- count: number;
2087
- isButton?: boolean | undefined;
2088
- font?: "defont" | "gulim" | "simsun" | undefined;
2089
- }> | ObjectSchema<{
2090
- type: LiteralSchema<"text", "text">;
2091
- content: StringSchema<string>;
2092
- slicedContent: ArraySchema<StringSchema<string>, string[]>;
2093
- isButton: OptionalSchema<BooleanSchema<boolean>, undefined, boolean | undefined>;
2094
- font: OptionalSchema<UnionSchema<(LiteralSchema<"defont", "defont"> | LiteralSchema<"gulim", "gulim"> | LiteralSchema<"simsun", "simsun">)[], "defont" | "gulim" | "simsun">, undefined, "defont" | "gulim" | "simsun" | undefined>;
2095
- width: OptionalSchema<ArraySchema<NumberSchema<number>, number[]>, undefined, number[] | undefined>;
2096
- }, undefined, {
2097
- type: "text";
2098
- content: string;
2099
- slicedContent: string[];
2100
- isButton?: boolean | undefined;
2101
- font?: "defont" | "gulim" | "simsun" | undefined;
2102
- width?: number[] | undefined;
2103
- }>)[], {
2104
- type: "spacer";
2105
- char: string;
2106
- charWidth: number;
2107
- count: number;
2108
- isButton?: boolean | undefined;
2109
- font?: "defont" | "gulim" | "simsun" | undefined;
2110
- } | {
2111
- type: "text";
2112
- content: string;
2113
- slicedContent: string[];
2114
- isButton?: boolean | undefined;
2115
- font?: "defont" | "gulim" | "simsun" | undefined;
2116
- width?: number[] | undefined;
2117
- }>;
2118
- type CommentContentItem = Output<typeof ZCommentContentItem>;
2119
- declare const ZCommentMeasuredContentItemText: IntersectSchema<[UnionSchema<(ObjectSchema<{
2120
- type: LiteralSchema<"spacer", "spacer">;
2121
- char: StringSchema<string>;
2122
- charWidth: NumberSchema<number>;
2123
- isButton: OptionalSchema<BooleanSchema<boolean>, undefined, boolean | undefined>;
2124
- font: OptionalSchema<UnionSchema<(LiteralSchema<"defont", "defont"> | LiteralSchema<"gulim", "gulim"> | LiteralSchema<"simsun", "simsun">)[], "defont" | "gulim" | "simsun">, undefined, "defont" | "gulim" | "simsun" | undefined>;
2125
- count: NumberSchema<number>;
2126
- }, undefined, {
2127
- type: "spacer";
2128
- char: string;
2129
- charWidth: number;
2130
- count: number;
2131
- isButton?: boolean | undefined;
2132
- font?: "defont" | "gulim" | "simsun" | undefined;
2133
- }> | ObjectSchema<{
2134
- type: LiteralSchema<"text", "text">;
2135
- content: StringSchema<string>;
2136
- slicedContent: ArraySchema<StringSchema<string>, string[]>;
2137
- isButton: OptionalSchema<BooleanSchema<boolean>, undefined, boolean | undefined>;
2138
- font: OptionalSchema<UnionSchema<(LiteralSchema<"defont", "defont"> | LiteralSchema<"gulim", "gulim"> | LiteralSchema<"simsun", "simsun">)[], "defont" | "gulim" | "simsun">, undefined, "defont" | "gulim" | "simsun" | undefined>;
2139
- width: OptionalSchema<ArraySchema<NumberSchema<number>, number[]>, undefined, number[] | undefined>;
2140
- }, undefined, {
2141
- type: "text";
2142
- content: string;
2143
- slicedContent: string[];
2144
- isButton?: boolean | undefined;
2145
- font?: "defont" | "gulim" | "simsun" | undefined;
2146
- width?: number[] | undefined;
2147
- }>)[], {
2148
- type: "spacer";
2149
- char: string;
2150
- charWidth: number;
2151
- count: number;
2152
- isButton?: boolean | undefined;
2153
- font?: "defont" | "gulim" | "simsun" | undefined;
2154
- } | {
2155
- type: "text";
2156
- content: string;
2157
- slicedContent: string[];
2158
- isButton?: boolean | undefined;
2159
- font?: "defont" | "gulim" | "simsun" | undefined;
2160
- width?: number[] | undefined;
2161
- }>, ObjectSchema<{
2162
- width: ArraySchema<NumberSchema<number>, number[]>;
2163
- }, undefined, {
2164
- width: number[];
2165
- }>], ({
2166
- type: "spacer";
2167
- char: string;
2168
- charWidth: number;
2169
- count: number;
2170
- isButton?: boolean | undefined;
2171
- font?: "defont" | "gulim" | "simsun" | undefined;
2172
- } | {
2173
- type: "text";
2174
- content: string;
2175
- slicedContent: string[];
2176
- isButton?: boolean | undefined;
2177
- font?: "defont" | "gulim" | "simsun" | undefined;
2178
- width?: number[] | undefined;
2179
- }) & {
2180
- width: number[];
2181
- }>;
2182
- declare const ZCommentMeasuredContentItem: UnionSchema<(ObjectSchema<{
2183
- type: LiteralSchema<"spacer", "spacer">;
2184
- char: StringSchema<string>;
2185
- charWidth: NumberSchema<number>;
2186
- isButton: OptionalSchema<BooleanSchema<boolean>, undefined, boolean | undefined>;
2187
- font: OptionalSchema<UnionSchema<(LiteralSchema<"defont", "defont"> | LiteralSchema<"gulim", "gulim"> | LiteralSchema<"simsun", "simsun">)[], "defont" | "gulim" | "simsun">, undefined, "defont" | "gulim" | "simsun" | undefined>;
2188
- count: NumberSchema<number>;
2189
- }, undefined, {
2190
- type: "spacer";
2191
- char: string;
2192
- charWidth: number;
2193
- count: number;
2194
- isButton?: boolean | undefined;
2195
- font?: "defont" | "gulim" | "simsun" | undefined;
2196
- }> | IntersectSchema<[UnionSchema<(ObjectSchema<{
2197
- type: LiteralSchema<"spacer", "spacer">;
2198
- char: StringSchema<string>;
2199
- charWidth: NumberSchema<number>;
2200
- isButton: OptionalSchema<BooleanSchema<boolean>, undefined, boolean | undefined>;
2201
- font: OptionalSchema<UnionSchema<(LiteralSchema<"defont", "defont"> | LiteralSchema<"gulim", "gulim"> | LiteralSchema<"simsun", "simsun">)[], "defont" | "gulim" | "simsun">, undefined, "defont" | "gulim" | "simsun" | undefined>;
2202
- count: NumberSchema<number>;
2203
- }, undefined, {
2204
- type: "spacer";
2205
- char: string;
2206
- charWidth: number;
2207
- count: number;
2208
- isButton?: boolean | undefined;
2209
- font?: "defont" | "gulim" | "simsun" | undefined;
2210
- }> | ObjectSchema<{
2211
- type: LiteralSchema<"text", "text">;
2212
- content: StringSchema<string>;
2213
- slicedContent: ArraySchema<StringSchema<string>, string[]>;
2214
- isButton: OptionalSchema<BooleanSchema<boolean>, undefined, boolean | undefined>;
2215
- font: OptionalSchema<UnionSchema<(LiteralSchema<"defont", "defont"> | LiteralSchema<"gulim", "gulim"> | LiteralSchema<"simsun", "simsun">)[], "defont" | "gulim" | "simsun">, undefined, "defont" | "gulim" | "simsun" | undefined>;
2216
- width: OptionalSchema<ArraySchema<NumberSchema<number>, number[]>, undefined, number[] | undefined>;
2217
- }, undefined, {
2218
- type: "text";
2219
- content: string;
2220
- slicedContent: string[];
2221
- isButton?: boolean | undefined;
2222
- font?: "defont" | "gulim" | "simsun" | undefined;
2223
- width?: number[] | undefined;
2224
- }>)[], {
2225
- type: "spacer";
2226
- char: string;
2227
- charWidth: number;
2228
- count: number;
2229
- isButton?: boolean | undefined;
2230
- font?: "defont" | "gulim" | "simsun" | undefined;
2231
- } | {
2232
- type: "text";
2233
- content: string;
2234
- slicedContent: string[];
2235
- isButton?: boolean | undefined;
2236
- font?: "defont" | "gulim" | "simsun" | undefined;
2237
- width?: number[] | undefined;
2238
- }>, ObjectSchema<{
2239
- width: ArraySchema<NumberSchema<number>, number[]>;
2240
- }, undefined, {
2241
- width: number[];
2242
- }>], ({
2243
- type: "spacer";
2244
- char: string;
2245
- charWidth: number;
2246
- count: number;
2247
- isButton?: boolean | undefined;
2248
- font?: "defont" | "gulim" | "simsun" | undefined;
2249
- } | {
2250
- type: "text";
2251
- content: string;
2252
- slicedContent: string[];
2253
- isButton?: boolean | undefined;
2254
- font?: "defont" | "gulim" | "simsun" | undefined;
2255
- width?: number[] | undefined;
2256
- }) & {
2257
- width: number[];
2258
- }>)[], {
2259
- type: "spacer";
2260
- char: string;
2261
- charWidth: number;
2262
- count: number;
2263
- isButton?: boolean | undefined;
2264
- font?: "defont" | "gulim" | "simsun" | undefined;
2265
- } | (({
2266
- type: "spacer";
2267
- char: string;
2268
- charWidth: number;
2269
- count: number;
2270
- isButton?: boolean | undefined;
2271
- font?: "defont" | "gulim" | "simsun" | undefined;
2272
- } | {
2273
- type: "text";
2274
- content: string;
2275
- slicedContent: string[];
2276
- isButton?: boolean | undefined;
2277
- font?: "defont" | "gulim" | "simsun" | undefined;
2278
- width?: number[] | undefined;
2279
- }) & {
2280
- width: number[];
2281
- })>;
2282
- type CommentMeasuredContentItem = Output<typeof ZCommentMeasuredContentItem>;
2702
+ readonly type: LiteralSchema<"text", undefined>;
2703
+ readonly content: StringSchema<undefined>;
2704
+ readonly slicedContent: ArraySchema<StringSchema<undefined>, undefined>;
2705
+ readonly isButton: OptionalSchema<BooleanSchema<undefined>, undefined>;
2706
+ readonly font: OptionalSchema<UnionSchema<[LiteralSchema<"defont", undefined>, LiteralSchema<"gulim", undefined>, LiteralSchema<"simsun", undefined>], undefined>, undefined>;
2707
+ readonly width: OptionalSchema<ArraySchema<NumberSchema<undefined>, undefined>, undefined>;
2708
+ }, undefined>;
2709
+ type CommentContentItemText = InferOutput<typeof ZCommentContentItemText>;
2710
+ declare const ZCommentContentItem: UnionSchema<[ObjectSchema<{
2711
+ readonly type: LiteralSchema<"spacer", undefined>;
2712
+ readonly char: StringSchema<undefined>;
2713
+ readonly charWidth: NumberSchema<undefined>;
2714
+ readonly isButton: OptionalSchema<BooleanSchema<undefined>, undefined>;
2715
+ readonly font: OptionalSchema<UnionSchema<[LiteralSchema<"defont", undefined>, LiteralSchema<"gulim", undefined>, LiteralSchema<"simsun", undefined>], undefined>, undefined>;
2716
+ readonly count: NumberSchema<undefined>;
2717
+ }, undefined>, ObjectSchema<{
2718
+ readonly type: LiteralSchema<"text", undefined>;
2719
+ readonly content: StringSchema<undefined>;
2720
+ readonly slicedContent: ArraySchema<StringSchema<undefined>, undefined>;
2721
+ readonly isButton: OptionalSchema<BooleanSchema<undefined>, undefined>;
2722
+ readonly font: OptionalSchema<UnionSchema<[LiteralSchema<"defont", undefined>, LiteralSchema<"gulim", undefined>, LiteralSchema<"simsun", undefined>], undefined>, undefined>;
2723
+ readonly width: OptionalSchema<ArraySchema<NumberSchema<undefined>, undefined>, undefined>;
2724
+ }, undefined>], undefined>;
2725
+ type CommentContentItem = InferOutput<typeof ZCommentContentItem>;
2726
+ declare const ZCommentMeasuredContentItemText: IntersectSchema<[UnionSchema<[ObjectSchema<{
2727
+ readonly type: LiteralSchema<"spacer", undefined>;
2728
+ readonly char: StringSchema<undefined>;
2729
+ readonly charWidth: NumberSchema<undefined>;
2730
+ readonly isButton: OptionalSchema<BooleanSchema<undefined>, undefined>;
2731
+ readonly font: OptionalSchema<UnionSchema<[LiteralSchema<"defont", undefined>, LiteralSchema<"gulim", undefined>, LiteralSchema<"simsun", undefined>], undefined>, undefined>;
2732
+ readonly count: NumberSchema<undefined>;
2733
+ }, undefined>, ObjectSchema<{
2734
+ readonly type: LiteralSchema<"text", undefined>;
2735
+ readonly content: StringSchema<undefined>;
2736
+ readonly slicedContent: ArraySchema<StringSchema<undefined>, undefined>;
2737
+ readonly isButton: OptionalSchema<BooleanSchema<undefined>, undefined>;
2738
+ readonly font: OptionalSchema<UnionSchema<[LiteralSchema<"defont", undefined>, LiteralSchema<"gulim", undefined>, LiteralSchema<"simsun", undefined>], undefined>, undefined>;
2739
+ readonly width: OptionalSchema<ArraySchema<NumberSchema<undefined>, undefined>, undefined>;
2740
+ }, undefined>], undefined>, ObjectSchema<{
2741
+ readonly width: ArraySchema<NumberSchema<undefined>, undefined>;
2742
+ }, undefined>], undefined>;
2743
+ declare const ZCommentMeasuredContentItem: UnionSchema<[IntersectSchema<[UnionSchema<[ObjectSchema<{
2744
+ readonly type: LiteralSchema<"spacer", undefined>;
2745
+ readonly char: StringSchema<undefined>;
2746
+ readonly charWidth: NumberSchema<undefined>;
2747
+ readonly isButton: OptionalSchema<BooleanSchema<undefined>, undefined>;
2748
+ readonly font: OptionalSchema<UnionSchema<[LiteralSchema<"defont", undefined>, LiteralSchema<"gulim", undefined>, LiteralSchema<"simsun", undefined>], undefined>, undefined>;
2749
+ readonly count: NumberSchema<undefined>;
2750
+ }, undefined>, ObjectSchema<{
2751
+ readonly type: LiteralSchema<"text", undefined>;
2752
+ readonly content: StringSchema<undefined>;
2753
+ readonly slicedContent: ArraySchema<StringSchema<undefined>, undefined>;
2754
+ readonly isButton: OptionalSchema<BooleanSchema<undefined>, undefined>;
2755
+ readonly font: OptionalSchema<UnionSchema<[LiteralSchema<"defont", undefined>, LiteralSchema<"gulim", undefined>, LiteralSchema<"simsun", undefined>], undefined>, undefined>;
2756
+ readonly width: OptionalSchema<ArraySchema<NumberSchema<undefined>, undefined>, undefined>;
2757
+ }, undefined>], undefined>, ObjectSchema<{
2758
+ readonly width: ArraySchema<NumberSchema<undefined>, undefined>;
2759
+ }, undefined>], undefined>, ObjectSchema<{
2760
+ readonly type: LiteralSchema<"spacer", undefined>;
2761
+ readonly char: StringSchema<undefined>;
2762
+ readonly charWidth: NumberSchema<undefined>;
2763
+ readonly isButton: OptionalSchema<BooleanSchema<undefined>, undefined>;
2764
+ readonly font: OptionalSchema<UnionSchema<[LiteralSchema<"defont", undefined>, LiteralSchema<"gulim", undefined>, LiteralSchema<"simsun", undefined>], undefined>, undefined>;
2765
+ readonly count: NumberSchema<undefined>;
2766
+ }, undefined>], undefined>;
2767
+ type CommentMeasuredContentItem = InferOutput<typeof ZCommentMeasuredContentItem>;
2283
2768
  type CommentFlashFontParsed = "gothic" | "gulim" | "simsunStrong" | "simsunWeak";
2284
2769
  type CommentContentIndex = {
2285
2770
  index: number;
2286
2771
  font: CommentFlashFontParsed;
2287
2772
  };
2288
- declare const ZCommentSize: UnionSchema<(LiteralSchema<"big", "big"> | LiteralSchema<"medium", "medium"> | LiteralSchema<"small", "small">)[], "big" | "medium" | "small">;
2289
- type CommentSize = Output<typeof ZCommentSize>;
2290
- declare const ZCommentLoc: UnionSchema<(LiteralSchema<"ue", "ue"> | LiteralSchema<"naka", "naka"> | LiteralSchema<"shita", "shita">)[], "ue" | "naka" | "shita">;
2291
- type CommentLoc = Output<typeof ZCommentLoc>;
2773
+ declare const ZCommentSize: UnionSchema<[LiteralSchema<"big", undefined>, LiteralSchema<"medium", undefined>, LiteralSchema<"small", undefined>], undefined>;
2774
+ type CommentSize = InferOutput<typeof ZCommentSize>;
2775
+ declare const ZCommentLoc: UnionSchema<[LiteralSchema<"ue", undefined>, LiteralSchema<"naka", undefined>, LiteralSchema<"shita", undefined>], undefined>;
2776
+ type CommentLoc = InferOutput<typeof ZCommentLoc>;
2292
2777
  type Collision = {
2293
2778
  [key in CollisionPos]: CollisionItem;
2294
2779
  };
@@ -2322,8 +2807,8 @@ type NicoScriptReverse = {
2322
2807
  start: number;
2323
2808
  end: number;
2324
2809
  };
2325
- declare const ZNicoScriptReverseTarget: UnionSchema<(LiteralSchema<"コメ", "コメ"> | LiteralSchema<"投コメ", "投コメ"> | LiteralSchema<"全", "全">)[], "コメ" | "投コメ" | "全">;
2326
- type NicoScriptReverseTarget = Output<typeof ZNicoScriptReverseTarget>;
2810
+ declare const ZNicoScriptReverseTarget: UnionSchema<[LiteralSchema<"コメ", undefined>, LiteralSchema<"投コメ", undefined>, LiteralSchema<"全", undefined>], undefined>;
2811
+ type NicoScriptReverseTarget = InferOutput<typeof ZNicoScriptReverseTarget>;
2327
2812
  type NicoScriptReplace = {
2328
2813
  start: number;
2329
2814
  long: number | undefined;
@@ -2338,12 +2823,12 @@ type NicoScriptReplace = {
2338
2823
  loc: CommentLoc | undefined;
2339
2824
  no: number;
2340
2825
  };
2341
- declare const ZNicoScriptReplaceRange: UnionSchema<(LiteralSchema<"", "全"> | LiteralSchema<"", "単">)[], "全" | "単">;
2342
- type NicoScriptReplaceRange = Output<typeof ZNicoScriptReplaceRange>;
2343
- declare const ZNicoScriptReplaceTarget: UnionSchema<(LiteralSchema<"コメ", "コメ"> | LiteralSchema<"投コメ", "投コメ"> | LiteralSchema<"全", "全"> | LiteralSchema<"含まない", "含まない"> | LiteralSchema<"含む", "含む">)[], "コメ" | "投コメ" | "全" | "含まない" | "含む">;
2344
- type NicoScriptReplaceTarget = Output<typeof ZNicoScriptReplaceTarget>;
2345
- declare const ZNicoScriptReplaceCondition: UnionSchema<(LiteralSchema<"部分一致", "部分一致"> | LiteralSchema<"完全一致", "完全一致">)[], "部分一致" | "完全一致">;
2346
- type NicoScriptReplaceCondition = Output<typeof ZNicoScriptReplaceCondition>;
2826
+ declare const ZNicoScriptReplaceRange: UnionSchema<[LiteralSchema<"", undefined>, LiteralSchema<"", undefined>], undefined>;
2827
+ type NicoScriptReplaceRange = InferOutput<typeof ZNicoScriptReplaceRange>;
2828
+ declare const ZNicoScriptReplaceTarget: UnionSchema<[LiteralSchema<"コメ", undefined>, LiteralSchema<"投コメ", undefined>, LiteralSchema<"全", undefined>, LiteralSchema<"含まない", undefined>, LiteralSchema<"含む", undefined>], undefined>;
2829
+ type NicoScriptReplaceTarget = InferOutput<typeof ZNicoScriptReplaceTarget>;
2830
+ declare const ZNicoScriptReplaceCondition: UnionSchema<[LiteralSchema<"部分一致", undefined>, LiteralSchema<"完全一致", undefined>], undefined>;
2831
+ type NicoScriptReplaceCondition = InferOutput<typeof ZNicoScriptReplaceCondition>;
2347
2832
  type NicoScriptBan = {
2348
2833
  start: number;
2349
2834
  end: number;
@@ -2390,6 +2875,7 @@ type ParsedCommand = {
2390
2875
  strokeColor?: string;
2391
2876
  wakuColor?: string;
2392
2877
  fillColor?: string;
2878
+ opacity?: number;
2393
2879
  font: CommentFont | undefined;
2394
2880
  full: boolean;
2395
2881
  ender: boolean;
@@ -2407,89 +2893,27 @@ type MeasureTextInput = FormattedCommentWithFont & {
2407
2893
  scale: number;
2408
2894
  };
2409
2895
  declare const ZMeasureInput: ObjectSchema<{
2410
- font: UnionSchema<(LiteralSchema<"defont", "defont"> | LiteralSchema<"mincho", "mincho"> | LiteralSchema<"gothic", "gothic"> | LiteralSchema<"gulim", "gulim"> | LiteralSchema<"simsun", "simsun">)[], "defont" | "mincho" | "gothic" | "gulim" | "simsun">;
2411
- content: ArraySchema<UnionSchema<(ObjectSchema<{
2412
- type: LiteralSchema<"spacer", "spacer">;
2413
- char: StringSchema<string>;
2414
- charWidth: NumberSchema<number>;
2415
- isButton: OptionalSchema<BooleanSchema<boolean>, undefined, boolean | undefined>;
2416
- font: OptionalSchema<UnionSchema<(LiteralSchema<"defont", "defont"> | LiteralSchema<"gulim", "gulim"> | LiteralSchema<"simsun", "simsun">)[], "defont" | "gulim" | "simsun">, undefined, "defont" | "gulim" | "simsun" | undefined>;
2417
- count: NumberSchema<number>;
2418
- }, undefined, {
2419
- type: "spacer";
2420
- char: string;
2421
- charWidth: number;
2422
- count: number;
2423
- isButton?: boolean | undefined;
2424
- font?: "defont" | "gulim" | "simsun" | undefined;
2425
- }> | ObjectSchema<{
2426
- type: LiteralSchema<"text", "text">;
2427
- content: StringSchema<string>;
2428
- slicedContent: ArraySchema<StringSchema<string>, string[]>;
2429
- isButton: OptionalSchema<BooleanSchema<boolean>, undefined, boolean | undefined>;
2430
- font: OptionalSchema<UnionSchema<(LiteralSchema<"defont", "defont"> | LiteralSchema<"gulim", "gulim"> | LiteralSchema<"simsun", "simsun">)[], "defont" | "gulim" | "simsun">, undefined, "defont" | "gulim" | "simsun" | undefined>;
2431
- width: OptionalSchema<ArraySchema<NumberSchema<number>, number[]>, undefined, number[] | undefined>;
2432
- }, undefined, {
2433
- type: "text";
2434
- content: string;
2435
- slicedContent: string[];
2436
- isButton?: boolean | undefined;
2437
- font?: "defont" | "gulim" | "simsun" | undefined;
2438
- width?: number[] | undefined;
2439
- }>)[], {
2440
- type: "spacer";
2441
- char: string;
2442
- charWidth: number;
2443
- count: number;
2444
- isButton?: boolean | undefined;
2445
- font?: "defont" | "gulim" | "simsun" | undefined;
2446
- } | {
2447
- type: "text";
2448
- content: string;
2449
- slicedContent: string[];
2450
- isButton?: boolean | undefined;
2451
- font?: "defont" | "gulim" | "simsun" | undefined;
2452
- width?: number[] | undefined;
2453
- }>, ({
2454
- type: "spacer";
2455
- char: string;
2456
- charWidth: number;
2457
- count: number;
2458
- isButton?: boolean | undefined;
2459
- font?: "defont" | "gulim" | "simsun" | undefined;
2460
- } | {
2461
- type: "text";
2462
- content: string;
2463
- slicedContent: string[];
2464
- isButton?: boolean | undefined;
2465
- font?: "defont" | "gulim" | "simsun" | undefined;
2466
- width?: number[] | undefined;
2467
- })[]>;
2468
- lineHeight: NumberSchema<number>;
2469
- charSize: NumberSchema<number>;
2470
- lineCount: NumberSchema<number>;
2471
- }, undefined, {
2472
- lineHeight: number;
2473
- font: "defont" | "mincho" | "gothic" | "gulim" | "simsun";
2474
- content: ({
2475
- type: "spacer";
2476
- char: string;
2477
- charWidth: number;
2478
- count: number;
2479
- isButton?: boolean | undefined;
2480
- font?: "defont" | "gulim" | "simsun" | undefined;
2481
- } | {
2482
- type: "text";
2483
- content: string;
2484
- slicedContent: string[];
2485
- isButton?: boolean | undefined;
2486
- font?: "defont" | "gulim" | "simsun" | undefined;
2487
- width?: number[] | undefined;
2488
- })[];
2489
- charSize: number;
2490
- lineCount: number;
2491
- }>;
2492
- type MeasureInput = Output<typeof ZMeasureInput>;
2896
+ readonly font: UnionSchema<[LiteralSchema<"defont", undefined>, LiteralSchema<"mincho", undefined>, LiteralSchema<"gothic", undefined>, LiteralSchema<"gulim", undefined>, LiteralSchema<"simsun", undefined>], undefined>;
2897
+ readonly content: ArraySchema<UnionSchema<[ObjectSchema<{
2898
+ readonly type: LiteralSchema<"spacer", undefined>;
2899
+ readonly char: StringSchema<undefined>;
2900
+ readonly charWidth: NumberSchema<undefined>;
2901
+ readonly isButton: OptionalSchema<BooleanSchema<undefined>, undefined>;
2902
+ readonly font: OptionalSchema<UnionSchema<[LiteralSchema<"defont", undefined>, LiteralSchema<"gulim", undefined>, LiteralSchema<"simsun", undefined>], undefined>, undefined>;
2903
+ readonly count: NumberSchema<undefined>;
2904
+ }, undefined>, ObjectSchema<{
2905
+ readonly type: LiteralSchema<"text", undefined>;
2906
+ readonly content: StringSchema<undefined>;
2907
+ readonly slicedContent: ArraySchema<StringSchema<undefined>, undefined>;
2908
+ readonly isButton: OptionalSchema<BooleanSchema<undefined>, undefined>;
2909
+ readonly font: OptionalSchema<UnionSchema<[LiteralSchema<"defont", undefined>, LiteralSchema<"gulim", undefined>, LiteralSchema<"simsun", undefined>], undefined>, undefined>;
2910
+ readonly width: OptionalSchema<ArraySchema<NumberSchema<undefined>, undefined>, undefined>;
2911
+ }, undefined>], undefined>, undefined>;
2912
+ readonly lineHeight: NumberSchema<undefined>;
2913
+ readonly charSize: NumberSchema<undefined>;
2914
+ readonly lineCount: NumberSchema<undefined>;
2915
+ }, undefined>;
2916
+ type MeasureInput = InferOutput<typeof ZMeasureInput>;
2493
2917
  type ValueOf<T> = T[keyof T];
2494
2918
 
2495
2919
  declare let imageCache: {
@@ -2513,7 +2937,14 @@ declare const index_d$3_resetImageCache: typeof resetImageCache;
2513
2937
  declare const index_d$3_resetNicoScripts: typeof resetNicoScripts;
2514
2938
  declare const index_d$3_setPlugins: typeof setPlugins;
2515
2939
  declare namespace index_d$3 {
2516
- export { index_d$3_imageCache as imageCache, index_d$3_nicoScripts as nicoScripts, index_d$3_plugins as plugins, index_d$3_resetImageCache as resetImageCache, index_d$3_resetNicoScripts as resetNicoScripts, index_d$3_setPlugins as setPlugins };
2940
+ export {
2941
+ index_d$3_imageCache as imageCache,
2942
+ index_d$3_nicoScripts as nicoScripts,
2943
+ index_d$3_plugins as plugins,
2944
+ index_d$3_resetImageCache as resetImageCache,
2945
+ index_d$3_resetNicoScripts as resetNicoScripts,
2946
+ index_d$3_setPlugins as setPlugins,
2947
+ };
2517
2948
  }
2518
2949
 
2519
2950
  declare const colors: {
@@ -2548,7 +2979,9 @@ declare const colors: {
2548
2979
 
2549
2980
  declare const colors$1_colors: typeof colors;
2550
2981
  declare namespace colors$1 {
2551
- export { colors$1_colors as colors };
2982
+ export {
2983
+ colors$1_colors as colors,
2984
+ };
2552
2985
  }
2553
2986
 
2554
2987
  declare let defaultConfig: BaseConfig;
@@ -2567,7 +3000,15 @@ declare const config$1_setConfig: typeof setConfig;
2567
3000
  declare const config$1_setOptions: typeof setOptions;
2568
3001
  declare const config$1_updateConfig: typeof updateConfig;
2569
3002
  declare namespace config$1 {
2570
- export { config$1_config as config, config$1_defaultConfig as defaultConfig, config$1_defaultOptions as defaultOptions, config$1_options as options, config$1_setConfig as setConfig, config$1_setOptions as setOptions, config$1_updateConfig as updateConfig };
3003
+ export {
3004
+ config$1_config as config,
3005
+ config$1_defaultConfig as defaultConfig,
3006
+ config$1_defaultOptions as defaultOptions,
3007
+ config$1_options as options,
3008
+ config$1_setConfig as setConfig,
3009
+ config$1_setOptions as setOptions,
3010
+ config$1_updateConfig as updateConfig,
3011
+ };
2571
3012
  }
2572
3013
 
2573
3014
  declare const fontTemplates: {
@@ -2678,14 +3119,19 @@ declare const fonts: {
2678
3119
  declare const fonts$1_fontTemplates: typeof fontTemplates;
2679
3120
  declare const fonts$1_fonts: typeof fonts;
2680
3121
  declare namespace fonts$1 {
2681
- export { fonts$1_fontTemplates as fontTemplates, fonts$1_fonts as fonts };
3122
+ export {
3123
+ fonts$1_fontTemplates as fontTemplates,
3124
+ fonts$1_fonts as fonts,
3125
+ };
2682
3126
  }
2683
3127
 
2684
3128
  declare const initConfig: () => void;
2685
3129
 
2686
3130
  declare const initConfig$1_initConfig: typeof initConfig;
2687
3131
  declare namespace initConfig$1 {
2688
- export { initConfig$1_initConfig as initConfig };
3132
+ export {
3133
+ initConfig$1_initConfig as initConfig,
3134
+ };
2689
3135
  }
2690
3136
 
2691
3137
  declare class CanvasRenderingContext2DError extends Error {
@@ -2723,7 +3169,12 @@ declare const index_d$2_InvalidOptionError: typeof InvalidOptionError;
2723
3169
  type index_d$2_NotImplementedError = NotImplementedError;
2724
3170
  declare const index_d$2_NotImplementedError: typeof NotImplementedError;
2725
3171
  declare namespace index_d$2 {
2726
- export { index_d$2_CanvasRenderingContext2DError as CanvasRenderingContext2DError, index_d$2_InvalidFormatError as InvalidFormatError, index_d$2_InvalidOptionError as InvalidOptionError, index_d$2_NotImplementedError as NotImplementedError };
3172
+ export {
3173
+ index_d$2_CanvasRenderingContext2DError as CanvasRenderingContext2DError,
3174
+ index_d$2_InvalidFormatError as InvalidFormatError,
3175
+ index_d$2_InvalidOptionError as InvalidOptionError,
3176
+ index_d$2_NotImplementedError as NotImplementedError,
3177
+ };
2727
3178
  }
2728
3179
 
2729
3180
  declare const registerHandler: <K extends keyof CommentEventHandlerMap>(eventName: K, handler: CommentEventHandlerMap[K]) => void;
@@ -2734,13 +3185,19 @@ declare const eventHandler_d_registerHandler: typeof registerHandler;
2734
3185
  declare const eventHandler_d_removeHandler: typeof removeHandler;
2735
3186
  declare const eventHandler_d_triggerHandler: typeof triggerHandler;
2736
3187
  declare namespace eventHandler_d {
2737
- export { eventHandler_d_registerHandler as registerHandler, eventHandler_d_removeHandler as removeHandler, eventHandler_d_triggerHandler as triggerHandler };
3188
+ export {
3189
+ eventHandler_d_registerHandler as registerHandler,
3190
+ eventHandler_d_removeHandler as removeHandler,
3191
+ eventHandler_d_triggerHandler as triggerHandler,
3192
+ };
2738
3193
  }
2739
3194
 
2740
3195
  declare const convert2formattedComment: (data: unknown, type: InputFormatType) => FormattedComment[];
2741
3196
 
2742
3197
  declare namespace inputParser_d {
2743
- export { convert2formattedComment as default };
3198
+ export {
3199
+ convert2formattedComment as default,
3200
+ };
2744
3201
  }
2745
3202
 
2746
3203
  declare class CanvasRenderer implements IRenderer {
@@ -2784,7 +3241,9 @@ declare class CanvasRenderer implements IRenderer {
2784
3241
  type index_d$1_CanvasRenderer = CanvasRenderer;
2785
3242
  declare const index_d$1_CanvasRenderer: typeof CanvasRenderer;
2786
3243
  declare namespace index_d$1 {
2787
- export { index_d$1_CanvasRenderer as CanvasRenderer };
3244
+ export {
3245
+ index_d$1_CanvasRenderer as CanvasRenderer,
3246
+ };
2788
3247
  }
2789
3248
 
2790
3249
  declare const typeGuard: {
@@ -2855,7 +3314,9 @@ declare const typeGuard: {
2855
3314
  };
2856
3315
 
2857
3316
  declare namespace typeGuard_d {
2858
- export { typeGuard as default };
3317
+ export {
3318
+ typeGuard as default,
3319
+ };
2859
3320
  }
2860
3321
 
2861
3322
  declare const arrayPush: (_array: {
@@ -2895,9 +3356,9 @@ declare const parseContent: (content: string) => ({
2895
3356
  type: "spacer";
2896
3357
  char: string;
2897
3358
  charWidth: number;
2898
- count: number;
2899
3359
  isButton?: boolean | undefined;
2900
3360
  font?: "defont" | "gulim" | "simsun" | undefined;
3361
+ count: number;
2901
3362
  } | {
2902
3363
  type: "text";
2903
3364
  content: string;
@@ -2957,7 +3418,39 @@ declare const index_d_parseFont: typeof parseFont;
2957
3418
  declare const index_d_processFixedComment: typeof processFixedComment;
2958
3419
  declare const index_d_processMovableComment: typeof processMovableComment;
2959
3420
  declare namespace index_d {
2960
- export { index_d_addHTML5PartToResult as addHTML5PartToResult, index_d_arrayEqual as arrayEqual, index_d_arrayPush as arrayPush, index_d_buildAtButtonComment as buildAtButtonComment, index_d_changeCALayer as changeCALayer, index_d_getButtonParts as getButtonParts, index_d_getCharSize as getCharSize, index_d_getConfig as getConfig, index_d_getDefaultCommand as getDefaultCommand, index_d_getFixedPosY as getFixedPosY, index_d_getFlashFontIndex as getFlashFontIndex, index_d_getFlashFontName as getFlashFontName, index_d_getFontSizeAndScale as getFontSizeAndScale, index_d_getLineHeight as getLineHeight, index_d_getMovablePosY as getMovablePosY, index_d_getPosX as getPosX, index_d_getPosY as getPosY, index_d_getStrokeColor as getStrokeColor, index_d_hex2rgb as hex2rgb, index_d_hex2rgba as hex2rgba, index_d_isBanActive as isBanActive, index_d_isFlashComment as isFlashComment, index_d_isLineBreakResize as isLineBreakResize, index_d_isReverseActive as isReverseActive, index_d_measure as measure, index_d_nativeSort as nativeSort, index_d_parseCommandAndNicoScript as parseCommandAndNicoScript, index_d_parseContent as parseContent, index_d_parseFont as parseFont, index_d_processFixedComment as processFixedComment, index_d_processMovableComment as processMovableComment };
3421
+ export {
3422
+ index_d_addHTML5PartToResult as addHTML5PartToResult,
3423
+ index_d_arrayEqual as arrayEqual,
3424
+ index_d_arrayPush as arrayPush,
3425
+ index_d_buildAtButtonComment as buildAtButtonComment,
3426
+ index_d_changeCALayer as changeCALayer,
3427
+ index_d_getButtonParts as getButtonParts,
3428
+ index_d_getCharSize as getCharSize,
3429
+ index_d_getConfig as getConfig,
3430
+ index_d_getDefaultCommand as getDefaultCommand,
3431
+ index_d_getFixedPosY as getFixedPosY,
3432
+ index_d_getFlashFontIndex as getFlashFontIndex,
3433
+ index_d_getFlashFontName as getFlashFontName,
3434
+ index_d_getFontSizeAndScale as getFontSizeAndScale,
3435
+ index_d_getLineHeight as getLineHeight,
3436
+ index_d_getMovablePosY as getMovablePosY,
3437
+ index_d_getPosX as getPosX,
3438
+ index_d_getPosY as getPosY,
3439
+ index_d_getStrokeColor as getStrokeColor,
3440
+ index_d_hex2rgb as hex2rgb,
3441
+ index_d_hex2rgba as hex2rgba,
3442
+ index_d_isBanActive as isBanActive,
3443
+ index_d_isFlashComment as isFlashComment,
3444
+ index_d_isLineBreakResize as isLineBreakResize,
3445
+ index_d_isReverseActive as isReverseActive,
3446
+ index_d_measure as measure,
3447
+ index_d_nativeSort as nativeSort,
3448
+ index_d_parseCommandAndNicoScript as parseCommandAndNicoScript,
3449
+ index_d_parseContent as parseContent,
3450
+ index_d_parseFont as parseFont,
3451
+ index_d_processFixedComment as processFixedComment,
3452
+ index_d_processMovableComment as processMovableComment,
3453
+ };
2961
3454
  }
2962
3455
 
2963
3456
  declare const definition: {
@@ -2969,7 +3462,17 @@ declare const definition: {
2969
3462
 
2970
3463
  declare const internal_definition: typeof definition;
2971
3464
  declare namespace internal {
2972
- export { index_d$4 as comments, index_d$3 as contexts, internal_definition as definition, index_d$2 as errors, eventHandler_d as eventHandler, inputParser_d as inputParser, index_d$1 as renderer, typeGuard_d as typeGuard, index_d as utils };
3465
+ export {
3466
+ index_d$4 as comments,
3467
+ index_d$3 as contexts,
3468
+ internal_definition as definition,
3469
+ index_d$2 as errors,
3470
+ eventHandler_d as eventHandler,
3471
+ inputParser_d as inputParser,
3472
+ index_d$1 as renderer,
3473
+ typeGuard_d as typeGuard,
3474
+ index_d as utils,
3475
+ };
2973
3476
  }
2974
3477
 
2975
3478
  declare class NiconiComments {
@@ -3073,4 +3576,5 @@ declare class NiconiComments {
3073
3576
  click(vpos: number, pos: Position): void;
3074
3577
  }
3075
3578
 
3076
- export { type ApiChat, type ApiGlobalNumRes, type ApiLeaf, type ApiPing, type ApiThread, type BaseConfig, type BaseOptions, type ButtonList, type ButtonParams, type ButtonPartLeft, type ButtonPartMiddle, type ButtonPartRight, type Canvas, type Collision, type CollisionItem, type CollisionPos, type CommentContentIndex, type CommentContentItem, type CommentContentItemText, type CommentDisableEvent, type CommentDisableEventHandler, type CommentEnableEvent, type CommentEnableEventHandler, type CommentEventBase, type CommentEventHandler, type CommentEventHandlerMap, type CommentEventMap, type CommentEventName, type CommentFlashFont, type CommentFlashFontParsed, type CommentFont, type CommentHTML5Font, type CommentLoc, type CommentMeasuredContentItem, type CommentSize, type CommentStageSize, type Config, type ConfigItem, type Context2D, type DefaultCommand, type FlashMode, type FlashScriptChar, type FontItem, type FormattedComment, type FormattedCommentWithFont, type FormattedCommentWithSize, type FormattedLegacyComment, type HTML5Fonts, type IComment, type IPlugin, type IPluginConstructor, type IPluginList, type IRenderer, type InputFormat, type InputFormatType, type InputParser, type JumpEvent, type JumpEventHandler, type MeasureInput, type MeasureTextInput, type MeasureTextResult, type MultiConfigItem, type NicoScript, type NicoScriptReplace, type NicoScriptReplaceCondition, type NicoScriptReplaceRange, type NicoScriptReplaceTarget, type NicoScriptReverseTarget, type Options, type OwnerComment, type ParseCommandAndNicoScriptResult, type ParseContentResult, type ParsedCommand, type Platform, type PlatformFont, type Position, type RawApiResponse, type SeekDisableEvent, type SeekDisableEventHandler, type SeekEnableEvent, type SeekEnableEventHandler, type Timeline, type V1Comment, type V1Thread, type ValueOf, type Xml2jsChat, type Xml2jsChatItem, type Xml2jsPacket, ZApiChat, ZApiGlobalNumRes, ZApiLeaf, ZApiPing, ZApiThread, ZCommentContentItem, ZCommentContentItemSpacer, ZCommentContentItemText, ZCommentFlashFont, ZCommentFont, ZCommentHTML5Font, ZCommentLoc, ZCommentMeasuredContentItem, ZCommentMeasuredContentItemText, ZCommentSize, ZFormattedComment, ZFormattedLegacyComment, ZHTML5Fonts, ZInputFormatType, ZMeasureInput, ZNicoScriptReplaceCondition, ZNicoScriptReplaceRange, ZNicoScriptReplaceTarget, ZNicoScriptReverseTarget, ZOwnerComment, ZRawApiResponse, ZV1Comment, ZV1Thread, ZXml2jsChat, ZXml2jsChatItem, ZXml2jsPacket, NiconiComments as default, type formattedComment, type formattedLegacyComment, type inputFormat, type inputFormatType, type ownerComment, type rawApiResponse, type v1Thread };
3579
+ export { ZApiChat, ZApiGlobalNumRes, ZApiLeaf, ZApiPing, ZApiThread, ZCommentContentItem, ZCommentContentItemSpacer, ZCommentContentItemText, ZCommentFlashFont, ZCommentFont, ZCommentHTML5Font, ZCommentLoc, ZCommentMeasuredContentItem, ZCommentMeasuredContentItemText, ZCommentSize, ZFormattedComment, ZFormattedLegacyComment, ZHTML5Fonts, ZInputFormatType, ZMeasureInput, ZNicoScriptReplaceCondition, ZNicoScriptReplaceRange, ZNicoScriptReplaceTarget, ZNicoScriptReverseTarget, ZOwnerComment, ZRawApiResponse, ZV1Comment, ZV1Thread, ZXml2jsChat, ZXml2jsChatItem, ZXml2jsPacket, NiconiComments as default };
3580
+ export type { ApiChat, ApiGlobalNumRes, ApiLeaf, ApiPing, ApiThread, BaseConfig, BaseOptions, ButtonList, ButtonParams, ButtonPartLeft, ButtonPartMiddle, ButtonPartRight, Canvas, Collision, CollisionItem, CollisionPos, CommentContentIndex, CommentContentItem, CommentContentItemText, CommentDisableEvent, CommentDisableEventHandler, CommentEnableEvent, CommentEnableEventHandler, CommentEventBase, CommentEventHandler, CommentEventHandlerMap, CommentEventMap, CommentEventName, CommentFlashFont, CommentFlashFontParsed, CommentFont, CommentHTML5Font, CommentLoc, CommentMeasuredContentItem, CommentSize, CommentStageSize, Config$1 as Config, ConfigItem, Context2D, DefaultCommand, FlashMode, FlashScriptChar, FontItem, FormattedComment, FormattedCommentWithFont, FormattedCommentWithSize, FormattedLegacyComment, HTML5Fonts, IComment, IPlugin, IPluginConstructor, IPluginList, IRenderer, InputFormat, InputFormatType, InputParser, JumpEvent, JumpEventHandler, MeasureInput, MeasureTextInput, MeasureTextResult, MultiConfigItem, NicoScript, NicoScriptReplace, NicoScriptReplaceCondition, NicoScriptReplaceRange, NicoScriptReplaceTarget, NicoScriptReverseTarget, Options, OwnerComment, ParseCommandAndNicoScriptResult, ParseContentResult, ParsedCommand, Platform, PlatformFont, Position, RawApiResponse, SeekDisableEvent, SeekDisableEventHandler, SeekEnableEvent, SeekEnableEventHandler, Timeline, V1Comment, V1Thread, ValueOf, Xml2jsChat, Xml2jsChatItem, Xml2jsPacket, formattedComment, formattedLegacyComment, inputFormat, inputFormatType, ownerComment, rawApiResponse, v1Thread };