@fluidframework/driver-base 2.0.0-rc.2.0.2 → 2.0.0-rc.3.0.1
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/CHANGELOG.md +29 -0
- package/api-report/driver-base.api.md +7 -5
- package/dist/documentDeltaConnection.d.ts +8 -5
- package/dist/documentDeltaConnection.d.ts.map +1 -1
- package/dist/documentDeltaConnection.js +28 -26
- package/dist/documentDeltaConnection.js.map +1 -1
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/dist/public.d.ts +12 -0
- package/internal.d.ts +11 -0
- package/lib/documentDeltaConnection.d.ts +8 -5
- package/lib/documentDeltaConnection.d.ts.map +1 -1
- package/lib/documentDeltaConnection.js +6 -4
- package/lib/documentDeltaConnection.js.map +1 -1
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/lib/public.d.ts +12 -0
- package/package.json +27 -48
- package/src/documentDeltaConnection.ts +17 -12
- package/src/packageVersion.ts +1 -1
- package/api-extractor-cjs.json +0 -8
- package/dist/driver-base-alpha.d.ts +0 -26
- package/dist/driver-base-beta.d.ts +0 -32
- package/dist/driver-base-public.d.ts +0 -32
- package/dist/driver-base-untrimmed.d.ts +0 -213
- package/lib/driver-base-alpha.d.ts +0 -26
- package/lib/driver-base-beta.d.ts +0 -32
- package/lib/driver-base-public.d.ts +0 -32
- package/lib/driver-base-untrimmed.d.ts +0 -213
- package/lib/test/driverUtilsTests.spec.js +0 -101
- package/lib/test/driverUtilsTests.spec.js.map +0 -1
- package/lib/test/types/validateDriverBasePrevious.generated.js +0 -10
- package/lib/test/types/validateDriverBasePrevious.generated.js.map +0 -1
- /package/{dist → lib}/tsdoc-metadata.json +0 -0
|
@@ -1,213 +0,0 @@
|
|
|
1
|
-
import { ConnectionMode } from '@fluidframework/protocol-definitions';
|
|
2
|
-
import { EventEmitterWithErrorHandling } from '@fluidframework/telemetry-utils';
|
|
3
|
-
import { IAnyDriverError } from '@fluidframework/driver-definitions';
|
|
4
|
-
import { IClientConfiguration } from '@fluidframework/protocol-definitions';
|
|
5
|
-
import { IConnect } from '@fluidframework/protocol-definitions';
|
|
6
|
-
import { IConnected } from '@fluidframework/protocol-definitions';
|
|
7
|
-
import { IDisposable } from '@fluidframework/core-interfaces';
|
|
8
|
-
import { IDocumentDeltaConnection } from '@fluidframework/driver-definitions';
|
|
9
|
-
import { IDocumentDeltaConnectionEvents } from '@fluidframework/driver-definitions';
|
|
10
|
-
import { IDocumentMessage } from '@fluidframework/protocol-definitions';
|
|
11
|
-
import { ISequencedDocumentMessage } from '@fluidframework/protocol-definitions';
|
|
12
|
-
import { ISignalClient } from '@fluidframework/protocol-definitions';
|
|
13
|
-
import { ISignalMessage } from '@fluidframework/protocol-definitions';
|
|
14
|
-
import { ITelemetryLoggerExt } from '@fluidframework/telemetry-utils';
|
|
15
|
-
import { ITokenClaims } from '@fluidframework/protocol-definitions';
|
|
16
|
-
import type { Socket } from 'socket.io-client';
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Represents a connection to a stream of delta updates.
|
|
20
|
-
* @internal
|
|
21
|
-
*/
|
|
22
|
-
export declare class DocumentDeltaConnection extends EventEmitterWithErrorHandling<IDocumentDeltaConnectionEvents> implements IDocumentDeltaConnection, IDisposable {
|
|
23
|
-
protected readonly socket: Socket;
|
|
24
|
-
documentId: string;
|
|
25
|
-
private readonly enableLongPollingDowngrades;
|
|
26
|
-
protected readonly connectionId?: string | undefined;
|
|
27
|
-
static readonly eventsToForward: string[];
|
|
28
|
-
static readonly eventsAlwaysForwarded: string[];
|
|
29
|
-
/**
|
|
30
|
-
* Last known sequence number to ordering service at the time of connection
|
|
31
|
-
* It may lap actual last sequence number (quite a bit, if container is very active).
|
|
32
|
-
* But it's best information for client to figure out how far it is behind, at least
|
|
33
|
-
* for "read" connections. "write" connections may use own "join" op to similar information,
|
|
34
|
-
* that is likely to be more up-to-date.
|
|
35
|
-
*/
|
|
36
|
-
checkpointSequenceNumber: number | undefined;
|
|
37
|
-
protected readonly queuedMessages: ISequencedDocumentMessage[];
|
|
38
|
-
protected readonly queuedSignals: ISignalMessage[];
|
|
39
|
-
/**
|
|
40
|
-
* A flag to indicate whether we have our handler attached. If it's attached, we're queueing incoming ops
|
|
41
|
-
* to later be retrieved via initialMessages.
|
|
42
|
-
*/
|
|
43
|
-
private earlyOpHandlerAttached;
|
|
44
|
-
private socketConnectionTimeout;
|
|
45
|
-
private _details;
|
|
46
|
-
private trackLatencyTimeout;
|
|
47
|
-
private readonly connectionListeners;
|
|
48
|
-
private readonly trackedListeners;
|
|
49
|
-
protected get hasDetails(): boolean;
|
|
50
|
-
get disposed(): boolean;
|
|
51
|
-
/**
|
|
52
|
-
* Flag to indicate whether the DocumentDeltaConnection is expected to still be capable of sending messages.
|
|
53
|
-
* After disconnection, we flip this to prevent any stale messages from being emitted.
|
|
54
|
-
*/
|
|
55
|
-
protected _disposed: boolean;
|
|
56
|
-
private readonly mc;
|
|
57
|
-
/**
|
|
58
|
-
* @deprecated Implementors should manage their own logger or monitoring context
|
|
59
|
-
*/
|
|
60
|
-
protected get logger(): ITelemetryLoggerExt;
|
|
61
|
-
get details(): IConnected;
|
|
62
|
-
/**
|
|
63
|
-
* @param socket - websocket to be used
|
|
64
|
-
* @param documentId - ID of the document
|
|
65
|
-
* @param logger - for reporting telemetry events
|
|
66
|
-
* @param enableLongPollingDowngrades - allow connection to be downgraded to long-polling on websocket failure
|
|
67
|
-
*/
|
|
68
|
-
protected constructor(socket: Socket, documentId: string, logger: ITelemetryLoggerExt, enableLongPollingDowngrades?: boolean, connectionId?: string | undefined);
|
|
69
|
-
/**
|
|
70
|
-
* Get the ID of the client who is sending the message
|
|
71
|
-
*
|
|
72
|
-
* @returns the client ID
|
|
73
|
-
*/
|
|
74
|
-
get clientId(): string;
|
|
75
|
-
/**
|
|
76
|
-
* Get the mode of the client
|
|
77
|
-
*
|
|
78
|
-
* @returns the client mode
|
|
79
|
-
*/
|
|
80
|
-
get mode(): ConnectionMode;
|
|
81
|
-
/**
|
|
82
|
-
* Get the claims of the client who is sending the message
|
|
83
|
-
*
|
|
84
|
-
* @returns client claims
|
|
85
|
-
*/
|
|
86
|
-
get claims(): ITokenClaims;
|
|
87
|
-
/**
|
|
88
|
-
* Get whether or not this is an existing document
|
|
89
|
-
*
|
|
90
|
-
* @returns true if the document exists
|
|
91
|
-
*/
|
|
92
|
-
get existing(): boolean;
|
|
93
|
-
/**
|
|
94
|
-
* Get the maximum size of a message before chunking is required
|
|
95
|
-
*
|
|
96
|
-
* @returns the maximum size of a message before chunking is required
|
|
97
|
-
*/
|
|
98
|
-
get maxMessageSize(): number;
|
|
99
|
-
/**
|
|
100
|
-
* Semver of protocol being used with the service
|
|
101
|
-
*/
|
|
102
|
-
get version(): string;
|
|
103
|
-
/**
|
|
104
|
-
* Configuration details provided by the service
|
|
105
|
-
*/
|
|
106
|
-
get serviceConfiguration(): IClientConfiguration;
|
|
107
|
-
private checkNotDisposed;
|
|
108
|
-
/**
|
|
109
|
-
* Get messages sent during the connection
|
|
110
|
-
*
|
|
111
|
-
* @returns messages sent during the connection
|
|
112
|
-
*/
|
|
113
|
-
get initialMessages(): ISequencedDocumentMessage[];
|
|
114
|
-
/**
|
|
115
|
-
* Get signals sent during the connection
|
|
116
|
-
*
|
|
117
|
-
* @returns signals sent during the connection
|
|
118
|
-
*/
|
|
119
|
-
get initialSignals(): ISignalMessage[];
|
|
120
|
-
/**
|
|
121
|
-
* Get initial client list
|
|
122
|
-
*
|
|
123
|
-
* @returns initial client list sent during the connection
|
|
124
|
-
*/
|
|
125
|
-
get initialClients(): ISignalClient[];
|
|
126
|
-
protected emitMessages(type: string, messages: IDocumentMessage[][]): void;
|
|
127
|
-
/**
|
|
128
|
-
* Submits a new delta operation to the server
|
|
129
|
-
*
|
|
130
|
-
* @param message - delta operation to submit
|
|
131
|
-
*/
|
|
132
|
-
submit(messages: IDocumentMessage[]): void;
|
|
133
|
-
/**
|
|
134
|
-
* Submits a new signal to the server
|
|
135
|
-
*
|
|
136
|
-
* @param content - Content of the signal.
|
|
137
|
-
* @param targetClientId - When specified, the signal is only sent to the provided client id.
|
|
138
|
-
*/
|
|
139
|
-
submitSignal(content: IDocumentMessage, targetClientId?: string): void;
|
|
140
|
-
/**
|
|
141
|
-
* Disconnect from the websocket and close the websocket too.
|
|
142
|
-
*/
|
|
143
|
-
private closeSocket;
|
|
144
|
-
protected closeSocketCore(error: IAnyDriverError): void;
|
|
145
|
-
/**
|
|
146
|
-
* Disconnect from the websocket, and permanently disable this DocumentDeltaConnection and close the socket.
|
|
147
|
-
* However the OdspDocumentDeltaConnection differ in dispose as in there we don't close the socket. There is no
|
|
148
|
-
* multiplexing here, so we need to close the socket here.
|
|
149
|
-
*/
|
|
150
|
-
dispose(): void;
|
|
151
|
-
protected disconnect(err: IAnyDriverError): void;
|
|
152
|
-
/**
|
|
153
|
-
* Disconnect from the websocket.
|
|
154
|
-
* @param reason - reason for disconnect
|
|
155
|
-
*/
|
|
156
|
-
protected disconnectCore(): void;
|
|
157
|
-
protected initialize(connectMessage: IConnect, timeout: number): Promise<void>;
|
|
158
|
-
private addPropsToError;
|
|
159
|
-
protected getConnectionDetailsProps(): {
|
|
160
|
-
disposed: boolean;
|
|
161
|
-
socketConnected: boolean;
|
|
162
|
-
clientId: string | undefined;
|
|
163
|
-
connectionId: string | undefined;
|
|
164
|
-
};
|
|
165
|
-
protected earlyOpHandler: (documentId: string, msgs: ISequencedDocumentMessage[]) => void;
|
|
166
|
-
protected earlySignalHandler: (msg: ISignalMessage | ISignalMessage[]) => void;
|
|
167
|
-
private removeEarlyOpHandler;
|
|
168
|
-
private removeEarlySignalHandler;
|
|
169
|
-
private addConnectionListener;
|
|
170
|
-
protected addTrackedListener(event: string, listener: (...args: any[]) => void): void;
|
|
171
|
-
private removeTrackedListeners;
|
|
172
|
-
private removeConnectionListeners;
|
|
173
|
-
private getErrorMessage;
|
|
174
|
-
private createErrorObjectWithProps;
|
|
175
|
-
/**
|
|
176
|
-
* Error raising for socket.io issues
|
|
177
|
-
*/
|
|
178
|
-
protected createErrorObject(handler: string, error?: any, canRetry?: boolean): IAnyDriverError;
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
/**
|
|
182
|
-
* Extract and return the w3c data.
|
|
183
|
-
* @param url - request url for which w3c data needs to be reported.
|
|
184
|
-
* @param initiatorType - type of the network call
|
|
185
|
-
* @internal
|
|
186
|
-
*/
|
|
187
|
-
export declare function getW3CData(url: string, initiatorType: string): {
|
|
188
|
-
dnsLookupTime: number | undefined;
|
|
189
|
-
w3cStartTime: number | undefined;
|
|
190
|
-
redirectTime: number | undefined;
|
|
191
|
-
tcpHandshakeTime: number | undefined;
|
|
192
|
-
secureConnectionTime: number | undefined;
|
|
193
|
-
responseNetworkTime: number | undefined;
|
|
194
|
-
fetchStartToResponseEndTime: number | undefined;
|
|
195
|
-
reqStartToResponseEndTime: number | undefined;
|
|
196
|
-
};
|
|
197
|
-
|
|
198
|
-
/**
|
|
199
|
-
* An implementation of Promise.race that gives you the winner of the promise race.
|
|
200
|
-
* If one of the promises is rejected before any other is resolved, this method will return the error/reason from that rejection.
|
|
201
|
-
* @internal
|
|
202
|
-
*/
|
|
203
|
-
export declare function promiseRaceWithWinner<T>(promises: Promise<T>[]): Promise<{
|
|
204
|
-
index: number;
|
|
205
|
-
value: T;
|
|
206
|
-
}>;
|
|
207
|
-
|
|
208
|
-
/**
|
|
209
|
-
* @internal
|
|
210
|
-
*/
|
|
211
|
-
export declare function validateMessages(reason: string, messages: ISequencedDocumentMessage[], from: number, logger: ITelemetryLoggerExt, strict?: boolean): void;
|
|
212
|
-
|
|
213
|
-
export { }
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { ConnectionMode } from '@fluidframework/protocol-definitions';
|
|
2
|
-
import { EventEmitterWithErrorHandling } from '@fluidframework/telemetry-utils';
|
|
3
|
-
import { IAnyDriverError } from '@fluidframework/driver-definitions';
|
|
4
|
-
import { IClientConfiguration } from '@fluidframework/protocol-definitions';
|
|
5
|
-
import { IConnect } from '@fluidframework/protocol-definitions';
|
|
6
|
-
import { IConnected } from '@fluidframework/protocol-definitions';
|
|
7
|
-
import { IDisposable } from '@fluidframework/core-interfaces';
|
|
8
|
-
import { IDocumentDeltaConnection } from '@fluidframework/driver-definitions';
|
|
9
|
-
import { IDocumentDeltaConnectionEvents } from '@fluidframework/driver-definitions';
|
|
10
|
-
import { IDocumentMessage } from '@fluidframework/protocol-definitions';
|
|
11
|
-
import { ISequencedDocumentMessage } from '@fluidframework/protocol-definitions';
|
|
12
|
-
import { ISignalClient } from '@fluidframework/protocol-definitions';
|
|
13
|
-
import { ISignalMessage } from '@fluidframework/protocol-definitions';
|
|
14
|
-
import { ITelemetryLoggerExt } from '@fluidframework/telemetry-utils';
|
|
15
|
-
import { ITokenClaims } from '@fluidframework/protocol-definitions';
|
|
16
|
-
import type { Socket } from 'socket.io-client';
|
|
17
|
-
|
|
18
|
-
/* Excluded from this release type: DocumentDeltaConnection */
|
|
19
|
-
|
|
20
|
-
/* Excluded from this release type: getW3CData */
|
|
21
|
-
|
|
22
|
-
/* Excluded from this release type: promiseRaceWithWinner */
|
|
23
|
-
|
|
24
|
-
/* Excluded from this release type: validateMessages */
|
|
25
|
-
|
|
26
|
-
export { }
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { ConnectionMode } from '@fluidframework/protocol-definitions';
|
|
2
|
-
import { EventEmitterWithErrorHandling } from '@fluidframework/telemetry-utils';
|
|
3
|
-
import { IAnyDriverError } from '@fluidframework/driver-definitions';
|
|
4
|
-
import { IClientConfiguration } from '@fluidframework/protocol-definitions';
|
|
5
|
-
import { IConnect } from '@fluidframework/protocol-definitions';
|
|
6
|
-
import { IConnected } from '@fluidframework/protocol-definitions';
|
|
7
|
-
import { IDisposable } from '@fluidframework/core-interfaces';
|
|
8
|
-
import { IDocumentDeltaConnection } from '@fluidframework/driver-definitions';
|
|
9
|
-
import { IDocumentDeltaConnectionEvents } from '@fluidframework/driver-definitions';
|
|
10
|
-
import { IDocumentMessage } from '@fluidframework/protocol-definitions';
|
|
11
|
-
import { ISequencedDocumentMessage } from '@fluidframework/protocol-definitions';
|
|
12
|
-
import { ISignalClient } from '@fluidframework/protocol-definitions';
|
|
13
|
-
import { ISignalMessage } from '@fluidframework/protocol-definitions';
|
|
14
|
-
import { ITelemetryLoggerExt } from '@fluidframework/telemetry-utils';
|
|
15
|
-
import { ITokenClaims } from '@fluidframework/protocol-definitions';
|
|
16
|
-
import type { Socket } from 'socket.io-client';
|
|
17
|
-
|
|
18
|
-
/* Excluded from this release type: DocumentDeltaConnection */
|
|
19
|
-
|
|
20
|
-
/* Excluded from this release type: EventEmitterWithErrorHandling */
|
|
21
|
-
|
|
22
|
-
/* Excluded from this release type: getW3CData */
|
|
23
|
-
|
|
24
|
-
/* Excluded from this release type: IDocumentDeltaConnection */
|
|
25
|
-
|
|
26
|
-
/* Excluded from this release type: IDocumentDeltaConnectionEvents */
|
|
27
|
-
|
|
28
|
-
/* Excluded from this release type: promiseRaceWithWinner */
|
|
29
|
-
|
|
30
|
-
/* Excluded from this release type: validateMessages */
|
|
31
|
-
|
|
32
|
-
export { }
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { ConnectionMode } from '@fluidframework/protocol-definitions';
|
|
2
|
-
import { EventEmitterWithErrorHandling } from '@fluidframework/telemetry-utils';
|
|
3
|
-
import { IAnyDriverError } from '@fluidframework/driver-definitions';
|
|
4
|
-
import { IClientConfiguration } from '@fluidframework/protocol-definitions';
|
|
5
|
-
import { IConnect } from '@fluidframework/protocol-definitions';
|
|
6
|
-
import { IConnected } from '@fluidframework/protocol-definitions';
|
|
7
|
-
import { IDisposable } from '@fluidframework/core-interfaces';
|
|
8
|
-
import { IDocumentDeltaConnection } from '@fluidframework/driver-definitions';
|
|
9
|
-
import { IDocumentDeltaConnectionEvents } from '@fluidframework/driver-definitions';
|
|
10
|
-
import { IDocumentMessage } from '@fluidframework/protocol-definitions';
|
|
11
|
-
import { ISequencedDocumentMessage } from '@fluidframework/protocol-definitions';
|
|
12
|
-
import { ISignalClient } from '@fluidframework/protocol-definitions';
|
|
13
|
-
import { ISignalMessage } from '@fluidframework/protocol-definitions';
|
|
14
|
-
import { ITelemetryLoggerExt } from '@fluidframework/telemetry-utils';
|
|
15
|
-
import { ITokenClaims } from '@fluidframework/protocol-definitions';
|
|
16
|
-
import type { Socket } from 'socket.io-client';
|
|
17
|
-
|
|
18
|
-
/* Excluded from this release type: DocumentDeltaConnection */
|
|
19
|
-
|
|
20
|
-
/* Excluded from this release type: EventEmitterWithErrorHandling */
|
|
21
|
-
|
|
22
|
-
/* Excluded from this release type: getW3CData */
|
|
23
|
-
|
|
24
|
-
/* Excluded from this release type: IDocumentDeltaConnection */
|
|
25
|
-
|
|
26
|
-
/* Excluded from this release type: IDocumentDeltaConnectionEvents */
|
|
27
|
-
|
|
28
|
-
/* Excluded from this release type: promiseRaceWithWinner */
|
|
29
|
-
|
|
30
|
-
/* Excluded from this release type: validateMessages */
|
|
31
|
-
|
|
32
|
-
export { }
|
|
@@ -1,213 +0,0 @@
|
|
|
1
|
-
import { ConnectionMode } from '@fluidframework/protocol-definitions';
|
|
2
|
-
import { EventEmitterWithErrorHandling } from '@fluidframework/telemetry-utils';
|
|
3
|
-
import { IAnyDriverError } from '@fluidframework/driver-definitions';
|
|
4
|
-
import { IClientConfiguration } from '@fluidframework/protocol-definitions';
|
|
5
|
-
import { IConnect } from '@fluidframework/protocol-definitions';
|
|
6
|
-
import { IConnected } from '@fluidframework/protocol-definitions';
|
|
7
|
-
import { IDisposable } from '@fluidframework/core-interfaces';
|
|
8
|
-
import { IDocumentDeltaConnection } from '@fluidframework/driver-definitions';
|
|
9
|
-
import { IDocumentDeltaConnectionEvents } from '@fluidframework/driver-definitions';
|
|
10
|
-
import { IDocumentMessage } from '@fluidframework/protocol-definitions';
|
|
11
|
-
import { ISequencedDocumentMessage } from '@fluidframework/protocol-definitions';
|
|
12
|
-
import { ISignalClient } from '@fluidframework/protocol-definitions';
|
|
13
|
-
import { ISignalMessage } from '@fluidframework/protocol-definitions';
|
|
14
|
-
import { ITelemetryLoggerExt } from '@fluidframework/telemetry-utils';
|
|
15
|
-
import { ITokenClaims } from '@fluidframework/protocol-definitions';
|
|
16
|
-
import type { Socket } from 'socket.io-client';
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Represents a connection to a stream of delta updates.
|
|
20
|
-
* @internal
|
|
21
|
-
*/
|
|
22
|
-
export declare class DocumentDeltaConnection extends EventEmitterWithErrorHandling<IDocumentDeltaConnectionEvents> implements IDocumentDeltaConnection, IDisposable {
|
|
23
|
-
protected readonly socket: Socket;
|
|
24
|
-
documentId: string;
|
|
25
|
-
private readonly enableLongPollingDowngrades;
|
|
26
|
-
protected readonly connectionId?: string | undefined;
|
|
27
|
-
static readonly eventsToForward: string[];
|
|
28
|
-
static readonly eventsAlwaysForwarded: string[];
|
|
29
|
-
/**
|
|
30
|
-
* Last known sequence number to ordering service at the time of connection
|
|
31
|
-
* It may lap actual last sequence number (quite a bit, if container is very active).
|
|
32
|
-
* But it's best information for client to figure out how far it is behind, at least
|
|
33
|
-
* for "read" connections. "write" connections may use own "join" op to similar information,
|
|
34
|
-
* that is likely to be more up-to-date.
|
|
35
|
-
*/
|
|
36
|
-
checkpointSequenceNumber: number | undefined;
|
|
37
|
-
protected readonly queuedMessages: ISequencedDocumentMessage[];
|
|
38
|
-
protected readonly queuedSignals: ISignalMessage[];
|
|
39
|
-
/**
|
|
40
|
-
* A flag to indicate whether we have our handler attached. If it's attached, we're queueing incoming ops
|
|
41
|
-
* to later be retrieved via initialMessages.
|
|
42
|
-
*/
|
|
43
|
-
private earlyOpHandlerAttached;
|
|
44
|
-
private socketConnectionTimeout;
|
|
45
|
-
private _details;
|
|
46
|
-
private trackLatencyTimeout;
|
|
47
|
-
private readonly connectionListeners;
|
|
48
|
-
private readonly trackedListeners;
|
|
49
|
-
protected get hasDetails(): boolean;
|
|
50
|
-
get disposed(): boolean;
|
|
51
|
-
/**
|
|
52
|
-
* Flag to indicate whether the DocumentDeltaConnection is expected to still be capable of sending messages.
|
|
53
|
-
* After disconnection, we flip this to prevent any stale messages from being emitted.
|
|
54
|
-
*/
|
|
55
|
-
protected _disposed: boolean;
|
|
56
|
-
private readonly mc;
|
|
57
|
-
/**
|
|
58
|
-
* @deprecated Implementors should manage their own logger or monitoring context
|
|
59
|
-
*/
|
|
60
|
-
protected get logger(): ITelemetryLoggerExt;
|
|
61
|
-
get details(): IConnected;
|
|
62
|
-
/**
|
|
63
|
-
* @param socket - websocket to be used
|
|
64
|
-
* @param documentId - ID of the document
|
|
65
|
-
* @param logger - for reporting telemetry events
|
|
66
|
-
* @param enableLongPollingDowngrades - allow connection to be downgraded to long-polling on websocket failure
|
|
67
|
-
*/
|
|
68
|
-
protected constructor(socket: Socket, documentId: string, logger: ITelemetryLoggerExt, enableLongPollingDowngrades?: boolean, connectionId?: string | undefined);
|
|
69
|
-
/**
|
|
70
|
-
* Get the ID of the client who is sending the message
|
|
71
|
-
*
|
|
72
|
-
* @returns the client ID
|
|
73
|
-
*/
|
|
74
|
-
get clientId(): string;
|
|
75
|
-
/**
|
|
76
|
-
* Get the mode of the client
|
|
77
|
-
*
|
|
78
|
-
* @returns the client mode
|
|
79
|
-
*/
|
|
80
|
-
get mode(): ConnectionMode;
|
|
81
|
-
/**
|
|
82
|
-
* Get the claims of the client who is sending the message
|
|
83
|
-
*
|
|
84
|
-
* @returns client claims
|
|
85
|
-
*/
|
|
86
|
-
get claims(): ITokenClaims;
|
|
87
|
-
/**
|
|
88
|
-
* Get whether or not this is an existing document
|
|
89
|
-
*
|
|
90
|
-
* @returns true if the document exists
|
|
91
|
-
*/
|
|
92
|
-
get existing(): boolean;
|
|
93
|
-
/**
|
|
94
|
-
* Get the maximum size of a message before chunking is required
|
|
95
|
-
*
|
|
96
|
-
* @returns the maximum size of a message before chunking is required
|
|
97
|
-
*/
|
|
98
|
-
get maxMessageSize(): number;
|
|
99
|
-
/**
|
|
100
|
-
* Semver of protocol being used with the service
|
|
101
|
-
*/
|
|
102
|
-
get version(): string;
|
|
103
|
-
/**
|
|
104
|
-
* Configuration details provided by the service
|
|
105
|
-
*/
|
|
106
|
-
get serviceConfiguration(): IClientConfiguration;
|
|
107
|
-
private checkNotDisposed;
|
|
108
|
-
/**
|
|
109
|
-
* Get messages sent during the connection
|
|
110
|
-
*
|
|
111
|
-
* @returns messages sent during the connection
|
|
112
|
-
*/
|
|
113
|
-
get initialMessages(): ISequencedDocumentMessage[];
|
|
114
|
-
/**
|
|
115
|
-
* Get signals sent during the connection
|
|
116
|
-
*
|
|
117
|
-
* @returns signals sent during the connection
|
|
118
|
-
*/
|
|
119
|
-
get initialSignals(): ISignalMessage[];
|
|
120
|
-
/**
|
|
121
|
-
* Get initial client list
|
|
122
|
-
*
|
|
123
|
-
* @returns initial client list sent during the connection
|
|
124
|
-
*/
|
|
125
|
-
get initialClients(): ISignalClient[];
|
|
126
|
-
protected emitMessages(type: string, messages: IDocumentMessage[][]): void;
|
|
127
|
-
/**
|
|
128
|
-
* Submits a new delta operation to the server
|
|
129
|
-
*
|
|
130
|
-
* @param message - delta operation to submit
|
|
131
|
-
*/
|
|
132
|
-
submit(messages: IDocumentMessage[]): void;
|
|
133
|
-
/**
|
|
134
|
-
* Submits a new signal to the server
|
|
135
|
-
*
|
|
136
|
-
* @param content - Content of the signal.
|
|
137
|
-
* @param targetClientId - When specified, the signal is only sent to the provided client id.
|
|
138
|
-
*/
|
|
139
|
-
submitSignal(content: IDocumentMessage, targetClientId?: string): void;
|
|
140
|
-
/**
|
|
141
|
-
* Disconnect from the websocket and close the websocket too.
|
|
142
|
-
*/
|
|
143
|
-
private closeSocket;
|
|
144
|
-
protected closeSocketCore(error: IAnyDriverError): void;
|
|
145
|
-
/**
|
|
146
|
-
* Disconnect from the websocket, and permanently disable this DocumentDeltaConnection and close the socket.
|
|
147
|
-
* However the OdspDocumentDeltaConnection differ in dispose as in there we don't close the socket. There is no
|
|
148
|
-
* multiplexing here, so we need to close the socket here.
|
|
149
|
-
*/
|
|
150
|
-
dispose(): void;
|
|
151
|
-
protected disconnect(err: IAnyDriverError): void;
|
|
152
|
-
/**
|
|
153
|
-
* Disconnect from the websocket.
|
|
154
|
-
* @param reason - reason for disconnect
|
|
155
|
-
*/
|
|
156
|
-
protected disconnectCore(): void;
|
|
157
|
-
protected initialize(connectMessage: IConnect, timeout: number): Promise<void>;
|
|
158
|
-
private addPropsToError;
|
|
159
|
-
protected getConnectionDetailsProps(): {
|
|
160
|
-
disposed: boolean;
|
|
161
|
-
socketConnected: boolean;
|
|
162
|
-
clientId: string | undefined;
|
|
163
|
-
connectionId: string | undefined;
|
|
164
|
-
};
|
|
165
|
-
protected earlyOpHandler: (documentId: string, msgs: ISequencedDocumentMessage[]) => void;
|
|
166
|
-
protected earlySignalHandler: (msg: ISignalMessage | ISignalMessage[]) => void;
|
|
167
|
-
private removeEarlyOpHandler;
|
|
168
|
-
private removeEarlySignalHandler;
|
|
169
|
-
private addConnectionListener;
|
|
170
|
-
protected addTrackedListener(event: string, listener: (...args: any[]) => void): void;
|
|
171
|
-
private removeTrackedListeners;
|
|
172
|
-
private removeConnectionListeners;
|
|
173
|
-
private getErrorMessage;
|
|
174
|
-
private createErrorObjectWithProps;
|
|
175
|
-
/**
|
|
176
|
-
* Error raising for socket.io issues
|
|
177
|
-
*/
|
|
178
|
-
protected createErrorObject(handler: string, error?: any, canRetry?: boolean): IAnyDriverError;
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
/**
|
|
182
|
-
* Extract and return the w3c data.
|
|
183
|
-
* @param url - request url for which w3c data needs to be reported.
|
|
184
|
-
* @param initiatorType - type of the network call
|
|
185
|
-
* @internal
|
|
186
|
-
*/
|
|
187
|
-
export declare function getW3CData(url: string, initiatorType: string): {
|
|
188
|
-
dnsLookupTime: number | undefined;
|
|
189
|
-
w3cStartTime: number | undefined;
|
|
190
|
-
redirectTime: number | undefined;
|
|
191
|
-
tcpHandshakeTime: number | undefined;
|
|
192
|
-
secureConnectionTime: number | undefined;
|
|
193
|
-
responseNetworkTime: number | undefined;
|
|
194
|
-
fetchStartToResponseEndTime: number | undefined;
|
|
195
|
-
reqStartToResponseEndTime: number | undefined;
|
|
196
|
-
};
|
|
197
|
-
|
|
198
|
-
/**
|
|
199
|
-
* An implementation of Promise.race that gives you the winner of the promise race.
|
|
200
|
-
* If one of the promises is rejected before any other is resolved, this method will return the error/reason from that rejection.
|
|
201
|
-
* @internal
|
|
202
|
-
*/
|
|
203
|
-
export declare function promiseRaceWithWinner<T>(promises: Promise<T>[]): Promise<{
|
|
204
|
-
index: number;
|
|
205
|
-
value: T;
|
|
206
|
-
}>;
|
|
207
|
-
|
|
208
|
-
/**
|
|
209
|
-
* @internal
|
|
210
|
-
*/
|
|
211
|
-
export declare function validateMessages(reason: string, messages: ISequencedDocumentMessage[], from: number, logger: ITelemetryLoggerExt, strict?: boolean): void;
|
|
212
|
-
|
|
213
|
-
export { }
|
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License.
|
|
4
|
-
*/
|
|
5
|
-
import { assert } from "@fluidframework/core-utils";
|
|
6
|
-
import { MockLogger } from "@fluidframework/telemetry-utils";
|
|
7
|
-
import { validateMessages } from "../driverUtils.js";
|
|
8
|
-
describe("driver utils tests", () => {
|
|
9
|
-
describe("validateMessagesTests", () => {
|
|
10
|
-
const mockLogger = new MockLogger();
|
|
11
|
-
const generateOps = (start, count) => {
|
|
12
|
-
const ops = [];
|
|
13
|
-
let i = 0;
|
|
14
|
-
while (i < count) {
|
|
15
|
-
ops.push({ sequenceNumber: start + i });
|
|
16
|
-
i++;
|
|
17
|
-
}
|
|
18
|
-
return ops;
|
|
19
|
-
};
|
|
20
|
-
beforeEach(() => {
|
|
21
|
-
mockLogger.clear();
|
|
22
|
-
});
|
|
23
|
-
it("from not equal to start", () => {
|
|
24
|
-
const ops = generateOps(1, 5);
|
|
25
|
-
validateMessages("test1", ops, 0, mockLogger.toTelemetryLogger(), true);
|
|
26
|
-
assert(ops.length === 0, "no ops should be returned");
|
|
27
|
-
assert(mockLogger.matchEventStrict([
|
|
28
|
-
{
|
|
29
|
-
eventName: "OpsFetchViolation",
|
|
30
|
-
reason: "test1",
|
|
31
|
-
from: 0,
|
|
32
|
-
start: 1,
|
|
33
|
-
last: 5,
|
|
34
|
-
length: 5,
|
|
35
|
-
details: JSON.stringify({
|
|
36
|
-
validLength: 0,
|
|
37
|
-
lastValidOpSeqNumber: undefined,
|
|
38
|
-
strict: true,
|
|
39
|
-
}),
|
|
40
|
-
},
|
|
41
|
-
]), "Ops fetch violation event not correctly recorded");
|
|
42
|
-
});
|
|
43
|
-
it("contiguous ops", () => {
|
|
44
|
-
const ops = generateOps(1, 5);
|
|
45
|
-
validateMessages("test2", ops, 1, mockLogger.toTelemetryLogger(), true);
|
|
46
|
-
assert(ops.length === 5, "ops should be returned");
|
|
47
|
-
assert(mockLogger.events.length === 0, "no events should be there");
|
|
48
|
-
});
|
|
49
|
-
it("non contiguous ops: strict = true", () => {
|
|
50
|
-
const ops = generateOps(1, 5);
|
|
51
|
-
// Change seq number of last op
|
|
52
|
-
ops[4].sequenceNumber = 7;
|
|
53
|
-
validateMessages("test", ops, 1, mockLogger.toTelemetryLogger(), true);
|
|
54
|
-
assert(ops.length === 0, "no ops should be returned as strict == true");
|
|
55
|
-
assert(mockLogger.matchEventStrict([
|
|
56
|
-
{
|
|
57
|
-
eventName: "OpsFetchViolation",
|
|
58
|
-
reason: "test",
|
|
59
|
-
from: 1,
|
|
60
|
-
start: 1,
|
|
61
|
-
last: 7,
|
|
62
|
-
length: 5,
|
|
63
|
-
details: JSON.stringify({
|
|
64
|
-
validLength: 0,
|
|
65
|
-
lastValidOpSeqNumber: undefined,
|
|
66
|
-
strict: true,
|
|
67
|
-
}),
|
|
68
|
-
},
|
|
69
|
-
]), "Ops fetch violation event not correctly recorded");
|
|
70
|
-
});
|
|
71
|
-
it("non contiguous ops: strict = false", () => {
|
|
72
|
-
const ops = generateOps(1, 5);
|
|
73
|
-
// Change seq number of last op
|
|
74
|
-
ops[4].sequenceNumber = 7;
|
|
75
|
-
validateMessages("test", ops, 1, mockLogger.toTelemetryLogger(), false);
|
|
76
|
-
assert(ops.length === 4, "some should be returned as strict == false");
|
|
77
|
-
assert(mockLogger.matchEventStrict([
|
|
78
|
-
{
|
|
79
|
-
eventName: "OpsFetchViolation",
|
|
80
|
-
reason: "test",
|
|
81
|
-
from: 1,
|
|
82
|
-
start: 1,
|
|
83
|
-
last: 7,
|
|
84
|
-
length: 5,
|
|
85
|
-
details: JSON.stringify({
|
|
86
|
-
validLength: 4,
|
|
87
|
-
lastValidOpSeqNumber: 4,
|
|
88
|
-
strict: false,
|
|
89
|
-
}),
|
|
90
|
-
},
|
|
91
|
-
]), "Ops fetch violation event not correctly recorded");
|
|
92
|
-
});
|
|
93
|
-
it("only 1 op: strict = false", () => {
|
|
94
|
-
const ops = generateOps(1, 1);
|
|
95
|
-
validateMessages("test", ops, 1, mockLogger.toTelemetryLogger(), false);
|
|
96
|
-
assert(ops.length === 1, "some should be returned as strict == false");
|
|
97
|
-
assert(mockLogger.events.length === 0, "no events should be there");
|
|
98
|
-
});
|
|
99
|
-
});
|
|
100
|
-
});
|
|
101
|
-
//# sourceMappingURL=driverUtilsTests.spec.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"driverUtilsTests.spec.js","sourceRoot":"","sources":["../../src/test/driverUtilsTests.spec.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAE7D,OAAO,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":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/core-utils\";\nimport { MockLogger } from \"@fluidframework/telemetry-utils\";\nimport { ISequencedDocumentMessage } from \"@fluidframework/protocol-definitions\";\nimport { validateMessages } from \"../driverUtils.js\";\n\ndescribe(\"driver utils tests\", () => {\n\tdescribe(\"validateMessagesTests\", () => {\n\t\tconst mockLogger = new MockLogger();\n\t\tconst generateOps = (start: number, count: number) => {\n\t\t\tconst ops: ISequencedDocumentMessage[] = [];\n\t\t\tlet i = 0;\n\t\t\twhile (i < count) {\n\t\t\t\tops.push({ sequenceNumber: start + i } as any as ISequencedDocumentMessage);\n\t\t\t\ti++;\n\t\t\t}\n\t\t\treturn ops;\n\t\t};\n\n\t\tbeforeEach(() => {\n\t\t\tmockLogger.clear();\n\t\t});\n\n\t\tit(\"from not equal to start\", () => {\n\t\t\tconst ops = generateOps(1, 5);\n\t\t\tvalidateMessages(\"test1\", ops, 0, mockLogger.toTelemetryLogger(), true);\n\t\t\tassert(ops.length === 0, \"no ops should be returned\");\n\t\t\tassert(\n\t\t\t\tmockLogger.matchEventStrict([\n\t\t\t\t\t{\n\t\t\t\t\t\teventName: \"OpsFetchViolation\",\n\t\t\t\t\t\treason: \"test1\",\n\t\t\t\t\t\tfrom: 0,\n\t\t\t\t\t\tstart: 1,\n\t\t\t\t\t\tlast: 5,\n\t\t\t\t\t\tlength: 5,\n\t\t\t\t\t\tdetails: JSON.stringify({\n\t\t\t\t\t\t\tvalidLength: 0,\n\t\t\t\t\t\t\tlastValidOpSeqNumber: undefined,\n\t\t\t\t\t\t\tstrict: true,\n\t\t\t\t\t\t}),\n\t\t\t\t\t},\n\t\t\t\t]),\n\t\t\t\t\"Ops fetch violation event not correctly recorded\",\n\t\t\t);\n\t\t});\n\n\t\tit(\"contiguous ops\", () => {\n\t\t\tconst ops = generateOps(1, 5);\n\t\t\tvalidateMessages(\"test2\", ops, 1, mockLogger.toTelemetryLogger(), true);\n\t\t\tassert(ops.length === 5, \"ops should be returned\");\n\t\t\tassert(mockLogger.events.length === 0, \"no events should be there\");\n\t\t});\n\n\t\tit(\"non contiguous ops: strict = true\", () => {\n\t\t\tconst ops = generateOps(1, 5);\n\t\t\t// Change seq number of last op\n\t\t\tops[4].sequenceNumber = 7;\n\t\t\tvalidateMessages(\"test\", ops, 1, mockLogger.toTelemetryLogger(), true);\n\t\t\tassert(ops.length === 0, \"no ops should be returned as strict == true\");\n\t\t\tassert(\n\t\t\t\tmockLogger.matchEventStrict([\n\t\t\t\t\t{\n\t\t\t\t\t\teventName: \"OpsFetchViolation\",\n\t\t\t\t\t\treason: \"test\",\n\t\t\t\t\t\tfrom: 1,\n\t\t\t\t\t\tstart: 1,\n\t\t\t\t\t\tlast: 7,\n\t\t\t\t\t\tlength: 5,\n\t\t\t\t\t\tdetails: JSON.stringify({\n\t\t\t\t\t\t\tvalidLength: 0,\n\t\t\t\t\t\t\tlastValidOpSeqNumber: undefined,\n\t\t\t\t\t\t\tstrict: true,\n\t\t\t\t\t\t}),\n\t\t\t\t\t},\n\t\t\t\t]),\n\t\t\t\t\"Ops fetch violation event not correctly recorded\",\n\t\t\t);\n\t\t});\n\n\t\tit(\"non contiguous ops: strict = false\", () => {\n\t\t\tconst ops = generateOps(1, 5);\n\t\t\t// Change seq number of last op\n\t\t\tops[4].sequenceNumber = 7;\n\t\t\tvalidateMessages(\"test\", ops, 1, mockLogger.toTelemetryLogger(), false);\n\t\t\tassert(ops.length === 4, \"some should be returned as strict == false\");\n\t\t\tassert(\n\t\t\t\tmockLogger.matchEventStrict([\n\t\t\t\t\t{\n\t\t\t\t\t\teventName: \"OpsFetchViolation\",\n\t\t\t\t\t\treason: \"test\",\n\t\t\t\t\t\tfrom: 1,\n\t\t\t\t\t\tstart: 1,\n\t\t\t\t\t\tlast: 7,\n\t\t\t\t\t\tlength: 5,\n\t\t\t\t\t\tdetails: JSON.stringify({\n\t\t\t\t\t\t\tvalidLength: 4,\n\t\t\t\t\t\t\tlastValidOpSeqNumber: 4,\n\t\t\t\t\t\t\tstrict: false,\n\t\t\t\t\t\t}),\n\t\t\t\t\t},\n\t\t\t\t]),\n\t\t\t\t\"Ops fetch violation event not correctly recorded\",\n\t\t\t);\n\t\t});\n\n\t\tit(\"only 1 op: strict = false\", () => {\n\t\t\tconst ops = generateOps(1, 1);\n\t\t\tvalidateMessages(\"test\", ops, 1, mockLogger.toTelemetryLogger(), false);\n\t\t\tassert(ops.length === 1, \"some should be returned as strict == false\");\n\t\t\tassert(mockLogger.events.length === 0, \"no events should be there\");\n\t\t});\n\t});\n});\n"]}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
use_current_ClassDeclaration_DocumentDeltaConnection(get_old_ClassDeclaration_DocumentDeltaConnection());
|
|
2
|
-
use_old_ClassDeclaration_DocumentDeltaConnection(get_current_ClassDeclaration_DocumentDeltaConnection());
|
|
3
|
-
use_current_FunctionDeclaration_getW3CData(get_old_FunctionDeclaration_getW3CData());
|
|
4
|
-
use_old_FunctionDeclaration_getW3CData(get_current_FunctionDeclaration_getW3CData());
|
|
5
|
-
use_current_FunctionDeclaration_promiseRaceWithWinner(get_old_FunctionDeclaration_promiseRaceWithWinner());
|
|
6
|
-
use_old_FunctionDeclaration_promiseRaceWithWinner(get_current_FunctionDeclaration_promiseRaceWithWinner());
|
|
7
|
-
use_current_FunctionDeclaration_validateMessages(get_old_FunctionDeclaration_validateMessages());
|
|
8
|
-
use_old_FunctionDeclaration_validateMessages(get_current_FunctionDeclaration_validateMessages());
|
|
9
|
-
export {};
|
|
10
|
-
//# sourceMappingURL=validateDriverBasePrevious.generated.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"validateDriverBasePrevious.generated.js","sourceRoot":"","sources":["../../../src/test/types/validateDriverBasePrevious.generated.ts"],"names":[],"mappings":"AAgCA,oDAAoD,CAChD,gDAAgD,EAAE,CAAC,CAAC;AAWxD,gDAAgD,CAC5C,oDAAoD,EAAE,CAAC,CAAC;AAW5D,0CAA0C,CACtC,sCAAsC,EAAE,CAAC,CAAC;AAW9C,sCAAsC,CAClC,0CAA0C,EAAE,CAAC,CAAC;AAWlD,qDAAqD,CACjD,iDAAiD,EAAE,CAAC,CAAC;AAWzD,iDAAiD,CAC7C,qDAAqD,EAAE,CAAC,CAAC;AAW7D,gDAAgD,CAC5C,4CAA4C,EAAE,CAAC,CAAC;AAWpD,4CAA4C,CACxC,gDAAgD,EAAE,CAAC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n/*\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.\n * Generated by fluid-type-test-generator in @fluidframework/build-tools.\n */\nimport type * as old from \"@fluidframework/driver-base-previous\";\nimport type * as current from \"../../index.js\";\n\n\n// See 'build-tools/src/type-test-generator/compatibility.ts' for more information.\ntype TypeOnly<T> = T extends number\n\t? number\n\t: T extends string\n\t? string\n\t: T extends boolean | bigint | symbol\n\t? T\n\t: {\n\t\t\t[P in keyof T]: TypeOnly<T[P]>;\n\t };\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"ClassDeclaration_DocumentDeltaConnection\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_ClassDeclaration_DocumentDeltaConnection():\n TypeOnly<old.DocumentDeltaConnection>;\ndeclare function use_current_ClassDeclaration_DocumentDeltaConnection(\n use: TypeOnly<current.DocumentDeltaConnection>): void;\nuse_current_ClassDeclaration_DocumentDeltaConnection(\n get_old_ClassDeclaration_DocumentDeltaConnection());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"ClassDeclaration_DocumentDeltaConnection\": {\"backCompat\": false}\n*/\ndeclare function get_current_ClassDeclaration_DocumentDeltaConnection():\n TypeOnly<current.DocumentDeltaConnection>;\ndeclare function use_old_ClassDeclaration_DocumentDeltaConnection(\n use: TypeOnly<old.DocumentDeltaConnection>): void;\nuse_old_ClassDeclaration_DocumentDeltaConnection(\n get_current_ClassDeclaration_DocumentDeltaConnection());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"FunctionDeclaration_getW3CData\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_FunctionDeclaration_getW3CData():\n TypeOnly<typeof old.getW3CData>;\ndeclare function use_current_FunctionDeclaration_getW3CData(\n use: TypeOnly<typeof current.getW3CData>): void;\nuse_current_FunctionDeclaration_getW3CData(\n get_old_FunctionDeclaration_getW3CData());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"FunctionDeclaration_getW3CData\": {\"backCompat\": false}\n*/\ndeclare function get_current_FunctionDeclaration_getW3CData():\n TypeOnly<typeof current.getW3CData>;\ndeclare function use_old_FunctionDeclaration_getW3CData(\n use: TypeOnly<typeof old.getW3CData>): void;\nuse_old_FunctionDeclaration_getW3CData(\n get_current_FunctionDeclaration_getW3CData());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"FunctionDeclaration_promiseRaceWithWinner\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_FunctionDeclaration_promiseRaceWithWinner():\n TypeOnly<typeof old.promiseRaceWithWinner>;\ndeclare function use_current_FunctionDeclaration_promiseRaceWithWinner(\n use: TypeOnly<typeof current.promiseRaceWithWinner>): void;\nuse_current_FunctionDeclaration_promiseRaceWithWinner(\n get_old_FunctionDeclaration_promiseRaceWithWinner());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"FunctionDeclaration_promiseRaceWithWinner\": {\"backCompat\": false}\n*/\ndeclare function get_current_FunctionDeclaration_promiseRaceWithWinner():\n TypeOnly<typeof current.promiseRaceWithWinner>;\ndeclare function use_old_FunctionDeclaration_promiseRaceWithWinner(\n use: TypeOnly<typeof old.promiseRaceWithWinner>): void;\nuse_old_FunctionDeclaration_promiseRaceWithWinner(\n get_current_FunctionDeclaration_promiseRaceWithWinner());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"FunctionDeclaration_validateMessages\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_FunctionDeclaration_validateMessages():\n TypeOnly<typeof old.validateMessages>;\ndeclare function use_current_FunctionDeclaration_validateMessages(\n use: TypeOnly<typeof current.validateMessages>): void;\nuse_current_FunctionDeclaration_validateMessages(\n get_old_FunctionDeclaration_validateMessages());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"FunctionDeclaration_validateMessages\": {\"backCompat\": false}\n*/\ndeclare function get_current_FunctionDeclaration_validateMessages():\n TypeOnly<typeof current.validateMessages>;\ndeclare function use_old_FunctionDeclaration_validateMessages(\n use: TypeOnly<typeof old.validateMessages>): void;\nuse_old_FunctionDeclaration_validateMessages(\n get_current_FunctionDeclaration_validateMessages());\n"]}
|
|
File without changes
|