@konoui/mjimage 0.0.60 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +12 -12
- package/dist/index.d.cts +98 -198
- package/dist/index.d.ts +98 -198
- package/dist/index.js +2599 -2577
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -45,7 +45,7 @@ export declare abstract class BaseActor {
|
|
|
45
45
|
"4w": ActorHand;
|
|
46
46
|
};
|
|
47
47
|
counter: Counter;
|
|
48
|
-
|
|
48
|
+
doraIndicators: Tile[];
|
|
49
49
|
eventHandler: EventHandler;
|
|
50
50
|
constructor(id: string, eventHandler: EventHandler);
|
|
51
51
|
hand(w: Wind): ActorHand;
|
|
@@ -201,8 +201,8 @@ export declare class BlockThree extends Block {
|
|
|
201
201
|
declare type BlockType = (typeof BLOCK)[keyof typeof BLOCK];
|
|
202
202
|
|
|
203
203
|
export declare interface BoardContext {
|
|
204
|
-
|
|
205
|
-
|
|
204
|
+
doraIndicators: readonly Tile[];
|
|
205
|
+
hiddenDoraIndicators?: readonly Tile[];
|
|
206
206
|
round: Round;
|
|
207
207
|
myWind: Wind;
|
|
208
208
|
ronWind?: Wind;
|
|
@@ -217,6 +217,7 @@ export declare interface BoardContext {
|
|
|
217
217
|
finalDiscardWin?: boolean;
|
|
218
218
|
oneShotWin?: boolean;
|
|
219
219
|
roundUp8000?: boolean;
|
|
220
|
+
disableCountable32000?: boolean;
|
|
220
221
|
}
|
|
221
222
|
|
|
222
223
|
declare type BoardRound = (typeof ROUND_MAP)[keyof typeof ROUND_MAP];
|
|
@@ -585,7 +586,7 @@ export declare interface DistributeEvent {
|
|
|
585
586
|
[key in Wind]: string;
|
|
586
587
|
};
|
|
587
588
|
wind: Wind;
|
|
588
|
-
|
|
589
|
+
doraIndicator: string;
|
|
589
590
|
players: string[];
|
|
590
591
|
places: {
|
|
591
592
|
[key: string]: Wind;
|
|
@@ -600,182 +601,6 @@ export declare interface DistributeEvent {
|
|
|
600
601
|
};
|
|
601
602
|
}
|
|
602
603
|
|
|
603
|
-
export declare class DoubleCalculator {
|
|
604
|
-
hand: Hand;
|
|
605
|
-
cfg: {
|
|
606
|
-
doras: readonly Tile[];
|
|
607
|
-
blindDoras: readonly Tile[];
|
|
608
|
-
roundWind: Tile;
|
|
609
|
-
myWind: Tile;
|
|
610
|
-
reached: 0 | 1 | 2;
|
|
611
|
-
sticks: {
|
|
612
|
-
readonly reach: number;
|
|
613
|
-
readonly dead: number;
|
|
614
|
-
};
|
|
615
|
-
replacementWin: boolean;
|
|
616
|
-
quadWin: boolean;
|
|
617
|
-
finalWallWin: boolean;
|
|
618
|
-
finalDiscardWin: boolean;
|
|
619
|
-
oneShotWin: boolean;
|
|
620
|
-
roundUp8000: boolean;
|
|
621
|
-
orig: BoardContext;
|
|
622
|
-
};
|
|
623
|
-
constructor(hand: Hand, params: BoardContext);
|
|
624
|
-
calc(...hands: readonly Block[][]): WinResult | false;
|
|
625
|
-
calcPatterns(hands: readonly Block[][]): {
|
|
626
|
-
points: {
|
|
627
|
-
name: string;
|
|
628
|
-
double: number;
|
|
629
|
-
}[];
|
|
630
|
-
fu: number;
|
|
631
|
-
hand: Block[];
|
|
632
|
-
}[];
|
|
633
|
-
private minus;
|
|
634
|
-
dA1(h: readonly Block[]): {
|
|
635
|
-
name: string;
|
|
636
|
-
double: number;
|
|
637
|
-
}[];
|
|
638
|
-
dB1(h: readonly Block[]): {
|
|
639
|
-
name: string;
|
|
640
|
-
double: number;
|
|
641
|
-
}[];
|
|
642
|
-
dC1(h: readonly Block[]): {
|
|
643
|
-
name: string;
|
|
644
|
-
double: number;
|
|
645
|
-
}[];
|
|
646
|
-
dD1(h: readonly Block[]): {
|
|
647
|
-
name: string;
|
|
648
|
-
double: number;
|
|
649
|
-
}[];
|
|
650
|
-
dE1(h: readonly Block[]): {
|
|
651
|
-
name: string;
|
|
652
|
-
double: number;
|
|
653
|
-
}[];
|
|
654
|
-
dF1(h: readonly Block[]): {
|
|
655
|
-
name: string;
|
|
656
|
-
double: number;
|
|
657
|
-
}[];
|
|
658
|
-
dG1(h: readonly Block[]): {
|
|
659
|
-
name: string;
|
|
660
|
-
double: number;
|
|
661
|
-
}[];
|
|
662
|
-
dH1(h: readonly Block[]): {
|
|
663
|
-
name: string;
|
|
664
|
-
double: number;
|
|
665
|
-
}[];
|
|
666
|
-
dI1(h: readonly Block[]): {
|
|
667
|
-
name: string;
|
|
668
|
-
double: number;
|
|
669
|
-
}[];
|
|
670
|
-
dJ1(h: readonly Block[]): {
|
|
671
|
-
name: string;
|
|
672
|
-
double: number;
|
|
673
|
-
}[];
|
|
674
|
-
dK1(h: readonly Block[]): {
|
|
675
|
-
name: string;
|
|
676
|
-
double: number;
|
|
677
|
-
}[];
|
|
678
|
-
dX1(h: readonly Block[]): {
|
|
679
|
-
name: string;
|
|
680
|
-
double: number;
|
|
681
|
-
}[];
|
|
682
|
-
dA2(h: readonly Block[]): {
|
|
683
|
-
name: string;
|
|
684
|
-
double: number;
|
|
685
|
-
}[];
|
|
686
|
-
dB2(h: readonly Block[]): {
|
|
687
|
-
name: string;
|
|
688
|
-
double: number;
|
|
689
|
-
}[];
|
|
690
|
-
dC2(h: readonly Block[]): {
|
|
691
|
-
name: string;
|
|
692
|
-
double: number;
|
|
693
|
-
}[];
|
|
694
|
-
dD2(h: readonly Block[]): {
|
|
695
|
-
name: string;
|
|
696
|
-
double: number;
|
|
697
|
-
}[];
|
|
698
|
-
dE2(h: readonly Block[]): {
|
|
699
|
-
name: string;
|
|
700
|
-
double: number;
|
|
701
|
-
}[];
|
|
702
|
-
dF2(h: readonly Block[]): {
|
|
703
|
-
name: string;
|
|
704
|
-
double: number;
|
|
705
|
-
}[];
|
|
706
|
-
dG2(h: readonly Block[]): {
|
|
707
|
-
name: string;
|
|
708
|
-
double: number;
|
|
709
|
-
}[];
|
|
710
|
-
dH2(h: readonly Block[]): {
|
|
711
|
-
name: string;
|
|
712
|
-
double: number;
|
|
713
|
-
}[];
|
|
714
|
-
dI2(h: readonly Block[]): {
|
|
715
|
-
name: string;
|
|
716
|
-
double: number;
|
|
717
|
-
}[];
|
|
718
|
-
dJ2(h: readonly Block[]): {
|
|
719
|
-
name: string;
|
|
720
|
-
double: number;
|
|
721
|
-
}[];
|
|
722
|
-
dA3(h: readonly Block[]): {
|
|
723
|
-
name: string;
|
|
724
|
-
double: number;
|
|
725
|
-
}[];
|
|
726
|
-
dB3(h: readonly Block[]): {
|
|
727
|
-
name: string;
|
|
728
|
-
double: number;
|
|
729
|
-
}[];
|
|
730
|
-
dC3(h: readonly Block[]): {
|
|
731
|
-
name: string;
|
|
732
|
-
double: number;
|
|
733
|
-
}[];
|
|
734
|
-
dA6(h: readonly Block[]): {
|
|
735
|
-
name: string;
|
|
736
|
-
double: number;
|
|
737
|
-
}[];
|
|
738
|
-
dA13(h: readonly Block[]): {
|
|
739
|
-
name: string;
|
|
740
|
-
double: number;
|
|
741
|
-
}[];
|
|
742
|
-
dB13(h: readonly Block[]): {
|
|
743
|
-
name: string;
|
|
744
|
-
double: number;
|
|
745
|
-
}[];
|
|
746
|
-
dC13(h: readonly Block[]): {
|
|
747
|
-
name: string;
|
|
748
|
-
double: number;
|
|
749
|
-
}[];
|
|
750
|
-
dD13(h: readonly Block[]): {
|
|
751
|
-
name: string;
|
|
752
|
-
double: number;
|
|
753
|
-
}[];
|
|
754
|
-
dE13(h: readonly Block[]): {
|
|
755
|
-
name: string;
|
|
756
|
-
double: number;
|
|
757
|
-
}[];
|
|
758
|
-
dF13(h: readonly Block[]): {
|
|
759
|
-
name: string;
|
|
760
|
-
double: number;
|
|
761
|
-
}[];
|
|
762
|
-
dG13(h: readonly Block[]): {
|
|
763
|
-
name: string;
|
|
764
|
-
double: number;
|
|
765
|
-
}[];
|
|
766
|
-
dH13(h: readonly Block[]): {
|
|
767
|
-
name: string;
|
|
768
|
-
double: number;
|
|
769
|
-
}[];
|
|
770
|
-
dI13(h: readonly Block[]): {
|
|
771
|
-
name: string;
|
|
772
|
-
double: number;
|
|
773
|
-
}[];
|
|
774
|
-
dJ13(h: readonly Block[]): never[];
|
|
775
|
-
dK13(h: readonly Block[]): never[];
|
|
776
|
-
calcFu(h: readonly Block[]): number;
|
|
777
|
-
}
|
|
778
|
-
|
|
779
604
|
export declare const drawBlocks: (svg: Svg, blocks: Block[], config?: ImageHelperConfig, options?: {
|
|
780
605
|
responsive?: boolean;
|
|
781
606
|
} & DrawOptions) => void;
|
|
@@ -988,9 +813,9 @@ export declare function isNum5(t: Tile): boolean;
|
|
|
988
813
|
export declare interface IWall {
|
|
989
814
|
kan(): Tile;
|
|
990
815
|
draw(): Tile;
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
816
|
+
openDoraIndicator(): Tile;
|
|
817
|
+
doraIndicators: readonly Tile[];
|
|
818
|
+
hiddenDoraIndicators: readonly Tile[];
|
|
994
819
|
canKan: boolean;
|
|
995
820
|
canDraw: boolean;
|
|
996
821
|
export(): WallProps;
|
|
@@ -1051,7 +876,7 @@ export declare const N19: readonly number[];
|
|
|
1051
876
|
export declare interface NewDoraEvent {
|
|
1052
877
|
id: string;
|
|
1053
878
|
type: Extract<Event_2, "NEW_DORA">;
|
|
1054
|
-
|
|
879
|
+
doraIndicator: string;
|
|
1055
880
|
wind: Wind;
|
|
1056
881
|
}
|
|
1057
882
|
|
|
@@ -1102,13 +927,13 @@ export declare class Parser {
|
|
|
1102
927
|
|
|
1103
928
|
export declare const parseTableInput: (s: string) => {
|
|
1104
929
|
board: {
|
|
1105
|
-
round:
|
|
930
|
+
round: Round;
|
|
1106
931
|
sticks: {
|
|
1107
932
|
reach: number;
|
|
1108
933
|
dead: number;
|
|
1109
934
|
};
|
|
1110
935
|
doras: string;
|
|
1111
|
-
front:
|
|
936
|
+
front: Wind;
|
|
1112
937
|
};
|
|
1113
938
|
"1w": {
|
|
1114
939
|
discard: string;
|
|
@@ -1196,6 +1021,76 @@ export declare class PlayerEfficiency {
|
|
|
1196
1021
|
|
|
1197
1022
|
export declare type PlayerEvent = DistributeEvent | EndEvent | CallEvent | RonEvent | TsumoEvent | DiscardEvent | DrawEvent | ReachEvent | ReachAcceptedEvent | NewDoraEvent | ChoiceAfterDrawnEvent | ChoiceAfterDiscardedEvent | ChoiceAfterCalled | ChoiceForReachAcceptance | ChoiceForChanKan;
|
|
1198
1023
|
|
|
1024
|
+
export declare class PointCalculator {
|
|
1025
|
+
hand: Hand;
|
|
1026
|
+
cfg: {
|
|
1027
|
+
doras: readonly Tile[];
|
|
1028
|
+
blindDoras: readonly Tile[];
|
|
1029
|
+
roundWind: Tile;
|
|
1030
|
+
myWind: Tile;
|
|
1031
|
+
reached: 0 | 1 | 2;
|
|
1032
|
+
sticks: {
|
|
1033
|
+
readonly reach: number;
|
|
1034
|
+
readonly dead: number;
|
|
1035
|
+
};
|
|
1036
|
+
replacementWin: boolean;
|
|
1037
|
+
quadWin: boolean;
|
|
1038
|
+
finalWallWin: boolean;
|
|
1039
|
+
finalDiscardWin: boolean;
|
|
1040
|
+
oneShotWin: boolean;
|
|
1041
|
+
roundUp8000: boolean;
|
|
1042
|
+
disableCountable32000: boolean;
|
|
1043
|
+
orig: BoardContext;
|
|
1044
|
+
};
|
|
1045
|
+
constructor(hand: Hand, params: BoardContext);
|
|
1046
|
+
calc(...hands: readonly Block[][]): WinResult | false;
|
|
1047
|
+
calcPatterns(hands: readonly Block[][]): {
|
|
1048
|
+
yakus: Yaku[];
|
|
1049
|
+
fu: number;
|
|
1050
|
+
hand: Block[];
|
|
1051
|
+
is32000?: boolean;
|
|
1052
|
+
}[];
|
|
1053
|
+
private minus;
|
|
1054
|
+
dA1(h: readonly Block[]): Yaku[];
|
|
1055
|
+
dB1(h: readonly Block[]): Yaku[];
|
|
1056
|
+
dC1(h: readonly Block[]): Yaku[];
|
|
1057
|
+
dD1(h: readonly Block[]): Yaku[];
|
|
1058
|
+
dE1(h: readonly Block[]): Yaku[];
|
|
1059
|
+
dF1(h: readonly Block[]): Yaku[];
|
|
1060
|
+
dG1(h: readonly Block[]): Yaku[];
|
|
1061
|
+
dH1(h: readonly Block[]): Yaku[];
|
|
1062
|
+
dI1(h: readonly Block[]): Yaku[];
|
|
1063
|
+
dJ1(h: readonly Block[]): Yaku[];
|
|
1064
|
+
dK1(h: readonly Block[]): Yaku[];
|
|
1065
|
+
dX1(h: readonly Block[]): Yaku[];
|
|
1066
|
+
dA2(h: readonly Block[]): Yaku[];
|
|
1067
|
+
dB2(h: readonly Block[]): Yaku[];
|
|
1068
|
+
dC2(h: readonly Block[]): Yaku[];
|
|
1069
|
+
dD2(h: readonly Block[]): Yaku[];
|
|
1070
|
+
dE2(h: readonly Block[]): Yaku[];
|
|
1071
|
+
dF2(h: readonly Block[]): Yaku[];
|
|
1072
|
+
dG2(h: readonly Block[]): Yaku[];
|
|
1073
|
+
dH2(h: readonly Block[]): Yaku[];
|
|
1074
|
+
dI2(h: readonly Block[]): Yaku[];
|
|
1075
|
+
dJ2(h: readonly Block[]): Yaku[];
|
|
1076
|
+
dA3(h: readonly Block[]): Yaku[];
|
|
1077
|
+
dB3(h: readonly Block[]): Yaku[];
|
|
1078
|
+
dC3(h: readonly Block[]): Yaku[];
|
|
1079
|
+
dA6(h: readonly Block[]): Yaku[];
|
|
1080
|
+
dA13(h: readonly Block[]): Yaku[];
|
|
1081
|
+
dB13(h: readonly Block[]): Yaku[];
|
|
1082
|
+
dC13(h: readonly Block[]): Yaku[];
|
|
1083
|
+
dD13(h: readonly Block[]): Yaku[];
|
|
1084
|
+
dE13(h: readonly Block[]): Yaku[];
|
|
1085
|
+
dF13(h: readonly Block[]): Yaku[];
|
|
1086
|
+
dG13(h: readonly Block[]): Yaku[];
|
|
1087
|
+
dH13(h: readonly Block[]): Yaku[];
|
|
1088
|
+
dI13(h: readonly Block[]): Yaku[];
|
|
1089
|
+
dJ13(h: readonly Block[]): Yaku[];
|
|
1090
|
+
dK13(h: readonly Block[]): Yaku[];
|
|
1091
|
+
calcFu(h: readonly Block[]): number;
|
|
1092
|
+
}
|
|
1093
|
+
|
|
1199
1094
|
export declare const prevRound: (r: Round) => Round;
|
|
1200
1095
|
|
|
1201
1096
|
export declare const prevWind: (w: Wind) => Wind;
|
|
@@ -1362,9 +1257,9 @@ declare type Separator = typeof INPUT_SEPARATOR;
|
|
|
1362
1257
|
|
|
1363
1258
|
export declare type SerializedBlock = ReturnType<Block["serialize"]>;
|
|
1364
1259
|
|
|
1365
|
-
declare type SerializedBoardContext = Omit<BoardContext, "
|
|
1366
|
-
|
|
1367
|
-
|
|
1260
|
+
declare type SerializedBoardContext = Omit<BoardContext, "doraIndicators" | "hiddenDoraIndicators"> & {
|
|
1261
|
+
doraIndicators: readonly string[];
|
|
1262
|
+
hiddenDoraIndicators?: readonly string[];
|
|
1368
1263
|
};
|
|
1369
1264
|
|
|
1370
1265
|
export declare interface SerializedCandidate {
|
|
@@ -1378,6 +1273,8 @@ export declare type SerializedWinResult = Omit<WinResult, "hand" | "boardContext
|
|
|
1378
1273
|
boardContext: SerializedBoardContext;
|
|
1379
1274
|
};
|
|
1380
1275
|
|
|
1276
|
+
export declare const serializeWinResult: (ret: WinResult) => SerializedWinResult;
|
|
1277
|
+
|
|
1381
1278
|
export declare class ShantenCalculator {
|
|
1382
1279
|
hand: Hand;
|
|
1383
1280
|
constructor(hand: Hand);
|
|
@@ -1576,9 +1473,9 @@ export declare class Wall {
|
|
|
1576
1473
|
constructor(backup?: WallProps);
|
|
1577
1474
|
kan(): Tile;
|
|
1578
1475
|
draw(): Tile;
|
|
1579
|
-
|
|
1580
|
-
get
|
|
1581
|
-
get
|
|
1476
|
+
openDoraIndicator(): Tile;
|
|
1477
|
+
get doraIndicators(): Tile[];
|
|
1478
|
+
get hiddenDoraIndicators(): Tile[];
|
|
1582
1479
|
get canKan(): boolean;
|
|
1583
1480
|
get canDraw(): boolean;
|
|
1584
1481
|
initialHands(): {
|
|
@@ -1596,8 +1493,8 @@ export declare interface WallProps {
|
|
|
1596
1493
|
drawable: string[];
|
|
1597
1494
|
dead: string[];
|
|
1598
1495
|
replacement: string[];
|
|
1599
|
-
|
|
1600
|
-
|
|
1496
|
+
doraIndicators: string[];
|
|
1497
|
+
hiddenDoraIndicators: string[];
|
|
1601
1498
|
}
|
|
1602
1499
|
|
|
1603
1500
|
export declare const WIND: {
|
|
@@ -1622,13 +1519,16 @@ export declare interface WinResult {
|
|
|
1622
1519
|
};
|
|
1623
1520
|
sum: number;
|
|
1624
1521
|
fu: number;
|
|
1625
|
-
|
|
1626
|
-
name: string;
|
|
1627
|
-
double: number;
|
|
1628
|
-
}[];
|
|
1522
|
+
yakus: readonly Yaku[];
|
|
1629
1523
|
point: number;
|
|
1630
1524
|
hand: Block[];
|
|
1631
1525
|
boardContext: BoardContext;
|
|
1526
|
+
description: string;
|
|
1527
|
+
}
|
|
1528
|
+
|
|
1529
|
+
export declare interface Yaku {
|
|
1530
|
+
name: string;
|
|
1531
|
+
han: number;
|
|
1632
1532
|
}
|
|
1633
1533
|
|
|
1634
1534
|
export { }
|