Skip to content

Commit 98146a2

Browse files
authored
Merge pull request #345 from ably/objects-features-idl
Add IDL of Objects features
2 parents 3feb6af + 7ccb26d commit 98146a2

1 file changed

Lines changed: 27 additions & 1 deletion

File tree

textile/objects-features.textile

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Objects feature enables clients to store shared data as "objects" on a channel.
1515

1616
h3(#realtime-objects). RealtimeObjects
1717

18-
* @(RTO1)@ @Objects#getRoot@ function:
18+
* @(RTO1)@ @RealtimeObjects#getRoot@ function:
1919
** @(RTO1a)@ Requires the @OBJECT_SUBSCRIBE@ channel mode to be granted per "RTO2":#RTO2
2020
** @(RTO1b)@ If the channel is in the @DETACHED@ or @FAILED@ state, the library should throw an @ErrorInfo@ error with @statusCode@ 400 and @code@ 90001
2121
** @(RTO1c)@ Waits for the objects sync sequence to complete and for "RTO5c":#RTO5c to finish
@@ -254,3 +254,29 @@ h3(#livemap). LiveMap
254254
*** @(RTLM17a1)@ If @ObjectsMapEntry.tombstone@ is @false@ or omitted, apply the @MAP_SET@ operation to the current key as described in "RTLM7":#RTLM7, passing in @ObjectsMapEntry.data@ and the current key as @ObjectsMapOp@, and @ObjectsMapEntry.timeserial@ as @serial@
255255
*** @(RTLM17a2)@ If @ObjectsMapEntry.tombstone@ is @true@, apply the @MAP_REMOVE@ operation to the current key as described in "RTLM8":#RTLM8, passing in the current key as @ObjectsMapOp@, and @ObjectsMapEntry.timeserial@ as @serial@
256256
** @(RTLM17b)@ Set the private flag @createOperationIsMerged@ to @true@
257+
258+
h2(#idl). Interface Definition
259+
260+
Describes types for RealtimeObjects.
261+
Types and their properties/methods are public and exposed to users by default. An @internal@ label may be used to indicate that a type or its property/method must not be exposed to users and is intended for internal SDK use only.
262+
263+
<pre>
264+
class RealtimeObjects: // RTO*
265+
getRoot() => io LiveMap // RTO1
266+
267+
class LiveObject: // RTLO*
268+
objectId: String // RTLO3a, internal
269+
siteTimeserials: Dict<String, String> // RTLO3b, internal
270+
createOperationIsMerged: Boolean // RTLO3c, internal
271+
canApplyOperation(ObjectMessage) -> Boolean // RTLO4a, internal
272+
273+
class LiveCounter extends LiveObject: // RTLC*, RTLC1
274+
value() -> Number // RTLC5
275+
276+
class LiveMap extends LiveObject: // RTLM*, RTLM1
277+
get(key: String) -> (Boolean | Binary | Number | String | JsonArray | JsonObject | LiveCounter | LiveMap)? // RTLM5
278+
size() -> Number // RTLM10
279+
entries() -> [String, (Boolean | Binary | Number | String | JsonArray | JsonObject | LiveCounter | LiveMap)?][] // RTLM11
280+
keys() -> String[] // RTLM12
281+
values() -> (Boolean | Binary | Number | String | JsonArray | JsonObject | LiveCounter | LiveMap)?[] // RTLM13
282+
</pre>

0 commit comments

Comments
 (0)