You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: ably.d.ts
+18-18Lines changed: 18 additions & 18 deletions
Original file line number
Diff line number
Diff line change
@@ -2288,32 +2288,32 @@ export type LiveObjectLifecycleEvent = LiveObjectLifecycleEvents.DELETED;
2288
2288
*/
2289
2289
exportdeclareinterfaceRealtimeObject{
2290
2290
/**
2291
-
* Retrieves the root {@link LiveMap} object for Objects on a channel.
2291
+
* Retrieves the {@link LiveMap} object - the entrypoint for Objects on a channel.
2292
2292
*
2293
2293
* A type parameter can be provided to describe the structure of the Objects on the channel. By default, it uses types from the globally defined `AblyObjectsTypes` interface.
2294
2294
*
2295
-
* You can specify custom types for Objects by defining a global `AblyObjectsTypes` interface with a `root` property that conforms to {@link LiveMapType}.
2295
+
* You can specify custom types for Objects by defining a global `AblyObjectsTypes` interface with a `object` property that conforms to {@link LiveMapType}.
2296
2296
*
2297
2297
* Example:
2298
2298
*
2299
2299
* ```typescript
2300
2300
* import { LiveCounter } from 'ably';
2301
2301
*
2302
-
* type MyRoot = {
2302
+
* type MyObject = {
2303
2303
* myTypedKey: LiveCounter;
2304
2304
* };
2305
2305
*
2306
2306
* declare global {
2307
2307
* export interface AblyObjectsTypes {
2308
-
* root: MyRoot;
2308
+
* object: MyObject;
2309
2309
* }
2310
2310
* }
2311
2311
* ```
2312
2312
*
2313
2313
* @returns A promise which, upon success, will be fulfilled with a {@link LiveMap} object. Upon failure, the promise will be rejected with an {@link ErrorInfo} object which explains the error.
* The default type for the `root` object for Objects on a channel, based on the globally defined {@link AblyObjectsTypes} interface.
2395
+
* The default type for the entrypoint {@link LiveMap} object on a channel, based on the globally defined {@link AblyObjectsTypes} interface.
2396
2396
*
2397
-
* - If no custom types are provided in `AblyObjectsTypes`, defaults to an untyped root map representation using the {@link LiveMapType} interface.
2398
-
* - If a `root` type exists in `AblyObjectsTypes` and conforms to the {@link LiveMapType} interface, it is used as the type for the `root` object.
2399
-
* - If the provided `root` type does not match {@link LiveMapType}, a type error message is returned.
2397
+
* - If no custom types are provided in `AblyObjectsTypes`, defaults to an untyped map representation using the {@link LiveMapType} interface.
2398
+
* - If an `object` key exists in `AblyObjectsTypes` and its type conforms to the {@link LiveMapType} interface, it is used as the type for the entrypoint {@link LiveMap} object.
2399
+
* - If the provided type in `object` key does not match {@link LiveMapType}, a type error message is returned.
2400
2400
*/
2401
-
exporttypeDefaultRoot=
2401
+
exporttypeAblyDefaultObject=
2402
2402
// we need a way to know when no types were provided by the user.
2403
-
// we expect a "root" property to be set on AblyObjectsTypes interface, e.g. it won't be "unknown" anymore
2404
-
unknownextendsAblyObjectsTypes['root']
2405
-
? LiveMapType// no custom types provided; use the default untyped map representation for the root
2406
-
: AblyObjectsTypes['root']extendsLiveMapType
2407
-
? AblyObjectsTypes['root']// "root" property exists, and it is of an expected type, we can use this interface for the root object in Objects.
2408
-
: `Provided type definition for the "root" object in AblyObjectsTypes is not of an expected LiveMapType`;
2403
+
// we expect an "object" property to be set on AblyObjectsTypes interface, e.g. it won't be "unknown" anymore
2404
+
unknownextendsAblyObjectsTypes['object']
2405
+
? LiveMapType// no custom types provided; use the default untyped map representation for the entrypoint map
2406
+
: AblyObjectsTypes['object']extendsLiveMapType
2407
+
? AblyObjectsTypes['object']// "object" property exists, and it is of an expected type, we can use this interface for the entrypoint map
2408
+
: `Provided type definition for the "object" object in AblyObjectsTypes is not of an expected LiveMapType`;
2409
2409
2410
2410
/**
2411
2411
* Object returned from an `on` call, allowing the listener provided in that call to be deregistered.
* Mirrors the {@link RealtimeObject.get} method and returns a {@link BatchContextLiveMap} wrapper for the root object on a channel.
2427
+
* Mirrors the {@link RealtimeObject.get} method and returns a {@link BatchContextLiveMap} wrapper for the entrypoint {@link LiveMap} object on a channel.
0 commit comments