@cloudbase/js-sdk 3.9.4 → 3.9.5-alpha.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloudbase/js-sdk",
3
- "version": "3.9.4",
3
+ "version": "3.9.5-alpha.0",
4
4
  "description": "cloudbase javascript sdk",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.esm.js",
@@ -196,5 +196,5 @@
196
196
  "> 1%",
197
197
  "chrome 53"
198
198
  ],
199
- "gitHead": "4ef23b2e1e34d6692aff0c751ccc911cfb1a51bf"
199
+ "gitHead": "77f1fb58a6fb83d3b2b061c6d206c96a350014d1"
200
200
  }
package/types/index.d.ts CHANGED
@@ -174,6 +174,12 @@ export interface DatabaseCapability {
174
174
  database?: (dbConfig?: { instance?: string; database?: string }) => cloudbase.database.App
175
175
  }
176
176
 
177
+ /** Realtime 能力(`registerRealtimeJs` 注册后可用)。小程序请用 `app.realtime()`,不要单独 `new RealtimeClient()`。 */
178
+ export interface RealtimeCapability {
179
+ /** 获取 Realtime 客户端(Broadcast / Presence / Postgres CDC) */
180
+ realtime?: () => import('@cloudbase/realtime-js').RealtimeClient
181
+ }
182
+
177
183
  /** 云存储能力(`registerStorage` 注册后可用)。 */
178
184
  export interface StorageCapability {
179
185
  /** Storage 命名空间实例(from 分流 + Bucket 管理) */
@@ -205,6 +211,7 @@ export type ICloudbase = CloudbaseCore
205
211
  & FunctionsCapability
206
212
  & DatabaseCapability
207
213
  & StorageCapability
214
+ & RealtimeCapability
208
215
 
209
216
  /**
210
217
  * 按需组合的 Cloudbase 客户端类型。
@@ -220,7 +227,7 @@ export type ICloudbase = CloudbaseCore
220
227
  * @typeParam Caps - 需要叠加的能力集合,默认叠加全部内置能力(等价于 `ICloudbase`)
221
228
  */
222
229
  export type CloudbaseClient<
223
- Caps = AuthCapability & FunctionsCapability & DatabaseCapability & StorageCapability,
230
+ Caps = AuthCapability & FunctionsCapability & DatabaseCapability & StorageCapability & RealtimeCapability,
224
231
  > = CloudbaseCore & Caps
225
232
 
226
233
  /**
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloudbase/types",
3
- "version": "3.8.2",
3
+ "version": "3.8.3-alpha.0",
4
4
  "description": "cloudbase javascript sdk types",
5
5
  "main": "dist/index.js",
6
6
  "types": "./index.d.ts",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloudbase/utilities",
3
- "version": "3.8.2",
3
+ "version": "3.8.3-alpha.0",
4
4
  "description": "cloudbase javascript sdk utilities",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.esm.js",