@pluv/io 3.2.2 → 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -1,539 +1,543 @@
1
- import { AbstractCrdtDocFactory, CrdtLibraryType as CrdtLibraryType$1, NoopCrdtDocFactory } from '@pluv/crdt';
2
- export { CrdtLibraryType } from '@pluv/crdt';
3
- import { JsonObject, IOAuthorize, InferIOAuthorizeUser, MaybePromise, IOEventMessage, EventRecord, ProcedureLike, InputZodLike, IORouterLike, BaseUser, UndefinedProps, CrdtDocLike, Id, InferEventMessage, InferEventsOutput, Maybe, IOLike, InferIOOutput, CrdtLibraryType, InferIOInput, InferIOAuthorize, HasRequiredProperty } from '@pluv/types';
4
- export { BaseUser, EventMessage, EventRecord, IOEventMessage } from '@pluv/types';
1
+ import { AbstractCrdtDocFactory, CrdtLibraryType, CrdtLibraryType as CrdtLibraryType$1, NoopCrdtDocFactory } from "@pluv/crdt";
2
+ import { BaseUser, BaseUser as BaseUser$1, CrdtDocLike, CrdtLibraryType as CrdtLibraryType$2, EventMessage, EventRecord, EventRecord as EventRecord$1, HasRequiredProperty, IOAuthorize, IOEventMessage, IOEventMessage as IOEventMessage$1, IOLike, IORouterLike, Id, InferEventMessage, InferEventsOutput, InferIOAuthorize, InferIOAuthorizeUser, InferIOInput, InferIOOutput, InputZodLike, JsonObject, Maybe, MaybePromise, ProcedureLike, UndefinedProps } from "@pluv/types";
5
3
 
4
+ //#region src/AbstractPersistence.d.ts
6
5
  declare abstract class AbstractPersistence {
7
- abstract addUser(room: string, connectionId: string, user: JsonObject | null): Promise<void>;
8
- abstract deleteStorageState(room: string): Promise<void>;
9
- abstract deleteUser(room: string, connectionId: string): Promise<void>;
10
- abstract deleteUsers(room: string): Promise<void>;
11
- abstract getStorageState(room: string): Promise<string | null>;
12
- abstract getUser(room: string, connectionId: string): Promise<JsonObject | null>;
13
- abstract getUsers(room: string): Promise<Map<[connectionId: string][0], JsonObject | null>>;
14
- abstract getUsersSize(room: string): Promise<number>;
15
- abstract initialize(roomContext: any): typeof this;
16
- abstract setStorageState(room: string, state: string): Promise<void>;
6
+ abstract addUser(room: string, connectionId: string, user: JsonObject | null): Promise<void>;
7
+ abstract deleteStorageState(room: string): Promise<void>;
8
+ abstract deleteUser(room: string, connectionId: string): Promise<void>;
9
+ abstract deleteUsers(room: string): Promise<void>;
10
+ abstract getStorageState(room: string): Promise<string | null>;
11
+ abstract getUser(room: string, connectionId: string): Promise<JsonObject | null>;
12
+ abstract getUsers(room: string): Promise<Map<[connectionId: string][0], JsonObject | null>>;
13
+ abstract getUsersSize(room: string): Promise<number>;
14
+ abstract initialize(roomContext: any): typeof this;
15
+ abstract setStorageState(room: string, state: string): Promise<void>;
17
16
  }
18
-
17
+ //#endregion
18
+ //#region src/AbstractWebSocket.d.ts
19
19
  type AbstractEvent = {};
20
20
  type AbstractCloseEvent = AbstractEvent & {
21
- readonly code: number;
22
- readonly reason: string;
21
+ readonly code: number;
22
+ readonly reason: string;
23
23
  };
24
24
  type AbstractMessageEvent<T = any> = AbstractEvent & {
25
- readonly data: T;
25
+ readonly data: T;
26
26
  };
27
27
  type AbstractErrorEvent = AbstractEvent & {
28
- error: unknown;
29
- message?: string;
28
+ error: unknown;
29
+ message?: string;
30
30
  };
31
31
  interface AbstractEventMap {
32
- close: AbstractCloseEvent;
33
- message: AbstractMessageEvent;
34
- error: AbstractErrorEvent;
32
+ close: AbstractCloseEvent;
33
+ message: AbstractMessageEvent;
34
+ error: AbstractErrorEvent;
35
35
  }
36
36
  type EventType = keyof AbstractEventMap;
37
37
  interface AbstractWebSocketHandleErrorParams {
38
- error: unknown;
39
- message?: string;
40
- room: string;
41
- session?: WebSocketSession<any>;
38
+ error: unknown;
39
+ message?: string;
40
+ room: string;
41
+ session?: WebSocketSession<any>;
42
42
  }
43
43
  type AbstractListener<TType extends keyof AbstractEventMap> = (event: AbstractEventMap[TType]) => MaybePromise<void>;
44
44
  type InferWebSocketSource<TAbstractWebSocket extends AbstractWebSocket> = TAbstractWebSocket extends AbstractWebSocket<infer IWebSocket> ? IWebSocket : never;
45
45
  interface AbstractWebSocketConfig {
46
- persistence: AbstractPersistence;
47
- platform: AbstractPlatform<any>;
48
- room: string;
46
+ persistence: AbstractPersistence;
47
+ platform: AbstractPlatform<any>;
48
+ room: string;
49
49
  }
50
50
  declare abstract class AbstractWebSocket<TWebSocket = any, TAuthorize extends IOAuthorize<any, any> | null = null> {
51
- /** The connection is not yet open. */
52
- readonly CONNECTING = 0;
53
- /** The connection is open and ready to communicate. */
54
- readonly OPEN = 1;
55
- /** The connection is in the process of closing. */
56
- readonly CLOSING = 2;
57
- /** The connection is closed. */
58
- readonly CLOSED = 3;
59
- readonly persistence: AbstractPersistence;
60
- readonly room: string;
61
- readonly webSocket: TWebSocket;
62
- protected readonly _platform: AbstractPlatform<this>;
63
- abstract set presence(presence: JsonObject | null);
64
- abstract get readyState(): 0 | 1 | 2 | 3;
65
- abstract get session(): WebSocketSession<TAuthorize>;
66
- abstract get sessionId(): string;
67
- abstract get state(): WebSocketSerializedState;
68
- abstract set state(state: WebSocketSerializedState);
69
- abstract set user(user: InferIOAuthorizeUser<TAuthorize>);
70
- constructor(webSocket: TWebSocket, config: AbstractWebSocketConfig);
71
- /**
72
- * TODO
73
- * @description Return an unsubscribe method to remove the event-listener.
74
- * This is preferred over adding an explicit abstract removeEventListener
75
- * method, because the implementing class might have to transform the
76
- * listener, and removing the same listener might be complicated as a
77
- * result.
78
- * @date August 28, 2022
79
- */
80
- abstract addEventListener<TType extends EventType>(type: TType, handler: AbstractListener<TType>): void;
81
- abstract close(code?: number | undefined, reason?: string | undefined): void;
82
- abstract send(message: ArrayBuffer | ArrayBufferView | string): void;
83
- abstract terminate(): void;
84
- handleError(params: AbstractWebSocketHandleErrorParams): void;
85
- sendMessage<TMessage extends IOEventMessage<any> = IOEventMessage<any>>(data: TMessage): void;
51
+ /** The connection is not yet open. */
52
+ readonly CONNECTING = 0;
53
+ /** The connection is open and ready to communicate. */
54
+ readonly OPEN = 1;
55
+ /** The connection is in the process of closing. */
56
+ readonly CLOSING = 2;
57
+ /** The connection is closed. */
58
+ readonly CLOSED = 3;
59
+ readonly persistence: AbstractPersistence;
60
+ readonly room: string;
61
+ readonly webSocket: TWebSocket;
62
+ protected readonly _platform: AbstractPlatform<this>;
63
+ abstract set presence(presence: JsonObject | null);
64
+ abstract get readyState(): 0 | 1 | 2 | 3;
65
+ abstract get session(): WebSocketSession<TAuthorize>;
66
+ abstract get sessionId(): string;
67
+ abstract get state(): WebSocketSerializedState;
68
+ abstract set state(state: WebSocketSerializedState);
69
+ abstract set user(user: InferIOAuthorizeUser<TAuthorize>);
70
+ constructor(webSocket: TWebSocket, config: AbstractWebSocketConfig);
71
+ /**
72
+ * TODO
73
+ * @description Return an unsubscribe method to remove the event-listener.
74
+ * This is preferred over adding an explicit abstract removeEventListener
75
+ * method, because the implementing class might have to transform the
76
+ * listener, and removing the same listener might be complicated as a
77
+ * result.
78
+ * @date August 28, 2022
79
+ */
80
+ abstract addEventListener<TType extends EventType>(type: TType, handler: AbstractListener<TType>): void;
81
+ abstract close(code?: number | undefined, reason?: string | undefined): void;
82
+ abstract send(message: ArrayBuffer | ArrayBufferView | string): void;
83
+ abstract terminate(): void;
84
+ handleError(params: AbstractWebSocketHandleErrorParams): void;
85
+ sendMessage<TMessage extends IOEventMessage$1<any> = IOEventMessage$1<any>>(data: TMessage): void;
86
86
  }
87
-
88
- interface PluvProcedureConfig<TPlatform extends AbstractPlatform<any>, TAuthorize extends IOAuthorize<any, InferInitContextType<TPlatform>> | null, TContext extends Record<string, any>, TInput extends JsonObject = {}, TOutput extends EventRecord<string, any> = {}> {
89
- broadcast?: EventResolver<"broadcast", TPlatform, TAuthorize, TContext, TInput, Partial<TOutput>> | null;
90
- input?: InputZodLike<TInput>;
91
- self?: EventResolver<"self", TPlatform, TAuthorize, TContext, TInput, Partial<TOutput>> | null;
92
- sync?: EventResolver<"sync", TPlatform, TAuthorize, TContext, TInput, Partial<TOutput>> | null;
87
+ //#endregion
88
+ //#region src/PluvProcedure.d.ts
89
+ interface PluvProcedureConfig<TPlatform extends AbstractPlatform<any>, TAuthorize extends IOAuthorize<any, InferInitContextType<TPlatform>> | null, TContext extends Record<string, any>, TInput extends JsonObject = {}, TOutput extends EventRecord$1<string, any> = {}> {
90
+ broadcast?: EventResolver<"broadcast", TPlatform, TAuthorize, TContext, TInput, Partial<TOutput>> | null;
91
+ input?: InputZodLike<TInput>;
92
+ self?: EventResolver<"self", TPlatform, TAuthorize, TContext, TInput, Partial<TOutput>> | null;
93
+ sync?: EventResolver<"sync", TPlatform, TAuthorize, TContext, TInput, Partial<TOutput>> | null;
93
94
  }
94
- declare class PluvProcedure<TPlatform extends AbstractPlatform<any>, TAuthorize extends IOAuthorize<any, InferInitContextType<TPlatform>> | null, TContext extends Record<string, any>, TInput extends JsonObject = {}, TOutput extends EventRecord<string, any> = {}, TFilled extends "input" | "broadcast" | "self" | "sync" | "" = ""> {
95
- private _broadcast;
96
- private _input;
97
- private _self;
98
- private _sync;
99
- get config(): ProcedureLike<TInput, TOutput>["config"];
100
- constructor(config?: PluvProcedureConfig<TPlatform, TAuthorize, TContext, TInput, TOutput>);
101
- broadcast<TResult extends EventRecord<string, any> = {}>(resolver: EventResolver<"broadcast", TPlatform, TAuthorize, TContext, TInput, TResult>): Omit<PluvProcedure<TPlatform, TAuthorize, TContext, TInput, MergeEventRecords<[TOutput, TResult]>, TFilled | "input" | "broadcast">, TFilled | "input" | "broadcast">;
102
- input<TData extends JsonObject>(input: InputZodLike<TData>): Omit<PluvProcedure<TPlatform, TAuthorize, TContext, TData, {}, TFilled | "input">, TFilled | "input">;
103
- self<TResult extends EventRecord<string, any> = {}>(resolver: EventResolver<"self", TPlatform, TAuthorize, TContext, TInput, TResult>): Omit<PluvProcedure<TPlatform, TAuthorize, TContext, TInput, MergeEventRecords<[TOutput, TResult]>, TFilled | "input" | "self">, TFilled | "input" | "self">;
104
- sync<TResult extends EventRecord<string, any> = {}>(resolver: EventResolver<"sync", TPlatform, TAuthorize, TContext, TInput, TResult>): Omit<PluvProcedure<TPlatform, TAuthorize, TContext, TInput, MergeEventRecords<[TOutput, TResult]>, TFilled | "input" | "sync">, TFilled | "input" | "sync">;
105
- private _resolver;
95
+ declare class PluvProcedure<TPlatform extends AbstractPlatform<any>, TAuthorize extends IOAuthorize<any, InferInitContextType<TPlatform>> | null, TContext extends Record<string, any>, TInput extends JsonObject = {}, TOutput extends EventRecord$1<string, any> = {}, TFilled extends "input" | "broadcast" | "self" | "sync" | "" = ""> {
96
+ private _broadcast;
97
+ private _input;
98
+ private _self;
99
+ private _sync;
100
+ get config(): ProcedureLike<TInput, TOutput>["config"];
101
+ constructor(config?: PluvProcedureConfig<TPlatform, TAuthorize, TContext, TInput, TOutput>);
102
+ broadcast<TResult extends EventRecord$1<string, any> = {}>(resolver: EventResolver<"broadcast", TPlatform, TAuthorize, TContext, TInput, TResult>): Omit<PluvProcedure<TPlatform, TAuthorize, TContext, TInput, MergeEventRecords<[TOutput, TResult]>, TFilled | "input" | "broadcast">, TFilled | "input" | "broadcast">;
103
+ input<TData extends JsonObject>(input: InputZodLike<TData>): Omit<PluvProcedure<TPlatform, TAuthorize, TContext, TData, {}, TFilled | "input">, TFilled | "input">;
104
+ self<TResult extends EventRecord$1<string, any> = {}>(resolver: EventResolver<"self", TPlatform, TAuthorize, TContext, TInput, TResult>): Omit<PluvProcedure<TPlatform, TAuthorize, TContext, TInput, MergeEventRecords<[TOutput, TResult]>, TFilled | "input" | "self">, TFilled | "input" | "self">;
105
+ sync<TResult extends EventRecord$1<string, any> = {}>(resolver: EventResolver<"sync", TPlatform, TAuthorize, TContext, TInput, TResult>): Omit<PluvProcedure<TPlatform, TAuthorize, TContext, TInput, MergeEventRecords<[TOutput, TResult]>, TFilled | "input" | "sync">, TFilled | "input" | "sync">;
106
+ private _resolver;
106
107
  }
107
-
108
+ //#endregion
109
+ //#region src/PluvRouter.d.ts
108
110
  type PluvRouterEventConfig<TPlatform extends AbstractPlatform<any> = AbstractPlatform<any>, TAuthorize extends PluvIOAuthorize<TPlatform, any, InferInitContextType<TPlatform>> | null = any, TContext extends Record<string, any> = {}> = {
109
- [P: string]: Pick<PluvProcedure<TPlatform, TAuthorize, TContext, any, any>, "config">;
111
+ [P: string]: Pick<PluvProcedure<TPlatform, TAuthorize, TContext, any, any>, "config">;
110
112
  };
111
- type MergedRouter<TRouters extends PluvRouter<TPlatform, TAuthorize, TContext, any>[] = [], TPlatform extends AbstractPlatform<any> = AbstractPlatform<any>, TAuthorize extends PluvIOAuthorize<TPlatform, any, InferInitContextType<TPlatform>> = any, TContext extends Record<string, any> = {}, TRoot extends TRouters[0]["_defs"]["events"] = {}> = TRouters extends [
112
- infer IHead extends PluvRouter<TPlatform, TAuthorize, TContext, any>,
113
- ...infer ITail extends PluvRouter<TPlatform, TAuthorize, TContext, any>[]
114
- ] ? MergedRouter<ITail, TPlatform, TAuthorize, TContext, TRoot & IHead["_defs"]["events"]> : PluvRouter<TPlatform, TAuthorize, TContext, TRoot>;
113
+ type MergedRouter<TRouters extends PluvRouter<TPlatform, TAuthorize, TContext, any>[] = [], TPlatform extends AbstractPlatform<any> = AbstractPlatform<any>, TAuthorize extends PluvIOAuthorize<TPlatform, any, InferInitContextType<TPlatform>> = any, TContext extends Record<string, any> = {}, TRoot extends TRouters[0]["_defs"]["events"] = {}> = TRouters extends [infer IHead extends PluvRouter<TPlatform, TAuthorize, TContext, any>, ...infer ITail extends PluvRouter<TPlatform, TAuthorize, TContext, any>[]] ? MergedRouter<ITail, TPlatform, TAuthorize, TContext, TRoot & IHead["_defs"]["events"]> : PluvRouter<TPlatform, TAuthorize, TContext, TRoot>;
115
114
  declare class PluvRouter<TPlatform extends AbstractPlatform<any> = AbstractPlatform<any>, TAuthorize extends PluvIOAuthorize<TPlatform, any, InferInitContextType<TPlatform>> | null = any, TContext extends Record<string, any> = {}, TEvents extends PluvRouterEventConfig<TPlatform, TAuthorize, TContext> = {}> implements IORouterLike<TEvents> {
116
- readonly _defs: {
117
- events: TEvents;
118
- };
119
- constructor(events: TEvents);
120
- static merge<TRouters extends PluvRouter<any, any, any, any>[]>(...routers: TRouters): MergedRouter<TRouters>;
121
- private _isValidEventName;
115
+ readonly _defs: {
116
+ events: TEvents;
117
+ };
118
+ constructor(events: TEvents);
119
+ static merge<TRouters extends PluvRouter<any, any, any, any>[]>(...routers: TRouters): MergedRouter<TRouters>;
120
+ private _isValidEventName;
122
121
  }
123
-
122
+ //#endregion
123
+ //#region src/types.d.ts
124
124
  type PluvContext<TPlatform extends AbstractPlatform, TContext extends Record<string, any>> = MaybePromise<TContext> | ((params: InferRoomContextType<TPlatform>) => MaybePromise<TContext>);
125
125
  type EventResolverKind = "broadcast" | "self" | "sync";
126
- type EventResolver<TKind extends EventResolverKind = EventResolverKind, TPlatform extends AbstractPlatform = AbstractPlatform, TAuthorize extends IOAuthorize<any, InferInitContextType<TPlatform>> | null = null, TContext extends Record<string, any> = {}, TInput extends JsonObject = {}, TOutput extends EventRecord<string, any> = {}> = (data: TInput, context: EventResolverContext<TKind, TPlatform, TAuthorize, TContext>) => MaybePromise<TOutput | void>;
126
+ type EventResolver<TKind extends EventResolverKind = EventResolverKind, TPlatform extends AbstractPlatform = AbstractPlatform, TAuthorize extends IOAuthorize<any, InferInitContextType<TPlatform>> | null = null, TContext extends Record<string, any> = {}, TInput extends JsonObject = {}, TOutput extends EventRecord$1<string, any> = {}> = (data: TInput, context: EventResolverContext<TKind, TPlatform, TAuthorize, TContext>) => MaybePromise<TOutput | void>;
127
127
  interface EventResolverContext<TKind extends EventResolverKind = EventResolverKind, TPlatform extends AbstractPlatform = AbstractPlatform, TAuthorize extends IOAuthorize<any, InferInitContextType<TPlatform>> | null = null, TContext extends Record<string, any> = {}> {
128
- context: TContext;
129
- doc: CrdtDocLike<any, any>;
130
- garbageCollect: () => Promise<void>;
131
- platform: TPlatform;
132
- presence: JsonObject | null;
133
- room: string;
134
- session: TKind extends "sync" ? WebSocketSession<TAuthorize> | null : WebSocketSession<TAuthorize>;
135
- sessions: readonly WebSocketSession<TAuthorize>[];
136
- time: number;
128
+ context: TContext;
129
+ doc: CrdtDocLike<any, any>;
130
+ garbageCollect: () => Promise<void>;
131
+ platform: TPlatform;
132
+ presence: JsonObject | null;
133
+ room: string;
134
+ session: TKind extends "sync" ? WebSocketSession<TAuthorize> | null : WebSocketSession<TAuthorize>;
135
+ sessions: readonly WebSocketSession<TAuthorize>[];
136
+ time: number;
137
137
  }
138
138
  type SendMessageOptions = {
139
- type?: "broadcast";
140
- sessionIds?: readonly string[];
139
+ type?: "broadcast";
140
+ sessionIds?: readonly string[];
141
141
  } | {
142
- type: "self";
142
+ type: "self";
143
143
  } | {
144
- type: "sync";
144
+ type: "sync";
145
145
  };
146
146
  interface WebSocketSessionTimers {
147
- ping: number;
148
- presence: number | null;
147
+ ping: number;
148
+ presence: number | null;
149
149
  }
150
150
  interface WebSocketSerializedState {
151
- presence: JsonObject | null;
152
- quit: boolean;
153
- room: string;
154
- timers: WebSocketSessionTimers;
151
+ presence: JsonObject | null;
152
+ quit: boolean;
153
+ room: string;
154
+ timers: WebSocketSessionTimers;
155
155
  }
156
156
  type WebSocketSession<TAuthorize extends IOAuthorize<any, any> | null = null> = WebSocketSerializedState & {
157
- id: string;
158
- user: InferIOAuthorizeUser<TAuthorize>;
159
- webSocket: AbstractWebSocket;
157
+ id: string;
158
+ user: InferIOAuthorizeUser<TAuthorize>;
159
+ webSocket: AbstractWebSocket;
160
160
  };
161
- type MergeEventRecords<TEventRecords extends EventRecord<string, any>[], TRoot extends EventRecord<string, any> = {}> = TEventRecords extends [
162
- infer IHead extends EventRecord<string, any>,
163
- ...infer ITail extends EventRecord<string, any>[]
164
- ] ? MergeEventRecords<ITail, Omit<TRoot, keyof IHead> & {
165
- [P in keyof IHead]: TRoot extends Record<P, any> ? TRoot[P] | IHead[P] : IHead[P];
166
- }> : Id<TRoot>;
161
+ type MergeEventRecords<TEventRecords extends EventRecord$1<string, any>[], TRoot extends EventRecord$1<string, any> = {}> = TEventRecords extends [infer IHead extends EventRecord$1<string, any>, ...infer ITail extends EventRecord$1<string, any>[]] ? MergeEventRecords<ITail, Omit<TRoot, keyof IHead> & { [P in keyof IHead]: TRoot extends Record<P, any> ? TRoot[P] | IHead[P] : IHead[P] }> : Id<TRoot>;
167
162
  type GetInitialStorageEvent<TContext extends Record<string, any>> = {
168
- context: TContext;
169
- room: string;
163
+ context: TContext;
164
+ room: string;
170
165
  };
171
166
  type GetInitialStorageFn<TContext extends Record<string, any>> = (event: GetInitialStorageEvent<TContext>) => MaybePromise<Maybe<string>>;
172
167
  type HandleMode = "io" | "fetch";
173
168
  type WebSocketRegistrationMode = "attached" | "detached";
174
169
  interface PlatformConfig {
175
- authorize: {
176
- secret?: boolean;
177
- };
178
- requireAuth?: boolean;
179
- handleMode: HandleMode;
180
- registrationMode: WebSocketRegistrationMode;
181
- listeners: {
182
- onRoomDeleted?: boolean;
183
- onRoomMessage?: boolean;
184
- onStorageUpdated?: boolean;
185
- onUserConnected?: boolean;
186
- onUserDisconnected?: boolean;
187
- };
188
- router?: boolean;
170
+ authorize: {
171
+ secret?: boolean;
172
+ };
173
+ requireAuth?: boolean;
174
+ handleMode: HandleMode;
175
+ registrationMode: WebSocketRegistrationMode;
176
+ listeners: {
177
+ onRoomDestroyed?: boolean;
178
+ onRoomMessage?: boolean;
179
+ onStorageDestroyed?: boolean;
180
+ onStorageUpdated?: boolean;
181
+ onUserConnected?: boolean;
182
+ onUserDisconnected?: boolean;
183
+ };
184
+ router?: boolean;
189
185
  }
190
- type ResolvedPluvIOAuthorize<TPlatform extends AbstractPlatform<any, any, any, any>, TUser extends BaseUser = any> = {
191
- user: InputZodLike<TUser>;
186
+ type ResolvedPluvIOAuthorize<TPlatform extends AbstractPlatform<any, any, any, any>, TUser extends BaseUser$1 = any> = {
187
+ user: InputZodLike<TUser>;
192
188
  } & UndefinedProps<{
193
- secret?: string;
189
+ secret?: string;
194
190
  }, Exclude<"secret", InferPlatformAuthorizeProperties<TPlatform>>>;
195
- type PluvIOAuthorize<TPlatform extends AbstractPlatform<any, any, any, any>, TUser extends BaseUser | null = any, TContext extends Record<string, unknown> = {}> = (TUser extends BaseUser ? ResolvedPluvIOAuthorize<TPlatform, TUser> : null) | ((context: TContext) => TUser extends BaseUser ? ResolvedPluvIOAuthorize<TPlatform, TUser> : null);
191
+ type PluvIOAuthorize<TPlatform extends AbstractPlatform<any, any, any, any>, TUser extends BaseUser$1 | null = any, TContext extends Record<string, unknown> = {}> = (TUser extends BaseUser$1 ? ResolvedPluvIOAuthorize<TPlatform, TUser> : null) | ((context: TContext) => TUser extends BaseUser$1 ? ResolvedPluvIOAuthorize<TPlatform, TUser> : null);
196
192
  interface PluvIOLimits {
197
- /**
198
- * @description Maximum size of presence object in bytes
199
- */
200
- presenceMaxSize?: number | null;
201
- /**
202
- * @description Maximum size of storage state in bytes
203
- */
204
- storageMaxSize?: number | null;
205
- /**
206
- * @description Maximum length of user id in characters
207
- */
208
- userIdMaxLength?: number | null;
209
- /**
210
- * @description Maximum size of user object in bytes
211
- */
212
- userMaxSize?: number | null;
193
+ /**
194
+ * @description Maximum size of presence object in bytes
195
+ */
196
+ presenceMaxSize?: number | null;
197
+ /**
198
+ * @description Maximum size of storage state in bytes
199
+ */
200
+ storageMaxSize?: number | null;
201
+ /**
202
+ * @description Maximum length of user id in characters
203
+ */
204
+ userIdMaxLength?: number | null;
205
+ /**
206
+ * @description Maximum size of user object in bytes
207
+ */
208
+ userMaxSize?: number | null;
213
209
  }
214
210
  type BasePluvIOListeners<TPlatform extends AbstractPlatform<any, any, any, any>, TAuthorize extends PluvIOAuthorize<TPlatform, any, InferInitContextType<TPlatform>> | null, TContext extends Record<string, any>, TEvents extends PluvRouterEventConfig<TPlatform, TAuthorize, TContext>> = {
215
- onRoomDeleted: (event: IORoomListenerEvent<TPlatform, TContext>) => void;
216
- onRoomMessage: (event: IORoomMessageEvent<TPlatform, TAuthorize, TContext, TEvents>) => void;
217
- onStorageUpdated: (event: IOStorageUpdatedEvent<TPlatform, TAuthorize, TContext>) => void;
218
- onUserConnected: (event: IOUserConnectedEvent<TPlatform, TAuthorize, TContext>) => void;
219
- onUserDisconnected: (event: IOUserDisconnectedEvent<TPlatform, TAuthorize, TContext>) => void;
211
+ onRoomDestroyed: (event: IORoomDestroyedEvent<TPlatform, TContext>) => void;
212
+ onRoomMessage: (event: IORoomMessageEvent<TPlatform, TAuthorize, TContext, TEvents>) => void;
213
+ onStorageDestroyed: (event: IORoomListenerEvent<TPlatform, TContext>) => void;
214
+ onStorageUpdated: (event: IOStorageUpdatedEvent<TPlatform, TAuthorize, TContext>) => void;
215
+ onUserConnected: (event: IOUserConnectedEvent<TPlatform, TAuthorize, TContext>) => void;
216
+ onUserDisconnected: (event: IOUserDisconnectedEvent<TPlatform, TAuthorize, TContext>) => void;
220
217
  };
221
218
  type PluvIOListeners<TPlatform extends AbstractPlatform<any, any, any, any>, TAuthorize extends PluvIOAuthorize<TPlatform, any, InferInitContextType<TPlatform>> | null, TContext extends Record<string, any>, TEvents extends PluvRouterEventConfig<TPlatform, TAuthorize, TContext>> = UndefinedProps<BasePluvIOListeners<TPlatform, TAuthorize, TContext, TEvents>, Exclude<keyof BasePluvIOListeners<TPlatform, TAuthorize, TContext, TEvents>, InferPlatformListeners<TPlatform>>>;
222
219
  type PluvIORouter<TPlatform extends AbstractPlatform<any, any, any, any>, TAuthorize extends PluvIOAuthorize<TPlatform, any, InferInitContextType<TPlatform>> | null, TContext extends Record<string, any>, TEvents extends PluvRouterEventConfig<TPlatform, TAuthorize, TContext>> = InferPlatformRouter<TPlatform> extends true ? {
223
- router?: PluvRouter<TPlatform, TAuthorize, TContext, TEvents>;
220
+ router?: PluvRouter<TPlatform, TAuthorize, TContext, TEvents>;
224
221
  } : {
225
- router?: undefined;
222
+ router?: undefined;
226
223
  };
227
224
  type InferPlatformConfig<TPlatform extends AbstractPlatform<any, any, any, any>> = TPlatform extends AbstractPlatform<any, any, any, infer IConfig> ? IConfig : never;
228
- type InferPlatformAuthorizeProperties<TPlatform extends AbstractPlatform<any, any, any, any>> = keyof {
229
- [P in keyof PlatformConfig["authorize"] as InferPlatformConfig<TPlatform>["authorize"][P] extends true | undefined ? P : never]: true;
230
- };
231
- type InferPlatformListeners<TPlatform extends AbstractPlatform<any, any, any, any>> = keyof {
232
- [P in keyof PlatformConfig["listeners"] as InferPlatformConfig<TPlatform>["listeners"][P] extends true | undefined ? P : never]: true;
233
- };
225
+ type InferPlatformAuthorizeProperties<TPlatform extends AbstractPlatform<any, any, any, any>> = keyof { [P in keyof PlatformConfig["authorize"] as InferPlatformConfig<TPlatform>["authorize"][P] extends true | undefined ? P : never]: true };
226
+ type InferPlatformListeners<TPlatform extends AbstractPlatform<any, any, any, any>> = keyof { [P in keyof PlatformConfig["listeners"] as InferPlatformConfig<TPlatform>["listeners"][P] extends true | undefined ? P : never]: true };
234
227
  type InferPlatformRouter<TPlatform extends AbstractPlatform<any, any, any, any>> = InferPlatformConfig<TPlatform>["router"];
235
228
  type IORoomListenerEvent<TPlatform extends AbstractPlatform<any, any, any, any>, TContext extends Record<string, any>> = {
236
- context: TContext;
237
- encodedState: string | null;
238
- platform: TPlatform;
239
- room: string;
229
+ context: TContext;
230
+ encodedState: string | null;
231
+ platform: TPlatform;
232
+ room: string;
233
+ };
234
+ type IORoomDestroyedEvent<TPlatform extends AbstractPlatform<any, any, any, any>, TContext extends Record<string, any>> = {
235
+ context: TContext;
236
+ platform: TPlatform;
237
+ room: string;
240
238
  };
241
239
  type IORoomMessageEvent<TPlatform extends AbstractPlatform<any>, TAuthorize extends PluvIOAuthorize<TPlatform, any, InferInitContextType<TPlatform>> | null, TContext extends Record<string, any>, TEvents extends PluvRouterEventConfig<TPlatform, TAuthorize, TContext>> = IORoomListenerEvent<TPlatform, TContext> & {
242
- message: InferEventMessage<InferEventsOutput<TEvents>, keyof InferEventsOutput<TEvents>>;
243
- user?: InferIOAuthorizeUser<TAuthorize>;
244
- webSocket?: InferPlatformWebSocketSource<TPlatform>;
240
+ message: InferEventMessage<InferEventsOutput<TEvents>, keyof InferEventsOutput<TEvents>>;
241
+ user?: InferIOAuthorizeUser<TAuthorize>;
242
+ webSocket?: InferPlatformWebSocketSource<TPlatform>;
245
243
  };
246
244
  type IOStorageUpdatedEvent<TPlatform extends AbstractPlatform<any>, TAuthorize extends IOAuthorize<any, InferInitContextType<TPlatform>> | null, TContext extends Record<string, any>> = IORoomListenerEvent<TPlatform, TContext> & {
247
- user?: InferIOAuthorizeUser<TAuthorize>;
248
- webSocket?: InferPlatformWebSocketSource<TPlatform>;
245
+ user?: InferIOAuthorizeUser<TAuthorize>;
246
+ webSocket?: InferPlatformWebSocketSource<TPlatform>;
249
247
  };
250
248
  type IOUserConnectedEvent<TPlatform extends AbstractPlatform<any>, TAuthorize extends IOAuthorize<any, InferInitContextType<TPlatform>> | null, TContext extends Record<string, any>> = IORoomListenerEvent<TPlatform, TContext> & {
251
- user?: InferIOAuthorizeUser<TAuthorize>;
252
- webSocket?: InferPlatformWebSocketSource<TPlatform>;
249
+ user?: InferIOAuthorizeUser<TAuthorize>;
250
+ webSocket?: InferPlatformWebSocketSource<TPlatform>;
253
251
  };
254
252
  type IOUserDisconnectedEvent<TPlatform extends AbstractPlatform<any>, TAuthorize extends IOAuthorize<any, InferInitContextType<TPlatform>> | null, TContext extends Record<string, any>> = IORoomListenerEvent<TPlatform, TContext> & {
255
- user?: InferIOAuthorizeUser<TAuthorize>;
253
+ user?: InferIOAuthorizeUser<TAuthorize>;
256
254
  };
257
255
  type WebSocketType<TPlatform extends AbstractPlatform> = InferPlatformWebSocketType<TPlatform> | InferPlatformWebSocketSource<TPlatform>;
258
-
259
- type IOPubSubEventMessage<TIO extends IOLike, TEvent extends keyof InferIOOutput<TIO> = keyof InferIOOutput<TIO>> = IOEventMessage<TIO, TEvent> & {
260
- options?: SendMessageOptions;
256
+ //#endregion
257
+ //#region src/AbstractPubSub.d.ts
258
+ type IOPubSubEventMessage<TIO extends IOLike, TEvent extends keyof InferIOOutput<TIO> = keyof InferIOOutput<TIO>> = IOEventMessage$1<TIO, TEvent> & {
259
+ options?: SendMessageOptions;
261
260
  };
262
261
  declare abstract class AbstractPubSub {
263
- abstract publish(roomName: string, payload: IOPubSubEventMessage<any>): Promise<void>;
264
- abstract subscribe(roomName: string, onMessage: (message: IOPubSubEventMessage<any>) => void): Promise<number>;
265
- abstract unsubscribe(subscriptionId: number): void;
262
+ abstract publish(roomName: string, payload: IOPubSubEventMessage<any>): Promise<void>;
263
+ abstract subscribe(roomName: string, onMessage: (message: IOPubSubEventMessage<any>) => void): Promise<number>;
264
+ abstract unsubscribe(subscriptionId: number): void;
266
265
  }
267
-
268
- interface JWT<TUser extends BaseUser> {
269
- room: string;
270
- sub: string;
271
- user: TUser;
266
+ //#endregion
267
+ //#region src/authorize.d.ts
268
+ interface JWT<TUser extends BaseUser$1> {
269
+ room: string;
270
+ sub: string;
271
+ user: TUser;
272
272
  }
273
- type JWTEncodeParams<TUser extends BaseUser | null, TPlatform extends AbstractPlatform<any, any>> = {
274
- maxAge?: number;
275
- room: string;
276
- user: TUser extends BaseUser ? TUser : "Error: Cannot create token without authorization!";
273
+ type JWTEncodeParams<TUser extends BaseUser$1 | null, TPlatform extends AbstractPlatform<any, any>> = {
274
+ maxAge?: number;
275
+ room: string;
276
+ user: TUser extends BaseUser$1 ? TUser : "Error: Cannot create token without authorization!";
277
277
  } & InferInitContextType<TPlatform>;
278
278
  interface AuthorizeParams {
279
- platform: AbstractPlatform<any, any>;
280
- secret: string;
279
+ platform: AbstractPlatform<any, any>;
280
+ secret: string;
281
281
  }
282
282
  interface AuthorizeModule {
283
- decode: <TUser extends BaseUser>(jwt: string) => Promise<TUser | null>;
284
- encode: <TUser extends BaseUser, TPlatform extends AbstractPlatform<any, any>>(params: JWTEncodeParams<TUser, TPlatform>) => Promise<string>;
283
+ decode: <TUser extends BaseUser$1>(jwt: string) => Promise<TUser | null>;
284
+ encode: <TUser extends BaseUser$1, TPlatform extends AbstractPlatform<any, any>>(params: JWTEncodeParams<TUser, TPlatform>) => Promise<string>;
285
285
  }
286
286
  declare const authorize: (params: AuthorizeParams) => {
287
- decode: <TUser extends BaseUser>(jwt: string) => Promise<JWT<TUser> | null>;
288
- encode: <TUser extends BaseUser, TPlatform extends AbstractPlatform<any, any>>(encodeParams: JWTEncodeParams<TUser, TPlatform>) => Promise<string>;
287
+ decode: <TUser extends BaseUser$1>(jwt: string) => Promise<JWT<TUser> | null>;
288
+ encode: <TUser extends BaseUser$1, TPlatform extends AbstractPlatform<any, any>>(encodeParams: JWTEncodeParams<TUser, TPlatform>) => Promise<string>;
289
289
  };
290
-
290
+ //#endregion
291
+ //#region src/AbstractPlatform.d.ts
291
292
  type InferPlatformWebSocketType<TPlatform extends AbstractPlatform> = TPlatform extends AbstractPlatform<infer IAbstractWebSocket> ? IAbstractWebSocket : never;
292
293
  type InferPlatformWebSocketSource<TPlatform> = TPlatform extends AbstractPlatform<infer IAbstractWebSocket> ? InferWebSocketSource<IAbstractWebSocket> : never;
293
294
  type InferInitContextType<TPlatform extends AbstractPlatform> = TPlatform extends AbstractPlatform<any, infer IInitContext> ? IInitContext : never;
294
295
  type InferRoomContextType<TPlatform extends AbstractPlatform> = TPlatform extends AbstractPlatform<any, any, infer IRoomContext> ? IRoomContext : never;
295
296
  type AbstractPlatformConfig<TRoomContext extends Record<string, any> = {}> = {
296
- persistence?: AbstractPersistence;
297
- pubSub?: AbstractPubSub;
298
- roomContext?: TRoomContext;
297
+ persistence?: AbstractPersistence;
298
+ pubSub?: AbstractPubSub;
299
+ roomContext?: TRoomContext;
299
300
  };
300
301
  interface ConvertWebSocketConfig {
301
- room: string;
302
+ room: string;
302
303
  }
303
304
  declare abstract class AbstractPlatform<TWebSocket extends AbstractWebSocket<any, any> = AbstractWebSocket<any, any>, TInitContext extends Record<string, any> = {}, TRoomContext extends Record<string, any> = {}, TConfig extends PlatformConfig = PlatformConfig> {
304
- protected readonly _initContext: TInitContext | undefined;
305
- protected readonly _roomContext: TRoomContext | undefined;
306
- private _initialized;
307
- persistence: AbstractPersistence;
308
- pubSub: AbstractPubSub;
309
- abstract readonly id: string;
310
- readonly _createToken?: (params: JWTEncodeParams<any, any> & {
311
- authorize: Maybe<ResolvedPluvIOAuthorize<any, any>>;
312
- }) => Promise<string>;
313
- _fetch?: (...args: any[]) => Promise<any>;
314
- abstract readonly _config: TConfig;
315
- abstract readonly _name: string;
316
- constructor(config?: AbstractPlatformConfig<TRoomContext>);
317
- abstract acceptWebSocket(webSocket: AbstractWebSocket): Promise<void>;
318
- abstract convertWebSocket(webSocket: InferWebSocketSource<TWebSocket>, config: ConvertWebSocketConfig): AbstractWebSocket<any, any>;
319
- abstract getLastPing(webSocket: AbstractWebSocket<any, any>): number | null;
320
- abstract getSerializedState(webSocket: InferWebSocketSource<TWebSocket>): WebSocketSerializedState | null;
321
- abstract getSessionId(webSocket: InferWebSocketSource<TWebSocket>): string | null;
322
- abstract getWebSockets(): readonly InferWebSocketSource<TWebSocket>[];
323
- abstract initialize(config: AbstractPlatformConfig<TRoomContext>): this;
324
- abstract parseData(data: string | ArrayBuffer): Record<string, any>;
325
- abstract randomUUID(): string;
326
- abstract setSerializedState(webSocket: AbstractWebSocket, state: WebSocketSerializedState): WebSocketSerializedState;
327
- validateConfig(config: any): void;
328
- protected _initialize(): typeof this;
305
+ protected readonly _initContext: TInitContext | undefined;
306
+ protected readonly _roomContext: TRoomContext | undefined;
307
+ private _initialized;
308
+ persistence: AbstractPersistence;
309
+ pubSub: AbstractPubSub;
310
+ abstract readonly id: string;
311
+ readonly _createToken?: (params: JWTEncodeParams<any, any> & {
312
+ authorize: Maybe<ResolvedPluvIOAuthorize<any, any>>;
313
+ }) => Promise<string>;
314
+ _fetch?: (...args: any[]) => Promise<any>;
315
+ abstract readonly _config: TConfig;
316
+ abstract readonly _name: string;
317
+ constructor(config?: AbstractPlatformConfig<TRoomContext>);
318
+ abstract acceptWebSocket(webSocket: AbstractWebSocket): Promise<void>;
319
+ abstract convertWebSocket(webSocket: InferWebSocketSource<TWebSocket>, config: ConvertWebSocketConfig): AbstractWebSocket<any, any>;
320
+ abstract getLastPing(webSocket: AbstractWebSocket<any, any>): number | null;
321
+ abstract getSerializedState(webSocket: InferWebSocketSource<TWebSocket>): WebSocketSerializedState | null;
322
+ abstract getSessionId(webSocket: InferWebSocketSource<TWebSocket>): string | null;
323
+ abstract getWebSockets(): readonly InferWebSocketSource<TWebSocket>[];
324
+ abstract initialize(config: AbstractPlatformConfig<TRoomContext>): this;
325
+ abstract parseData(data: string | ArrayBuffer): Record<string, any>;
326
+ abstract randomUUID(): string;
327
+ abstract setSerializedState(webSocket: AbstractWebSocket, state: WebSocketSerializedState): WebSocketSerializedState;
328
+ validateConfig(config: any): void;
329
+ protected _initialize(): typeof this;
329
330
  }
330
-
331
+ //#endregion
332
+ //#region src/IORoom.d.ts
331
333
  interface IORoomListeners<TPlatform extends AbstractPlatform<any>, TAuthorize extends PluvIOAuthorize<TPlatform, any, InferInitContextType<TPlatform>> | null, TContext extends Record<string, any>, TEvents extends PluvRouterEventConfig<TPlatform, TAuthorize, TContext>> {
332
- onDestroy: (event: IORoomListenerEvent<TPlatform, TContext>) => void;
333
- onMessage: (event: IORoomMessageEvent<TPlatform, TAuthorize, TContext, TEvents>) => void;
334
- onUserConnected: (event: IOUserConnectedEvent<TPlatform, TAuthorize, TContext>) => void;
335
- onUserDisconnected: (event: IOUserDisconnectedEvent<TPlatform, TAuthorize, TContext>) => void;
334
+ onRoomDestroyed: (event: IORoomDestroyedEvent<TPlatform, TContext>) => void;
335
+ onStorageDestroyed: (event: IORoomListenerEvent<TPlatform, TContext>) => void;
336
+ onMessage: (event: IORoomMessageEvent<TPlatform, TAuthorize, TContext, TEvents>) => void;
337
+ onUserConnected: (event: IOUserConnectedEvent<TPlatform, TAuthorize, TContext>) => void;
338
+ onUserDisconnected: (event: IOUserDisconnectedEvent<TPlatform, TAuthorize, TContext>) => void;
336
339
  }
337
- type BroadcastProxy<TIO extends IORoom<any, any, any, any, any>> = (<TEvent extends keyof InferIOInput<TIO>>(event: TEvent, data: Id<InferIOInput<TIO>[TEvent]>) => Promise<void>) & {
338
- [event in keyof InferIOInput<TIO>]: (data: Id<InferIOInput<TIO>>[event]) => Promise<void>;
339
- };
340
+ type BroadcastProxy<TIO extends IORoom<any, any, any, any, any>> = (<TEvent extends keyof InferIOInput<TIO>>(event: TEvent, data: Id<InferIOInput<TIO>[TEvent]>) => Promise<void>) & { [event in keyof InferIOInput<TIO>]: (data: Id<InferIOInput<TIO>>[event]) => Promise<void> };
340
341
  type IORoomConfig<TPlatform extends AbstractPlatform<any> = AbstractPlatform<any>, TAuthorize extends PluvIOAuthorize<TPlatform, any, InferInitContextType<TPlatform>> | null = any, TContext extends Record<string, any> = {}, TEvents extends PluvRouterEventConfig<TPlatform, TAuthorize, TContext> = {}> = Partial<IORoomListeners<TPlatform, TAuthorize, TContext, TEvents>> & {
341
- authorize?: TAuthorize;
342
- context: PluvContext<TPlatform, TContext>;
343
- crdt?: {
344
- doc: (value: any) => AbstractCrdtDocFactory<any, any>;
345
- };
346
- debug: boolean;
347
- getInitialStorage: GetInitialStorageFn<TContext>;
348
- platform: TPlatform;
349
- roomContext: InferRoomContextType<TPlatform>;
350
- router: PluvRouter<TPlatform, TAuthorize, TContext, TEvents>;
342
+ authorize?: TAuthorize;
343
+ context: PluvContext<TPlatform, TContext>;
344
+ crdt?: {
345
+ doc: (value: any) => AbstractCrdtDocFactory<any, any>;
346
+ };
347
+ debug: boolean;
348
+ getInitialStorage: GetInitialStorageFn<TContext>;
349
+ platform: TPlatform;
350
+ roomContext: InferRoomContextType<TPlatform>;
351
+ router: PluvRouter<TPlatform, TAuthorize, TContext, TEvents>;
351
352
  };
352
353
  type WebSocketRegisterConfig<TPlatform extends AbstractPlatform<any> = AbstractPlatform<any>> = {
353
- token?: string | null;
354
+ token?: string | null;
354
355
  } & InferInitContextType<TPlatform>;
355
- declare class IORoom<TPlatform extends AbstractPlatform<any> = AbstractPlatform<any>, TAuthorize extends PluvIOAuthorize<TPlatform, any, InferInitContextType<TPlatform>> | null = null, TContext extends Record<string, any> = {}, TCrdt extends CrdtLibraryType<any> = CrdtLibraryType<any>, TEvents extends PluvRouterEventConfig<TPlatform, TAuthorize, TContext> = {}> implements IOLike<TAuthorize, TCrdt, TEvents> {
356
- readonly id: string;
357
- private _doc;
358
- private _lastGarbageCollectMs;
359
- private _uninitialize;
360
- private readonly _authorize;
361
- private readonly _context;
362
- private readonly _crdt;
363
- private readonly _debug;
364
- private readonly _docFactory;
365
- private readonly _getInitialStorage;
366
- private readonly _listeners;
367
- private readonly _platform;
368
- private readonly _roomContext;
369
- private readonly _router;
370
- private readonly _sessions;
371
- private readonly _userSessionss;
372
- /**
373
- * @ignore
374
- * @readonly
375
- * @deprecated Internal use only. Changes to this will never be marked as breaking.
376
- */
377
- get _defs(): {
378
- authorize: TAuthorize;
379
- context: TContext;
380
- crdt: TCrdt;
381
- events: TEvents;
382
- platform: TPlatform;
383
- };
384
- get broadcast(): BroadcastProxy<this>;
385
- private get _initialized();
386
- constructor(id: string, config: IORoomConfig<TPlatform, TAuthorize, TContext, TEvents>);
387
- /**
388
- * @description Closes a connection with the specified sessionId
389
- * @param sessionId The session id of the connection to close
390
- */
391
- evict(sessionId: string): Promise<void>;
392
- /**
393
- * @description Closes all connections to this room, effectively destroying
394
- * the room
395
- */
396
- evictAll(): Promise<void>;
397
- /**
398
- * @description The IORoom will garbage collect occasionally as connections ping/pong the
399
- * server
400
- */
401
- garbageCollect(): Promise<void>;
402
- getSize(): number;
403
- onClose(webSocket: WebSocketType<TPlatform>): (event: AbstractCloseEvent) => Promise<void>;
404
- onError(webSocket: WebSocketType<TPlatform>): (event: AbstractErrorEvent) => Promise<void>;
405
- onMessage(webSocket: WebSocketType<TPlatform>): (event: AbstractMessageEvent) => Promise<void>;
406
- register(webSocket: InferPlatformWebSocketSource<TPlatform>, ...options: keyof InferInitContextType<TPlatform> extends never ? [{
407
- token?: string;
408
- }?] : [WebSocketRegisterConfig<TPlatform>]): Promise<void>;
409
- private _addUserSession;
410
- private _broadcast;
411
- private _closeWebSockets;
412
- private _emitQuitters;
413
- private _emitRegistered;
414
- private _emitSyncState;
415
- private _ensureDetached;
416
- private _getAbstractWs;
417
- /**
418
- * TODO
419
- * @description Revisit any cast types
420
- * @date July 17, 2025
421
- */
422
- private _getAuthorizedUser;
423
- private _getContext;
424
- private _getInitialDoc;
425
- private _getIOAuthorize;
426
- private _getLatestPresence;
427
- private _getProcedure;
428
- private _getProcedureInputs;
429
- private _getSession;
430
- private _getSessions;
431
- private _initialize;
432
- private _logDebug;
433
- private _onClose;
434
- private _onMessage;
435
- private _parseMessage;
436
- private _setPresence;
437
- private _removeUserSession;
438
- private _sendMessage;
439
- private _sendBroadcastMessage;
440
- private _sendSelfMessage;
441
- private _sendSyncMessage;
356
+ declare class IORoom<TPlatform extends AbstractPlatform<any> = AbstractPlatform<any>, TAuthorize extends PluvIOAuthorize<TPlatform, any, InferInitContextType<TPlatform>> | null = null, TContext extends Record<string, any> = {}, TCrdt extends CrdtLibraryType$2<any> = CrdtLibraryType$2<any>, TEvents extends PluvRouterEventConfig<TPlatform, TAuthorize, TContext> = {}> implements IOLike<TAuthorize, TCrdt, TEvents> {
357
+ readonly id: string;
358
+ private _doc;
359
+ private _lastGarbageCollectMs;
360
+ private _uninitialize;
361
+ private readonly _authorize;
362
+ private readonly _context;
363
+ private readonly _crdt;
364
+ private readonly _debug;
365
+ private readonly _docFactory;
366
+ private readonly _getInitialStorage;
367
+ private readonly _listeners;
368
+ private readonly _platform;
369
+ private readonly _roomContext;
370
+ private readonly _router;
371
+ private readonly _sessions;
372
+ private readonly _userSessionss;
373
+ private _wasDocEmptyOnInit;
374
+ private _storageInitializedViaSession;
375
+ /**
376
+ * @ignore
377
+ * @readonly
378
+ * @deprecated Internal use only. Changes to this will never be marked as breaking.
379
+ */
380
+ get _defs(): {
381
+ authorize: TAuthorize;
382
+ context: TContext;
383
+ crdt: TCrdt;
384
+ events: TEvents;
385
+ platform: TPlatform;
386
+ };
387
+ get broadcast(): BroadcastProxy<this>;
388
+ private get _initialized();
389
+ constructor(id: string, config: IORoomConfig<TPlatform, TAuthorize, TContext, TEvents>);
390
+ /**
391
+ * @description Closes a connection with the specified sessionId
392
+ * @param sessionId The session id of the connection to close
393
+ */
394
+ evict(sessionId: string): Promise<void>;
395
+ /**
396
+ * @description Closes all connections to this room, effectively destroying
397
+ * the room
398
+ */
399
+ evictAll(): Promise<void>;
400
+ /**
401
+ * @description The IORoom will garbage collect occasionally as connections ping/pong the
402
+ * server
403
+ */
404
+ garbageCollect(): Promise<void>;
405
+ getSize(): number;
406
+ onClose(webSocket: WebSocketType<TPlatform>): (event: AbstractCloseEvent) => Promise<void>;
407
+ onError(webSocket: WebSocketType<TPlatform>): (event: AbstractErrorEvent) => Promise<void>;
408
+ onMessage(webSocket: WebSocketType<TPlatform>): (event: AbstractMessageEvent) => Promise<void>;
409
+ register(webSocket: InferPlatformWebSocketSource<TPlatform>, ...options: keyof InferInitContextType<TPlatform> extends never ? [{
410
+ token?: string;
411
+ }?] : [WebSocketRegisterConfig<TPlatform>]): Promise<void>;
412
+ private _addUserSession;
413
+ private _broadcast;
414
+ private _closeWebSockets;
415
+ private _emitQuitters;
416
+ private _emitRegistered;
417
+ private _emitSyncState;
418
+ private _ensureDetached;
419
+ private _getAbstractWs;
420
+ /**
421
+ * TODO
422
+ * @description Revisit any cast types
423
+ * @date July 17, 2025
424
+ */
425
+ private _getAuthorizedUser;
426
+ private _getContext;
427
+ private _getInitialDoc;
428
+ private _getIOAuthorize;
429
+ private _getLatestPresence;
430
+ private _getProcedure;
431
+ private _getProcedureInputs;
432
+ private _getSession;
433
+ private _getSessions;
434
+ private _initialize;
435
+ private _logDebug;
436
+ private _onClose;
437
+ private _onMessage;
438
+ private _parseMessage;
439
+ private _setPresence;
440
+ private _removeUserSession;
441
+ private _checkStorageInitializedViaSession;
442
+ private _sendMessage;
443
+ private _sendBroadcastMessage;
444
+ private _sendSelfMessage;
445
+ private _sendSyncMessage;
442
446
  }
443
-
447
+ //#endregion
448
+ //#region src/PluvServer.d.ts
444
449
  type InferIORoom<TServer extends PluvServer<any, any, any, any, any>> = TServer extends PluvServer<infer IPlatform, infer IAuthorize, infer IContext, infer ICrdt, infer IEvents> ? IORoom<IPlatform, IAuthorize, IContext, ICrdt, IEvents> : never;
445
450
  type PluvServerConfig<TPlatform extends AbstractPlatform<any, any> = AbstractPlatform<any, any>, TAuthorize extends PluvIOAuthorize<TPlatform, any, InferInitContextType<TPlatform>> | null = any, TContext extends Record<string, any> = {}, TCrdt extends CrdtLibraryType$1<any> = CrdtLibraryType$1<any>, TEvents extends PluvRouterEventConfig<TPlatform, TAuthorize, TContext> = {}> = Partial<PluvIOListeners<TPlatform, TAuthorize, TContext, TEvents>> & {
446
- authorize?: TAuthorize;
447
- context?: PluvContext<TPlatform, TContext>;
448
- crdt?: {
449
- doc: (value: any) => AbstractCrdtDocFactory<any, any>;
450
- };
451
- debug?: boolean;
452
- limits: PluvIOLimits;
453
- io: PluvIO<TPlatform, TAuthorize, TContext>;
454
- platform: () => TPlatform;
455
- router?: PluvRouter<TPlatform, TAuthorize, TContext, TEvents>;
451
+ authorize?: TAuthorize;
452
+ context?: PluvContext<TPlatform, TContext>;
453
+ crdt?: {
454
+ doc: (value: any) => AbstractCrdtDocFactory<any, any>;
455
+ };
456
+ debug?: boolean;
457
+ limits: PluvIOLimits;
458
+ io: PluvIO<TPlatform, TAuthorize, TContext>;
459
+ platform: () => TPlatform;
460
+ router?: PluvRouter<TPlatform, TAuthorize, TContext, TEvents>;
456
461
  } & (TCrdt extends CrdtLibraryType$1<NoopCrdtDocFactory> ? {
457
- getInitialStorage?: "[ERROR]: Must specify crdt to use getInitialStorage";
462
+ getInitialStorage?: "[ERROR]: Must specify crdt to use getInitialStorage";
458
463
  } : {
459
- getInitialStorage: GetInitialStorageFn<TContext>;
464
+ getInitialStorage: GetInitialStorageFn<TContext>;
460
465
  });
461
- type BaseCreateRoomOptions<TPlatform extends AbstractPlatform<any, any>, TAuthorize extends PluvIOAuthorize<TPlatform, any, InferInitContextType<TPlatform>> | null, TContext extends Record<string, any>, TEvents extends PluvRouterEventConfig<TPlatform, TAuthorize, TContext>> = Partial<IORoomListeners<TPlatform, TAuthorize, TContext, TEvents>> & {
462
- debug?: boolean;
466
+ type BaseCreateRoomOptions<TPlatform extends AbstractPlatform<any, any>, TAuthorize extends PluvIOAuthorize<TPlatform, any, InferInitContextType<TPlatform>> | null, TContext extends Record<string, any>, TEvents extends PluvRouterEventConfig<TPlatform, TAuthorize, TContext>> = {
467
+ debug?: boolean;
463
468
  };
464
- type CreateRoomOptions<TPlatform extends AbstractPlatform<any, any>, TAuthorize extends PluvIOAuthorize<TPlatform, any, InferInitContextType<TPlatform>> | null, TContext extends Record<string, any>, TEvents extends PluvRouterEventConfig<TPlatform, TAuthorize, TContext>> = keyof InferRoomContextType<TPlatform> extends never ? [BaseCreateRoomOptions<TPlatform, TAuthorize, TContext, TEvents>] | [] : [
465
- Id<BaseCreateRoomOptions<TPlatform, TAuthorize, TContext, TEvents> & InferRoomContextType<TPlatform>>
466
- ];
469
+ type CreateRoomOptions<TPlatform extends AbstractPlatform<any, any>, TAuthorize extends PluvIOAuthorize<TPlatform, any, InferInitContextType<TPlatform>> | null, TContext extends Record<string, any>, TEvents extends PluvRouterEventConfig<TPlatform, TAuthorize, TContext>> = keyof Omit<InferRoomContextType<TPlatform>, "meta"> extends never ? [BaseCreateRoomOptions<TPlatform, TAuthorize, TContext, TEvents>] | [] : [Id<BaseCreateRoomOptions<TPlatform, TAuthorize, TContext, TEvents> & InferRoomContextType<TPlatform>>];
467
470
  declare class PluvServer<TPlatform extends AbstractPlatform<any, any> = AbstractPlatform<any, any>, TAuthorize extends PluvIOAuthorize<TPlatform, any, InferInitContextType<TPlatform>> | null = any, TContext extends Record<string, any> = {}, TCrdt extends CrdtLibraryType$1<any> = CrdtLibraryType$1<any>, TEvents extends PluvRouterEventConfig<TPlatform, TAuthorize, TContext> = {}> implements IOLike<TAuthorize, TCrdt, TEvents> {
468
- readonly version: string;
469
- private readonly _config;
470
- private readonly _docFactory;
471
- get fetch(): (...args: any[]) => Promise<any>;
472
- /**
473
- * @ignore
474
- * @readonly
475
- * @deprecated Internal use only. Changes to this will never be marked as breaking.
476
- */
477
- get _defs(): {
478
- authorize: TAuthorize;
479
- context: PluvContext<TPlatform, TContext>;
480
- crdt: TCrdt;
481
- events: TEvents;
482
- platform: TPlatform;
483
- };
484
- private get _baseRouter();
485
- private get _procedure();
486
- private get _router();
487
- constructor(options: PluvServerConfig<TPlatform, TAuthorize, TContext, TCrdt, TEvents>);
488
- createRoom(room: string, ...options: CreateRoomOptions<TPlatform, TAuthorize, TContext, TEvents>): IORoom<TPlatform, TAuthorize, TContext, TCrdt, TEvents>;
489
- createToken(params: JWTEncodeParams<InferIOAuthorizeUser<InferIOAuthorize<this>>, TPlatform>): Promise<string>;
490
- private _getInitialStorage;
491
- private _getListeners;
492
- private _logDebug;
471
+ readonly version: string;
472
+ private readonly _config;
473
+ private readonly _docFactory;
474
+ get fetch(): (...args: any[]) => Promise<any>;
475
+ /**
476
+ * @ignore
477
+ * @readonly
478
+ * @deprecated Internal use only. Changes to this will never be marked as breaking.
479
+ */
480
+ get _defs(): {
481
+ authorize: TAuthorize;
482
+ context: PluvContext<TPlatform, TContext>;
483
+ crdt: TCrdt;
484
+ events: TEvents;
485
+ platform: TPlatform;
486
+ };
487
+ private get _baseRouter();
488
+ private get _procedure();
489
+ private get _router();
490
+ constructor(options: PluvServerConfig<TPlatform, TAuthorize, TContext, TCrdt, TEvents>);
491
+ createRoom(room: string, ...options: CreateRoomOptions<TPlatform, TAuthorize, TContext, TEvents>): IORoom<TPlatform, TAuthorize, TContext, TCrdt, TEvents>;
492
+ createToken(params: JWTEncodeParams<InferIOAuthorizeUser<InferIOAuthorize<this>>, TPlatform>): Promise<string>;
493
+ private _getInitialStorage;
494
+ private _getListeners;
495
+ private _logDebug;
493
496
  }
494
-
497
+ //#endregion
498
+ //#region src/PluvIO.d.ts
495
499
  type PluvIOConfig<TPlatform extends AbstractPlatform<any>, TAuthorize extends IOAuthorize<any, InferInitContextType<TPlatform>> | null, TContext extends Record<string, any>, TCrdt extends CrdtLibraryType$1<any> = CrdtLibraryType$1<any>> = {
496
- authorize?: TAuthorize;
497
- context?: PluvContext<TPlatform, TContext>;
498
- crdt?: TCrdt;
499
- debug?: boolean;
500
- limits?: PluvIOLimits;
501
- platform: () => TPlatform;
500
+ authorize?: TAuthorize;
501
+ context?: PluvContext<TPlatform, TContext>;
502
+ crdt?: TCrdt;
503
+ debug?: boolean;
504
+ limits?: PluvIOLimits;
505
+ platform: () => TPlatform;
502
506
  };
503
507
  type ResolvedServerConfig<TPlatform extends AbstractPlatform<any> = AbstractPlatform<any>, TAuthorize extends PluvIOAuthorize<TPlatform, any, InferInitContextType<TPlatform>> | null = any, TContext extends Record<string, any> = {}, TCrdt extends CrdtLibraryType$1<any> = CrdtLibraryType$1<NoopCrdtDocFactory>, TEvents extends PluvRouterEventConfig<TPlatform, TAuthorize, TContext> = {}> = Partial<PluvIOListeners<TPlatform, TAuthorize, TContext, TEvents>> & PluvIORouter<TPlatform, TAuthorize, TContext, TEvents> & (TCrdt extends CrdtLibraryType$1<NoopCrdtDocFactory> ? {
504
- getInitialStorage?: "[ERROR]: Must specify crdt to use getInitialStorage";
508
+ getInitialStorage?: "[ERROR]: Must specify crdt to use getInitialStorage";
505
509
  } : {
506
- getInitialStorage: GetInitialStorageFn<TContext>;
510
+ getInitialStorage: GetInitialStorageFn<TContext>;
507
511
  });
508
- type BaseServerConfig<TPlatform extends AbstractPlatform<any> = AbstractPlatform<any>, TAuthorize extends PluvIOAuthorize<TPlatform, any, InferInitContextType<TPlatform>> | null = any, TContext extends Record<string, any> = {}, TCrdt extends CrdtLibraryType$1<any> = CrdtLibraryType$1<NoopCrdtDocFactory>, TEvents extends PluvRouterEventConfig<TPlatform, TAuthorize, TContext> = {}> = {
509
- [P in keyof ResolvedServerConfig<TPlatform, TAuthorize, TContext, TCrdt, TEvents> as ResolvedServerConfig<TPlatform, TAuthorize, TContext, TCrdt, TEvents>[P] extends undefined ? never : P]: ResolvedServerConfig<TPlatform, TAuthorize, TContext, TCrdt, TEvents>[P];
510
- };
512
+ type BaseServerConfig<TPlatform extends AbstractPlatform<any> = AbstractPlatform<any>, TAuthorize extends PluvIOAuthorize<TPlatform, any, InferInitContextType<TPlatform>> | null = any, TContext extends Record<string, any> = {}, TCrdt extends CrdtLibraryType$1<any> = CrdtLibraryType$1<NoopCrdtDocFactory>, TEvents extends PluvRouterEventConfig<TPlatform, TAuthorize, TContext> = {}> = { [P in keyof ResolvedServerConfig<TPlatform, TAuthorize, TContext, TCrdt, TEvents> as ResolvedServerConfig<TPlatform, TAuthorize, TContext, TCrdt, TEvents>[P] extends undefined ? never : P]: ResolvedServerConfig<TPlatform, TAuthorize, TContext, TCrdt, TEvents>[P] };
511
513
  type ServerConfig<TPlatform extends AbstractPlatform<any> = AbstractPlatform<any>, TAuthorize extends PluvIOAuthorize<TPlatform, any, InferInitContextType<TPlatform>> | null = any, TContext extends Record<string, any> = {}, TCrdt extends CrdtLibraryType$1<any> = CrdtLibraryType$1<NoopCrdtDocFactory>, TEvents extends PluvRouterEventConfig<TPlatform, TAuthorize, TContext> = {}> = HasRequiredProperty<BaseServerConfig<TPlatform, TAuthorize, TContext, TCrdt, TEvents>> extends true ? [BaseServerConfig<TPlatform, TAuthorize, TContext, TCrdt, TEvents>] : [BaseServerConfig<TPlatform, TAuthorize, TContext, TCrdt, TEvents>?];
512
514
  declare class PluvIO<TPlatform extends AbstractPlatform<any> = AbstractPlatform<any>, TAuthorize extends PluvIOAuthorize<TPlatform, any, InferInitContextType<TPlatform>> | null = any, TContext extends Record<string, any> = {}, TCrdt extends CrdtLibraryType$1<any> = CrdtLibraryType$1<any>> {
513
- readonly version: string;
514
- private readonly _authorize;
515
- private readonly _context;
516
- private readonly _crdt;
517
- private readonly _debug;
518
- private readonly _limits;
519
- private readonly _platform;
520
- get procedure(): PluvProcedure<TPlatform, TAuthorize, TContext, {}, {}>;
521
- constructor(options: PluvIOConfig<TPlatform, TAuthorize, TContext, TCrdt>);
522
- createToken(params: JWTEncodeParams<InferIOAuthorizeUser<TAuthorize>, TPlatform>): Promise<string>;
523
- mergeRouters<TRouters extends PluvRouter<TPlatform, TAuthorize, TContext, any>[]>(...routers: TRouters): MergedRouter<TRouters>;
524
- router<TEvents extends PluvRouterEventConfig<TPlatform, TAuthorize, TContext>>(events: TEvents): PluvRouter<TPlatform, TAuthorize, TContext, TEvents>;
525
- server<TEvents extends PluvRouterEventConfig<TPlatform, TAuthorize, TContext> = {}>(...config: ServerConfig<TPlatform, TAuthorize, TContext, TCrdt, TEvents>): PluvServer<TPlatform, TAuthorize, TContext, TCrdt, TEvents>;
526
- private _getIOAuthorize;
515
+ readonly version: string;
516
+ private readonly _authorize;
517
+ private readonly _context;
518
+ private readonly _crdt;
519
+ private readonly _debug;
520
+ private readonly _limits;
521
+ private readonly _platform;
522
+ get procedure(): PluvProcedure<TPlatform, TAuthorize, TContext, {}, {}>;
523
+ constructor(options: PluvIOConfig<TPlatform, TAuthorize, TContext, TCrdt>);
524
+ createToken(params: JWTEncodeParams<InferIOAuthorizeUser<TAuthorize>, TPlatform>): Promise<string>;
525
+ mergeRouters<TRouters extends PluvRouter<TPlatform, TAuthorize, TContext, any>[]>(...routers: TRouters): MergedRouter<TRouters>;
526
+ router<TEvents extends PluvRouterEventConfig<TPlatform, TAuthorize, TContext>>(events: TEvents): PluvRouter<TPlatform, TAuthorize, TContext, TEvents>;
527
+ server<TEvents extends PluvRouterEventConfig<TPlatform, TAuthorize, TContext> = {}>(...config: ServerConfig<TPlatform, TAuthorize, TContext, TCrdt, TEvents>): PluvServer<TPlatform, TAuthorize, TContext, TCrdt, TEvents>;
528
+ private _getIOAuthorize;
527
529
  }
528
-
529
- type CreateIOParams<TPlatform extends AbstractPlatform<any> = AbstractPlatform<any>, TContext extends Record<string, any> = {}, TUser extends BaseUser | null = null, TCrdt extends CrdtLibraryType$1<any> = CrdtLibraryType$1<NoopCrdtDocFactory>> = {
530
- authorize?: PluvIOAuthorize<TPlatform, TUser, InferInitContextType<TPlatform>>;
531
- context?: PluvContext<TPlatform, TContext>;
532
- crdt?: TCrdt;
533
- debug?: boolean;
534
- limits?: PluvIOLimits;
535
- platform: () => TPlatform;
530
+ //#endregion
531
+ //#region src/createIO.d.ts
532
+ type CreateIOParams<TPlatform extends AbstractPlatform<any> = AbstractPlatform<any>, TContext extends Record<string, any> = {}, TUser extends BaseUser$1 | null = null, TCrdt extends CrdtLibraryType$1<any> = CrdtLibraryType$1<NoopCrdtDocFactory>> = {
533
+ authorize?: PluvIOAuthorize<TPlatform, TUser, InferInitContextType<TPlatform>>;
534
+ context?: PluvContext<TPlatform, TContext>;
535
+ crdt?: TCrdt;
536
+ debug?: boolean;
537
+ limits?: PluvIOLimits;
538
+ platform: () => TPlatform;
536
539
  };
537
- declare const createIO: <TPlatform extends AbstractPlatform<any> = AbstractPlatform<any>, TContext extends Record<string, any> = {}, TUser extends BaseUser | null = null, TCrdt extends CrdtLibraryType$1<any> = CrdtLibraryType$1<NoopCrdtDocFactory>>(params: CreateIOParams<TPlatform, TContext, TUser, TCrdt>) => PluvIO<TPlatform, PluvIOAuthorize<TPlatform, TUser, InferInitContextType<TPlatform>>, TContext, TCrdt>;
538
-
539
- export { type AbstractCloseEvent, type AbstractErrorEvent, type AbstractEvent, type AbstractEventMap, type AbstractListener, type AbstractMessageEvent, AbstractPersistence, AbstractPlatform, type AbstractPlatformConfig, AbstractPubSub, AbstractWebSocket, type AbstractWebSocketConfig, type AbstractWebSocketHandleErrorParams, type AuthorizeModule, type AuthorizeParams, type ConvertWebSocketConfig, type CreateIOParams, type CreateRoomOptions, type GetInitialStorageFn, type HandleMode, type IOPubSubEventMessage, IORoom, type IORoomListenerEvent, type IORoomMessageEvent, type IOStorageUpdatedEvent, type IOUserConnectedEvent, type IOUserDisconnectedEvent, type InferIORoom, type InferInitContextType, type InferPlatformWebSocketType, type InferRoomContextType, type JWT, type JWTEncodeParams, type MergedRouter, type PlatformConfig, type PluvContext, PluvIO, type PluvIOAuthorize, type PluvIOConfig, type PluvIOLimits, type PluvIOListeners, PluvProcedure, type PluvProcedureConfig, PluvRouter, type PluvRouterEventConfig, PluvServer, type PluvServerConfig, type ServerConfig, type WebSocketRegistrationMode, type WebSocketSerializedState, type WebSocketSession, authorize, createIO };
540
+ declare const createIO: <TPlatform extends AbstractPlatform<any> = AbstractPlatform<any>, TContext extends Record<string, any> = {}, TUser extends BaseUser$1 | null = null, TCrdt extends CrdtLibraryType$1<any> = CrdtLibraryType$1<NoopCrdtDocFactory>>(params: CreateIOParams<TPlatform, TContext, TUser, TCrdt>) => PluvIO<TPlatform, PluvIOAuthorize<TPlatform, TUser, InferInitContextType<TPlatform>>, TContext, TCrdt>;
541
+ //#endregion
542
+ export { type AbstractCloseEvent, type AbstractErrorEvent, type AbstractEvent, type AbstractEventMap, type AbstractListener, type AbstractMessageEvent, AbstractPersistence, AbstractPlatform, type AbstractPlatformConfig, AbstractPubSub, AbstractWebSocket, type AbstractWebSocketConfig, type AbstractWebSocketHandleErrorParams, type AuthorizeModule, type AuthorizeParams, type BaseUser, type ConvertWebSocketConfig, type CrdtLibraryType, type CreateIOParams, type CreateRoomOptions, type EventMessage, type EventRecord, type GetInitialStorageFn, type HandleMode, type IOEventMessage, type IOPubSubEventMessage, type IORoom, type IORoomDestroyedEvent, type IORoomListenerEvent, type IORoomMessageEvent, type IOStorageUpdatedEvent, type IOUserConnectedEvent, type IOUserDisconnectedEvent, type InferIORoom, type InferInitContextType, type InferPlatformWebSocketType, type InferRoomContextType, type JWT, type JWTEncodeParams, type MergedRouter, type PlatformConfig, type PluvContext, PluvIO, type PluvIOAuthorize, type PluvIOConfig, type PluvIOLimits, type PluvIOListeners, PluvProcedure, type PluvProcedureConfig, PluvRouter, type PluvRouterEventConfig, PluvServer, type PluvServerConfig, type ServerConfig, type WebSocketRegistrationMode, type WebSocketSerializedState, type WebSocketSession, authorize, createIO };
543
+ //# sourceMappingURL=index.d.mts.map