Skip to content

Commit 5e18ae8

Browse files
committed
Add Objects Access API spec
Adds spec for `LiveMap.size`, `LiveMap.entries`, `LiveMap.keys` and `LiveMap.values`
1 parent fc46aed commit 5e18ae8

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

textile/objects-features.textile

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,27 @@ h3(#livemap). LiveMap
106106
***** @(RTLM5d2f1)@ If an object with id @objectId@ does not exist, return undefined/null
107107
***** @(RTLM5d2f2)@ If an object with id @objectId@ exists, return it
108108
**** @(RTLM5d2g)@ Otherwise, return undefined/null
109+
* @(RTLM10)@ @LiveMap#size@:
110+
** @(RTLM10a)@ A method or property, depending on what is more idiomatic for the platform to use for a Map/Dictionary interface. For example, in JavaScript, this is a property similar to @Map.size@ for the native @Map@ class
111+
** @(RTLM10b)@ Requires the @OBJECT_SUBSCRIBE@ channel mode to be granted per "RTO2":#RTO2
112+
** @(RTLM10c)@ If the channel is in the @DETACHED@ or @FAILED@ state, the library should throw an @ErrorInfo@ error with @statusCode@ 400 and @code@ 90001
113+
** @(RTLM10d)@ Returns the number of non-tombstoned entries (per "RTLM14":#RTLM14) in the internal @data@ map
114+
* @(RTLM11)@ @LiveMap#entries@:
115+
** @(RTLM11a)@ A method or property, depending on what is more idiomatic for the platform to use for a Map/Dictionary interface. For example, in JavaScript, this is a method similar to @Map.entries()@ for the native @Map@ class
116+
** @(RTLM11b)@ Requires the @OBJECT_SUBSCRIBE@ channel mode to be granted per "RTO2":#RTO2
117+
** @(RTLM11c)@ If the channel is in the @DETACHED@ or @FAILED@ state, the library should throw an @ErrorInfo@ error with @statusCode@ 400 and @code@ 90001
118+
** @(RTLM11d)@ Returns key-value pairs from the internal @data@ map:
119+
*** @(RTLM11d1)@ Pairs with tombstoned entries (per "RTLM14":#RTLM14) are not returned
120+
*** @(RTLM11d2)@ The return type is idiomatic for the platform's analogous Map/Dictionary interface operation. For example, in JavaScript, it returns a map iterator object like the one returned by @Map.entries()@ method for the native @Map@ class
121+
* @(RTLM12)@ @LiveMap#keys@:
122+
** @(RTLM12a)@ A method or property, depending on what is more idiomatic for the platform to use for a Map/Dictionary interface. For example, in JavaScript, this is a method similar to @Map.keys()@ for the native @Map@ class
123+
** @(RTLM12b)@ Identical to @LiveMap#entries@, except that it returns only the keys from the internal @data@ map
124+
* @(RTLM13)@ @LiveMap#values@:
125+
** @(RTLM13a)@ A method or property, depending on what is more idiomatic for the platform to use for a Map/Dictionary interface. For example, in JavaScript, this is a method similar to @Map.values()@ for the native @Map@ class
126+
** @(RTLM13b)@ Identical to @LiveMap#entries@, except that it returns only the values from the internal @data@ map
127+
* @(RTLM14)@ An @ObjectsMapEntry@ in the internal @data@ map can be checked for being tombstoned using the convenience method:
128+
** @(RTLM14a)@ The method returns true if @ObjectsMapEntry.tombstone@ is true
129+
** @(RTLM14b)@ Otherwise, it returns false
109130
* @(RTLM6)@ @LiveMap@ internal @data@ can be overridden with the provided @ObjectState@ in the following way:
110131
** @(RTLM6a)@ Replace the private @siteTimeserials@ of the @LiveMap@ with the value from @ObjectState.siteTimeserials@
111132
** @(RTLM6b)@ Set the private flag @createOperationIsMerged@ to @false@

0 commit comments

Comments
 (0)