export session interface to create a user interface for context

This commit is contained in:
2026-06-12 11:27:12 +02:00
parent 734c631356
commit 887a43636f
2 changed files with 19 additions and 21 deletions
+2 -5
View File
@@ -9,13 +9,10 @@ import {
useEffect,
useState,
} from "react";
import type { ISession } from "#/interfaces.ts";
import { getSession } from "#/server/lichess.ts";
interface ILichessUser {
username: string;
id: string;
}
interface ILichessUser extends Omit<ISession, "token"> {}
interface ILichessUserContextType {
user: ILichessUser | null;
+17 -16
View File
@@ -1,5 +1,21 @@
import type { infer } from "zod";
import type { TokenResponseSchema } from "#/schemas.ts";
import type { SessionSchema, TokenResponseSchema } from "#/schemas.ts";
export interface ISession extends infer<typeof SessionSchema> {}
export interface ITokenData extends infer<typeof TokenResponseSchema> {}
export interface IUserStudy {
id: string;
name: string;
createdAt: number;
updatedAt: number;
}
export interface IUserStudyChapter {
chapterId: string;
name: string;
pgn: string;
}
export interface IPosition {
ply: number;
@@ -32,18 +48,3 @@ export interface IGameState {
diagrams: IPosition[];
diagramClock: boolean;
}
export interface ITokenData extends infer<typeof TokenResponseSchema> {}
export interface IUserStudy {
id: string;
name: string;
createdAt: number;
updatedAt: number;
}
export interface IUserStudyChapter {
chapterId: string;
name: string;
pgn: string;
}