@m1212e/rumble 0.16.47 → 0.17.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/out/index.d.mts CHANGED
@@ -4398,6 +4398,26 @@ declare const rumble: <UserContext extends Record<string, any>, DB extends Drizz
4398
4398
  createSofa: (args: Omit<Parameters<typeof useSofa>[0], "schema" | "context">) => Router<any, {}, {
4399
4399
  [TKey: string]: never;
4400
4400
  }>;
4401
+ /**
4402
+ * Creates a WebSocket server handler for GraphQL subscriptions.
4403
+ * Pass the ws implementation function as the first argument and rumble will
4404
+ * inject the schema and context automatically.
4405
+ *
4406
+ * @example
4407
+ *
4408
+ * ```ts
4409
+ * // ws
4410
+ * import { useServer } from "graphql-ws/use/ws";
4411
+ * import { WebSocketServer } from "ws";
4412
+ * const wss = new WebSocketServer({ port: 4000 });
4413
+ * const disposable = createWs(useServer, { ... }, wss);
4414
+ *
4415
+ * // bun
4416
+ * import { makeHandler } from "graphql-ws/use/bun";
4417
+ * Bun.serve({ websocket: createWs(makeHandler, { ... }), ... });
4418
+ * ```
4419
+ */
4420
+ createWs: <T_2 extends (options: any, ...rest: any[]) => any>(implementation: T_2, args: Omit<Parameters<T_2>[0], "schema" | "context">, ...rest: Parameters<T_2> extends [any, ...infer R] ? R : never) => ReturnType<T_2>;
4401
4421
  /**
4402
4422
  * A function for creating default objects for your schema
4403
4423
  */