@yorkie-js/sdk 0.7.5 → 0.7.7
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/yorkie-js-sdk.d.ts +48 -1
- package/dist/yorkie-js-sdk.es.js +954 -260
- package/dist/yorkie-js-sdk.es.js.map +1 -1
- package/dist/yorkie-js-sdk.js +954 -260
- package/dist/yorkie-js-sdk.js.map +1 -1
- package/package.json +2 -2
package/dist/yorkie-js-sdk.d.ts
CHANGED
|
@@ -960,6 +960,7 @@ export declare class Client {
|
|
|
960
960
|
private taskQueue;
|
|
961
961
|
private processing;
|
|
962
962
|
private keepalive;
|
|
963
|
+
private deactivating;
|
|
963
964
|
/**
|
|
964
965
|
* @param rpcAddr - the address of the RPC server.
|
|
965
966
|
* @param opts - the options of the client.
|
|
@@ -3079,6 +3080,20 @@ declare class Document_2<R, P extends Indexable = Indexable> implements Attachab
|
|
|
3079
3080
|
* `removeOnlineClient` removes the clientID from the online client set.
|
|
3080
3081
|
*/
|
|
3081
3082
|
removeOnlineClient(clientID: ActorID): void;
|
|
3083
|
+
/**
|
|
3084
|
+
* `reconcilePresence` compares the previous and current state of a client's
|
|
3085
|
+
* presence/online status and returns the appropriate event to emit.
|
|
3086
|
+
*
|
|
3087
|
+
* For remote clients, "online" means the client is in onlineClients.
|
|
3088
|
+
* For self, "online" means the document status is Attached.
|
|
3089
|
+
*
|
|
3090
|
+
* State transition table:
|
|
3091
|
+
* (!hadP || !wasOn) → (hasP && isOn) : watched (remote) or presence-changed (self)
|
|
3092
|
+
* (hadP && wasOn) → (hasP && isOn) : presence-changed
|
|
3093
|
+
* (hadP && wasOn) → (!hasP || !isOn): unwatched (remote only)
|
|
3094
|
+
* otherwise : no event (waiting)
|
|
3095
|
+
*/
|
|
3096
|
+
private reconcilePresence;
|
|
3082
3097
|
/**
|
|
3083
3098
|
* `hasPresence` returns whether the given clientID has a presence or not.
|
|
3084
3099
|
*/
|
|
@@ -3701,6 +3716,19 @@ declare function isDate(value: any): value is YSONDate {
|
|
|
3701
3716
|
);
|
|
3702
3717
|
}
|
|
3703
3718
|
|
|
3719
|
+
/**
|
|
3720
|
+
* `isDedupCounter` checks if a value is a YSONDedupCounter object.
|
|
3721
|
+
*/
|
|
3722
|
+
declare function isDedupCounter(value: any): value is YSONDedupCounter {
|
|
3723
|
+
return (
|
|
3724
|
+
typeof value === 'object' &&
|
|
3725
|
+
value !== null &&
|
|
3726
|
+
value.type === 'DedupCounter' &&
|
|
3727
|
+
typeof value.value === 'object' &&
|
|
3728
|
+
typeof value.registers === 'string'
|
|
3729
|
+
);
|
|
3730
|
+
}
|
|
3731
|
+
|
|
3704
3732
|
/**
|
|
3705
3733
|
* `isDocEventForReplay` checks if an event can be used to replay a document.
|
|
3706
3734
|
*/
|
|
@@ -3768,7 +3796,8 @@ declare function isObject(value: any): value is { [key: string]: YSONValue } {
|
|
|
3768
3796
|
!isLong(value) &&
|
|
3769
3797
|
!isDate(value) &&
|
|
3770
3798
|
!isBinData(value) &&
|
|
3771
|
-
!isCounter(value)
|
|
3799
|
+
!isCounter(value) &&
|
|
3800
|
+
!isDedupCounter(value)
|
|
3772
3801
|
);
|
|
3773
3802
|
}
|
|
3774
3803
|
|
|
@@ -7004,6 +7033,7 @@ declare namespace YSON {
|
|
|
7004
7033
|
YSONDate as Date,
|
|
7005
7034
|
YSONBinData as BinData,
|
|
7006
7035
|
YSONCounter as Counter,
|
|
7036
|
+
YSONDedupCounter as DedupCounter,
|
|
7007
7037
|
isText,
|
|
7008
7038
|
isTree,
|
|
7009
7039
|
isInt,
|
|
@@ -7011,6 +7041,7 @@ declare namespace YSON {
|
|
|
7011
7041
|
isDate,
|
|
7012
7042
|
isBinData,
|
|
7013
7043
|
isCounter,
|
|
7044
|
+
isDedupCounter,
|
|
7014
7045
|
isObject,
|
|
7015
7046
|
parse,
|
|
7016
7047
|
textToString,
|
|
@@ -7058,6 +7089,21 @@ declare interface YSONDate {
|
|
|
7058
7089
|
value: string;
|
|
7059
7090
|
}
|
|
7060
7091
|
|
|
7092
|
+
/**
|
|
7093
|
+
* `YSONDedupCounter` represents a DedupCounter CRDT that uses HyperLogLog
|
|
7094
|
+
* to count unique actors.
|
|
7095
|
+
*
|
|
7096
|
+
* @example
|
|
7097
|
+
* ```typescript
|
|
7098
|
+
* { type: 'DedupCounter', value: { type: 'Int', value: 15 }, registers: 'AQID...' }
|
|
7099
|
+
* ```
|
|
7100
|
+
*/
|
|
7101
|
+
declare interface YSONDedupCounter {
|
|
7102
|
+
type: 'DedupCounter';
|
|
7103
|
+
value: YSONInt;
|
|
7104
|
+
registers: string;
|
|
7105
|
+
}
|
|
7106
|
+
|
|
7061
7107
|
/**
|
|
7062
7108
|
* `YSONInt` represents a 32-bit integer.
|
|
7063
7109
|
*
|
|
@@ -7194,6 +7240,7 @@ declare type YSONValue =
|
|
|
7194
7240
|
| YSONDate
|
|
7195
7241
|
| YSONBinData
|
|
7196
7242
|
| YSONCounter
|
|
7243
|
+
| YSONDedupCounter
|
|
7197
7244
|
| { [key: string]: YSONValue }
|
|
7198
7245
|
| Array<YSONValue>;
|
|
7199
7246
|
|