fix(misskey-js): add mahjong streaming types
This commit is contained in:
parent
ccb6007d32
commit
dc55fba800
|
@ -307,7 +307,7 @@ const $i = ensureSignin();
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
room: Misskey.entities.MahjongRoomDetailed;
|
room: Misskey.entities.MahjongRoomDetailed;
|
||||||
connection?: Misskey.ChannelConnection | null;
|
connection?: Misskey.ChannelConnection<Misskey.Channels['mahjongRoom']> | null;
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
const room = ref<Misskey.entities.MahjongRoomDetailed>(deepClone(props.room));
|
const room = ref<Misskey.entities.MahjongRoomDetailed>(deepClone(props.room));
|
||||||
|
|
|
@ -69,7 +69,7 @@ const router = useRouter();
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
room: Misskey.entities.MahjongRoomDetailed;
|
room: Misskey.entities.MahjongRoomDetailed;
|
||||||
connection: Misskey.ChannelConnection;
|
connection: Misskey.ChannelConnection<Misskey.Channels['mahjongRoom']>;
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
const room = ref<Misskey.entities.MahjongRoomDetailed>(deepClone(props.room));
|
const room = ref<Misskey.entities.MahjongRoomDetailed>(deepClone(props.room));
|
||||||
|
|
|
@ -32,7 +32,7 @@ const props = defineProps<{
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
const room = shallowRef<Misskey.entities.MahjongRoomDetailed | null>(null);
|
const room = shallowRef<Misskey.entities.MahjongRoomDetailed | null>(null);
|
||||||
const connection = shallowRef<Misskey.ChannelConnection | null>(null);
|
const connection = shallowRef<Misskey.ChannelConnection<Misskey.Channels['mahjongRoom']> | null>(null);
|
||||||
const shareWhenStart = ref(false);
|
const shareWhenStart = ref(false);
|
||||||
|
|
||||||
watch(() => props.roomId, () => {
|
watch(() => props.roomId, () => {
|
||||||
|
|
|
@ -4,6 +4,7 @@ import {
|
||||||
ChatMessageLite,
|
ChatMessageLite,
|
||||||
DriveFile,
|
DriveFile,
|
||||||
DriveFolder,
|
DriveFolder,
|
||||||
|
MahjongRoomDetailed,
|
||||||
Note,
|
Note,
|
||||||
Notification,
|
Notification,
|
||||||
Signin,
|
Signin,
|
||||||
|
@ -32,6 +33,8 @@ type ReversiUpdateSettings<K extends ReversiUpdateKey> = {
|
||||||
value: ReversiGameDetailed[K];
|
value: ReversiGameDetailed[K];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
type MmjHouse = 'e' | 's' | 'w' | 'n';
|
||||||
|
|
||||||
export type Channels = {
|
export type Channels = {
|
||||||
main: {
|
main: {
|
||||||
params: null;
|
params: null;
|
||||||
|
@ -277,6 +280,106 @@ export type Channels = {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
mahjongRoom: {
|
||||||
|
params: {
|
||||||
|
roomId: string;
|
||||||
|
};
|
||||||
|
events: {
|
||||||
|
joined: (payload: {
|
||||||
|
index: number;
|
||||||
|
user: UserLite | null;
|
||||||
|
}) => void;
|
||||||
|
changeReadyStates: (payload: {
|
||||||
|
user1: boolean;
|
||||||
|
user2: boolean;
|
||||||
|
user3: boolean;
|
||||||
|
user4: boolean;
|
||||||
|
}) => void;
|
||||||
|
started: (payload: { room: MahjongRoomDetailed }) => void;
|
||||||
|
nextKyoku: (payload: { room: MahjongRoomDetailed }) => void;
|
||||||
|
tsumo: (payload: {
|
||||||
|
house: MmjHouse;
|
||||||
|
tile: number;
|
||||||
|
}) => void;
|
||||||
|
dahai: (payload: {
|
||||||
|
house: MmjHouse;
|
||||||
|
tile: number;
|
||||||
|
riichi: boolean;
|
||||||
|
}) => void;
|
||||||
|
dahaiAndTsumo: (payload: {
|
||||||
|
dahaiHouse: MmjHouse;
|
||||||
|
dahaiTile: number;
|
||||||
|
tsumoTile: number;
|
||||||
|
riichi: boolean;
|
||||||
|
}) => void;
|
||||||
|
ponned: (payload: {
|
||||||
|
caller: MmjHouse;
|
||||||
|
callee: MmjHouse;
|
||||||
|
tiles: readonly [number, number, number];
|
||||||
|
}) => void;
|
||||||
|
kanned: (payload: {
|
||||||
|
caller: MmjHouse;
|
||||||
|
callee: MmjHouse;
|
||||||
|
tiles: readonly [number, number, number, number];
|
||||||
|
rinsyan: number;
|
||||||
|
}) => void;
|
||||||
|
ciied: (payload: {
|
||||||
|
caller: MmjHouse;
|
||||||
|
callee: MmjHouse;
|
||||||
|
tiles: readonly [number, number, number];
|
||||||
|
}) => void;
|
||||||
|
ronned: (payload: {
|
||||||
|
callers: MmjHouse[];
|
||||||
|
callee: MmjHouse;
|
||||||
|
handTiles: Record<MmjHouse, number[]>;
|
||||||
|
}) => void;
|
||||||
|
ryuukyoku: (payload: unknown) => void;
|
||||||
|
ankanned: (payload: {
|
||||||
|
house: MmjHouse;
|
||||||
|
tiles: readonly [number, number, number, number];
|
||||||
|
rinsyan: number;
|
||||||
|
}) => void;
|
||||||
|
kakanned: (payload: {
|
||||||
|
house: MmjHouse;
|
||||||
|
tiles: readonly [number, number, number, number];
|
||||||
|
rinsyan: number;
|
||||||
|
from: MmjHouse;
|
||||||
|
}) => void;
|
||||||
|
tsumoHora: (payload: {
|
||||||
|
house: MmjHouse;
|
||||||
|
handTiles: number[];
|
||||||
|
tsumoTile: number;
|
||||||
|
}) => void;
|
||||||
|
};
|
||||||
|
receives: {
|
||||||
|
ready: boolean;
|
||||||
|
updateSettings: {
|
||||||
|
key: string;
|
||||||
|
body: unknown;
|
||||||
|
};
|
||||||
|
addAi: Record<string, never>;
|
||||||
|
confirmNextKyoku: Record<string, never>;
|
||||||
|
dahai: {
|
||||||
|
tile: number;
|
||||||
|
riichi?: boolean;
|
||||||
|
};
|
||||||
|
tsumoHora: Record<string, never>;
|
||||||
|
ronHora: Record<string, never>;
|
||||||
|
pon: Record<string, never>;
|
||||||
|
cii: {
|
||||||
|
pattern: string;
|
||||||
|
};
|
||||||
|
kan: Record<string, never>;
|
||||||
|
ankan: {
|
||||||
|
tile: number;
|
||||||
|
};
|
||||||
|
kakan: {
|
||||||
|
tile: number;
|
||||||
|
};
|
||||||
|
nop: Record<string, never>;
|
||||||
|
claimTimeIsUp: Record<string, never>;
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
export type NoteUpdatedEvent = { id: Note['id'] } & ({
|
export type NoteUpdatedEvent = { id: Note['id'] } & ({
|
||||||
|
|
Loading…
Reference in New Issue