@konoui/mjimage 0.5.0 → 0.5.2
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 +10 -15
- package/dist/index.d.cts +8 -7
- package/dist/index.d.ts +8 -7
- package/dist/index.js +3333 -3229
- package/package.json +5 -5
package/dist/index.d.cts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { Actor } from 'xstate';
|
|
2
2
|
import { AnyActorRef } from 'xstate';
|
|
3
3
|
import { EventObject } from 'xstate';
|
|
4
|
-
import { incrementalIDGenerator as incrementalIDGenerator_2 } from './state-machine';
|
|
5
4
|
import { InferOutput } from 'valibot';
|
|
6
5
|
import { MaxValueAction } from 'valibot';
|
|
7
6
|
import { MetaObject } from 'xstate';
|
|
@@ -17,7 +16,6 @@ import { StateMachine } from 'xstate';
|
|
|
17
16
|
import { StateValue } from 'xstate';
|
|
18
17
|
import { StrictObjectSchema } from 'valibot';
|
|
19
18
|
import { StringSchema } from 'valibot';
|
|
20
|
-
import { Wind as Wind_2 } from '../..';
|
|
21
19
|
|
|
22
20
|
export declare class ActorHand extends Hand {
|
|
23
21
|
isBackHand(): boolean;
|
|
@@ -117,6 +115,7 @@ export declare abstract class Block {
|
|
|
117
115
|
|
|
118
116
|
export declare class BlockAnKan extends Block {
|
|
119
117
|
constructor(tiles: readonly Tile[]);
|
|
118
|
+
get tiles(): readonly Tile[];
|
|
120
119
|
get tilesWithBack(): Tile[];
|
|
121
120
|
static from(s: string): BlockAnKan;
|
|
122
121
|
toString(): string;
|
|
@@ -225,8 +224,6 @@ declare type BoardRound = (typeof ROUND_MAP)[keyof typeof ROUND_MAP];
|
|
|
225
224
|
|
|
226
225
|
declare type BoardWind = (typeof WIND_MAP)[keyof typeof WIND_MAP];
|
|
227
226
|
|
|
228
|
-
export declare const callBlockIndex: (caller: Wind, discardedBy: Wind, type: typeof BLOCK.PON | typeof BLOCK.DAI_KAN) => 0 | 1 | 2 | 3;
|
|
229
|
-
|
|
230
227
|
export declare interface CallEvent {
|
|
231
228
|
id: string;
|
|
232
229
|
type: Extract<ChoiceEvent, "PON" | "CHI" | "AN_KAN" | "SHO_KAN" | "DAI_KAN">;
|
|
@@ -302,7 +299,7 @@ export declare class Controller {
|
|
|
302
299
|
oneShotMap: { [key in Wind]: boolean; };
|
|
303
300
|
missingMap: { [key in Wind]: boolean; };
|
|
304
301
|
controller: Controller;
|
|
305
|
-
genEventID: ReturnType<
|
|
302
|
+
genEventID: ReturnType<incrementalIDGenerator>;
|
|
306
303
|
}, {
|
|
307
304
|
type: "";
|
|
308
305
|
} | {
|
|
@@ -708,6 +705,8 @@ export declare class G extends Mark {
|
|
|
708
705
|
each(block: (idx: number, children: Mark[]) => void, deep: boolean): void;
|
|
709
706
|
}
|
|
710
707
|
|
|
708
|
+
export declare const getCallBlockIndex: (caller: Wind, discardedBy: Wind, type: typeof BLOCK.PON | typeof BLOCK.DAI_KAN) => 0 | 1 | 2 | 3;
|
|
709
|
+
|
|
711
710
|
export declare class Hand {
|
|
712
711
|
protected data: HandData;
|
|
713
712
|
constructor(input: string | Block[], allowBackBlock?: boolean);
|
|
@@ -923,7 +922,7 @@ export declare class Parser {
|
|
|
923
922
|
tiles(): readonly Tile[];
|
|
924
923
|
tileSeparators(): readonly (Tile | Separator)[];
|
|
925
924
|
private makeBlocks;
|
|
926
|
-
validate
|
|
925
|
+
private validate;
|
|
927
926
|
}
|
|
928
927
|
|
|
929
928
|
export declare const parseTableInput: (s: string) => {
|
|
@@ -993,7 +992,7 @@ export declare class Player extends BaseActor {
|
|
|
993
992
|
river: River;
|
|
994
993
|
doras: Tile[];
|
|
995
994
|
constructor(playerID: string, eventHandler: EventHandler);
|
|
996
|
-
get myWind():
|
|
995
|
+
get myWind(): Wind;
|
|
997
996
|
setHands(e: DistributeEvent): void;
|
|
998
997
|
handleDiscard(tiles: Tile[]): Tile;
|
|
999
998
|
handleEvent(e: PlayerEvent): void;
|
|
@@ -1438,6 +1437,8 @@ export declare const TILE_CONTEXT: {
|
|
|
1438
1437
|
|
|
1439
1438
|
export declare const tileSortFunc: (i: Tile, j: Tile) => number;
|
|
1440
1439
|
|
|
1440
|
+
export declare const toDora: (doraIndicator: Tile) => Tile;
|
|
1441
|
+
|
|
1441
1442
|
export declare interface TsumoEvent {
|
|
1442
1443
|
id: string;
|
|
1443
1444
|
type: Extract<ChoiceEvent, "TSUMO">;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { Actor } from 'xstate';
|
|
2
2
|
import { AnyActorRef } from 'xstate';
|
|
3
3
|
import { EventObject } from 'xstate';
|
|
4
|
-
import { incrementalIDGenerator as incrementalIDGenerator_2 } from './state-machine';
|
|
5
4
|
import { InferOutput } from 'valibot';
|
|
6
5
|
import { MaxValueAction } from 'valibot';
|
|
7
6
|
import { MetaObject } from 'xstate';
|
|
@@ -17,7 +16,6 @@ import { StateMachine } from 'xstate';
|
|
|
17
16
|
import { StateValue } from 'xstate';
|
|
18
17
|
import { StrictObjectSchema } from 'valibot';
|
|
19
18
|
import { StringSchema } from 'valibot';
|
|
20
|
-
import { Wind as Wind_2 } from '../..';
|
|
21
19
|
|
|
22
20
|
export declare class ActorHand extends Hand {
|
|
23
21
|
isBackHand(): boolean;
|
|
@@ -117,6 +115,7 @@ export declare abstract class Block {
|
|
|
117
115
|
|
|
118
116
|
export declare class BlockAnKan extends Block {
|
|
119
117
|
constructor(tiles: readonly Tile[]);
|
|
118
|
+
get tiles(): readonly Tile[];
|
|
120
119
|
get tilesWithBack(): Tile[];
|
|
121
120
|
static from(s: string): BlockAnKan;
|
|
122
121
|
toString(): string;
|
|
@@ -225,8 +224,6 @@ declare type BoardRound = (typeof ROUND_MAP)[keyof typeof ROUND_MAP];
|
|
|
225
224
|
|
|
226
225
|
declare type BoardWind = (typeof WIND_MAP)[keyof typeof WIND_MAP];
|
|
227
226
|
|
|
228
|
-
export declare const callBlockIndex: (caller: Wind, discardedBy: Wind, type: typeof BLOCK.PON | typeof BLOCK.DAI_KAN) => 0 | 1 | 2 | 3;
|
|
229
|
-
|
|
230
227
|
export declare interface CallEvent {
|
|
231
228
|
id: string;
|
|
232
229
|
type: Extract<ChoiceEvent, "PON" | "CHI" | "AN_KAN" | "SHO_KAN" | "DAI_KAN">;
|
|
@@ -302,7 +299,7 @@ export declare class Controller {
|
|
|
302
299
|
oneShotMap: { [key in Wind]: boolean; };
|
|
303
300
|
missingMap: { [key in Wind]: boolean; };
|
|
304
301
|
controller: Controller;
|
|
305
|
-
genEventID: ReturnType<
|
|
302
|
+
genEventID: ReturnType<incrementalIDGenerator>;
|
|
306
303
|
}, {
|
|
307
304
|
type: "";
|
|
308
305
|
} | {
|
|
@@ -708,6 +705,8 @@ export declare class G extends Mark {
|
|
|
708
705
|
each(block: (idx: number, children: Mark[]) => void, deep: boolean): void;
|
|
709
706
|
}
|
|
710
707
|
|
|
708
|
+
export declare const getCallBlockIndex: (caller: Wind, discardedBy: Wind, type: typeof BLOCK.PON | typeof BLOCK.DAI_KAN) => 0 | 1 | 2 | 3;
|
|
709
|
+
|
|
711
710
|
export declare class Hand {
|
|
712
711
|
protected data: HandData;
|
|
713
712
|
constructor(input: string | Block[], allowBackBlock?: boolean);
|
|
@@ -923,7 +922,7 @@ export declare class Parser {
|
|
|
923
922
|
tiles(): readonly Tile[];
|
|
924
923
|
tileSeparators(): readonly (Tile | Separator)[];
|
|
925
924
|
private makeBlocks;
|
|
926
|
-
validate
|
|
925
|
+
private validate;
|
|
927
926
|
}
|
|
928
927
|
|
|
929
928
|
export declare const parseTableInput: (s: string) => {
|
|
@@ -993,7 +992,7 @@ export declare class Player extends BaseActor {
|
|
|
993
992
|
river: River;
|
|
994
993
|
doras: Tile[];
|
|
995
994
|
constructor(playerID: string, eventHandler: EventHandler);
|
|
996
|
-
get myWind():
|
|
995
|
+
get myWind(): Wind;
|
|
997
996
|
setHands(e: DistributeEvent): void;
|
|
998
997
|
handleDiscard(tiles: Tile[]): Tile;
|
|
999
998
|
handleEvent(e: PlayerEvent): void;
|
|
@@ -1438,6 +1437,8 @@ export declare const TILE_CONTEXT: {
|
|
|
1438
1437
|
|
|
1439
1438
|
export declare const tileSortFunc: (i: Tile, j: Tile) => number;
|
|
1440
1439
|
|
|
1440
|
+
export declare const toDora: (doraIndicator: Tile) => Tile;
|
|
1441
|
+
|
|
1441
1442
|
export declare interface TsumoEvent {
|
|
1442
1443
|
id: string;
|
|
1443
1444
|
type: Extract<ChoiceEvent, "TSUMO">;
|