15 lines
421 B
TypeScript
15 lines
421 B
TypeScript
export type GameSessionData = {
|
|
answers: Map<string, { correctOptionId: number }>;
|
|
userId: string | null;
|
|
};
|
|
|
|
export interface GameSessionStore {
|
|
create(
|
|
sessionId: string,
|
|
data: GameSessionData,
|
|
ttlMs: number,
|
|
): Promise<void>;
|
|
get(sessionId: string): Promise<GameSessionData | null>;
|
|
update(sessionId: string, data: GameSessionData): Promise<void>;
|
|
delete(sessionId: string): Promise<void>;
|
|
}
|