@caisual/kit 0.5.0 → 0.8.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.d.ts +2 -175
- package/dist/kit.js +1418 -48
- package/dist/node.d.ts +1 -88
- package/dist/node.js +128 -31
- package/dist/overlay.d.ts +1 -0
- package/dist/overlay.js +1846 -0
- package/dist/runtime.d.ts +1 -111
- package/dist/runtime.js +160 -32
- package/dist/server.d.ts +1 -71
- package/dist/server.js +1 -0
- package/dist/types/api.d.ts +25 -0
- package/dist/types/contracts/biglietto.d.ts +24 -0
- package/dist/types/contracts/device.d.ts +66 -0
- package/dist/types/contracts/firma.d.ts +21 -0
- package/dist/types/contracts/index.d.ts +10 -0
- package/dist/types/contracts/keys.d.ts +59 -0
- package/dist/types/contracts/manifest.d.ts +118 -0
- package/dist/types/contracts/overlay-boards.d.ts +3 -0
- package/dist/types/contracts/overlay.d.ts +215 -0
- package/dist/types/contracts/runtime.d.ts +70 -0
- package/dist/types/contracts/server-js.d.ts +11 -0
- package/dist/types/contracts/slug.d.ts +5 -0
- package/dist/types/contracts/token-crew.d.ts +21 -0
- package/dist/types/daily.d.ts +3 -0
- package/dist/types/errors.d.ts +6 -0
- package/dist/types/handshake.d.ts +26 -0
- package/dist/types/http.d.ts +3 -0
- package/dist/types/index.d.ts +217 -0
- package/dist/types/kit.d.ts +26 -0
- package/dist/types/node/index.d.ts +96 -0
- package/dist/types/node/websocket.d.ts +29 -0
- package/dist/types/overlay/boards.d.ts +48 -0
- package/dist/types/overlay/bridge.d.ts +3 -0
- package/dist/types/overlay/host-bridge.d.ts +58 -0
- package/dist/types/overlay/i18n.d.ts +122 -0
- package/dist/types/overlay/index.d.ts +9 -0
- package/dist/types/overlay/shortcut.d.ts +4 -0
- package/dist/types/overlay/styles.d.ts +1 -0
- package/dist/types/overlay/ui-model.d.ts +45 -0
- package/dist/types/overlay/ui.d.ts +80 -0
- package/dist/types/overlay/voice-panel.d.ts +13 -0
- package/dist/types/protocollo.d.ts +257 -0
- package/dist/types/runtime/index.d.ts +127 -0
- package/dist/types/server/index.d.ts +72 -0
- package/dist/types/session/index.d.ts +49 -0
- package/dist/types/session/resume.d.ts +13 -0
- package/dist/types/standalone.d.ts +14 -0
- package/dist/types/stanza/index.d.ts +3 -0
- package/dist/types/stanza/json.d.ts +18 -0
- package/dist/types/stanza/nucleo.d.ts +97 -0
- package/dist/types/stanza/tipi.d.ts +134 -0
- package/dist/types/stanza-client/index.d.ts +24 -0
- package/dist/types/voce/index.d.ts +124 -0
- package/package.json +10 -2
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
import type { ConnectionState, QueuedScore } from './contracts/index.js';
|
|
2
|
+
import type { Session, Overlay } from './session/index.js';
|
|
3
|
+
import type { RoomConfiguration } from './protocollo.js';
|
|
4
|
+
export type { Session, GameSession, Overlay } from './session/index.js';
|
|
5
|
+
export type { ConnectionState, QueuedScore, OverlayView, OverlayPanel } from './contracts/index.js';
|
|
6
|
+
import type { DeviceReport } from './contracts/index.js';
|
|
7
|
+
export type { DeviceReport } from './contracts/index.js';
|
|
8
|
+
export type JsonValue = null | boolean | number | string | JsonValue[] | {
|
|
9
|
+
[key: string]: JsonValue;
|
|
10
|
+
};
|
|
11
|
+
export interface Player {
|
|
12
|
+
id: string;
|
|
13
|
+
name: string;
|
|
14
|
+
guest: boolean;
|
|
15
|
+
}
|
|
16
|
+
export interface SaveInfo {
|
|
17
|
+
key: string;
|
|
18
|
+
bytes: number;
|
|
19
|
+
updatedAt: number;
|
|
20
|
+
}
|
|
21
|
+
export interface BoardEntry {
|
|
22
|
+
rank: number;
|
|
23
|
+
name: string;
|
|
24
|
+
score: number;
|
|
25
|
+
guest: boolean;
|
|
26
|
+
me: boolean;
|
|
27
|
+
verified: boolean;
|
|
28
|
+
}
|
|
29
|
+
export interface BoardTop {
|
|
30
|
+
day: string | null;
|
|
31
|
+
entries: BoardEntry[];
|
|
32
|
+
me: {
|
|
33
|
+
rank: number;
|
|
34
|
+
score: number;
|
|
35
|
+
verified: boolean;
|
|
36
|
+
} | null;
|
|
37
|
+
}
|
|
38
|
+
export type BoardResult = {
|
|
39
|
+
accepted: true;
|
|
40
|
+
best: number;
|
|
41
|
+
rank: number;
|
|
42
|
+
day: string | null;
|
|
43
|
+
verified: boolean;
|
|
44
|
+
};
|
|
45
|
+
export type BoardOffline = {
|
|
46
|
+
accepted: false;
|
|
47
|
+
reason: 'offline';
|
|
48
|
+
verified: false;
|
|
49
|
+
};
|
|
50
|
+
export type RoomStatus = 'lobby' | 'countdown' | 'playing' | 'ended';
|
|
51
|
+
export interface RoomPlayer {
|
|
52
|
+
id: string;
|
|
53
|
+
name: string;
|
|
54
|
+
guest: boolean;
|
|
55
|
+
role: string | null;
|
|
56
|
+
team: number | null;
|
|
57
|
+
ready: boolean;
|
|
58
|
+
connected: boolean;
|
|
59
|
+
}
|
|
60
|
+
export type VoiceMode = 'none' | 'room' | 'team' | 'proximity';
|
|
61
|
+
export type VoiceState = 'off' | 'joining' | 'on' | 'reconnecting';
|
|
62
|
+
export interface VoicePeer {
|
|
63
|
+
id: string;
|
|
64
|
+
mic: boolean;
|
|
65
|
+
muted: boolean;
|
|
66
|
+
speaking: boolean;
|
|
67
|
+
volume: number;
|
|
68
|
+
gain: number;
|
|
69
|
+
}
|
|
70
|
+
export interface Voice {
|
|
71
|
+
readonly mode: VoiceMode;
|
|
72
|
+
readonly state: VoiceState;
|
|
73
|
+
readonly mic: boolean;
|
|
74
|
+
readonly muted: boolean;
|
|
75
|
+
readonly speaking: boolean;
|
|
76
|
+
readonly peers: readonly VoicePeer[];
|
|
77
|
+
join(options?: {
|
|
78
|
+
mic?: boolean;
|
|
79
|
+
}): Promise<void>;
|
|
80
|
+
leave(): void;
|
|
81
|
+
mute(muted?: boolean): void;
|
|
82
|
+
setVolume(playerId: string, volume: number): void;
|
|
83
|
+
onPeers(listener: (peers: readonly VoicePeer[]) => void): () => void;
|
|
84
|
+
onState(listener: (state: VoiceState) => void): () => void;
|
|
85
|
+
}
|
|
86
|
+
export interface RoomInvite {
|
|
87
|
+
code: string;
|
|
88
|
+
url: string;
|
|
89
|
+
}
|
|
90
|
+
export interface RoomMetadata {
|
|
91
|
+
host: string | null;
|
|
92
|
+
mode: string | null;
|
|
93
|
+
countdownAt: number | null;
|
|
94
|
+
configuration: RoomConfiguration | null;
|
|
95
|
+
connection: ConnectionState;
|
|
96
|
+
closedCode: number | null;
|
|
97
|
+
}
|
|
98
|
+
export interface Room {
|
|
99
|
+
readonly mode: string | null;
|
|
100
|
+
readonly countdownAt: number | null;
|
|
101
|
+
readonly connection: ConnectionState;
|
|
102
|
+
readonly metadata: RoomMetadata;
|
|
103
|
+
onMetadata(listener: (metadata: RoomMetadata) => void): () => void;
|
|
104
|
+
onConnection(listener: (state: ConnectionState) => void): () => void;
|
|
105
|
+
disconnect(): void;
|
|
106
|
+
readonly state: JsonValue;
|
|
107
|
+
readonly tick: number;
|
|
108
|
+
readonly seed: number;
|
|
109
|
+
readonly status: RoomStatus;
|
|
110
|
+
readonly players: readonly RoomPlayer[];
|
|
111
|
+
readonly you: string;
|
|
112
|
+
readonly host: string | null;
|
|
113
|
+
readonly code: string;
|
|
114
|
+
readonly result: JsonValue;
|
|
115
|
+
readonly voice: Voice;
|
|
116
|
+
readonly queuedScores: readonly QueuedScore[];
|
|
117
|
+
onError(listener: (error: {
|
|
118
|
+
code: string;
|
|
119
|
+
message: string;
|
|
120
|
+
}) => void): () => void;
|
|
121
|
+
onScoreQueued(listener: (score: QueuedScore) => void): () => void;
|
|
122
|
+
requestRole(role: string): Promise<void>;
|
|
123
|
+
invite(): RoomInvite;
|
|
124
|
+
onState(listener: (state: JsonValue, tick: number, serverTime: number) => void): () => void;
|
|
125
|
+
onPlayers(listener: (players: readonly RoomPlayer[]) => void): () => void;
|
|
126
|
+
onStatus(listener: (status: RoomStatus, result: JsonValue, at: number) => void): () => void;
|
|
127
|
+
onMessage(listener: (message: JsonValue) => void): () => void;
|
|
128
|
+
send(message: JsonValue): void;
|
|
129
|
+
ready(ready: boolean): void;
|
|
130
|
+
setRole(role: string): void;
|
|
131
|
+
setTeam(team: number): void;
|
|
132
|
+
start(): void;
|
|
133
|
+
leave(): void;
|
|
134
|
+
serverTime(): number;
|
|
135
|
+
}
|
|
136
|
+
export interface Spectate {
|
|
137
|
+
readonly mode: string | null;
|
|
138
|
+
readonly countdownAt: number | null;
|
|
139
|
+
readonly connection: ConnectionState;
|
|
140
|
+
readonly metadata: RoomMetadata;
|
|
141
|
+
onMetadata(listener: (metadata: RoomMetadata) => void): () => void;
|
|
142
|
+
onConnection(listener: (state: ConnectionState) => void): () => void;
|
|
143
|
+
disconnect(): void;
|
|
144
|
+
readonly state: JsonValue;
|
|
145
|
+
readonly tick: number;
|
|
146
|
+
readonly seed: number;
|
|
147
|
+
readonly status: RoomStatus;
|
|
148
|
+
readonly players: readonly RoomPlayer[];
|
|
149
|
+
readonly host: string | null;
|
|
150
|
+
readonly code: string;
|
|
151
|
+
readonly result: JsonValue;
|
|
152
|
+
readonly delayMs: number;
|
|
153
|
+
onState(listener: (state: JsonValue, tick: number, serverTime: number) => void): () => void;
|
|
154
|
+
onPlayers(listener: (players: readonly RoomPlayer[]) => void): () => void;
|
|
155
|
+
onStatus(listener: (status: RoomStatus, result: JsonValue, at: number) => void): () => void;
|
|
156
|
+
onMessage(listener: (message: JsonValue) => void): () => void;
|
|
157
|
+
leave(): void;
|
|
158
|
+
serverTime(): number;
|
|
159
|
+
}
|
|
160
|
+
export interface MatchOptions {
|
|
161
|
+
mode: string;
|
|
162
|
+
key: Record<string, string | number>;
|
|
163
|
+
signal?: AbortSignal;
|
|
164
|
+
onWaiting?(waiting: {
|
|
165
|
+
players: number;
|
|
166
|
+
min: number;
|
|
167
|
+
max: number;
|
|
168
|
+
}): void;
|
|
169
|
+
}
|
|
170
|
+
export interface Rooms {
|
|
171
|
+
readonly invited: string | null;
|
|
172
|
+
create(options: {
|
|
173
|
+
mode: string | null;
|
|
174
|
+
}): Promise<Room>;
|
|
175
|
+
join(code?: string): Promise<Room>;
|
|
176
|
+
watch(code: string): Promise<Spectate>;
|
|
177
|
+
match(options: MatchOptions): Promise<Room>;
|
|
178
|
+
}
|
|
179
|
+
export interface CaisualConnection {
|
|
180
|
+
session: Session;
|
|
181
|
+
overlay: Overlay;
|
|
182
|
+
connected: boolean;
|
|
183
|
+
device: DeviceReport;
|
|
184
|
+
player: Player;
|
|
185
|
+
daily: {
|
|
186
|
+
day: string;
|
|
187
|
+
seed: number;
|
|
188
|
+
random(): number;
|
|
189
|
+
};
|
|
190
|
+
time: {
|
|
191
|
+
now(): number;
|
|
192
|
+
};
|
|
193
|
+
save: {
|
|
194
|
+
set(key: string, value: JsonValue): Promise<SaveInfo>;
|
|
195
|
+
get(key: string): Promise<JsonValue | null>;
|
|
196
|
+
remove(key: string): Promise<void>;
|
|
197
|
+
list(): Promise<SaveInfo[]>;
|
|
198
|
+
};
|
|
199
|
+
board: {
|
|
200
|
+
submit(board: string, score: number, options?: {
|
|
201
|
+
daily?: boolean;
|
|
202
|
+
}): Promise<BoardResult | BoardOffline>;
|
|
203
|
+
top(board: string, options?: {
|
|
204
|
+
daily?: boolean;
|
|
205
|
+
day?: string;
|
|
206
|
+
limit?: number;
|
|
207
|
+
guests?: boolean;
|
|
208
|
+
}): Promise<BoardTop>;
|
|
209
|
+
};
|
|
210
|
+
room: Rooms;
|
|
211
|
+
}
|
|
212
|
+
export type BaseConnection = Omit<CaisualConnection, 'device' | 'session' | 'overlay'>;
|
|
213
|
+
export interface Caisual {
|
|
214
|
+
connect(): Promise<CaisualConnection>;
|
|
215
|
+
}
|
|
216
|
+
export declare const caisual: Caisual;
|
|
217
|
+
export default caisual;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { type DeviceReport } from './contracts/index.js';
|
|
2
|
+
import type { Caisual } from './index.js';
|
|
3
|
+
import { type FinestraHandshakeKit } from './handshake.js';
|
|
4
|
+
import { type ArchivioLocale } from './standalone.js';
|
|
5
|
+
import type { DipendenzeVoce } from './voce/index.js';
|
|
6
|
+
interface DocumentoMeta {
|
|
7
|
+
querySelector(selector: string): {
|
|
8
|
+
getAttribute(name: string): string | null;
|
|
9
|
+
} | null;
|
|
10
|
+
}
|
|
11
|
+
export interface DipendenzeKit {
|
|
12
|
+
finestra: FinestraHandshakeKit | null;
|
|
13
|
+
documento: DocumentoMeta | null;
|
|
14
|
+
fetcher: typeof fetch;
|
|
15
|
+
archivio: ArchivioLocale | null;
|
|
16
|
+
hostname: string;
|
|
17
|
+
subtle: SubtleCrypto;
|
|
18
|
+
ora: () => number;
|
|
19
|
+
sonda: () => Promise<DeviceReport>;
|
|
20
|
+
apriSocket?: (url: string) => WebSocket;
|
|
21
|
+
voce?: DipendenzeVoce;
|
|
22
|
+
timeoutHandshake?: number;
|
|
23
|
+
timeoutRinnovo?: number;
|
|
24
|
+
}
|
|
25
|
+
export declare function creaKit(input?: DipendenzeKit): Caisual;
|
|
26
|
+
export {};
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import type { IncomingMessage } from 'node:http';
|
|
2
|
+
import type { Duplex } from 'node:stream';
|
|
3
|
+
import type { GameDefinition, JsonValue, RoomStatus, SharedGameStore } from '../server/index.js';
|
|
4
|
+
export interface NodeWebSocket {
|
|
5
|
+
on(event: 'message', listener: (message: string) => void): this;
|
|
6
|
+
on(event: 'close', listener: () => void): this;
|
|
7
|
+
send(message: string): void;
|
|
8
|
+
close(code?: number, reason?: string): void;
|
|
9
|
+
}
|
|
10
|
+
export declare function acceptNodeWebSocket(request: IncomingMessage, socket: Duplex, head?: Buffer): NodeWebSocket;
|
|
11
|
+
export interface NodePlayerIdentity {
|
|
12
|
+
id: string;
|
|
13
|
+
name: string;
|
|
14
|
+
guest: boolean;
|
|
15
|
+
}
|
|
16
|
+
export interface NodeRoomManifest {
|
|
17
|
+
id: string;
|
|
18
|
+
players: {
|
|
19
|
+
min: number;
|
|
20
|
+
max: number;
|
|
21
|
+
};
|
|
22
|
+
lobby: boolean;
|
|
23
|
+
persistent?: boolean;
|
|
24
|
+
spectators?: {
|
|
25
|
+
delayMs: number;
|
|
26
|
+
} | null;
|
|
27
|
+
roles: Array<{
|
|
28
|
+
id: string;
|
|
29
|
+
min: number;
|
|
30
|
+
max?: number;
|
|
31
|
+
}>;
|
|
32
|
+
teams: {
|
|
33
|
+
min: number;
|
|
34
|
+
max: number;
|
|
35
|
+
} | null;
|
|
36
|
+
modes: Array<{
|
|
37
|
+
id: string;
|
|
38
|
+
execution?: 'local' | 'room';
|
|
39
|
+
players?: {
|
|
40
|
+
min: number;
|
|
41
|
+
max: number;
|
|
42
|
+
};
|
|
43
|
+
lobby?: boolean;
|
|
44
|
+
}>;
|
|
45
|
+
voice?: 'none' | 'room' | 'team' | 'proximity';
|
|
46
|
+
}
|
|
47
|
+
export type NodeRoomJoinResult = {
|
|
48
|
+
ok: true;
|
|
49
|
+
} | {
|
|
50
|
+
ok: false;
|
|
51
|
+
code: 'room_not_found' | 'room_full' | 'room_ended' | 'room_playing';
|
|
52
|
+
};
|
|
53
|
+
export type NodeRoomWatchResult = {
|
|
54
|
+
ok: true;
|
|
55
|
+
} | {
|
|
56
|
+
ok: false;
|
|
57
|
+
code: 'room_not_found' | 'room_ended' | 'spectators_disabled' | 'spectators_full';
|
|
58
|
+
};
|
|
59
|
+
export interface NodeRoomInfo {
|
|
60
|
+
roomId: string;
|
|
61
|
+
status: RoomStatus;
|
|
62
|
+
players: number;
|
|
63
|
+
max: number;
|
|
64
|
+
mode: string | null;
|
|
65
|
+
}
|
|
66
|
+
export interface NodeRoomFlush {
|
|
67
|
+
scores: Array<{
|
|
68
|
+
playerId: string;
|
|
69
|
+
board: string;
|
|
70
|
+
score: number;
|
|
71
|
+
daily: boolean;
|
|
72
|
+
day?: string | null;
|
|
73
|
+
submittedAt?: number;
|
|
74
|
+
}>;
|
|
75
|
+
ended: {
|
|
76
|
+
result: JsonValue;
|
|
77
|
+
at: number;
|
|
78
|
+
} | null;
|
|
79
|
+
}
|
|
80
|
+
export interface NodeRoomOptions {
|
|
81
|
+
storageFile?: string;
|
|
82
|
+
deposito?: SharedGameStore | null;
|
|
83
|
+
}
|
|
84
|
+
export interface NodeRoom {
|
|
85
|
+
create(roomId: string, mode: string | null, creator: NodePlayerIdentity): Promise<boolean>;
|
|
86
|
+
info(): Promise<NodeRoomInfo | null>;
|
|
87
|
+
canJoin(identity: NodePlayerIdentity): Promise<NodeRoomJoinResult>;
|
|
88
|
+
canWatch(): Promise<NodeRoomWatchResult>;
|
|
89
|
+
connect(socket: NodeWebSocket, identity: NodePlayerIdentity): Promise<NodeRoomJoinResult>;
|
|
90
|
+
watch(socket: NodeWebSocket, identity: NodePlayerIdentity): Promise<NodeRoomWatchResult>;
|
|
91
|
+
flush(): Promise<NodeRoomFlush>;
|
|
92
|
+
wake(): Promise<void>;
|
|
93
|
+
close(): Promise<void>;
|
|
94
|
+
}
|
|
95
|
+
/** Crea una stanza Node usando memoria o un singolo file JSON persistente. */
|
|
96
|
+
export declare function createNodeRoom(definition: GameDefinition, manifest: NodeRoomManifest, options?: NodeRoomOptions): Promise<NodeRoom>;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { EventEmitter } from 'node:events';
|
|
2
|
+
import type { IncomingMessage } from 'node:http';
|
|
3
|
+
import type { Duplex } from 'node:stream';
|
|
4
|
+
export declare interface NodeWebSocket {
|
|
5
|
+
on(event: 'message', listener: (message: string) => void): this;
|
|
6
|
+
on(event: 'close', listener: () => void): this;
|
|
7
|
+
}
|
|
8
|
+
/** WebSocket testuale minimo per server Node, senza estensioni negoziate. */
|
|
9
|
+
export declare class NodeWebSocket extends EventEmitter {
|
|
10
|
+
private readonly socket;
|
|
11
|
+
private readonly massimoMessaggio;
|
|
12
|
+
private buffer;
|
|
13
|
+
private frammenti;
|
|
14
|
+
private byteFrammenti;
|
|
15
|
+
private frammentando;
|
|
16
|
+
private chiusuraInviata;
|
|
17
|
+
private terminato;
|
|
18
|
+
constructor(socket: Duplex, head: Buffer, massimoMessaggio?: number);
|
|
19
|
+
send(message: string): void;
|
|
20
|
+
close(code?: number, reason?: string): void;
|
|
21
|
+
private termina;
|
|
22
|
+
private erroreProtocollo;
|
|
23
|
+
private aggiungi;
|
|
24
|
+
private leggiFrame;
|
|
25
|
+
private gestisciControllo;
|
|
26
|
+
private gestisciDati;
|
|
27
|
+
}
|
|
28
|
+
/** Completa un upgrade HTTP gia autorizzato e restituisce il canale testuale. */
|
|
29
|
+
export declare function acceptNodeWebSocket(request: IncomingMessage, socket: Duplex, head?: Buffer): NodeWebSocket;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { type Manifest, type QueuedScore } from '../contracts/index.js';
|
|
2
|
+
export interface BoardQuery {
|
|
3
|
+
board: string;
|
|
4
|
+
period: 'daily' | 'all-time';
|
|
5
|
+
guests: boolean;
|
|
6
|
+
day?: string;
|
|
7
|
+
}
|
|
8
|
+
export interface BoardData {
|
|
9
|
+
day: string | null;
|
|
10
|
+
entries: {
|
|
11
|
+
rank: number;
|
|
12
|
+
name: string;
|
|
13
|
+
guest: boolean;
|
|
14
|
+
me: boolean;
|
|
15
|
+
score: number;
|
|
16
|
+
verified: boolean;
|
|
17
|
+
}[];
|
|
18
|
+
me: {
|
|
19
|
+
rank: number;
|
|
20
|
+
score: number;
|
|
21
|
+
verified: boolean;
|
|
22
|
+
} | null;
|
|
23
|
+
ownGuest: boolean;
|
|
24
|
+
}
|
|
25
|
+
export type BoardReader = (query: BoardQuery) => Promise<BoardData>;
|
|
26
|
+
export type Saving = 'saving' | 'saved' | 'bestAlready' | 'refreshHint';
|
|
27
|
+
export declare function createBoardController(input: {
|
|
28
|
+
manifest: Manifest;
|
|
29
|
+
player: string;
|
|
30
|
+
guests?: boolean;
|
|
31
|
+
read: BoardReader;
|
|
32
|
+
changed(): void;
|
|
33
|
+
later?: (callback: () => void, ms: number) => ReturnType<typeof setTimeout>;
|
|
34
|
+
clear?: (timer: ReturnType<typeof setTimeout>) => void;
|
|
35
|
+
}): {
|
|
36
|
+
readonly state: {
|
|
37
|
+
query: BoardQuery | null;
|
|
38
|
+
data: BoardData | null;
|
|
39
|
+
loading: boolean;
|
|
40
|
+
error: boolean;
|
|
41
|
+
saving: Saving | null;
|
|
42
|
+
};
|
|
43
|
+
select(next: BoardQuery): void;
|
|
44
|
+
queued(score: QueuedScore): void;
|
|
45
|
+
refresh: () => Promise<void>;
|
|
46
|
+
reset(): void;
|
|
47
|
+
dispose(): void;
|
|
48
|
+
};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { type OverlayConfiguration, type OverlayOperations, type OverlaySessionState, type QueuedScore, type OverlayPanel } from '../contracts/index.js';
|
|
2
|
+
export interface FinestraHandshake {
|
|
3
|
+
addEventListener(type: 'message', listener: (event: MessageEvent) => void): void;
|
|
4
|
+
removeEventListener(type: 'message', listener: (event: MessageEvent) => void): void;
|
|
5
|
+
setInterval(handler: () => void, timeout: number): number;
|
|
6
|
+
clearInterval(id: number): void;
|
|
7
|
+
setTimeout(handler: () => void, timeout: number): number;
|
|
8
|
+
clearTimeout(id: number): void;
|
|
9
|
+
}
|
|
10
|
+
export interface FrameHandshake {
|
|
11
|
+
readonly src?: string;
|
|
12
|
+
contentWindow: {
|
|
13
|
+
postMessage(message: unknown, targetOrigin: string, transfer?: Transferable[]): void;
|
|
14
|
+
} | null;
|
|
15
|
+
addEventListener?(type: 'load', listener: () => void): void;
|
|
16
|
+
removeEventListener?(type: 'load', listener: () => void): void;
|
|
17
|
+
}
|
|
18
|
+
export interface HostBridgeInput {
|
|
19
|
+
finestra: FinestraHandshake;
|
|
20
|
+
frame: FrameHandshake;
|
|
21
|
+
origineGioco: string;
|
|
22
|
+
origineLive: string;
|
|
23
|
+
invite: string | null;
|
|
24
|
+
ticket: string;
|
|
25
|
+
configuration?: OverlayConfiguration;
|
|
26
|
+
rinnova(aud: 'portal' | 'live'): Promise<string>;
|
|
27
|
+
onRoom(room: {
|
|
28
|
+
code: string;
|
|
29
|
+
} | null): void;
|
|
30
|
+
creaCanale?(): MessageChannel;
|
|
31
|
+
epoch?(): string;
|
|
32
|
+
requestTimeoutMs?: number;
|
|
33
|
+
}
|
|
34
|
+
export declare function eMessaggioReady(value: unknown): boolean;
|
|
35
|
+
export declare function eRichiestaBiglietto(value: unknown): boolean;
|
|
36
|
+
export declare function stanzaDaMessaggio(value: unknown): {
|
|
37
|
+
code: string;
|
|
38
|
+
} | null | undefined;
|
|
39
|
+
export declare function creaPonteOspite(input: HostBridgeInput): {
|
|
40
|
+
readonly epoch: string | null;
|
|
41
|
+
serverTime(): number | null;
|
|
42
|
+
readonly state: OverlaySessionState | null;
|
|
43
|
+
subscribe(listener: (value: OverlaySessionState | null) => void): () => void;
|
|
44
|
+
onShortcut(listener: () => void): () => void;
|
|
45
|
+
onOpen(listener: (value: OverlayPanel) => void): () => void;
|
|
46
|
+
onError(listener: (value: {
|
|
47
|
+
sessionId: string;
|
|
48
|
+
error: {
|
|
49
|
+
code: string;
|
|
50
|
+
message: string;
|
|
51
|
+
};
|
|
52
|
+
}) => void): () => void;
|
|
53
|
+
onScore(listener: (value: QueuedScore) => void): () => void;
|
|
54
|
+
request<K extends keyof OverlayOperations>(op: K, args: OverlayOperations[K]): Promise<void>;
|
|
55
|
+
dispose(): void;
|
|
56
|
+
};
|
|
57
|
+
export type HostBridge = ReturnType<typeof creaPonteOspite>;
|
|
58
|
+
export declare function avviaHandshake(input: HostBridgeInput): () => void;
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
export declare const languages: readonly ['en', 'it', 'es', 'fr', 'de', 'pt'];
|
|
2
|
+
export type OverlayLanguage = typeof languages[number];
|
|
3
|
+
declare const words: {
|
|
4
|
+
readonly loading: readonly ["Loading game...", "Caricamento...", "Cargando...", "Chargement...", "Spiel wird geladen...", "Carregando..."];
|
|
5
|
+
readonly home: readonly ["Play", "Gioca", "Jugar", "Jouer", "Spielen", "Jogar"];
|
|
6
|
+
readonly mode: readonly ["Mode", "Modalità", "Modo", "Mode", "Modus", "Modo"];
|
|
7
|
+
readonly play: readonly ["Play", "Gioca", "Jugar", "Jouer", "Spielen", "Jogar"];
|
|
8
|
+
readonly friendsPlay: readonly ["Play with friends", "Gioca con amici", "Jugar con amigos", "Jouer entre amis", "Mit Freunden spielen", "Jogar com amigos"];
|
|
9
|
+
readonly find: readonly ["Find players", "Trova giocatori", "Buscar jugadores", "Trouver des joueurs", "Spieler finden", "Buscar jogadores"];
|
|
10
|
+
readonly join: readonly ["Join with code", "Entra con codice", "Entrar con código", "Rejoindre avec un code", "Mit Code beitreten", "Entrar com código"];
|
|
11
|
+
readonly joinInvite: readonly ["Join this room", "Entra in questa stanza", "Entrar en está sala", "Rejoindre cette salle", "Diesem Raum beitreten", "Entrar nestá sala"];
|
|
12
|
+
readonly watch: readonly ["Watch a room", "Guarda una stanza", "Observar una sala", "Regarder une salle", "Raum ansehen", "Assistir a uma sala"];
|
|
13
|
+
readonly resume: readonly ["Resume", "Riprendi", "Continuar", "Reprendre", "Fortsetzen", "Continuar"];
|
|
14
|
+
readonly room: readonly ["Room", "Stanza", "Sala", "Salle", "Raum", "Sala"];
|
|
15
|
+
readonly code: readonly ["Room code", "Codice stanza", "Código de sala", "Code de salle", "Raumcode", "Código da sala"];
|
|
16
|
+
readonly copy: readonly ["Copy invite", "Copia invito", "Copiar invitación", "Copier le lien", "Einladung kopieren", "Copiar convite"];
|
|
17
|
+
readonly copied: readonly ["Invite copied", "Invito copiato", "Invitacion copiada", "Lien copié", "Einladung kopiert", "Convite copiado"];
|
|
18
|
+
readonly copyFailed: readonly ["Copy this link:", "Copia questo link:", "Copia este enlace:", "Copiez ce lien :", "Diesen Link kopieren:", "Copie este link:"];
|
|
19
|
+
readonly joining: readonly ["Joining room...", "Ingresso nella stanza...", "Entrando en la sala...", "Connexion à la salle...", "Raum wird betreten...", "Entrando na sala..."];
|
|
20
|
+
readonly matching: readonly ["Finding your people...", "Ricerca giocatori...", "Buscando jugadores...", "Recherche de joueurs...", "Spieler werden gesucht...", "Buscando jogadores..."];
|
|
21
|
+
readonly queue: readonly ["{n} / {max} players", "{n} / {max} giocatori", "{n} / {max} jugadores", "{n} / {max} joueurs", "{n} / {max} Spieler", "{n} / {max} jogadores"];
|
|
22
|
+
readonly cancel: readonly ["Cancel", "Annulla", "Cancelar", "Annuler", "Abbrechen", "Cancelar"];
|
|
23
|
+
readonly close: readonly ["Close", "Chiudi", "Cerrar", "Fermer", "Schließen", "Fechar"];
|
|
24
|
+
readonly back: readonly ["Back", "Indietro", "Volver", "Retour", "Zurück", "Voltar"];
|
|
25
|
+
readonly ready: readonly ["Ready", "Pronto", "Listo", "Prêt", "Bereit", "Pronto"];
|
|
26
|
+
readonly unready: readonly ["Not ready", "Non pronto", "No listo", "Pas prêt", "Nicht bereit", "Não pronto"];
|
|
27
|
+
readonly start: readonly ["Start", "Inizia", "Empezar", "Commencer", "Starten", "Começar"];
|
|
28
|
+
readonly role: readonly ["Role", "Ruolo", "Rol", "Rôle", "Rolle", "Função"];
|
|
29
|
+
readonly team: readonly ["Team", "Squadra", "Equipo", "Équipe", "Team", "Equipe"];
|
|
30
|
+
readonly host: readonly ["Host", "Host", "Anfitrion", "Hôte", "Host", "Anfitrião"];
|
|
31
|
+
readonly you: readonly ["You", "Tu", "Tú", "Vous", "Du", "Você"];
|
|
32
|
+
readonly away: readonly ["Away", "Assente", "Ausente", "Absent", "Abwesend", "Ausente"];
|
|
33
|
+
readonly needPlayers: readonly ["Waiting for more players", "In attesa di giocatori", "Esperando más jugadores", "En attente de joueurs", "Weitere Spieler fehlen", "Esperando mais jogadores"];
|
|
34
|
+
readonly needReady: readonly ["Everyone needs to be ready", "Tutti devono essere pronti", "Todos deben estar listos", "Tout le monde doit être prêt", "Alle müssen bereit sein", "Todos precisam estar prontos"];
|
|
35
|
+
readonly needRoles: readonly ["Fill the required roles", "Completa i ruoli richiesti", "Completa los roles", "Complétez les rôles", "Benötigte Rollen besetzen", "Complete as funções"];
|
|
36
|
+
readonly needTeams: readonly ["Choose the required teams", "Scegli le squadre richieste", "Elige los equipos", "Choisissez les équipes", "Teams auswahlen", "Escolha as equipes"];
|
|
37
|
+
readonly waitHost: readonly ["Waiting for the host", "In attesa dell'host", "Esperando al anfitrion", "En attente de l’hôte", "Warten auf den Host", "Esperando o anfitrião"];
|
|
38
|
+
readonly starting: readonly ["Starting in", "Si inizia tra", "Empieza en", "Début dans", "Start in", "Começa em"];
|
|
39
|
+
readonly playing: readonly ["Playing", "In partita", "Jugando", "En jeu", "Im Spiel", "Jogando"];
|
|
40
|
+
readonly ended: readonly ["Game finished", "Partita conclusa", "Partida terminada", "Partie terminée", "Spiel beendet", "Partida encerrada"];
|
|
41
|
+
readonly again: readonly ["Play again", "Gioca ancora", "Jugar de nuevo", "Rejouer", "Erneut spielen", "Jogar novamente"];
|
|
42
|
+
readonly newRoom: readonly ["New room. Share the new invite.", "Nuova stanza. Condividi il nuovo invito.", "Nueva sala. Comparte la invitación.", "Nouvelle salle. Partagez le lien.", "Neuer Raum. Neue Einladung teilen.", "Nova sala. Compartilhe o convite."];
|
|
43
|
+
readonly watching: readonly ["Watching", "In osservazione", "Observando", "Spectateur", "Zuschauen", "Assistindo"];
|
|
44
|
+
readonly delay: readonly ["{n}s delay", "Ritardo {n}s", "Retraso de {n}s", "Retard de {n}s", "{n}s Verzögerung", "Atraso de {n}s"];
|
|
45
|
+
readonly exit: readonly ["Exit", "Esci", "Salir", "Quitter", "Verlassen", "Sair"];
|
|
46
|
+
readonly leaveNow: readonly ["Leave for now", "Esci per ora", "Salir por ahora", "Quitter pour le moment", "Vorübergehend verlassen", "Sair por enquanto"];
|
|
47
|
+
readonly leaveRoom: readonly ["Leave room", "Lascia la stanza", "Abandonar sala", "Abandonner la salle", "Raum verlassen", "Deixar a sala"];
|
|
48
|
+
readonly leaveHint: readonly ["Your room stays available for Resume.", "La stanza resta disponibile con Riprendi.", "Podrás volver a está sala.", "Vous pourrez reprendre cette salle.", "Du kannst den Raum fortsetzen.", "Você pode voltar a está sala."];
|
|
49
|
+
readonly temporaryHint: readonly ["The game continues. Rejoining may only be possible briefly.", "La partita continua. Il rientro può essere disponibile solo per poco.", "La partida continua. Volver puede ser posible solo por poco tiempo.", "La partie continue. Le retour peut être limité.", "Das Spiel läuft weiter. Rückkehr nur kurz möglich.", "A partida continua. O retorno pode ser limitado."];
|
|
50
|
+
readonly abandonHint: readonly ["Leave room gives up your place.", "Lascia la stanza libera il tuo posto.", "Abandonar libera tu plaza.", "Abandonner libère votre place.", "Raum verlassen gibt deinen Platz frei.", "Deixar a sala libera sua vaga."];
|
|
51
|
+
readonly reconnecting: readonly ["Reconnecting...", "Riconnessione...", "Reconectando...", "Reconnexion...", "Verbindung wird erneuert...", "Reconectando..."];
|
|
52
|
+
readonly replaced: readonly ["Opened in another tab", "Aperta in un’altra scheda", "Abierta en otra pestána", "Ouverte dans un autre onglet", "In anderem Tab geöffnet", "Aberta em outra aba"];
|
|
53
|
+
readonly error: readonly ["Something went wrong. Try again.", "Qualcosa non va. Riprova.", "Algo salió mal. Reintenta.", "Une erreur est survenue. Réessayez.", "Etwas ist schiefgelaufen. Erneut versuchen.", "Algo deu errado. Tente novamente."];
|
|
54
|
+
readonly noRoom: readonly ["This room is no longer available.", "Questa stanza non è più disponibile.", "Esta sala ya no está disponible.", "Cette salle n'est plus disponible.", "Dieser Raum ist nicht mehr verfügbar.", "Esta sala não está mais disponivel."];
|
|
55
|
+
readonly full: readonly ["This room is full.", "La stanza è piena.", "La sala está llena.", "Cette salle est pleine.", "Dieser Raum ist voll.", "Esta sala está cheia."];
|
|
56
|
+
readonly noMatch: readonly ["No match this time. Try again.", "Nessun gruppo trovato. Riprova.", "No hay grupo. Reintenta.", "Aucun groupe trouvé. Réessayez.", "Keine Gruppe gefunden. Erneut versuchen.", "Nenhum grupo encontrado. Tente novamente."];
|
|
57
|
+
readonly invalidCode: readonly ["Enter a six-character room code.", "Inserisci un codice di sei caratteri.", "Escribe un código de seis caracteres.", "Entrez un code de six caracteres.", "Sechsstelligen Raumcode eingeben.", "Digite um código de seis caracteres."];
|
|
58
|
+
readonly refused: readonly ["The room did not accept that change.", "La stanza ha rifiutato la modifica.", "La sala rechazó el cambio.", "La salle a refusé ce changement.", "Der Raum hat die Änderung abgelehnt.", "A sala recusou a alteração."];
|
|
59
|
+
readonly unavailable: readonly ["Unavailable right now", "Non disponibile ora", "No disponible ahora", "Indisponible pour le moment", "Derzeit nicht verfügbar", "Indisponivel agora"];
|
|
60
|
+
readonly offline: readonly ["Connection unavailable. Try again.", "Connessione non disponibile. Riprova.", "Sin conexión. Reintenta.", "Connexion indisponible. Réessayez.", "Keine Verbindung. Erneut versuchen.", "Sem conexão. Tente novamente."];
|
|
61
|
+
readonly saveFailed: readonly ["Keep the room code. Resume could not be saved.", "Conserva il codice. Riprendi non è stato salvato.", "Guarda el código. No se pudo guardar el regreso.", "Gardez le code. La reprise ne peut pas être enregistrée.", "Raumcode aufbewahren. Fortsetzen nicht gespeichert.", "Guarde o código. O retorno não foi salvo."];
|
|
62
|
+
readonly boards: readonly ["Leaderboard", "Classifica", "Clasificación", "Classement", "Bestenliste", "Classificação"];
|
|
63
|
+
readonly board: readonly ["Board", "Classifica", "Tabla", "Classement", "Bestenliste", "Tabela"];
|
|
64
|
+
readonly daily: readonly ["Daily", "Giornaliera", "Diaria", "Du jour", "Täglich", "Diária"];
|
|
65
|
+
readonly allTime: readonly ["All time", "Di sempre", "Histórica", "Tous les temps", "Gesamt", "Geral"];
|
|
66
|
+
readonly accounts: readonly ["Accounts", "Account", "Cuentas", "Comptes", "Konten", "Contas"];
|
|
67
|
+
readonly guests: readonly ["Guests", "Ospiti", "Invitados", "Invités", "Gäste", "Visitantes"];
|
|
68
|
+
readonly category: readonly ["Category", "Categoria", "Categoria", "Catégorie", "Kategorie", "Categoria"];
|
|
69
|
+
readonly period: readonly ["Period", "Periodo", "Período", "Période", "Zeitraum", "Período"];
|
|
70
|
+
readonly rank: readonly ["Rank", "Posizione", "Puesto", "Rang", "Platz", "Posicao"];
|
|
71
|
+
readonly score: readonly ["Score", "Punteggio", "Puntos", "Score", "Punkte", "Pontos"];
|
|
72
|
+
readonly verified: readonly ["Verified", "Verificato", "Verificado", "Vérifié", "Verifiziert", "Verificado"];
|
|
73
|
+
readonly own: readonly ["Your best", "Il tuo record", "Tu record", "Votre record", "Dein Rekord", "Seu recorde"];
|
|
74
|
+
readonly empty: readonly ["No scores yet", "Nessun punteggio", "Aún no hay puntos", "Aucun score", "Noch keine Punkte", "Ainda sem pontos"];
|
|
75
|
+
readonly saving: readonly ["Saving score...", "Salvataggio punteggio...", "Guardando puntos...", "Enregistrement du score...", "Punkte werden gespeichert...", "Salvando pontos..."];
|
|
76
|
+
readonly saved: readonly ["Your best is on the board", "Il tuo record è in classifica", "Tu record está en la tabla", "Votre record est au classement", "Dein Rekord ist eingetragen", "Seu recorde está na tabela"];
|
|
77
|
+
readonly bestAlready: readonly ["Your best is already on the board", "Il tuo record era già in classifica", "Tu record ya estaba en la tabla", "Votre record est déjà au classement", "Dein Rekord ist bereits eingetragen", "Seu recorde já está na tabela"];
|
|
78
|
+
readonly refresh: readonly ["Refresh", "Aggiorna", "Actualizar", "Actualiser", "Aktualisieren", "Atualizar"];
|
|
79
|
+
readonly refreshHint: readonly ["Score not visible yet. Refresh to check.", "Punteggio non ancora visibile. Aggiorna per controllare.", "Puntos aún no visibles. Actualiza.", "Score pas encore visible. Actualisez.", "Punkte noch nicht sichtbar. Aktualisieren.", "Pontos ainda não visiveis. Atualize."];
|
|
80
|
+
readonly friends: readonly ["Friends & party", "Amici e gruppo", "Amigos y grupo", "Amis et groupe", "Freunde & Gruppe", "Amigos e grupo"];
|
|
81
|
+
readonly localCrew: readonly ["Friends and party are unavailable in local preview.", "Amici e gruppo non disponibili in anteprima locale.", "Amigos y grupo no disponibles en la vista local.", "Amis et groupe indisponibles en aperçu local.", "Freunde und Gruppe in lokaler Vorschau nicht verfügbar.", "Amigos e grupo indisponíveis na prévia local."];
|
|
82
|
+
readonly loginCrew: readonly ["Sign in on Caisual to use friends and party.", "Accedi a Caisual per amici e gruppo.", "Inicia sesion para amigos y grupo.", "Connectez-vous pour utiliser amis et groupe.", "Für Freunde und Gruppe bei Caisual anmelden.", "Entre no Caisual para amigos e grupo."];
|
|
83
|
+
readonly online: readonly ["Online", "Online", "En linea", "En ligne", "Online", "Online"];
|
|
84
|
+
readonly noFriends: readonly ["No friends online", "Nessun amico online", "Sin amigos en linea", "Aucun ami en ligne", "Keine Freunde online", "Nenhum amigo online"];
|
|
85
|
+
readonly createParty: readonly ["Create party", "Crea gruppo", "Crear grupo", "Créer un groupe", "Gruppe erstellen", "Criar grupo"];
|
|
86
|
+
readonly inviteParty: readonly ["Invite to party", "Invita nel gruppo", "Invitar al grupo", "Inviter au groupe", "In Gruppe einladen", "Convidar para o grupo"];
|
|
87
|
+
readonly leaveParty: readonly ["Leave party", "Lascia gruppo", "Salir del grupo", "Quitter le groupe", "Gruppe verlassen", "Sair do grupo"];
|
|
88
|
+
readonly accept: readonly ["Accept", "Accetta", "Aceptar", "Accepter", "Annehmen", "Aceitar"];
|
|
89
|
+
readonly decline: readonly ["Decline", "Rifiuta", "Rechazar", "Refuser", "Ablehnen", "Recusar"];
|
|
90
|
+
readonly follow: readonly ["Join them", "Raggiungi", "Unirse", "Rejoindre", "Beitreten", "Juntar-se"];
|
|
91
|
+
readonly voice: readonly ["Voice", "Voce", "Voz", "Voix", "Sprache", "Voz"];
|
|
92
|
+
readonly voiceJoin: readonly ["Join voice", "Entra in voce", "Unirse a voz", "Activer la voix", "Sprachchat beitreten", "Entrar na voz"];
|
|
93
|
+
readonly voiceLeave: readonly ["Leave voice", "Esci dalla voce", "Salir de voz", "Quitter la voix", "Sprachchat verlassen", "Sair da voz"];
|
|
94
|
+
readonly voiceMute: readonly ["Mute", "Disattiva microfono", "Silenciar", "Couper le micro", "Stummschalten", "Silenciar"];
|
|
95
|
+
readonly voiceUnmute: readonly ["Unmute", "Attiva microfono", "Activar micrófono", "Activer le micro", "Mikrofon aktivieren", "Ativar microfone"];
|
|
96
|
+
readonly voiceOff: readonly ["Voice off", "Voce disattivata", "Voz desactivada", "Voix désactivée", "Sprachchat aus", "Voz desativada"];
|
|
97
|
+
readonly voiceJoining: readonly ["Joining voice...", "Connessione voce...", "Conectando voz...", "Connexion vocale...", "Sprachchat verbindet...", "Conectando voz..."];
|
|
98
|
+
readonly voiceOn: readonly ["Voice connected", "Voce connessa", "Voz conectada", "Voix connectée", "Sprachchat verbunden", "Voz conectada"];
|
|
99
|
+
readonly voiceMuted: readonly ["Muted", "Microfono disattivato", "Silenciado", "Micro coupé", "Stumm", "Silenciado"];
|
|
100
|
+
readonly voiceMic: readonly ["Mic on", "Microfono attivo", "Micrófono activo", "Micro actif", "Mikrofon an", "Microfone ativo"];
|
|
101
|
+
readonly voiceListening: readonly ["Listening only", "Solo ascolto", "Solo escucha", "Écoute seule", "Nur zuhören", "Somente ouvindo"];
|
|
102
|
+
readonly voiceSpeaking: readonly ["Speaking", "Sta parlando", "Hablando", "Parle", "Spricht", "Falando"];
|
|
103
|
+
readonly voicePeers: readonly ["Voice participants", "Partecipanti in voce", "Participantes de voz", "Participants vocaux", "Sprachteilnehmer", "Participantes de voz"];
|
|
104
|
+
readonly voiceEmpty: readonly ["No one else in voice yet.", "Nessun altro in voce per ora.", "Aún no hay nadie más en voz.", "Personne d’autre en voix pour le moment.", "Noch niemand im Sprachchat.", "Ninguém mais na voz ainda."];
|
|
105
|
+
readonly voiceVolume: readonly ["Volume for {name}", "Volume di {name}", "Volumen de {name}", "Volume de {name}", "Lautstärke für {name}", "Volume de {name}"];
|
|
106
|
+
readonly voiceUnavailable: readonly ["Join a room with voice to use these controls.", "Entra in una stanza con voce per usare questi controlli.", "Entra en una sala con voz para usar estos controles.", "Rejoignez une salle vocale pour utiliser ces commandes.", "Diese Steuerung braucht einen Raum mit Sprachchat.", "Entre em uma sala com voz para usar estes controles."];
|
|
107
|
+
readonly voiceWatch: readonly ["Voice is unavailable while watching.", "La voce non e' disponibile in osservazione.", "La voz no está disponible al observar.", "La voix est indisponible en observation.", "Beim Zuschauen ist kein Sprachchat verfügbar.", "A voz não está disponível ao assistir."];
|
|
108
|
+
readonly voiceDenied: readonly ["Microphone permission denied. Allow it in your browser, then try again.", "Permesso microfono negato. Consenti l'accesso nel browser e riprova.", "Permiso de micrófono denegado. Actívalo en el navegador e inténtalo de nuevo.", "Accès au micro refusé. Autorisez-le dans le navigateur, puis réessayez.", "Mikrofonzugriff verweigert. Im Browser erlauben und erneut versuchen.", "Permissão do microfone negada. Permita no navegador e tente novamente."];
|
|
109
|
+
readonly voiceUnsupported: readonly ["Voice is not supported in this browser.", "Questo browser non supporta la voce.", "Este navegador no admite voz.", "Ce navigateur ne prend pas en charge la voix.", "Dieser Browser unterstützt keinen Sprachchat.", "Este navegador não oferece suporte a voz."];
|
|
110
|
+
readonly voiceFailed: readonly ["Voice could not connect. Try again.", "Connessione voce non riuscita. Riprova.", "No se pudo conectar la voz. Inténtalo de nuevo.", "Connexion vocale impossible. Réessayez.", "Sprachverbindung fehlgeschlagen. Erneut versuchen.", "Não foi possível conectar a voz. Tente novamente."];
|
|
111
|
+
readonly voicePeerGone: readonly ["This participant has left voice.", "Questo partecipante e' uscito dalla voce.", "Este participante salió de voz.", "Ce participant a quitté la voix.", "Diese Person hat den Sprachchat verlassen.", "Este participante saiu da voz."];
|
|
112
|
+
readonly shortcut: readonly ["Shift+Tab shortcut", "Scorciatoia Shift+Tab", "Atajo Shift+Tab", "Raccourci Maj+Tab", "Umschalt+Tab-Kurzbefehl", "Atalho Shift+Tab"];
|
|
113
|
+
readonly menu: readonly ["Caisual menu", "Menu Caisual", "Menu Caisual", "Menu Caisual", "Caisual-Menu", "Menu Caisual"];
|
|
114
|
+
readonly retry: readonly ["Retry", "Riprova", "Reintentar", "Réessayer", "Erneut versuchen", "Tentar novamente"];
|
|
115
|
+
};
|
|
116
|
+
export type TextKey = keyof typeof words;
|
|
117
|
+
export type Dictionary = Record<TextKey, string>;
|
|
118
|
+
export declare const dictionaries: Record<OverlayLanguage, Dictionary>;
|
|
119
|
+
export declare function overlayLanguage(raw: string | null | undefined): OverlayLanguage;
|
|
120
|
+
export declare function translator(language: string): (key: TextKey, values?: Record<string, string | number>) => string;
|
|
121
|
+
export declare function errorText(code: string): TextKey;
|
|
122
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { creaPonteOspite, avviaHandshake, eMessaggioReady, eRichiestaBiglietto, stanzaDaMessaggio } from './host-bridge.js';
|
|
2
|
+
export type { HostBridge, HostBridgeInput, FinestraHandshake, FrameHandshake } from './host-bridge.js';
|
|
3
|
+
export { overlayConfiguration } from '../contracts/index.js';
|
|
4
|
+
export type { OverlayConfiguration, OverlayOperations, OverlaySessionState, OverlayCapabilities, OverlayPanel, OverlayView, OverlayVoice, OverlayVoicePeer } from '../contracts/index.js';
|
|
5
|
+
export { mountOverlay } from './ui.js';
|
|
6
|
+
export type { MountOverlayInput, OverlayCrew, CrewSnapshot } from './ui.js';
|
|
7
|
+
export type { BoardReader, BoardQuery, BoardData } from './boards.js';
|
|
8
|
+
export { overlayLanguage } from './i18n.js';
|
|
9
|
+
export { styles as overlayStyles } from './styles.js';
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { OverlayView } from '../contracts/index.js';
|
|
2
|
+
export declare function bindOverlayShortcut(target: Pick<Window, 'addEventListener' | 'removeEventListener'>, overlay: {
|
|
3
|
+
onChange(listener: (view: OverlayView) => void): () => void;
|
|
4
|
+
}, open: () => void): () => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const styles = "\n:host{all:initial;position:fixed;inset:0;z-index:10000;pointer-events:none;font:15px/1.45 system-ui,sans-serif;color:#f4f4f1;color-scheme:dark;--accent:#a8efc5}\n[data-layout],[data-surface],.sr{pointer-events:none}*{box-sizing:border-box}button,input,select{font:inherit}button,a,input,select{touch-action:manipulation}button,select,input{border:1px solid #ffffff30;background:#25292b;color:inherit;border-radius:12px;min-height:44px;padding:10px 14px}button{cursor:pointer}button:disabled{opacity:.45;cursor:default}button:hover:not(:disabled){background:#343b3a}button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible{outline:3px solid var(--accent);outline-offset:3px}a{color:var(--accent)}.primary{background:var(--accent);color:var(--accent-ink,#11221b);border-color:transparent;font-weight:700}.primary:hover:not(:disabled){filter:brightness(1.1);background:var(--accent)}.quiet{background:transparent}label{display:grid;gap:6px;text-align:left}select,input{width:100%;min-width:0}h1,h2,p{margin:0}h1{font-size:clamp(26px,5vw,42px);line-height:1.1;letter-spacing:-.035em}h2{font-size:20px}small,.muted{color:#bdc5c1}.stack{display:grid;gap:16px}.row{display:flex;gap:8px;align-items:center;flex-wrap:wrap}.row>*{flex:0 1 auto}.row .grow,.grow{flex:1}.split{display:grid;grid-template-columns:1fr 1fr;gap:10px}.pill{position:absolute;top:max(10px,env(safe-area-inset-top));right:max(10px,env(safe-area-inset-right));display:flex;height:44px;border:1px solid #ffffff35;border-radius:24px;background:#171e20eF;box-shadow:0 4px 20px #0004;pointer-events:auto;overflow:hidden}.pill button{border:0;border-radius:0;padding:8px 13px;background:transparent}.pill .exit{width:44px;border-left:1px solid #ffffff30}.pill button:focus-visible{outline-offset:-4px}.pill small{margin-left:8px}.backdrop{position:absolute;inset:0;background:#0b151ce8;backdrop-filter:blur(10px);pointer-events:auto;display:grid;place-items:center;padding:max(16px,env(safe-area-inset-top)) max(16px,env(safe-area-inset-right)) max(16px,env(safe-area-inset-bottom)) max(16px,env(safe-area-inset-left));overflow:auto}.backdrop.home{background-color:#142127;background-size:cover;background-position:center}.dialog{position:relative;width:min(100%,540px);max-height:100%;overflow:auto;overscroll-behavior:contain;background:#141b1df5;border:1px solid #ffffff25;border-radius:22px;padding:24px;box-shadow:0 20px 80px #0005}.dialog.wide{width:min(100%,700px)}.top{display:flex;align-items:center;gap:12px;margin-bottom:18px}.top h2{flex:1}.tabs{display:flex;gap:6px;flex-wrap:wrap;border-bottom:1px solid #ffffff25;padding-bottom:12px}.tabs button{min-height:36px;padding:6px 10px}.tabs [aria-current=true]{border-color:var(--accent)}.roster{list-style:none;padding:0;margin:0;display:grid;gap:8px;max-height:32dvh;overflow:auto}.roster li{display:flex;align-items:center;gap:8px;padding:10px;background:#ffffff08;border-radius:10px}.roster .name{flex:1;overflow-wrap:anywhere}.badge{border:1px solid #ffffff30;border-radius:6px;padding:2px 6px;font-size:12px}.code{font-size:24px;letter-spacing:.13em;font-variant-numeric:tabular-nums}.notice,.error{border-radius:10px;padding:10px;background:#a8efc514;overflow-wrap:anywhere}.error{background:#ff8b7720;color:#ffd2c9}.countdown{font-size:88px;line-height:1;text-align:center;font-variant-numeric:tabular-nums}.ended{position:absolute;bottom:max(12px,env(safe-area-inset-bottom));left:50%;transform:translateX(-50%);max-width:calc(100% - 24px);width:max-content;background:#171e20f5;pointer-events:auto;border:1px solid #ffffff30;border-radius:16px;padding:10px;display:flex;align-items:center;justify-content:center;gap:8px;flex-wrap:wrap}.ended strong{padding:0 8px}.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}.table-wrap{overflow:auto;max-height:38dvh}table{width:100%;border-collapse:collapse;text-align:left}th,td{padding:9px 6px;border-bottom:1px solid #ffffff20}td:nth-child(3){text-align:right}td small{display:block}.self{background:#ffffff0a}.checkbox{display:flex;align-items:center;gap:8px;font-size:13px}.checkbox input{width:18px;min-height:18px}.full{width:100%}\n[hidden]{display:none!important}.voice-peers{list-style:none;margin:0;padding:0;display:grid;gap:10px}.voice-peers li{border:1px solid #ffffff25;border-radius:12px;padding:12px;display:grid;gap:8px}.voice-peers [data-speaking=true]{border-color:var(--accent)}.voice-peers input{width:100%;accent-color:var(--accent);padding:0}.voice-peers label{font-size:13px}.pill .voice-toggle{width:44px;padding:8px}.voice-toggle[data-voice-state=on][data-muted=false]{color:var(--accent)}\n@media(max-width:480px){.dialog{padding:18px;border-radius:18px}.split{grid-template-columns:1fr 1fr;gap:8px}.tabs{gap:4px}.tabs button{font-size:13px;padding:6px 8px}.pill button:focus-visible{outline-offset:-4px}.pill small{display:none}.ended{gap:6px}.ended strong{font-size:13px}.ended button{padding:8px 10px;font-size:13px}.roster{max-height:28dvh}}\n@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto}}\n";
|