@rebasepro/client 0.9.1-canary.f2f61da → 0.9.1-canary.ff338b5

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.ts CHANGED
@@ -7,6 +7,7 @@ import { createApiKeys, CreateApiKeysOptions } from "./api-keys";
7
7
  import { CollectionClient } from "./collection";
8
8
  import { createFunctionsClient } from "./functions";
9
9
  import { RebaseWebSocketClient } from "./websocket";
10
+ import { RebaseRealtimeChannel } from "./realtime-channel";
10
11
  import { InsertOf, RebaseClient, RebaseSdkData, RowOf, StorageSource, StorageSourceDefinition, StorageSourceRegistry, UpdateOf } from "@rebasepro/types";
11
12
  export { RebaseApiError } from "./transport";
12
13
  export { RebaseClientError } from "./errors";
@@ -27,6 +28,8 @@ export type { CreateBackupsOptions } from "./backups";
27
28
  export type { ApiKeyMasked, ApiKeyPermission, ApiKeyWithSecret, CreateApiKeyRequest, CreateApiKeysOptions, UpdateApiKeyRequest } from "./api-keys";
28
29
  export type { FunctionInvokeOptions, FunctionsClient } from "./functions";
29
30
  export { RebaseWebSocketClient } from "./websocket";
31
+ export { RebaseRealtimeChannel } from "./realtime-channel";
32
+ export type { PresenceState, PresenceDiff, BroadcastEvent, ChannelTransport } from "./realtime-channel";
30
33
  export interface CreateRebaseClientOptions extends RebaseClientConfig {
31
34
  auth?: CreateAuthOptions;
32
35
  admin?: CreateAdminOptions;
@@ -74,6 +77,21 @@ export type CreateRebaseClientResult<DB = Record<string, unknown>> = Omit<Rebase
74
77
  apiKeys: ReturnType<typeof createApiKeys>;
75
78
  functions: ReturnType<typeof createFunctionsClient>;
76
79
  ws?: RebaseWebSocketClient;
80
+ /**
81
+ * Broadcast and presence channels.
82
+ *
83
+ * Was missing from this type while present on the returned object, which
84
+ * made `client.realtime.channel(...)` a type error and forced every adopter
85
+ * to cast around the feature before they could reach it.
86
+ */
87
+ realtime: {
88
+ /**
89
+ * Join a broadcast/presence channel. Repeated calls with the same name
90
+ * return the same channel object. Throws only when the client was
91
+ * created with `realtime: false`.
92
+ */
93
+ channel: (name: string) => RebaseRealtimeChannel;
94
+ };
77
95
  /**
78
96
  * Release the realtime socket and its reconnect timer.
79
97
  *