mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Fix types for session
This commit is contained in:
26
index.d.ts
vendored
26
index.d.ts
vendored
@@ -1,6 +1,24 @@
|
||||
import { UserDirectoryList, User } from "./src/users";
|
||||
import { CsrfSyncedToken } from "csrf-sync";
|
||||
|
||||
declare global {
|
||||
declare namespace CookieSessionInterfaces {
|
||||
export interface CookieSessionObject {
|
||||
/**
|
||||
* The CSRF token for the session.
|
||||
*/
|
||||
csrfToken: CsrfSyncedToken;
|
||||
/**
|
||||
* Authenticated user handle.
|
||||
*/
|
||||
handle: string;
|
||||
/**
|
||||
* Last time the session was extended.
|
||||
*/
|
||||
touch: number;
|
||||
}
|
||||
}
|
||||
|
||||
namespace Express {
|
||||
export interface Request {
|
||||
user: {
|
||||
@@ -15,11 +33,3 @@ declare global {
|
||||
*/
|
||||
var DATA_ROOT: string;
|
||||
}
|
||||
|
||||
declare module 'express-session' {
|
||||
export interface SessionData {
|
||||
handle: string;
|
||||
touch: number;
|
||||
// other properties...
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user