@konoui/mjimage 0.0.32 → 0.0.33

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.d.cts CHANGED
@@ -756,7 +756,6 @@ export declare class Efficiency {
756
756
  shanten: number;
757
757
  candidates: Tile[];
758
758
  };
759
- static partialShanten(input: string): number;
760
759
  }
761
760
 
762
761
  export declare interface EndEvent {
@@ -971,7 +970,7 @@ export declare const parseTableInput: (s: string) => {
971
970
  score: number;
972
971
  };
973
972
  board: {
974
- round: "1w1" | "1w2" | "1w3" | "1w4" | "2w1" | "2w2" | "2w3" | "2w4" | "3w1" | "3w2" | "3w3" | "3w4" | "4w1" | "4w2" | "4w3" | "4w4";
973
+ round: string | number;
975
974
  sticks: {
976
975
  reach: number;
977
976
  dead: number;
@@ -1006,10 +1005,10 @@ export declare class PlaceManager {
1006
1005
  resetDeadStick(): void;
1007
1006
  resetReachStick(): void;
1008
1007
  is(r: Round): boolean;
1009
- wind(id: string): "1w" | "2w" | "3w" | "4w";
1008
+ wind(id: string): Wind;
1010
1009
  playerID(w: Wind): string;
1011
1010
  get playerMap(): {
1012
- [key: string]: "1w" | "2w" | "3w" | "4w";
1011
+ [key: string]: Wind;
1013
1012
  };
1014
1013
  }
1015
1014
 
@@ -1017,7 +1016,7 @@ export declare class Player extends BaseActor {
1017
1016
  river: River;
1018
1017
  doras: Tile[];
1019
1018
  constructor(playerID: string, eventHandler: EventHandler);
1020
- get myWind(): "1w" | "2w" | "3w" | "4w";
1019
+ get myWind(): Wind;
1021
1020
  setHands(e: DistributeEvent): void;
1022
1021
  handleDiscard(tiles: Tile[]): Tile;
1023
1022
  handleEvent(e: PlayerEvent): void;
@@ -1046,7 +1045,7 @@ export declare interface PlayerProps {
1046
1045
  handler: EventHandler;
1047
1046
  }
1048
1047
 
1049
- export declare const prevRound: (r: Round) => "1w1" | "1w2" | "1w3" | "1w4" | "2w1" | "2w2" | "2w3" | "2w4" | "3w1" | "3w2" | "3w3" | "3w4" | "4w1" | "4w2" | "4w3" | "4w4";
1048
+ export declare const prevRound: (r: Round) => string;
1050
1049
 
1051
1050
  export declare const prevWind: (w: Wind) => Wind;
1052
1051
 
@@ -1116,25 +1115,29 @@ export declare interface RonEvent {
1116
1115
  pushBackReachStick: boolean;
1117
1116
  }
1118
1117
 
1119
- export declare type Round = keyof typeof ROUND_MAP;
1118
+ export declare const ROUND: {
1119
+ readonly E1: string;
1120
+ readonly E2: string;
1121
+ readonly E3: string;
1122
+ readonly E4: string;
1123
+ readonly S1: string;
1124
+ readonly S2: string;
1125
+ readonly S3: string;
1126
+ readonly S4: string;
1127
+ readonly W1: string;
1128
+ readonly W2: string;
1129
+ readonly W3: string;
1130
+ readonly W4: string;
1131
+ readonly N1: string;
1132
+ readonly N2: string;
1133
+ readonly N3: string;
1134
+ readonly N4: string;
1135
+ };
1136
+
1137
+ export declare type Round = (typeof ROUND)[keyof typeof ROUND];
1120
1138
 
1121
1139
  export declare const ROUND_MAP: {
1122
- readonly "1w1": "東1局";
1123
- readonly "1w2": "東2局";
1124
- readonly "1w3": "東3局";
1125
- readonly "1w4": "東4局";
1126
- readonly "2w1": "南1局";
1127
- readonly "2w2": "南2局";
1128
- readonly "2w3": "南3局";
1129
- readonly "2w4": "南4局";
1130
- readonly "3w1": "西1局";
1131
- readonly "3w2": "西2局";
1132
- readonly "3w3": "西3局";
1133
- readonly "3w4": "西4局";
1134
- readonly "4w1": "北1局";
1135
- readonly "4w2": "北2局";
1136
- readonly "4w3": "北3局";
1137
- readonly "4w4": "北4局";
1140
+ readonly [x: string]: "東1局" | "東2局" | "東3局" | "東4局" | "南1局" | "南2局" | "南3局" | "南4局" | "西1局" | "西2局" | "西3局" | "西4局" | "北1局" | "北2局" | "北3局" | "北4局";
1138
1141
  };
1139
1142
 
1140
1143
  export declare interface ScoreBoardInput {
@@ -1168,10 +1171,10 @@ export declare class ScoreManager {
1168
1171
  */
1169
1172
  restoreReachStick(id: string): void;
1170
1173
  update(result: {
1171
- "1w": number;
1172
- "2w": number;
1173
- "3w": number;
1174
- "4w": number;
1174
+ [WIND.E]: number;
1175
+ [WIND.S]: number;
1176
+ [WIND.W]: number;
1177
+ [WIND.N]: number;
1175
1178
  }, windMap: {
1176
1179
  [key: string]: Wind;
1177
1180
  }): void;
@@ -1212,14 +1215,14 @@ export declare class ShantenCalculator {
1212
1215
  export declare function shuffle<T>(array: T[]): T[];
1213
1216
 
1214
1217
  export declare const TABLE_CONTEXT: {
1215
- BASE: number;
1218
+ readonly BASE: 40;
1216
1219
  };
1217
1220
 
1218
1221
  export declare type TableInput = InferOutput<typeof tableInputSchema>;
1219
1222
 
1220
1223
  declare const tableInputSchema: StrictObjectSchema< {
1221
1224
  readonly board: StrictObjectSchema< {
1222
- readonly round: OptionalSchema<PicklistSchema<("1w1" | "1w2" | "1w3" | "1w4" | "2w1" | "2w2" | "2w3" | "2w4" | "3w1" | "3w2" | "3w3" | "3w4" | "4w1" | "4w2" | "4w3" | "4w4")[], undefined>, "1w1">;
1225
+ readonly round: OptionalSchema<PicklistSchema<(string | number)[], undefined>, string>;
1223
1226
  readonly sticks: OptionalSchema<StrictObjectSchema< {
1224
1227
  readonly reach: OptionalSchema<SchemaWithPipe<[NumberSchema<undefined>, MinValueAction<number, 0, "">, MaxValueAction<number, 9, "">]>, 0>;
1225
1228
  readonly dead: OptionalSchema<SchemaWithPipe<[NumberSchema<undefined>, MinValueAction<number, 0, "">, MaxValueAction<number, 9, "">]>, 0>;
@@ -1227,7 +1230,7 @@ readonly dead: OptionalSchema<SchemaWithPipe<[NumberSchema<undefined>, MinValueA
1227
1230
  readonly reach: 0;
1228
1231
  readonly dead: 0;
1229
1232
  }>;
1230
- readonly doras: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, readonly ["3w"]>;
1233
+ readonly doras: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, readonly ["2w"]>;
1231
1234
  readonly front: OptionalSchema<PicklistSchema<("1w" | "2w" | "3w" | "4w")[], undefined>, "1w">;
1232
1235
  }, undefined>;
1233
1236
  readonly "1w": OptionalSchema<StrictObjectSchema< {
@@ -1298,10 +1301,10 @@ export declare class Tile {
1298
1301
  }
1299
1302
 
1300
1303
  export declare const TILE_CONTEXT: {
1301
- WIDTH: number;
1302
- HEIGHT: number;
1303
- TEXT_SCALE: number;
1304
- BLOCK_MARGIN_SCALE: number;
1304
+ readonly WIDTH: 66;
1305
+ readonly HEIGHT: 90;
1306
+ readonly TEXT_SCALE: 0.8;
1307
+ readonly BLOCK_MARGIN_SCALE: 0.3;
1305
1308
  };
1306
1309
 
1307
1310
  export declare const tileSortFunc: (i: Tile, j: Tile) => number;
@@ -1353,13 +1356,13 @@ export declare interface WallProps {
1353
1356
  }
1354
1357
 
1355
1358
  export declare const WIND: {
1356
- readonly EAST: "1w";
1357
- readonly SOUTH: "2w";
1358
- readonly WEST: "3w";
1359
- readonly NORTH: "4w";
1359
+ readonly E: "1w";
1360
+ readonly S: "2w";
1361
+ readonly W: "3w";
1362
+ readonly N: "4w";
1360
1363
  };
1361
1364
 
1362
- export declare type Wind = keyof typeof WIND_MAP;
1365
+ export declare type Wind = (typeof WIND)[keyof typeof WIND];
1363
1366
 
1364
1367
  export declare const WIND_MAP: {
1365
1368
  readonly "1w": "東";
package/dist/index.d.ts CHANGED
@@ -756,7 +756,6 @@ export declare class Efficiency {
756
756
  shanten: number;
757
757
  candidates: Tile[];
758
758
  };
759
- static partialShanten(input: string): number;
760
759
  }
761
760
 
762
761
  export declare interface EndEvent {
@@ -971,7 +970,7 @@ export declare const parseTableInput: (s: string) => {
971
970
  score: number;
972
971
  };
973
972
  board: {
974
- round: "1w1" | "1w2" | "1w3" | "1w4" | "2w1" | "2w2" | "2w3" | "2w4" | "3w1" | "3w2" | "3w3" | "3w4" | "4w1" | "4w2" | "4w3" | "4w4";
973
+ round: string | number;
975
974
  sticks: {
976
975
  reach: number;
977
976
  dead: number;
@@ -1006,10 +1005,10 @@ export declare class PlaceManager {
1006
1005
  resetDeadStick(): void;
1007
1006
  resetReachStick(): void;
1008
1007
  is(r: Round): boolean;
1009
- wind(id: string): "1w" | "2w" | "3w" | "4w";
1008
+ wind(id: string): Wind;
1010
1009
  playerID(w: Wind): string;
1011
1010
  get playerMap(): {
1012
- [key: string]: "1w" | "2w" | "3w" | "4w";
1011
+ [key: string]: Wind;
1013
1012
  };
1014
1013
  }
1015
1014
 
@@ -1017,7 +1016,7 @@ export declare class Player extends BaseActor {
1017
1016
  river: River;
1018
1017
  doras: Tile[];
1019
1018
  constructor(playerID: string, eventHandler: EventHandler);
1020
- get myWind(): "1w" | "2w" | "3w" | "4w";
1019
+ get myWind(): Wind;
1021
1020
  setHands(e: DistributeEvent): void;
1022
1021
  handleDiscard(tiles: Tile[]): Tile;
1023
1022
  handleEvent(e: PlayerEvent): void;
@@ -1046,7 +1045,7 @@ export declare interface PlayerProps {
1046
1045
  handler: EventHandler;
1047
1046
  }
1048
1047
 
1049
- export declare const prevRound: (r: Round) => "1w1" | "1w2" | "1w3" | "1w4" | "2w1" | "2w2" | "2w3" | "2w4" | "3w1" | "3w2" | "3w3" | "3w4" | "4w1" | "4w2" | "4w3" | "4w4";
1048
+ export declare const prevRound: (r: Round) => string;
1050
1049
 
1051
1050
  export declare const prevWind: (w: Wind) => Wind;
1052
1051
 
@@ -1116,25 +1115,29 @@ export declare interface RonEvent {
1116
1115
  pushBackReachStick: boolean;
1117
1116
  }
1118
1117
 
1119
- export declare type Round = keyof typeof ROUND_MAP;
1118
+ export declare const ROUND: {
1119
+ readonly E1: string;
1120
+ readonly E2: string;
1121
+ readonly E3: string;
1122
+ readonly E4: string;
1123
+ readonly S1: string;
1124
+ readonly S2: string;
1125
+ readonly S3: string;
1126
+ readonly S4: string;
1127
+ readonly W1: string;
1128
+ readonly W2: string;
1129
+ readonly W3: string;
1130
+ readonly W4: string;
1131
+ readonly N1: string;
1132
+ readonly N2: string;
1133
+ readonly N3: string;
1134
+ readonly N4: string;
1135
+ };
1136
+
1137
+ export declare type Round = (typeof ROUND)[keyof typeof ROUND];
1120
1138
 
1121
1139
  export declare const ROUND_MAP: {
1122
- readonly "1w1": "東1局";
1123
- readonly "1w2": "東2局";
1124
- readonly "1w3": "東3局";
1125
- readonly "1w4": "東4局";
1126
- readonly "2w1": "南1局";
1127
- readonly "2w2": "南2局";
1128
- readonly "2w3": "南3局";
1129
- readonly "2w4": "南4局";
1130
- readonly "3w1": "西1局";
1131
- readonly "3w2": "西2局";
1132
- readonly "3w3": "西3局";
1133
- readonly "3w4": "西4局";
1134
- readonly "4w1": "北1局";
1135
- readonly "4w2": "北2局";
1136
- readonly "4w3": "北3局";
1137
- readonly "4w4": "北4局";
1140
+ readonly [x: string]: "東1局" | "東2局" | "東3局" | "東4局" | "南1局" | "南2局" | "南3局" | "南4局" | "西1局" | "西2局" | "西3局" | "西4局" | "北1局" | "北2局" | "北3局" | "北4局";
1138
1141
  };
1139
1142
 
1140
1143
  export declare interface ScoreBoardInput {
@@ -1168,10 +1171,10 @@ export declare class ScoreManager {
1168
1171
  */
1169
1172
  restoreReachStick(id: string): void;
1170
1173
  update(result: {
1171
- "1w": number;
1172
- "2w": number;
1173
- "3w": number;
1174
- "4w": number;
1174
+ [WIND.E]: number;
1175
+ [WIND.S]: number;
1176
+ [WIND.W]: number;
1177
+ [WIND.N]: number;
1175
1178
  }, windMap: {
1176
1179
  [key: string]: Wind;
1177
1180
  }): void;
@@ -1212,14 +1215,14 @@ export declare class ShantenCalculator {
1212
1215
  export declare function shuffle<T>(array: T[]): T[];
1213
1216
 
1214
1217
  export declare const TABLE_CONTEXT: {
1215
- BASE: number;
1218
+ readonly BASE: 40;
1216
1219
  };
1217
1220
 
1218
1221
  export declare type TableInput = InferOutput<typeof tableInputSchema>;
1219
1222
 
1220
1223
  declare const tableInputSchema: StrictObjectSchema< {
1221
1224
  readonly board: StrictObjectSchema< {
1222
- readonly round: OptionalSchema<PicklistSchema<("1w1" | "1w2" | "1w3" | "1w4" | "2w1" | "2w2" | "2w3" | "2w4" | "3w1" | "3w2" | "3w3" | "3w4" | "4w1" | "4w2" | "4w3" | "4w4")[], undefined>, "1w1">;
1225
+ readonly round: OptionalSchema<PicklistSchema<(string | number)[], undefined>, string>;
1223
1226
  readonly sticks: OptionalSchema<StrictObjectSchema< {
1224
1227
  readonly reach: OptionalSchema<SchemaWithPipe<[NumberSchema<undefined>, MinValueAction<number, 0, "">, MaxValueAction<number, 9, "">]>, 0>;
1225
1228
  readonly dead: OptionalSchema<SchemaWithPipe<[NumberSchema<undefined>, MinValueAction<number, 0, "">, MaxValueAction<number, 9, "">]>, 0>;
@@ -1227,7 +1230,7 @@ readonly dead: OptionalSchema<SchemaWithPipe<[NumberSchema<undefined>, MinValueA
1227
1230
  readonly reach: 0;
1228
1231
  readonly dead: 0;
1229
1232
  }>;
1230
- readonly doras: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, readonly ["3w"]>;
1233
+ readonly doras: OptionalSchema<ArraySchema<StringSchema<undefined>, undefined>, readonly ["2w"]>;
1231
1234
  readonly front: OptionalSchema<PicklistSchema<("1w" | "2w" | "3w" | "4w")[], undefined>, "1w">;
1232
1235
  }, undefined>;
1233
1236
  readonly "1w": OptionalSchema<StrictObjectSchema< {
@@ -1298,10 +1301,10 @@ export declare class Tile {
1298
1301
  }
1299
1302
 
1300
1303
  export declare const TILE_CONTEXT: {
1301
- WIDTH: number;
1302
- HEIGHT: number;
1303
- TEXT_SCALE: number;
1304
- BLOCK_MARGIN_SCALE: number;
1304
+ readonly WIDTH: 66;
1305
+ readonly HEIGHT: 90;
1306
+ readonly TEXT_SCALE: 0.8;
1307
+ readonly BLOCK_MARGIN_SCALE: 0.3;
1305
1308
  };
1306
1309
 
1307
1310
  export declare const tileSortFunc: (i: Tile, j: Tile) => number;
@@ -1353,13 +1356,13 @@ export declare interface WallProps {
1353
1356
  }
1354
1357
 
1355
1358
  export declare const WIND: {
1356
- readonly EAST: "1w";
1357
- readonly SOUTH: "2w";
1358
- readonly WEST: "3w";
1359
- readonly NORTH: "4w";
1359
+ readonly E: "1w";
1360
+ readonly S: "2w";
1361
+ readonly W: "3w";
1362
+ readonly N: "4w";
1360
1363
  };
1361
1364
 
1362
- export declare type Wind = keyof typeof WIND_MAP;
1365
+ export declare type Wind = (typeof WIND)[keyof typeof WIND];
1363
1366
 
1364
1367
  export declare const WIND_MAP: {
1365
1368
  readonly "1w": "東";