@yorkie-js/sdk 0.6.47 → 0.6.49

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.
@@ -134,7 +134,7 @@ declare interface AuthErrorEvent extends BaseDocEvent {
134
134
  type: DocEventType_2.AuthError;
135
135
  value: {
136
136
  reason: string;
137
- method: 'PushPull' | 'WatchDocument';
137
+ method: 'PushPull' | 'Watch';
138
138
  };
139
139
  }
140
140
 
@@ -142,7 +142,7 @@ declare interface AuthErrorEvent_2 extends BaseDocEvent_2 {
142
142
  type: DocEventType.AuthError;
143
143
  value: {
144
144
  reason: string;
145
- method: 'PushPull' | 'WatchDocument';
145
+ method: 'PushPull' | 'Watch';
146
146
  };
147
147
  }
148
148
 
@@ -1728,7 +1728,18 @@ declare class CRDTText<A extends Indexable = Indexable> extends CRDTElement {
1728
1728
  * @param attributes - style attributes
1729
1729
  * @param editedAt - edited time
1730
1730
  */
1731
- setStyle(range: RGATreeSplitPosRange, attributes: Record<string, string>, editedAt: TimeTicket, versionVector?: VersionVector): [Array<GCPair>, DataSize, Array<TextChange<A>>];
1731
+ setStyle(range: RGATreeSplitPosRange, attributes: Record<string, string>, editedAt: TimeTicket, versionVector?: VersionVector): [
1732
+ Array<GCPair>,
1733
+ DataSize,
1734
+ Array<TextChange<A>>,
1735
+ Map<string, string>,
1736
+ Array<string>
1737
+ ];
1738
+ /**
1739
+ * `removeStyle` removes the style attributes of the given range.
1740
+ * Returns previous attribute values (from first styled node) for reverse operation.
1741
+ */
1742
+ removeStyle(range: RGATreeSplitPosRange, attributesToRemove: Array<string>, editedAt: TimeTicket, versionVector?: VersionVector): [Array<GCPair>, DataSize, Array<TextChange<A>>, Map<string, string>];
1732
1743
  /**
1733
1744
  * `indexRangeToPosRange` returns the position range of the given index range.
1734
1745
  */
@@ -2403,38 +2414,6 @@ declare type DocEvent_2<P extends Indexable_2 = Indexable_2, T = OpInfo_2> =
2403
2414
  | PresenceEvent<P>
2404
2415
  | AuthErrorEvent;
2405
2416
 
2406
- /**
2407
- * @generated from message yorkie.v1.DocEvent
2408
- */
2409
- declare type DocEvent_3 = Message<"yorkie.v1.DocEvent"> & {
2410
- /**
2411
- * @generated from field: yorkie.v1.DocEventType type = 1;
2412
- */
2413
- type: DocEventType_3;
2414
- /**
2415
- * @generated from field: string publisher = 2;
2416
- */
2417
- publisher: string;
2418
- /**
2419
- * @generated from field: yorkie.v1.DocEventBody body = 3;
2420
- */
2421
- body?: DocEventBody;
2422
- };
2423
-
2424
- /**
2425
- * @generated from message yorkie.v1.DocEventBody
2426
- */
2427
- declare type DocEventBody = Message<"yorkie.v1.DocEventBody"> & {
2428
- /**
2429
- * @generated from field: string topic = 1;
2430
- */
2431
- topic: string;
2432
- /**
2433
- * @generated from field: bytes payload = 2;
2434
- */
2435
- payload: Uint8Array;
2436
- };
2437
-
2438
2417
  declare type DocEventCallbackMap<P extends Indexable> = {
2439
2418
  default: NextFn<LocalChangeEvent<OpInfo, P> | RemoteChangeEvent<OpInfo, P> | SnapshotEvent>;
2440
2419
  presence: NextFn<PresenceEvent_2<P>>;
@@ -2923,9 +2902,13 @@ declare class Document_2<R, P extends Indexable = Indexable> implements Attachab
2923
2902
  */
2924
2903
  applyChange(change: Change<P>, source: OpSource): void;
2925
2904
  /**
2926
- * `applyWatchStream` applies the given watch stream response into this document.
2905
+ * `applyWatchInit` applies the watch initialization with the given client IDs.
2906
+ */
2907
+ applyWatchInit(clientIDs: Array<string>): void;
2908
+ /**
2909
+ * `applyDocEvent` applies the given doc event into this document.
2927
2910
  */
2928
- applyWatchStream(resp: WatchDocumentResponse): void;
2911
+ applyDocEvent(type: DocEventType_3, publisher: string): void;
2929
2912
  /**
2930
2913
  * `applyStatus` applies the document status into this document.
2931
2914
  */
@@ -3727,6 +3710,10 @@ export declare type JSONArray<T> = {
3727
3710
  * `moveLast` moves the element after the last element.
3728
3711
  */
3729
3712
  moveLast(id: TimeTicket): void;
3713
+ /**
3714
+ * `elements` returns an iterator of wrapped elements including CRDT metadata.
3715
+ */
3716
+ elements(): IterableIterator<WrappedElement<T>>;
3730
3717
  /**
3731
3718
  * `toTestString` returns a String containing the meta data of the node
3732
3719
  * for debugging purpose.
@@ -4376,6 +4363,10 @@ declare type Operation_Style = Message<"yorkie.v1.Operation.Style"> & {
4376
4363
  createdAtMapByActor: {
4377
4364
  [key: string]: TimeTicket_2;
4378
4365
  };
4366
+ /**
4367
+ * @generated from field: repeated string attributes_to_remove = 7;
4368
+ */
4369
+ attributesToRemove: string[];
4379
4370
  };
4380
4371
 
4381
4372
  /**
@@ -6755,41 +6746,6 @@ declare type VersionVector_2 = Message<"yorkie.v1.VersionVector"> & {
6755
6746
  */
6756
6747
  declare function versionVectorToHex(vector: VersionVector): string;
6757
6748
 
6758
- /**
6759
- * @generated from message yorkie.v1.WatchDocumentResponse
6760
- */
6761
- declare type WatchDocumentResponse = Message<"yorkie.v1.WatchDocumentResponse"> & {
6762
- /**
6763
- * @generated from oneof yorkie.v1.WatchDocumentResponse.body
6764
- */
6765
- body: {
6766
- /**
6767
- * @generated from field: yorkie.v1.WatchDocumentResponse.Initialization initialization = 1;
6768
- */
6769
- value: WatchDocumentResponse_Initialization;
6770
- case: "initialization";
6771
- } | {
6772
- /**
6773
- * @generated from field: yorkie.v1.DocEvent event = 2;
6774
- */
6775
- value: DocEvent_3;
6776
- case: "event";
6777
- } | {
6778
- case: undefined;
6779
- value?: undefined;
6780
- };
6781
- };
6782
-
6783
- /**
6784
- * @generated from message yorkie.v1.WatchDocumentResponse.Initialization
6785
- */
6786
- declare type WatchDocumentResponse_Initialization = Message<"yorkie.v1.WatchDocumentResponse.Initialization"> & {
6787
- /**
6788
- * @generated from field: repeated string client_ids = 1;
6789
- */
6790
- clientIds: string[];
6791
- };
6792
-
6793
6749
  export declare interface WatchedEvent<P extends Indexable> extends BaseDocEvent_2 {
6794
6750
  type: DocEventType.Watched;
6795
6751
  source: OpSource.Remote;