forked from SillyTavern/SillyTavern
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.d.ts
69 lines (62 loc) · 1.62 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
import { EventEmitter } from 'node:events';
import { CsrfSyncedToken } from 'csrf-sync';
import { UserDirectoryList, User } from './src/users.js';
import { CommandLineArguments } from './src/command-line.js';
import { EVENT_NAMES } from './src/server-events.js';
/**
* Event payload for SERVER_STARTED event.
*/
export interface ServerStartedEvent {
/**
* The URL the server is listening on.
*/
url: URL;
}
/**
* Map of all server events to their payload types.
*/
export interface ServerEventMap {
[EVENT_NAMES.SERVER_STARTED]: [ServerStartedEvent];
}
declare global {
declare namespace NodeJS {
export interface Process {
/**
* A global instance of the server events emitter.
*/
serverEvents: EventEmitter<ServerEventMap>;
}
}
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: {
profile: User;
directories: UserDirectoryList;
};
}
}
/**
* The root directory for user data.
*/
var DATA_ROOT: string;
/**
* Parsed command line arguments.
*/
var COMMAND_LINE_ARGS: CommandLineArguments;
}