@xpadev-net/niconicomments 0.2.71 → 0.2.73

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 +228 -731
  2. package/dist/bundle.js +392 -366
  3. package/package.json +25 -35
package/dist/bundle.d.ts CHANGED
@@ -323,16 +323,16 @@ interface CommentEventMap {
323
323
  /**
324
324
  * Pipe action context type.
325
325
  */
326
- type PipeActionContext = {
326
+ interface PipeActionContext {
327
327
  type: string;
328
328
  expects: string | null;
329
329
  message: ErrorMessage | undefined;
330
330
  requirement: unknown;
331
- };
331
+ }
332
332
  /**
333
333
  * Valid action result type.
334
334
  */
335
- type ValidActionResult<TOutput> = {
335
+ interface ValidActionResult<TOutput> {
336
336
  /**
337
337
  * The pipe output.
338
338
  */
@@ -341,11 +341,11 @@ type ValidActionResult<TOutput> = {
341
341
  * The pipe issues.
342
342
  */
343
343
  issues?: undefined;
344
- };
344
+ }
345
345
  /**
346
346
  * Invalid action result type.
347
347
  */
348
- type InvalidActionResult = {
348
+ interface InvalidActionResult {
349
349
  /**
350
350
  * The pipe output.
351
351
  */
@@ -354,7 +354,7 @@ type InvalidActionResult = {
354
354
  * The pipe issues.
355
355
  */
356
356
  issues: PipeActionIssues;
357
- };
357
+ }
358
358
  /**
359
359
  * Pipe action result type.
360
360
  */
@@ -362,7 +362,11 @@ type PipeActionResult<TOutput> = ValidActionResult<TOutput> | InvalidActionResul
362
362
  /**
363
363
  * Base validation type.
364
364
  */
365
- type BaseValidation<TInput = any> = {
365
+ interface BaseValidation<TInput = any> {
366
+ /**
367
+ * The validation type.
368
+ */
369
+ type: string;
366
370
  /**
367
371
  * The expected property.
368
372
  */
@@ -375,6 +379,10 @@ type BaseValidation<TInput = any> = {
375
379
  * Whether it's async.
376
380
  */
377
381
  async: false;
382
+ /**
383
+ * The validation requirement.
384
+ */
385
+ requirement: unknown;
378
386
  /**
379
387
  * Parses unknown input based on its requirement.
380
388
  *
@@ -385,11 +393,15 @@ type BaseValidation<TInput = any> = {
385
393
  * @internal
386
394
  */
387
395
  _parse(input: TInput): PipeActionResult<TInput>;
388
- };
396
+ }
389
397
  /**
390
398
  * Base validation async type.
391
399
  */
392
- type BaseValidationAsync<TInput = any> = {
400
+ interface BaseValidationAsync<TInput = any> {
401
+ /**
402
+ * The validation type.
403
+ */
404
+ type: string;
393
405
  /**
394
406
  * The expected property.
395
407
  */
@@ -402,6 +414,10 @@ type BaseValidationAsync<TInput = any> = {
402
414
  * Whether it's async.
403
415
  */
404
416
  async: true;
417
+ /**
418
+ * The validation requirement.
419
+ */
420
+ requirement: unknown;
405
421
  /**
406
422
  * Parses unknown input based on its requirement.
407
423
  *
@@ -412,11 +428,15 @@ type BaseValidationAsync<TInput = any> = {
412
428
  * @internal
413
429
  */
414
430
  _parse(input: TInput): Promise<PipeActionResult<TInput>>;
415
- };
431
+ }
416
432
  /**
417
433
  * Base transformation type.
418
434
  */
419
- type BaseTransformation<TInput = any> = {
435
+ interface BaseTransformation<TInput = any> {
436
+ /**
437
+ * The transformation type.
438
+ */
439
+ type: string;
420
440
  /**
421
441
  * Whether it's async.
422
442
  */
@@ -431,11 +451,15 @@ type BaseTransformation<TInput = any> = {
431
451
  * @internal
432
452
  */
433
453
  _parse(input: TInput): PipeActionResult<TInput>;
434
- };
454
+ }
435
455
  /**
436
456
  * Base transformation async type.
437
457
  */
438
- type BaseTransformationAsync<TInput = any> = {
458
+ interface BaseTransformationAsync<TInput = any> {
459
+ /**
460
+ * The transformation type.
461
+ */
462
+ type: string;
439
463
  /**
440
464
  * Whether it's async.
441
465
  */
@@ -450,7 +474,7 @@ type BaseTransformationAsync<TInput = any> = {
450
474
  * @internal
451
475
  */
452
476
  _parse(input: TInput): Promise<PipeActionResult<TInput>>;
453
- };
477
+ }
454
478
  /**
455
479
  * Pipe type.
456
480
  */
@@ -467,13 +491,13 @@ type IssueReason = 'any' | 'array' | 'bigint' | 'blob' | 'boolean' | 'date' | 'i
467
491
  /**
468
492
  * Unknown path item type.
469
493
  */
470
- type UnknownPathItem = {
494
+ interface UnknownPathItem {
471
495
  type: 'unknown';
472
496
  origin: 'key' | 'value';
473
497
  input: unknown;
474
498
  key: unknown;
475
499
  value: unknown;
476
- };
500
+ }
477
501
  /**
478
502
  * Path item type.
479
503
  */
@@ -485,7 +509,7 @@ type IssuePath = [PathItem, ...PathItem[]];
485
509
  /**
486
510
  * Schema issue type.
487
511
  */
488
- type SchemaIssue = Omit<SchemaConfig, 'message'> & {
512
+ interface SchemaIssue extends Omit<SchemaConfig, 'message'> {
489
513
  /**
490
514
  * The issue reason.
491
515
  */
@@ -522,7 +546,7 @@ type SchemaIssue = Omit<SchemaConfig, 'message'> & {
522
546
  * The sub issues.
523
547
  */
524
548
  issues?: SchemaIssues;
525
- };
549
+ }
526
550
  /**
527
551
  * Schema issues type.
528
552
  */
@@ -530,14 +554,14 @@ type SchemaIssues = [SchemaIssue, ...SchemaIssue[]];
530
554
  /**
531
555
  * Pipe action issue type.
532
556
  */
533
- type PipeActionIssue = {
557
+ interface PipeActionIssue {
534
558
  context: PipeActionContext;
535
559
  reference: Function;
536
560
  input: unknown;
537
561
  label: string;
538
562
  received?: string;
539
563
  path?: IssuePath;
540
- };
564
+ }
541
565
  /**
542
566
  * Pipe action issues type.
543
567
  */
@@ -550,7 +574,7 @@ type ErrorMessage = string | ((issue: SchemaIssue) => string);
550
574
  /**
551
575
  * The schema config type.
552
576
  */
553
- type SchemaConfig = {
577
+ interface SchemaConfig {
554
578
  /**
555
579
  * The selected language.
556
580
  */
@@ -571,32 +595,12 @@ type SchemaConfig = {
571
595
  * Whether the pipe was skipped.
572
596
  */
573
597
  skipPipe?: boolean;
574
- };
575
- /**
576
- * Maybe readonly type.
577
- */
578
- type MaybeReadonly<T> = Readonly<T> | T;
579
- /**
580
- * Resolve type.
581
- *
582
- * Hint: This type has no effect and is only used so that TypeScript displays
583
- * the final type in the preview instead of the utility types used.
584
- */
585
- type Resolve<T> = T;
586
- /**
587
- * Resolve object type.
588
- *
589
- * Hint: This type has no effect and is only used so that TypeScript displays
590
- * the final type in the preview instead of the utility types used.
591
- */
592
- type ResolveObject<T> = Resolve<{
593
- [k in keyof T]: T[k];
594
- }>;
598
+ }
595
599
 
596
600
  /**
597
601
  * Typed schema result type.
598
602
  */
599
- type TypedSchemaResult<TOutput> = {
603
+ interface TypedSchemaResult<TOutput> {
600
604
  /**
601
605
  * Whether is's typed.
602
606
  */
@@ -609,11 +613,11 @@ type TypedSchemaResult<TOutput> = {
609
613
  * The parse issues.
610
614
  */
611
615
  issues?: SchemaIssues;
612
- };
616
+ }
613
617
  /**
614
618
  * Untyped schema result type.
615
619
  */
616
- type UntypedSchemaResult = {
620
+ interface UntypedSchemaResult {
617
621
  /**
618
622
  * Whether is's typed.
619
623
  */
@@ -626,7 +630,7 @@ type UntypedSchemaResult = {
626
630
  * The parse issues.
627
631
  */
628
632
  issues: SchemaIssues;
629
- };
633
+ }
630
634
  /**
631
635
  * Schema result type.
632
636
  */
@@ -634,7 +638,11 @@ type SchemaResult<TOutput> = TypedSchemaResult<TOutput> | UntypedSchemaResult;
634
638
  /**
635
639
  * Base schema type.
636
640
  */
637
- type BaseSchema<TInput = any, TOutput = TInput> = {
641
+ interface BaseSchema<TInput = any, TOutput = TInput> {
642
+ /**
643
+ * The schema type.
644
+ */
645
+ type: string;
638
646
  /**
639
647
  * The expected property.
640
648
  */
@@ -663,11 +671,15 @@ type BaseSchema<TInput = any, TOutput = TInput> = {
663
671
  input: TInput;
664
672
  output: TOutput;
665
673
  };
666
- };
674
+ }
667
675
  /**
668
676
  * Base schema async type.
669
677
  */
670
- type BaseSchemaAsync<TInput = any, TOutput = TInput> = {
678
+ interface BaseSchemaAsync<TInput = any, TOutput = TInput> {
679
+ /**
680
+ * The schema type.
681
+ */
682
+ type: string;
671
683
  /**
672
684
  * The expected property.
673
685
  */
@@ -696,7 +708,7 @@ type BaseSchemaAsync<TInput = any, TOutput = TInput> = {
696
708
  input: TInput;
697
709
  output: TOutput;
698
710
  };
699
- };
711
+ }
700
712
  /**
701
713
  * Input inference type.
702
714
  */
@@ -706,10 +718,39 @@ type Input<TSchema extends BaseSchema | BaseSchemaAsync> = NonNullable<TSchema['
706
718
  */
707
719
  type Output<TSchema extends BaseSchema | BaseSchemaAsync> = NonNullable<TSchema['_types']>['output'];
708
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
+
709
750
  /**
710
751
  * Array schema type.
711
752
  */
712
- type ArraySchema<TItem extends BaseSchema, TOutput = Output<TItem>[]> = BaseSchema<Input<TItem>[], TOutput> & {
753
+ interface ArraySchema<TItem extends BaseSchema, TOutput = Output<TItem>[]> extends BaseSchema<Input<TItem>[], TOutput> {
713
754
  /**
714
755
  * The schema type.
715
756
  */
@@ -726,23 +767,23 @@ type ArraySchema<TItem extends BaseSchema, TOutput = Output<TItem>[]> = BaseSche
726
767
  * The validation and transformation pipeline.
727
768
  */
728
769
  pipe: Pipe<Output<TItem>[]> | undefined;
729
- };
770
+ }
730
771
 
731
772
  /**
732
773
  * Array path item type.
733
774
  */
734
- type ArrayPathItem = {
775
+ interface ArrayPathItem {
735
776
  type: 'array';
736
777
  origin: 'value';
737
778
  input: unknown[];
738
779
  key: number;
739
780
  value: unknown;
740
- };
781
+ }
741
782
 
742
783
  /**
743
784
  * Boolean schema type.
744
785
  */
745
- type BooleanSchema<TOutput = boolean> = BaseSchema<boolean, TOutput> & {
786
+ interface BooleanSchema<TOutput = boolean> extends BaseSchema<boolean, TOutput> {
746
787
  /**
747
788
  * The schema type.
748
789
  */
@@ -755,19 +796,19 @@ type BooleanSchema<TOutput = boolean> = BaseSchema<boolean, TOutput> & {
755
796
  * The validation and transformation pipeline.
756
797
  */
757
798
  pipe: Pipe<boolean> | undefined;
758
- };
799
+ }
759
800
 
760
801
  /**
761
802
  * Enum type.
762
803
  */
763
- type Enum = {
804
+ interface Enum {
764
805
  [key: string]: string | number;
765
806
  [key: number]: string;
766
- };
807
+ }
767
808
  /**
768
809
  * Native enum schema type.
769
810
  */
770
- type EnumSchema<TEnum extends Enum, TOutput = TEnum[keyof TEnum]> = BaseSchema<TEnum[keyof TEnum], TOutput> & {
811
+ interface EnumSchema<TEnum extends Enum, TOutput = TEnum[keyof TEnum]> extends BaseSchema<TEnum[keyof TEnum], TOutput> {
771
812
  /**
772
813
  * The schema type.
773
814
  */
@@ -780,12 +821,12 @@ type EnumSchema<TEnum extends Enum, TOutput = TEnum[keyof TEnum]> = BaseSchema<T
780
821
  * The error message.
781
822
  */
782
823
  message: ErrorMessage | undefined;
783
- };
824
+ }
784
825
 
785
826
  /**
786
827
  * Native enum schema async type.
787
828
  */
788
- type EnumSchemaAsync<TEnum extends Enum, TOutput = TEnum[keyof TEnum]> = BaseSchemaAsync<TEnum[keyof TEnum], TOutput> & {
829
+ interface EnumSchemaAsync<TEnum extends Enum, TOutput = TEnum[keyof TEnum]> extends BaseSchemaAsync<TEnum[keyof TEnum], TOutput> {
789
830
  /**
790
831
  * The schema type.
791
832
  */
@@ -798,7 +839,7 @@ type EnumSchemaAsync<TEnum extends Enum, TOutput = TEnum[keyof TEnum]> = BaseSch
798
839
  * The error message.
799
840
  */
800
841
  message: ErrorMessage | undefined;
801
- };
842
+ }
802
843
 
803
844
  /**
804
845
  * Intersect options async type.
@@ -839,7 +880,7 @@ type IntersectOptions = MaybeReadonly<[
839
880
  /**
840
881
  * Intersect schema type.
841
882
  */
842
- type IntersectSchema<TOptions extends IntersectOptions, TOutput = IntersectOutput<TOptions>> = BaseSchema<IntersectInput<TOptions>, TOutput> & {
883
+ interface IntersectSchema<TOptions extends IntersectOptions, TOutput = IntersectOutput<TOptions>> extends BaseSchema<IntersectInput<TOptions>, TOutput> {
843
884
  /**
844
885
  * The schema type.
845
886
  */
@@ -856,7 +897,7 @@ type IntersectSchema<TOptions extends IntersectOptions, TOutput = IntersectOutpu
856
897
  * The validation and transformation pipeline.
857
898
  */
858
899
  pipe: Pipe<IntersectOutput<TOptions>> | undefined;
859
- };
900
+ }
860
901
 
861
902
  /**
862
903
  * Literal type.
@@ -866,7 +907,7 @@ type Literal = number | string | boolean | symbol | bigint;
866
907
  /**
867
908
  * Literal schema type.
868
909
  */
869
- type LiteralSchema<TLiteral extends Literal, TOutput = TLiteral> = BaseSchema<TLiteral, TOutput> & {
910
+ interface LiteralSchema<TLiteral extends Literal, TOutput = TLiteral> extends BaseSchema<TLiteral, TOutput> {
870
911
  /**
871
912
  * The schema type.
872
913
  */
@@ -879,23 +920,23 @@ type LiteralSchema<TLiteral extends Literal, TOutput = TLiteral> = BaseSchema<TL
879
920
  * The error message.
880
921
  */
881
922
  message: ErrorMessage | undefined;
882
- };
923
+ }
883
924
 
884
925
  /**
885
926
  * Map path item type.
886
927
  */
887
- type MapPathItem = {
928
+ interface MapPathItem {
888
929
  type: 'map';
889
930
  origin: 'key' | 'value';
890
931
  input: Map<unknown, unknown>;
891
932
  key: unknown;
892
933
  value: unknown;
893
- };
934
+ }
894
935
 
895
936
  /**
896
937
  * Never schema type.
897
938
  */
898
- type NeverSchema = BaseSchema<never> & {
939
+ interface NeverSchema extends BaseSchema<never> {
899
940
  /**
900
941
  * The schema type.
901
942
  */
@@ -904,12 +945,12 @@ type NeverSchema = BaseSchema<never> & {
904
945
  * The error message.
905
946
  */
906
947
  message: ErrorMessage | undefined;
907
- };
948
+ }
908
949
 
909
950
  /**
910
951
  * Never schema async type.
911
952
  */
912
- type NeverSchemaAsync = BaseSchemaAsync<never> & {
953
+ interface NeverSchemaAsync extends BaseSchemaAsync<never> {
913
954
  /**
914
955
  * The schema type.
915
956
  */
@@ -918,12 +959,12 @@ type NeverSchemaAsync = BaseSchemaAsync<never> & {
918
959
  * The error message.
919
960
  */
920
961
  message: ErrorMessage | undefined;
921
- };
962
+ }
922
963
 
923
964
  /**
924
965
  * Nullable schema type.
925
966
  */
926
- type NullableSchema<TWrapped extends BaseSchema, TDefault extends Input<TWrapped> | (() => Input<TWrapped> | undefined) | undefined = undefined, TOutput = TDefault extends Input<TWrapped> | (() => Input<TWrapped>) ? Output<TWrapped> : Output<TWrapped> | null> = BaseSchema<Input<TWrapped> | null, TOutput> & {
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> {
927
968
  /**
928
969
  * The schema type.
929
970
  */
@@ -936,12 +977,12 @@ type NullableSchema<TWrapped extends BaseSchema, TDefault extends Input<TWrapped
936
977
  * The default value.
937
978
  */
938
979
  default: TDefault;
939
- };
980
+ }
940
981
 
941
982
  /**
942
983
  * Number schema type.
943
984
  */
944
- type NumberSchema<TOutput = number> = BaseSchema<number, TOutput> & {
985
+ interface NumberSchema<TOutput = number> extends BaseSchema<number, TOutput> {
945
986
  /**
946
987
  * The schema type.
947
988
  */
@@ -954,12 +995,12 @@ type NumberSchema<TOutput = number> = BaseSchema<number, TOutput> & {
954
995
  * The validation and transformation pipeline.
955
996
  */
956
997
  pipe: Pipe<number> | undefined;
957
- };
998
+ }
958
999
 
959
1000
  /**
960
1001
  * Optional schema type.
961
1002
  */
962
- type OptionalSchema<TWrapped extends BaseSchema, TDefault extends Input<TWrapped> | (() => Input<TWrapped> | undefined) | undefined = undefined, TOutput = TDefault extends Input<TWrapped> | (() => Input<TWrapped>) ? Output<TWrapped> : Output<TWrapped> | undefined> = BaseSchema<Input<TWrapped> | undefined, TOutput> & {
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> {
963
1004
  /**
964
1005
  * The schema type.
965
1006
  */
@@ -972,12 +1013,12 @@ type OptionalSchema<TWrapped extends BaseSchema, TDefault extends Input<TWrapped
972
1013
  * Returns the default value.
973
1014
  */
974
1015
  default: TDefault;
975
- };
1016
+ }
976
1017
 
977
1018
  /**
978
1019
  * Optional schema async type.
979
1020
  */
980
- type OptionalSchemaAsync<TWrapped extends BaseSchema | BaseSchemaAsync, TDefault extends Input<TWrapped> | (() => Input<TWrapped> | Promise<Input<TWrapped> | undefined> | undefined) | undefined = undefined, TOutput = TDefault extends Input<TWrapped> | (() => Input<TWrapped> | Promise<Input<TWrapped>>) ? Output<TWrapped> : Output<TWrapped> | undefined> = BaseSchemaAsync<Input<TWrapped> | undefined, TOutput> & {
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> {
981
1022
  /**
982
1023
  * The schema type.
983
1024
  */
@@ -990,23 +1031,25 @@ type OptionalSchemaAsync<TWrapped extends BaseSchema | BaseSchemaAsync, TDefault
990
1031
  * Returns the default value.
991
1032
  */
992
1033
  default: TDefault;
993
- };
1034
+ }
994
1035
 
995
1036
  /**
996
1037
  * Object entries async type.
997
1038
  */
998
- type ObjectEntriesAsync = Record<string, BaseSchema | BaseSchemaAsync>;
1039
+ interface ObjectEntriesAsync {
1040
+ [key: string]: BaseSchema | BaseSchemaAsync;
1041
+ }
999
1042
 
1000
1043
  /**
1001
1044
  * Object path item type.
1002
1045
  */
1003
- type ObjectPathItem = {
1046
+ interface ObjectPathItem {
1004
1047
  type: 'object';
1005
1048
  origin: 'value';
1006
1049
  input: Record<string, unknown>;
1007
1050
  key: string;
1008
1051
  value: unknown;
1009
- };
1052
+ }
1010
1053
  /**
1011
1054
  * Required object keys type.
1012
1055
  */
@@ -1047,11 +1090,13 @@ type ObjectOutput<TEntries extends ObjectEntries | ObjectEntriesAsync, TRest ext
1047
1090
  /**
1048
1091
  * Object entries type.
1049
1092
  */
1050
- type ObjectEntries = Record<string, BaseSchema>;
1093
+ interface ObjectEntries {
1094
+ [key: string]: BaseSchema;
1095
+ }
1051
1096
  /**
1052
1097
  * Object schema type.
1053
1098
  */
1054
- type ObjectSchema<TEntries extends ObjectEntries, TRest extends BaseSchema | undefined = undefined, TOutput = ObjectOutput<TEntries, TRest>> = BaseSchema<ObjectInput<TEntries, TRest>, TOutput> & {
1099
+ interface ObjectSchema<TEntries extends ObjectEntries, TRest extends BaseSchema | undefined = undefined, TOutput = ObjectOutput<TEntries, TRest>> extends BaseSchema<ObjectInput<TEntries, TRest>, TOutput> {
1055
1100
  /**
1056
1101
  * The schema type.
1057
1102
  */
@@ -1072,7 +1117,7 @@ type ObjectSchema<TEntries extends ObjectEntries, TRest extends BaseSchema | und
1072
1117
  * The validation and transformation pipeline.
1073
1118
  */
1074
1119
  pipe: Pipe<ObjectOutput<TEntries, TRest>> | undefined;
1075
- };
1120
+ }
1076
1121
 
1077
1122
  /**
1078
1123
  * Picklist options type.
@@ -1082,7 +1127,7 @@ type PicklistOptions = MaybeReadonly<(string | number | bigint)[]>;
1082
1127
  /**
1083
1128
  * Picklist schema type.
1084
1129
  */
1085
- type PicklistSchema<TOptions extends PicklistOptions, TOutput = TOptions[number]> = BaseSchema<TOptions[number], TOutput> & {
1130
+ interface PicklistSchema<TOptions extends PicklistOptions, TOutput = TOptions[number]> extends BaseSchema<TOptions[number], TOutput> {
1086
1131
  /**
1087
1132
  * The schema type.
1088
1133
  */
@@ -1095,12 +1140,12 @@ type PicklistSchema<TOptions extends PicklistOptions, TOutput = TOptions[number]
1095
1140
  * The error message.
1096
1141
  */
1097
1142
  message: ErrorMessage | undefined;
1098
- };
1143
+ }
1099
1144
 
1100
1145
  /**
1101
1146
  * Picklist schema async type.
1102
1147
  */
1103
- type PicklistSchemaAsync<TOptions extends PicklistOptions, TOutput = TOptions[number]> = BaseSchemaAsync<TOptions[number], TOutput> & {
1148
+ interface PicklistSchemaAsync<TOptions extends PicklistOptions, TOutput = TOptions[number]> extends BaseSchemaAsync<TOptions[number], TOutput> {
1104
1149
  /**
1105
1150
  * The schema type.
1106
1151
  */
@@ -1113,12 +1158,12 @@ type PicklistSchemaAsync<TOptions extends PicklistOptions, TOutput = TOptions[nu
1113
1158
  * The error message.
1114
1159
  */
1115
1160
  message: ErrorMessage | undefined;
1116
- };
1161
+ }
1117
1162
 
1118
1163
  /**
1119
1164
  * Special schema type.
1120
1165
  */
1121
- type SpecialSchema<TInput, TOutput = TInput> = BaseSchema<TInput, TOutput> & {
1166
+ interface SpecialSchema<TInput, TOutput = TInput> extends BaseSchema<TInput, TOutput> {
1122
1167
  /**
1123
1168
  * The schema type.
1124
1169
  */
@@ -1135,12 +1180,12 @@ type SpecialSchema<TInput, TOutput = TInput> = BaseSchema<TInput, TOutput> & {
1135
1180
  * The validation and transformation pipeline.
1136
1181
  */
1137
1182
  pipe: Pipe<TInput> | undefined;
1138
- };
1183
+ }
1139
1184
 
1140
1185
  /**
1141
1186
  * Special schema async type.
1142
1187
  */
1143
- type SpecialSchemaAsync<TInput, TOutput = TInput> = BaseSchemaAsync<TInput, TOutput> & {
1188
+ interface SpecialSchemaAsync<TInput, TOutput = TInput> extends BaseSchemaAsync<TInput, TOutput> {
1144
1189
  /**
1145
1190
  * The schema type.
1146
1191
  */
@@ -1157,12 +1202,12 @@ type SpecialSchemaAsync<TInput, TOutput = TInput> = BaseSchemaAsync<TInput, TOut
1157
1202
  * The validation and transformation pipeline.
1158
1203
  */
1159
1204
  pipe: PipeAsync<TInput> | undefined;
1160
- };
1205
+ }
1161
1206
 
1162
1207
  /**
1163
1208
  * String schema type.
1164
1209
  */
1165
- type StringSchema<TOutput = string> = BaseSchema<string, TOutput> & {
1210
+ interface StringSchema<TOutput = string> extends BaseSchema<string, TOutput> {
1166
1211
  /**
1167
1212
  * The schema type.
1168
1213
  */
@@ -1175,12 +1220,12 @@ type StringSchema<TOutput = string> = BaseSchema<string, TOutput> & {
1175
1220
  * The validation and transformation pipeline.
1176
1221
  */
1177
1222
  pipe: Pipe<string> | undefined;
1178
- };
1223
+ }
1179
1224
 
1180
1225
  /**
1181
1226
  * String schema async type.
1182
1227
  */
1183
- type StringSchemaAsync<TOutput = string> = BaseSchemaAsync<string, TOutput> & {
1228
+ interface StringSchemaAsync<TOutput = string> extends BaseSchemaAsync<string, TOutput> {
1184
1229
  /**
1185
1230
  * The schema type.
1186
1231
  */
@@ -1193,7 +1238,7 @@ type StringSchemaAsync<TOutput = string> = BaseSchemaAsync<string, TOutput> & {
1193
1238
  * The validation and transformation pipeline.
1194
1239
  */
1195
1240
  pipe: PipeAsync<string> | undefined;
1196
- };
1241
+ }
1197
1242
 
1198
1243
  /**
1199
1244
  * Union options type.
@@ -1202,7 +1247,7 @@ type UnionOptions = MaybeReadonly<BaseSchema[]>;
1202
1247
  /**
1203
1248
  * Union schema type.
1204
1249
  */
1205
- type UnionSchema<TOptions extends UnionOptions, TOutput = Output<TOptions[number]>> = BaseSchema<Input<TOptions[number]>, TOutput> & {
1250
+ interface UnionSchema<TOptions extends UnionOptions, TOutput = Output<TOptions[number]>> extends BaseSchema<Input<TOptions[number]>, TOutput> {
1206
1251
  /**
1207
1252
  * The schema type.
1208
1253
  */
@@ -1219,7 +1264,7 @@ type UnionSchema<TOptions extends UnionOptions, TOutput = Output<TOptions[number
1219
1264
  * The validation and transformation pipeline.
1220
1265
  */
1221
1266
  pipe: Pipe<Output<TOptions[number]>> | undefined;
1222
- };
1267
+ }
1223
1268
 
1224
1269
  /**
1225
1270
  * Union options async type.
@@ -1228,7 +1273,7 @@ type UnionOptionsAsync = MaybeReadonly<(BaseSchema | BaseSchemaAsync)[]>;
1228
1273
  /**
1229
1274
  * Union schema async type.
1230
1275
  */
1231
- type UnionSchemaAsync<TOptions extends UnionOptionsAsync, TOutput = Output<TOptions[number]>> = BaseSchemaAsync<Input<TOptions[number]>, TOutput> & {
1276
+ interface UnionSchemaAsync<TOptions extends UnionOptionsAsync, TOutput = Output<TOptions[number]>> extends BaseSchemaAsync<Input<TOptions[number]>, TOutput> {
1232
1277
  /**
1233
1278
  * The schema type.
1234
1279
  */
@@ -1245,7 +1290,7 @@ type UnionSchemaAsync<TOptions extends UnionOptionsAsync, TOutput = Output<TOpti
1245
1290
  * The validation and transformation pipeline.
1246
1291
  */
1247
1292
  pipe: PipeAsync<Input<TOptions[number]>> | undefined;
1248
- };
1293
+ }
1249
1294
 
1250
1295
  /**
1251
1296
  * Record key async type.
@@ -1255,13 +1300,13 @@ type RecordKeyAsync = EnumSchema<any, string | number | symbol> | EnumSchemaAsyn
1255
1300
  /**
1256
1301
  * Record path item type.
1257
1302
  */
1258
- type RecordPathItem = {
1303
+ interface RecordPathItem {
1259
1304
  type: 'record';
1260
1305
  origin: 'key' | 'value';
1261
1306
  input: Record<string | number | symbol, unknown>;
1262
1307
  key: string | number | symbol;
1263
1308
  value: unknown;
1264
- };
1309
+ }
1265
1310
  /**
1266
1311
  * Partial key schema type.
1267
1312
  */
@@ -1282,7 +1327,7 @@ type RecordKey = EnumSchema<any, string | number | symbol> | PicklistSchema<any,
1282
1327
  /**
1283
1328
  * Record schema type.
1284
1329
  */
1285
- type RecordSchema<TKey extends RecordKey, TValue extends BaseSchema, TOutput = RecordOutput<TKey, TValue>> = BaseSchema<RecordInput<TKey, TValue>, TOutput> & {
1330
+ interface RecordSchema<TKey extends RecordKey, TValue extends BaseSchema, TOutput = RecordOutput<TKey, TValue>> extends BaseSchema<RecordInput<TKey, TValue>, TOutput> {
1286
1331
  /**
1287
1332
  * The schema type.
1288
1333
  */
@@ -1303,34 +1348,34 @@ type RecordSchema<TKey extends RecordKey, TValue extends BaseSchema, TOutput = R
1303
1348
  * The validation and transformation pipeline.
1304
1349
  */
1305
1350
  pipe: Pipe<RecordOutput<TKey, TValue>> | undefined;
1306
- };
1351
+ }
1307
1352
 
1308
1353
  /**
1309
1354
  * Set path item type.
1310
1355
  */
1311
- type SetPathItem = {
1356
+ interface SetPathItem {
1312
1357
  type: 'set';
1313
1358
  origin: 'value';
1314
1359
  input: Set<unknown>;
1315
1360
  key: number;
1316
1361
  value: unknown;
1317
- };
1362
+ }
1318
1363
 
1319
1364
  /**
1320
1365
  * Tuple path item type.
1321
1366
  */
1322
- type TuplePathItem = {
1367
+ interface TuplePathItem {
1323
1368
  type: 'tuple';
1324
1369
  origin: 'value';
1325
1370
  input: [unknown, ...unknown[]];
1326
1371
  key: number;
1327
1372
  value: unknown;
1328
- };
1373
+ }
1329
1374
 
1330
1375
  /**
1331
1376
  * Unknown schema type.
1332
1377
  */
1333
- type UnknownSchema<TOutput = unknown> = BaseSchema<unknown, TOutput> & {
1378
+ interface UnknownSchema<TOutput = unknown> extends BaseSchema<unknown, TOutput> {
1334
1379
  /**
1335
1380
  * The schema type.
1336
1381
  */
@@ -1339,7 +1384,7 @@ type UnknownSchema<TOutput = unknown> = BaseSchema<unknown, TOutput> & {
1339
1384
  * The validation and transformation pipeline.
1340
1385
  */
1341
1386
  pipe: Pipe<unknown> | undefined;
1342
- };
1387
+ }
1343
1388
 
1344
1389
  type Platform = "win7" | "win8_1" | "win" | "mac10_9" | "mac10_11" | "mac" | "other";
1345
1390
  declare const ZHTML5Fonts: UnionSchema<(LiteralSchema<"defont", "defont"> | LiteralSchema<"mincho", "mincho"> | LiteralSchema<"gothic", "gothic">)[], "defont" | "mincho" | "gothic">;
@@ -2744,336 +2789,68 @@ declare namespace index_d$1 {
2744
2789
 
2745
2790
  declare const typeGuard: {
2746
2791
  formatted: {
2747
- comment: (i: unknown) => i is {
2748
- owner: boolean;
2749
- content: string;
2750
- id: number;
2751
- vpos: number;
2752
- date: number;
2753
- date_usec: number;
2754
- premium: boolean;
2755
- mail: string[];
2756
- user_id: number;
2757
- layer: number;
2758
- is_my_post: boolean;
2759
- };
2760
- comments: (i: unknown) => i is {
2761
- owner: boolean;
2762
- content: string;
2763
- id: number;
2764
- vpos: number;
2765
- date: number;
2766
- date_usec: number;
2767
- premium: boolean;
2768
- mail: string[];
2769
- user_id: number;
2770
- layer: number;
2771
- is_my_post: boolean;
2772
- }[];
2773
- legacyComment: (i: unknown) => i is {
2774
- owner: boolean;
2775
- content: string;
2776
- id: number;
2777
- vpos: number;
2778
- date: number;
2779
- date_usec: number;
2780
- premium: boolean;
2781
- mail: string[];
2782
- };
2783
- legacyComments: (i: unknown) => i is {
2784
- owner: boolean;
2785
- content: string;
2786
- id: number;
2787
- vpos: number;
2788
- date: number;
2789
- date_usec: number;
2790
- premium: boolean;
2791
- mail: string[];
2792
- }[];
2792
+ comment: (i: unknown) => i is FormattedComment;
2793
+ comments: (i: unknown) => i is FormattedComment[];
2794
+ legacyComment: (i: unknown) => i is FormattedLegacyComment;
2795
+ legacyComments: (i: unknown) => i is FormattedLegacyComment[];
2793
2796
  };
2794
2797
  legacy: {
2795
- rawApiResponses: (i: unknown) => i is ({
2796
- chat: {
2797
- content: string;
2798
- vpos: number;
2799
- date: number;
2800
- date_usec: number;
2801
- premium: number;
2802
- mail: string;
2803
- user_id: string;
2804
- thread: string;
2805
- no: number;
2806
- nicoru: number;
2807
- anonymity: number;
2808
- deleted: number;
2809
- };
2810
- } | {
2811
- [x: string]: unknown;
2812
- })[];
2813
- apiChat: (i: unknown) => i is {
2814
- content: string;
2815
- vpos: number;
2816
- date: number;
2817
- date_usec: number;
2818
- premium: number;
2819
- mail: string;
2820
- user_id: string;
2821
- thread: string;
2822
- no: number;
2823
- nicoru: number;
2824
- anonymity: number;
2825
- deleted: number;
2826
- };
2827
- apiGlobalNumRes: (i: unknown) => i is {
2828
- thread: string;
2829
- num_res: number;
2830
- };
2831
- apiLeaf: (i: unknown) => i is {
2832
- count: number;
2833
- thread: string;
2834
- };
2835
- apiPing: (i: unknown) => i is {
2836
- content: string;
2837
- };
2838
- apiThread: (i: unknown) => i is {
2839
- thread: string;
2840
- resultcode: number;
2841
- server_time: number;
2842
- ticket: string;
2843
- revision: number;
2844
- };
2798
+ rawApiResponses: (i: unknown) => i is RawApiResponse[];
2799
+ apiChat: (i: unknown) => i is ApiChat;
2800
+ apiGlobalNumRes: (i: unknown) => i is ApiGlobalNumRes;
2801
+ apiLeaf: (i: unknown) => i is ApiLeaf;
2802
+ apiPing: (i: unknown) => i is ApiPing;
2803
+ apiThread: (i: unknown) => i is ApiThread;
2845
2804
  };
2846
2805
  xmlDocument: (i: unknown) => i is XMLDocument;
2847
2806
  xml2js: {
2848
- packet: (i: unknown) => i is {
2849
- packet: {
2850
- chat: {
2851
- _: string;
2852
- $: {
2853
- owner: string;
2854
- vpos: string;
2855
- date: string;
2856
- date_usec: string;
2857
- premium: string;
2858
- mail: string;
2859
- user_id?: string | undefined;
2860
- no?: string | undefined;
2861
- };
2862
- }[];
2863
- };
2864
- };
2865
- chat: (i: unknown) => i is {
2866
- chat: {
2867
- _: string;
2868
- $: {
2869
- owner: string;
2870
- vpos: string;
2871
- date: string;
2872
- date_usec: string;
2873
- premium: string;
2874
- mail: string;
2875
- user_id?: string | undefined;
2876
- no?: string | undefined;
2877
- };
2878
- }[];
2879
- };
2880
- chatItem: (i: unknown) => i is {
2881
- _: string;
2882
- $: {
2883
- owner: string;
2884
- vpos: string;
2885
- date: string;
2886
- date_usec: string;
2887
- premium: string;
2888
- mail: string;
2889
- user_id?: string | undefined;
2890
- no?: string | undefined;
2891
- };
2892
- };
2807
+ packet: (i: unknown) => i is Xml2jsPacket;
2808
+ chat: (i: unknown) => i is Xml2jsChat;
2809
+ chatItem: (i: unknown) => i is Xml2jsChatItem;
2893
2810
  };
2894
2811
  legacyOwner: {
2895
2812
  comments: (i: unknown) => i is string;
2896
2813
  };
2897
2814
  owner: {
2898
- comment: (i: unknown) => i is {
2899
- time: string;
2900
- command: string;
2901
- comment: string;
2902
- };
2903
- comments: (i: unknown) => i is {
2904
- time: string;
2905
- command: string;
2906
- comment: string;
2907
- }[];
2815
+ comment: (i: unknown) => i is OwnerComment;
2816
+ comments: (i: unknown) => i is OwnerComment[];
2908
2817
  };
2909
2818
  v1: {
2910
- comment: (i: unknown) => i is {
2911
- id: string;
2912
- no: number;
2913
- vposMs: number;
2914
- body: string;
2915
- commands: string[];
2916
- userId: string;
2917
- isPremium: boolean;
2918
- score: number;
2919
- postedAt: string;
2920
- nicoruCount: number;
2921
- nicoruId: string | null;
2922
- source: string;
2923
- isMyPost: boolean;
2924
- };
2925
- comments: (i: unknown) => i is {
2926
- id: string;
2927
- no: number;
2928
- vposMs: number;
2929
- body: string;
2930
- commands: string[];
2931
- userId: string;
2932
- isPremium: boolean;
2933
- score: number;
2934
- postedAt: string;
2935
- nicoruCount: number;
2936
- nicoruId: string | null;
2937
- source: string;
2938
- isMyPost: boolean;
2939
- }[];
2940
- thread: (i: unknown) => i is {
2941
- id: unknown;
2942
- fork: string;
2943
- commentCount: number;
2944
- comments: {
2945
- id: string;
2946
- no: number;
2947
- vposMs: number;
2948
- body: string;
2949
- commands: string[];
2950
- userId: string;
2951
- isPremium: boolean;
2952
- score: number;
2953
- postedAt: string;
2954
- nicoruCount: number;
2955
- nicoruId: string | null;
2956
- source: string;
2957
- isMyPost: boolean;
2958
- }[];
2959
- };
2960
- threads: (i: unknown) => i is {
2961
- id: unknown;
2962
- fork: string;
2963
- commentCount: number;
2964
- comments: {
2965
- id: string;
2966
- no: number;
2967
- vposMs: number;
2968
- body: string;
2969
- commands: string[];
2970
- userId: string;
2971
- isPremium: boolean;
2972
- score: number;
2973
- postedAt: string;
2974
- nicoruCount: number;
2975
- nicoruId: string | null;
2976
- source: string;
2977
- isMyPost: boolean;
2978
- }[];
2979
- }[];
2819
+ comment: (i: unknown) => i is V1Comment;
2820
+ comments: (i: unknown) => i is V1Comment[];
2821
+ thread: (i: unknown) => i is V1Thread;
2822
+ threads: (i: unknown) => i is V1Thread[];
2980
2823
  };
2981
2824
  nicoScript: {
2982
2825
  range: {
2983
- target: (i: unknown) => i is "コメ" | "投コメ" | "全";
2826
+ target: (i: unknown) => i is NicoScriptReverseTarget;
2984
2827
  };
2985
2828
  replace: {
2986
- range: (i: unknown) => i is "全" | "単";
2987
- target: (i: unknown) => i is "コメ" | "投コメ" | "全" | "含まない" | "含む";
2988
- condition: (i: unknown) => i is "部分一致" | "完全一致";
2829
+ range: (i: unknown) => i is NicoScriptReplaceRange;
2830
+ target: (i: unknown) => i is NicoScriptReplaceTarget;
2831
+ condition: (i: unknown) => i is NicoScriptReplaceCondition;
2989
2832
  };
2990
2833
  };
2991
2834
  comment: {
2992
- font: (i: unknown) => i is "defont" | "mincho" | "gothic" | "gulim" | "simsun";
2993
- loc: (i: unknown) => i is "ue" | "naka" | "shita";
2994
- size: (i: unknown) => i is "big" | "medium" | "small";
2835
+ font: (i: unknown) => i is CommentFont;
2836
+ loc: (i: unknown) => i is CommentLoc;
2837
+ size: (i: unknown) => i is CommentSize;
2995
2838
  command: {
2996
2839
  key: (i: unknown) => i is "full" | "ender" | "_live" | "invisible";
2997
2840
  };
2998
- color: (i: unknown) => i is "white" | "red" | "pink" | "orange" | "yellow" | "green" | "cyan" | "blue" | "purple" | "black" | "white2" | "niconicowhite" | "red2" | "truered" | "pink2" | "orange2" | "passionorange" | "yellow2" | "madyellow" | "green2" | "elementalgreen" | "cyan2" | "blue2" | "marinblue" | "purple2" | "nobleviolet" | "black2";
2841
+ color: (i: unknown) => i is keyof typeof colors;
2999
2842
  colorCode: (i: unknown) => i is string;
3000
2843
  colorCodeAllowAlpha: (i: unknown) => i is string;
3001
2844
  };
3002
2845
  config: {
3003
- initOptions: (item: unknown) => item is Partial<BaseOptions>;
2846
+ initOptions: (item: unknown) => item is Options;
3004
2847
  };
3005
2848
  internal: {
3006
- CommentMeasuredContentItem: (i: unknown) => i is {
3007
- type: "spacer";
3008
- char: string;
3009
- charWidth: number;
3010
- count: number;
3011
- isButton?: boolean | undefined;
3012
- font?: "defont" | "gulim" | "simsun" | undefined;
3013
- } | (({
3014
- type: "spacer";
3015
- char: string;
3016
- charWidth: number;
3017
- count: number;
3018
- isButton?: boolean | undefined;
3019
- font?: "defont" | "gulim" | "simsun" | undefined;
3020
- } | {
3021
- type: "text";
3022
- content: string;
3023
- slicedContent: string[];
3024
- isButton?: boolean | undefined;
3025
- font?: "defont" | "gulim" | "simsun" | undefined;
3026
- width?: number[] | undefined;
3027
- }) & {
3028
- width: number[];
3029
- });
3030
- CommentMeasuredContentItemArray: (i: unknown) => i is ({
3031
- type: "spacer";
3032
- char: string;
3033
- charWidth: number;
3034
- count: number;
3035
- isButton?: boolean | undefined;
3036
- font?: "defont" | "gulim" | "simsun" | undefined;
3037
- } | (({
3038
- type: "spacer";
3039
- char: string;
3040
- charWidth: number;
3041
- count: number;
3042
- isButton?: boolean | undefined;
3043
- font?: "defont" | "gulim" | "simsun" | undefined;
3044
- } | {
3045
- type: "text";
3046
- content: string;
3047
- slicedContent: string[];
3048
- isButton?: boolean | undefined;
3049
- font?: "defont" | "gulim" | "simsun" | undefined;
3050
- width?: number[] | undefined;
3051
- }) & {
3052
- width: number[];
3053
- }))[];
2849
+ CommentMeasuredContentItem: (i: unknown) => i is CommentMeasuredContentItem;
2850
+ CommentMeasuredContentItemArray: (i: unknown) => i is CommentMeasuredContentItem[];
3054
2851
  MultiConfigItem: <T>(i: unknown) => i is MultiConfigItem<T>;
3055
- HTML5Fonts: (i: unknown) => i is "defont" | "mincho" | "gothic";
3056
- MeasureInput: (i: unknown) => i is {
3057
- lineHeight: number;
3058
- font: "defont" | "mincho" | "gothic" | "gulim" | "simsun";
3059
- content: ({
3060
- type: "spacer";
3061
- char: string;
3062
- charWidth: number;
3063
- count: number;
3064
- isButton?: boolean | undefined;
3065
- font?: "defont" | "gulim" | "simsun" | undefined;
3066
- } | {
3067
- type: "text";
3068
- content: string;
3069
- slicedContent: string[];
3070
- isButton?: boolean | undefined;
3071
- font?: "defont" | "gulim" | "simsun" | undefined;
3072
- width?: number[] | undefined;
3073
- })[];
3074
- charSize: number;
3075
- lineCount: number;
3076
- };
2852
+ HTML5Fonts: (i: unknown) => i is HTML5Fonts;
2853
+ MeasureInput: (i: unknown) => i is MeasureInput;
3077
2854
  };
3078
2855
  };
3079
2856
 
@@ -3081,13 +2858,13 @@ declare namespace typeGuard_d {
3081
2858
  export { typeGuard as default };
3082
2859
  }
3083
2860
 
3084
- declare const arrayPush: (array: {
2861
+ declare const arrayPush: (_array: {
3085
2862
  [key: number]: IComment[];
3086
2863
  }, key: string | number, push: IComment) => void;
3087
2864
  declare const arrayEqual: (a: unknown[], b: unknown[]) => boolean;
3088
2865
 
3089
- declare const hex2rgb: (hex: string) => number[];
3090
- declare const hex2rgba: (hex: string) => number[];
2866
+ declare const hex2rgb: (_hex: string) => number[];
2867
+ declare const hex2rgba: (_hex: string) => number[];
3091
2868
  declare const getStrokeColor: (comment: FormattedCommentWithSize) => string;
3092
2869
 
3093
2870
  declare const isLineBreakResize: (comment: MeasureTextInput) => boolean;
@@ -3100,7 +2877,7 @@ declare const processFixedComment: (comment: IComment, collision: CollisionItem,
3100
2877
  declare const processMovableComment: (comment: IComment, collision: Collision, timeline: Timeline, lazy?: boolean) => void;
3101
2878
  declare const getFixedPosY: (comment: IComment, collision: CollisionItem) => number;
3102
2879
  declare const getMovablePosY: (comment: IComment, collision: Collision, beforeVpos: number) => number;
3103
- declare const getPosY: (currentPos: number, targetComment: IComment, collision: IComment[] | undefined, isChanged?: boolean) => {
2880
+ declare const getPosY: (_currentPos: number, targetComment: IComment, collision: IComment[] | undefined, _isChanged?: boolean) => {
3104
2881
  currentPos: number;
3105
2882
  isChanged: boolean;
3106
2883
  isBreak: boolean;
@@ -3140,8 +2917,8 @@ declare const measure: (comment: MeasureInput, renderer: IRenderer) => {
3140
2917
  lineWidth: number[];
3141
2918
  itemWidth: number[][];
3142
2919
  };
3143
- declare const addHTML5PartToResult: (lineContent: CommentContentItem[], part: string, font?: CommentHTML5Font) => void;
3144
- declare const getFontSizeAndScale: (charSize: number) => {
2920
+ declare const addHTML5PartToResult: (lineContent: CommentContentItem[], part: string, _font?: CommentHTML5Font) => void;
2921
+ declare const getFontSizeAndScale: (_charSize: number) => {
3145
2922
  scale: number;
3146
2923
  fontSize: number;
3147
2924
  };
@@ -3209,254 +2986,52 @@ declare class NiconiComments {
3209
2986
  private readonly timeline;
3210
2987
  static typeGuard: {
3211
2988
  formatted: {
3212
- comment: (i: unknown) => i is {
3213
- owner: boolean;
3214
- content: string;
3215
- id: number;
3216
- vpos: number;
3217
- date: number;
3218
- date_usec: number;
3219
- premium: boolean;
3220
- mail: string[];
3221
- user_id: number;
3222
- layer: number;
3223
- is_my_post: boolean;
3224
- };
3225
- comments: (i: unknown) => i is {
3226
- owner: boolean;
3227
- content: string;
3228
- id: number;
3229
- vpos: number;
3230
- date: number;
3231
- date_usec: number;
3232
- premium: boolean;
3233
- mail: string[];
3234
- user_id: number;
3235
- layer: number;
3236
- is_my_post: boolean;
3237
- }[];
3238
- legacyComment: (i: unknown) => i is {
3239
- owner: boolean;
3240
- content: string;
3241
- id: number;
3242
- vpos: number;
3243
- date: number;
3244
- date_usec: number;
3245
- premium: boolean;
3246
- mail: string[];
3247
- };
3248
- legacyComments: (i: unknown) => i is {
3249
- owner: boolean;
3250
- content: string;
3251
- id: number;
3252
- vpos: number;
3253
- date: number;
3254
- date_usec: number;
3255
- premium: boolean;
3256
- mail: string[];
3257
- }[];
2989
+ comment: (i: unknown) => i is FormattedComment;
2990
+ comments: (i: unknown) => i is FormattedComment[];
2991
+ legacyComment: (i: unknown) => i is FormattedLegacyComment;
2992
+ legacyComments: (i: unknown) => i is FormattedLegacyComment[];
3258
2993
  };
3259
2994
  legacy: {
3260
- rawApiResponses: (i: unknown) => i is ({
3261
- chat: {
3262
- content: string;
3263
- vpos: number;
3264
- date: number;
3265
- date_usec: number;
3266
- premium: number;
3267
- mail: string;
3268
- user_id: string;
3269
- thread: string;
3270
- no: number;
3271
- nicoru: number;
3272
- anonymity: number;
3273
- deleted: number;
3274
- };
3275
- } | {
3276
- [x: string]: unknown;
3277
- })[];
3278
- apiChat: (i: unknown) => i is {
3279
- content: string;
3280
- vpos: number;
3281
- date: number;
3282
- date_usec: number;
3283
- premium: number;
3284
- mail: string;
3285
- user_id: string;
3286
- thread: string;
3287
- no: number;
3288
- nicoru: number;
3289
- anonymity: number;
3290
- deleted: number;
3291
- };
3292
- apiGlobalNumRes: (i: unknown) => i is {
3293
- thread: string;
3294
- num_res: number;
3295
- };
3296
- apiLeaf: (i: unknown) => i is {
3297
- count: number;
3298
- thread: string;
3299
- };
3300
- apiPing: (i: unknown) => i is {
3301
- content: string;
3302
- };
3303
- apiThread: (i: unknown) => i is {
3304
- thread: string;
3305
- resultcode: number;
3306
- server_time: number;
3307
- ticket: string;
3308
- revision: number;
3309
- };
2995
+ rawApiResponses: (i: unknown) => i is RawApiResponse[];
2996
+ apiChat: (i: unknown) => i is ApiChat;
2997
+ apiGlobalNumRes: (i: unknown) => i is ApiGlobalNumRes;
2998
+ apiLeaf: (i: unknown) => i is ApiLeaf;
2999
+ apiPing: (i: unknown) => i is ApiPing;
3000
+ apiThread: (i: unknown) => i is ApiThread;
3310
3001
  };
3311
3002
  xmlDocument: (i: unknown) => i is XMLDocument;
3312
3003
  xml2js: {
3313
- packet: (i: unknown) => i is {
3314
- packet: {
3315
- chat: {
3316
- _: string;
3317
- $: {
3318
- owner: string;
3319
- vpos: string;
3320
- date: string;
3321
- date_usec: string;
3322
- premium: string;
3323
- mail: string;
3324
- user_id?: string | undefined;
3325
- no?: string | undefined;
3326
- };
3327
- }[];
3328
- };
3329
- };
3330
- chat: (i: unknown) => i is {
3331
- chat: {
3332
- _: string;
3333
- $: {
3334
- owner: string;
3335
- vpos: string;
3336
- date: string;
3337
- date_usec: string;
3338
- premium: string;
3339
- mail: string;
3340
- user_id?: string | undefined;
3341
- no?: string | undefined;
3342
- };
3343
- }[];
3344
- };
3345
- chatItem: (i: unknown) => i is {
3346
- _: string;
3347
- $: {
3348
- owner: string;
3349
- vpos: string;
3350
- date: string;
3351
- date_usec: string;
3352
- premium: string;
3353
- mail: string;
3354
- user_id?: string | undefined;
3355
- no?: string | undefined;
3356
- };
3357
- };
3004
+ packet: (i: unknown) => i is Xml2jsPacket;
3005
+ chat: (i: unknown) => i is Xml2jsChat;
3006
+ chatItem: (i: unknown) => i is Xml2jsChatItem;
3358
3007
  };
3359
3008
  legacyOwner: {
3360
3009
  comments: (i: unknown) => i is string;
3361
3010
  };
3362
3011
  owner: {
3363
- comment: (i: unknown) => i is {
3364
- time: string;
3365
- command: string;
3366
- comment: string;
3367
- };
3368
- comments: (i: unknown) => i is {
3369
- time: string;
3370
- command: string;
3371
- comment: string;
3372
- }[];
3012
+ comment: (i: unknown) => i is OwnerComment;
3013
+ comments: (i: unknown) => i is OwnerComment[];
3373
3014
  };
3374
3015
  v1: {
3375
- comment: (i: unknown) => i is {
3376
- id: string;
3377
- no: number;
3378
- vposMs: number;
3379
- body: string;
3380
- commands: string[];
3381
- userId: string;
3382
- isPremium: boolean;
3383
- score: number;
3384
- postedAt: string;
3385
- nicoruCount: number;
3386
- nicoruId: string | null;
3387
- source: string;
3388
- isMyPost: boolean;
3389
- };
3390
- comments: (i: unknown) => i is {
3391
- id: string;
3392
- no: number;
3393
- vposMs: number;
3394
- body: string;
3395
- commands: string[];
3396
- userId: string;
3397
- isPremium: boolean;
3398
- score: number;
3399
- postedAt: string;
3400
- nicoruCount: number;
3401
- nicoruId: string | null;
3402
- source: string;
3403
- isMyPost: boolean;
3404
- }[];
3405
- thread: (i: unknown) => i is {
3406
- id: unknown;
3407
- fork: string;
3408
- commentCount: number;
3409
- comments: {
3410
- id: string;
3411
- no: number;
3412
- vposMs: number;
3413
- body: string;
3414
- commands: string[];
3415
- userId: string;
3416
- isPremium: boolean;
3417
- score: number;
3418
- postedAt: string;
3419
- nicoruCount: number;
3420
- nicoruId: string | null;
3421
- source: string;
3422
- isMyPost: boolean;
3423
- }[];
3424
- };
3425
- threads: (i: unknown) => i is {
3426
- id: unknown;
3427
- fork: string;
3428
- commentCount: number;
3429
- comments: {
3430
- id: string;
3431
- no: number;
3432
- vposMs: number;
3433
- body: string;
3434
- commands: string[];
3435
- userId: string;
3436
- isPremium: boolean;
3437
- score: number;
3438
- postedAt: string;
3439
- nicoruCount: number;
3440
- nicoruId: string | null;
3441
- source: string;
3442
- isMyPost: boolean;
3443
- }[];
3444
- }[];
3016
+ comment: (i: unknown) => i is V1Comment;
3017
+ comments: (i: unknown) => i is V1Comment[];
3018
+ thread: (i: unknown) => i is V1Thread;
3019
+ threads: (i: unknown) => i is V1Thread[];
3445
3020
  };
3446
3021
  nicoScript: {
3447
3022
  range: {
3448
- target: (i: unknown) => i is "コメ" | "投コメ" | "全";
3023
+ target: (i: unknown) => i is NicoScriptReverseTarget;
3449
3024
  };
3450
3025
  replace: {
3451
- range: (i: unknown) => i is "全" | "単";
3452
- target: (i: unknown) => i is "コメ" | "投コメ" | "全" | "含まない" | "含む";
3453
- condition: (i: unknown) => i is "部分一致" | "完全一致";
3026
+ range: (i: unknown) => i is NicoScriptReplaceRange;
3027
+ target: (i: unknown) => i is NicoScriptReplaceTarget;
3028
+ condition: (i: unknown) => i is NicoScriptReplaceCondition;
3454
3029
  };
3455
3030
  };
3456
3031
  comment: {
3457
- font: (i: unknown) => i is "defont" | "mincho" | "gothic" | "gulim" | "simsun";
3458
- loc: (i: unknown) => i is "ue" | "naka" | "shita";
3459
- size: (i: unknown) => i is "big" | "medium" | "small";
3032
+ font: (i: unknown) => i is CommentFont;
3033
+ loc: (i: unknown) => i is CommentLoc;
3034
+ size: (i: unknown) => i is CommentSize;
3460
3035
  command: {
3461
3036
  key: (i: unknown) => i is "full" | "ender" | "_live" | "invisible";
3462
3037
  };
@@ -3465,101 +3040,23 @@ declare class NiconiComments {
3465
3040
  colorCodeAllowAlpha: (i: unknown) => i is string;
3466
3041
  };
3467
3042
  config: {
3468
- initOptions: (item: unknown) => item is Partial<BaseOptions>;
3043
+ initOptions: (item: unknown) => item is Options;
3469
3044
  };
3470
3045
  internal: {
3471
- CommentMeasuredContentItem: (i: unknown) => i is {
3472
- type: "spacer";
3473
- char: string;
3474
- charWidth: number;
3475
- count: number;
3476
- isButton?: boolean | undefined;
3477
- font?: "defont" | "gulim" | "simsun" | undefined;
3478
- } | (({
3479
- type: "spacer";
3480
- char: string;
3481
- charWidth: number;
3482
- count: number;
3483
- isButton?: boolean | undefined;
3484
- font?: "defont" | "gulim" | "simsun" | undefined;
3485
- } | {
3486
- type: "text";
3487
- content: string;
3488
- slicedContent: string[];
3489
- isButton?: boolean | undefined;
3490
- font?: "defont" | "gulim" | "simsun" | undefined;
3491
- width?: number[] | undefined;
3492
- }) & {
3493
- width: number[];
3494
- });
3495
- CommentMeasuredContentItemArray: (i: unknown) => i is ({
3496
- type: "spacer";
3497
- char: string;
3498
- charWidth: number;
3499
- count: number;
3500
- isButton?: boolean | undefined;
3501
- font?: "defont" | "gulim" | "simsun" | undefined;
3502
- } | (({
3503
- type: "spacer";
3504
- char: string;
3505
- charWidth: number;
3506
- count: number;
3507
- isButton?: boolean | undefined;
3508
- font?: "defont" | "gulim" | "simsun" | undefined;
3509
- } | {
3510
- type: "text";
3511
- content: string;
3512
- slicedContent: string[];
3513
- isButton?: boolean | undefined;
3514
- font?: "defont" | "gulim" | "simsun" | undefined;
3515
- width?: number[] | undefined;
3516
- }) & {
3517
- width: number[];
3518
- }))[];
3046
+ CommentMeasuredContentItem: (i: unknown) => i is CommentMeasuredContentItem;
3047
+ CommentMeasuredContentItemArray: (i: unknown) => i is CommentMeasuredContentItem[];
3519
3048
  MultiConfigItem: <T>(i: unknown) => i is MultiConfigItem<T>;
3520
- HTML5Fonts: (i: unknown) => i is "defont" | "mincho" | "gothic";
3521
- MeasureInput: (i: unknown) => i is {
3522
- lineHeight: number;
3523
- font: "defont" | "mincho" | "gothic" | "gulim" | "simsun";
3524
- content: ({
3525
- type: "spacer";
3526
- char: string;
3527
- charWidth: number;
3528
- count: number;
3529
- isButton?: boolean | undefined;
3530
- font?: "defont" | "gulim" | "simsun" | undefined;
3531
- } | {
3532
- type: "text";
3533
- content: string;
3534
- slicedContent: string[];
3535
- isButton?: boolean | undefined;
3536
- font?: "defont" | "gulim" | "simsun" | undefined;
3537
- width?: number[] | undefined;
3538
- })[];
3539
- charSize: number;
3540
- lineCount: number;
3541
- };
3049
+ HTML5Fonts: (i: unknown) => i is HTML5Fonts;
3050
+ MeasureInput: (i: unknown) => i is MeasureInput;
3542
3051
  };
3543
3052
  };
3544
3053
  static default: typeof NiconiComments;
3545
3054
  static FlashComment: {
3546
- condition: (comment: {
3547
- owner: boolean;
3548
- content: string;
3549
- id: number;
3550
- vpos: number;
3551
- date: number;
3552
- date_usec: number;
3553
- premium: boolean;
3554
- mail: string[];
3555
- user_id: number;
3556
- layer: number;
3557
- is_my_post: boolean;
3558
- }) => boolean;
3055
+ condition: (comment: FormattedComment) => boolean;
3559
3056
  class: typeof FlashComment;
3560
3057
  };
3561
3058
  static internal: typeof internal;
3562
- constructor(renderer: IRenderer | HTMLCanvasElement, data: InputFormat, initOptions?: Options);
3059
+ constructor(_renderer: IRenderer | HTMLCanvasElement, data: InputFormat, initOptions?: Options);
3563
3060
  private preRendering;
3564
3061
  private getCommentPos;
3565
3062
  private sortTimelineComment;