From 887a43636f8c19f0647a05c97ca92161b6de066d Mon Sep 17 00:00:00 2001 From: Owen Date: Fri, 12 Jun 2026 11:27:12 +0200 Subject: [PATCH] export session interface to create a user interface for context --- src/context/LichessUserContext.tsx | 7 ++----- src/interfaces.ts | 33 +++++++++++++++--------------- 2 files changed, 19 insertions(+), 21 deletions(-) diff --git a/src/context/LichessUserContext.tsx b/src/context/LichessUserContext.tsx index 0936d1a..c22414c 100644 --- a/src/context/LichessUserContext.tsx +++ b/src/context/LichessUserContext.tsx @@ -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 {} interface ILichessUserContextType { user: ILichessUser | null; diff --git a/src/interfaces.ts b/src/interfaces.ts index ed64d38..f1ac15d 100644 --- a/src/interfaces.ts +++ b/src/interfaces.ts @@ -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 {} +export interface ITokenData extends infer {} + +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 {} - -export interface IUserStudy { - id: string; - name: string; - createdAt: number; - updatedAt: number; -} - -export interface IUserStudyChapter { - chapterId: string; - name: string; - pgn: string; -}