@hydranium/protocol 1.0.0-next.284 → 1.0.0-next.287
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/lib/client/data-connection.d.ts +61 -7
- package/lib/client/data-connection.d.ts.map +1 -1
- package/lib/client/data-connection.js +110 -16
- package/lib/client/data-connection.js.map +1 -1
- package/lib/client/data-events.d.ts +5 -1
- package/lib/client/data-events.d.ts.map +1 -1
- package/lib/client/data-events.js +5 -1
- package/lib/client/data-events.js.map +1 -1
- package/lib/client/data-session.d.ts +32 -8
- package/lib/client/data-session.d.ts.map +1 -1
- package/lib/client/data-session.js +81 -15
- package/lib/client/data-session.js.map +1 -1
- package/lib/data/data-server-protocol.d.ts +23 -14
- package/lib/data/data-server-protocol.d.ts.map +1 -1
- package/lib/data/events.d.ts +14 -1
- package/lib/data/events.d.ts.map +1 -1
- package/lib/transfer-document.d.ts +9 -0
- package/lib/transfer-document.d.ts.map +1 -1
- package/lib/transfer-document.js.map +1 -1
- package/package.json +1 -1
- package/src/client/data-connection.ts +162 -44
- package/src/client/data-events.ts +5 -1
- package/src/client/data-session.ts +89 -16
- package/src/data/data-server-protocol.ts +23 -14
- package/src/data/events.ts +14 -1
- package/src/transfer-document.ts +10 -0
package/src/data/events.ts
CHANGED
|
@@ -62,6 +62,12 @@ export interface TransferDocumentUpdatedEvent<
|
|
|
62
62
|
*/
|
|
63
63
|
sourceClientId: string;
|
|
64
64
|
reason: TransferDocumentUpdateReason;
|
|
65
|
+
/**
|
|
66
|
+
* The position of this event among the update and deletion events the
|
|
67
|
+
* server sent on this connection, which a watch's answer carries as of
|
|
68
|
+
* the moment it was taken: a greater one was sent later.
|
|
69
|
+
*/
|
|
70
|
+
sequence: number;
|
|
65
71
|
}
|
|
66
72
|
|
|
67
73
|
/** Callback shape for `DataClientProtocol.onDocumentUpdated`. */
|
|
@@ -158,9 +164,16 @@ export interface TransferDocumentDeletedEvent {
|
|
|
158
164
|
/**
|
|
159
165
|
* The session whose `deleteModelDocument` removed the file, so it can tell
|
|
160
166
|
* its own deletion from another's; the unknown-client id for a file
|
|
161
|
-
* removed outside any session, as a file watcher reports one
|
|
167
|
+
* removed outside any session, as a file watcher reports one, and for one
|
|
168
|
+
* a `DataConnection` found gone after a reconnect, which no event named.
|
|
162
169
|
*/
|
|
163
170
|
readonly sourceClientId: string;
|
|
171
|
+
/**
|
|
172
|
+
* The position of this event among the update and deletion events the
|
|
173
|
+
* server sent on this connection, as on an update; absent on a deletion a
|
|
174
|
+
* `DataConnection` found after a reconnect, which the server never sent.
|
|
175
|
+
*/
|
|
176
|
+
readonly sequence?: number;
|
|
164
177
|
}
|
|
165
178
|
|
|
166
179
|
/** Callback shape for `DataClientProtocol.onDocumentDeleted`. */
|
package/src/transfer-document.ts
CHANGED
|
@@ -98,6 +98,16 @@ export type TransferSavedDocument<TTransfer extends TransferElement, TDiagnostic
|
|
|
98
98
|
persisted: { version: TextVersion };
|
|
99
99
|
};
|
|
100
100
|
|
|
101
|
+
/** What a watch answers, once it is in place. */
|
|
102
|
+
export interface TransferWatchedDocument {
|
|
103
|
+
/** The key the watch's events name the document by, which a symlinked URI does not spell. */
|
|
104
|
+
readonly uri: string;
|
|
105
|
+
/** Whether a document exists there; one the server fails to load counts, only a missing one does not. */
|
|
106
|
+
readonly exists: boolean;
|
|
107
|
+
/** The position of the last update or deletion event sent before `exists` was taken; an event past it was sent after. */
|
|
108
|
+
readonly sequence: number;
|
|
109
|
+
}
|
|
110
|
+
|
|
101
111
|
export namespace TransferDocument {
|
|
102
112
|
/**
|
|
103
113
|
* Whether the server had this document. Branch on it where absence is an
|