mirror of
https://github.com/TheRealOwenRees/chess-scribe-website.git
synced 2026-07-23 01:46:57 +00:00
export session interface to create a user interface for context
This commit is contained in:
@@ -9,13 +9,10 @@ import {
|
|||||||
useEffect,
|
useEffect,
|
||||||
useState,
|
useState,
|
||||||
} from "react";
|
} from "react";
|
||||||
|
import type { ISession } from "#/interfaces.ts";
|
||||||
import { getSession } from "#/server/lichess.ts";
|
import { getSession } from "#/server/lichess.ts";
|
||||||
|
|
||||||
interface ILichessUser {
|
interface ILichessUser extends Omit<ISession, "token"> {}
|
||||||
username: string;
|
|
||||||
id: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface ILichessUserContextType {
|
interface ILichessUserContextType {
|
||||||
user: ILichessUser | null;
|
user: ILichessUser | null;
|
||||||
|
|||||||
+17
-16
@@ -1,5 +1,21 @@
|
|||||||
import type { infer } from "zod";
|
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 {
|
export interface IPosition {
|
||||||
ply: number;
|
ply: number;
|
||||||
@@ -32,18 +48,3 @@ export interface IGameState {
|
|||||||
diagrams: IPosition[];
|
diagrams: IPosition[];
|
||||||
diagramClock: boolean;
|
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;
|
|
||||||
}
|
|
||||||
|
|||||||
Reference in New Issue
Block a user