@liveblocks/client 0.16.1 → 0.16.4-beta1

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/index.d.ts ADDED
@@ -0,0 +1,31 @@
1
+ import { C as ClientOptions, a as Client } from './shared';
2
+ export { B as BroadcastOptions, a as Client, H as History, J as Json, d as JsonObject, c as LiveList, b as LiveMap, L as LiveObject, e as Lson, f as LsonObject, O as Others, P as Presence, R as Room, S as StorageUpdate, U as User } from './shared';
3
+
4
+ /**
5
+ * Create a client that will be responsible to communicate with liveblocks servers.
6
+ *
7
+ * @example
8
+ * const client = createClient({
9
+ * authEndpoint: "/api/auth"
10
+ * });
11
+ *
12
+ * // It's also possible to use a function to call your authentication endpoint.
13
+ * // Useful to add additional headers or use an API wrapper (like Firebase functions)
14
+ * const client = createClient({
15
+ * authEndpoint: async (room) => {
16
+ * const response = await fetch("/api/auth", {
17
+ * method: "POST",
18
+ * headers: {
19
+ * Authentication: "token",
20
+ * "Content-Type": "application/json"
21
+ * },
22
+ * body: JSON.stringify({ room })
23
+ * });
24
+ *
25
+ * return await response.json();
26
+ * }
27
+ * });
28
+ */
29
+ declare function createClient(options: ClientOptions): Client;
30
+
31
+ export { createClient };