feat(server-sdk): authentication

This commit is contained in:
Neko Ayaka
2025-01-17 01:23:48 +08:00
parent be0dc65650
commit 7b7fb2dd5c
8 changed files with 149 additions and 47 deletions
@@ -29,6 +29,15 @@ export type WithInputSource<Source extends keyof InputSource> = {
// A little hack for creating extensible discriminated unions : r/typescript
// https://www.reddit.com/r/typescript/comments/1064ibt/a_little_hack_for_creating_extensible/
export interface WebSocketEvents {
'error': {
message: string
}
'module:authenticate': {
token: string
}
'module:authenticated': {
authenticated: boolean
}
'module:announce': {
name: string
possibleEvents: Array<(keyof WebSocketEvents)>