@caisual/kit 0.10.0 → 0.13.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/kit.js +196 -24
- package/dist/node.js +77 -18
- package/dist/overlay.js +134 -35
- package/dist/runtime.js +79 -18
- package/dist/types/api.d.ts +1 -0
- package/dist/types/contracts/biglietto.d.ts +3 -2
- package/dist/types/contracts/immagine.d.ts +27 -0
- package/dist/types/contracts/index.d.ts +3 -0
- package/dist/types/contracts/manifest.d.ts +4 -1
- package/dist/types/contracts/match-result.d.ts +16 -0
- package/dist/types/contracts/overlay.d.ts +7 -1
- package/dist/types/contracts/versioni.d.ts +18 -0
- package/dist/types/daily.d.ts +14 -0
- package/dist/types/errors.d.ts +2 -2
- package/dist/types/handshake.d.ts +2 -1
- package/dist/types/index.d.ts +10 -0
- package/dist/types/node/index.d.ts +4 -0
- package/dist/types/overlay/host-bridge.d.ts +6 -1
- package/dist/types/overlay/i18n.d.ts +9 -0
- package/dist/types/overlay/styles.d.ts +1 -1
- package/dist/types/overlay/ui-model.d.ts +4 -0
- package/dist/types/overlay/ui.d.ts +2 -0
- package/dist/types/protocollo.d.ts +8 -0
- package/dist/types/runtime/index.d.ts +4 -0
- package/dist/types/server/index.d.ts +12 -1
- package/dist/types/session/index.d.ts +1 -1
- package/dist/types/stanza/nucleo.d.ts +3 -0
- package/dist/types/stanza/tipi.d.ts +11 -0
- package/dist/types/stanza-client/index.d.ts +4 -0
- package/package.json +1 -1
|
@@ -1,6 +1,11 @@
|
|
|
1
|
+
export type { MatchResult } from '../contracts/index.js';
|
|
1
2
|
export type JsonValue = null | boolean | number | string | JsonValue[] | {
|
|
2
3
|
[key: string]: JsonValue;
|
|
3
4
|
};
|
|
5
|
+
export type RematchOptions = boolean | {
|
|
6
|
+
keepSetup?: boolean;
|
|
7
|
+
autoStart?: boolean;
|
|
8
|
+
};
|
|
4
9
|
export type RoomStatus = 'lobby' | 'countdown' | 'playing' | 'finished' | 'ended';
|
|
5
10
|
export type VoiceMode = 'none' | 'room' | 'team' | 'proximity';
|
|
6
11
|
export type LeaveReason = 'left' | 'timeout' | 'kicked';
|
|
@@ -36,20 +41,26 @@ export interface Room<State extends JsonValue = JsonValue> {
|
|
|
36
41
|
setRole(player: Player | string, role: string): void;
|
|
37
42
|
setTeam(player: Player | string, team: number): void;
|
|
38
43
|
end(result: JsonValue, options?: {
|
|
39
|
-
rematch?:
|
|
44
|
+
rematch?: RematchOptions;
|
|
40
45
|
}): void;
|
|
41
46
|
save(key: string, value: JsonValue): Promise<void>;
|
|
42
47
|
load(key: string): Promise<JsonValue | null>;
|
|
43
48
|
readonly shared: SharedGameStore;
|
|
44
49
|
schedule(milliseconds: number, handler: string, payload: JsonValue): void;
|
|
45
50
|
readonly board: {
|
|
51
|
+
submit(board: string, score: number, options?: {
|
|
52
|
+
daily?: boolean;
|
|
53
|
+
day?: string;
|
|
54
|
+
}): void;
|
|
46
55
|
submit(player: Player | string, board: string, score: number, options?: {
|
|
47
56
|
daily?: boolean;
|
|
57
|
+
day?: string;
|
|
48
58
|
}): void;
|
|
49
59
|
};
|
|
50
60
|
readonly daily: {
|
|
51
61
|
readonly day: string;
|
|
52
62
|
readonly seed: number;
|
|
63
|
+
readonly expiresAt: number;
|
|
53
64
|
};
|
|
54
65
|
readonly time: {
|
|
55
66
|
now(): number;
|
|
@@ -36,7 +36,7 @@ export declare function createSession(base: BaseConnection, configuration?: Over
|
|
|
36
36
|
onState(listener: (value: OverlaySessionState) => void): () => void;
|
|
37
37
|
onOpen(listener: (value: OverlayPanel) => void): () => void;
|
|
38
38
|
onError(listener: (value: {
|
|
39
|
-
sessionId: string;
|
|
39
|
+
sessionId: string | null;
|
|
40
40
|
error: {
|
|
41
41
|
code: string;
|
|
42
42
|
message: string;
|
|
@@ -46,6 +46,8 @@ export declare class NucleoStanza {
|
|
|
46
46
|
private giocatorePerModificaDalServer;
|
|
47
47
|
private erroreMinimi;
|
|
48
48
|
private rivincita;
|
|
49
|
+
private prontiRivincita;
|
|
50
|
+
private avviaRivincita;
|
|
49
51
|
private avviaCountdown;
|
|
50
52
|
private verificaCountdown;
|
|
51
53
|
private messaggioErrato;
|
|
@@ -55,6 +57,7 @@ export declare class NucleoStanza {
|
|
|
55
57
|
private eseguiTimer;
|
|
56
58
|
private pianifica;
|
|
57
59
|
private giornata;
|
|
60
|
+
private contestoGiornaliero;
|
|
58
61
|
private accodaPunteggio;
|
|
59
62
|
private richiediFine;
|
|
60
63
|
private salva;
|
|
@@ -8,6 +8,10 @@ export interface ManifestStanza {
|
|
|
8
8
|
};
|
|
9
9
|
lobby: boolean;
|
|
10
10
|
persistent?: boolean;
|
|
11
|
+
boards?: Record<string, {
|
|
12
|
+
source: 'client' | 'server';
|
|
13
|
+
day?: 'submit' | 'start';
|
|
14
|
+
}>;
|
|
11
15
|
roles: Array<{
|
|
12
16
|
id: string;
|
|
13
17
|
min: number;
|
|
@@ -96,6 +100,13 @@ export interface StatoPersistito {
|
|
|
96
100
|
hostId: string | null;
|
|
97
101
|
result: JsonValue | null;
|
|
98
102
|
resultAt: number | null;
|
|
103
|
+
daily?: import('../daily.js').DailyContext;
|
|
104
|
+
rivincita?: {
|
|
105
|
+
keepSetup: boolean;
|
|
106
|
+
autoStart: boolean;
|
|
107
|
+
} | null;
|
|
108
|
+
prontiPrecedenti?: string[];
|
|
109
|
+
countdownRivincita?: boolean;
|
|
99
110
|
rivincitaFinoA?: number | null;
|
|
100
111
|
countdownAt: number | null;
|
|
101
112
|
timer: TimerPersistito[];
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Rooms } from '../index.js';
|
|
2
|
+
import { type ErroreCaisual } from '../errors.js';
|
|
2
3
|
import type { GestoreBiglietto } from '../handshake.js';
|
|
3
4
|
import { type DipendenzeVoce } from '../voce/index.js';
|
|
4
5
|
interface TimerStanza {
|
|
@@ -8,6 +9,9 @@ interface TimerStanza {
|
|
|
8
9
|
clearInterval(id: number): void;
|
|
9
10
|
}
|
|
10
11
|
export interface DipendenzeStanze extends TimerStanza {
|
|
12
|
+
n: number;
|
|
13
|
+
reload?(target?: import('../contracts/index.js').RicaricaGioco): void;
|
|
14
|
+
onVersionError?(error: ErroreCaisual, target?: import('../contracts/index.js').RicaricaGioco): void;
|
|
11
15
|
appOrigin: string;
|
|
12
16
|
liveOrigin: string;
|
|
13
17
|
fetcher: typeof fetch;
|