@medplum/mock 3.2.5 → 3.2.6
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/cjs/index.cjs +4 -4
- package/dist/cjs/index.cjs.map +3 -3
- package/dist/cjs/index.d.ts +13 -1
- package/dist/esm/index.d.ts +13 -1
- package/dist/esm/index.mjs +4 -4
- package/dist/esm/index.mjs.map +3 -3
- package/package.json +5 -5
package/dist/cjs/index.d.ts
CHANGED
|
@@ -13,6 +13,7 @@ import { DiagnosticReport } from '@medplum/fhirtypes';
|
|
|
13
13
|
import { Encounter } from '@medplum/fhirtypes';
|
|
14
14
|
import { FhirRouter } from '@medplum/fhir-router';
|
|
15
15
|
import { Group } from '@medplum/fhirtypes';
|
|
16
|
+
import { IReconnectingWebSocket } from '@medplum/core';
|
|
16
17
|
import { LoginState } from '@medplum/core';
|
|
17
18
|
import { Media } from '@medplum/fhirtypes';
|
|
18
19
|
import { MedplumClient } from '@medplum/core';
|
|
@@ -42,8 +43,10 @@ import { SubscriptionManager } from '@medplum/core';
|
|
|
42
43
|
import { Task } from '@medplum/fhirtypes';
|
|
43
44
|
import type { TDocumentDefinitions } from 'pdfmake/interfaces';
|
|
44
45
|
import type { TFontDictionary } from 'pdfmake/interfaces';
|
|
46
|
+
import { TypedEventTarget } from '@medplum/core';
|
|
45
47
|
import { UserConfiguration } from '@medplum/fhirtypes';
|
|
46
48
|
import { ValueSet } from '@medplum/fhirtypes';
|
|
49
|
+
import { WebSocketEventMap as WebSocketEventMap_2 } from '@medplum/core';
|
|
47
50
|
|
|
48
51
|
export declare const BartSimpson: Patient;
|
|
49
52
|
|
|
@@ -271,6 +274,7 @@ export declare class MockClient extends MedplumClient {
|
|
|
271
274
|
pushToAgent(agent: Agent | Reference<Agent>, destination: Device | Reference<Device> | string, body: any, contentType?: string | undefined, _waitForResponse?: boolean | undefined, _options?: MedplumRequestOptions | undefined): Promise<any>;
|
|
272
275
|
setAgentAvailable(value: boolean): void;
|
|
273
276
|
getSubscriptionManager(): MockSubscriptionManager;
|
|
277
|
+
setSubscriptionManager(subManager: MockSubscriptionManager): void;
|
|
274
278
|
subscribeToCriteria(criteria: string, subscriptionProps?: Partial<Subscription>): SubscriptionEmitter;
|
|
275
279
|
unsubscribeFromCriteria(criteria: string, subscriptionProps?: Partial<Subscription>): void;
|
|
276
280
|
getMasterSubscriptionEmitter(): SubscriptionEmitter;
|
|
@@ -330,8 +334,15 @@ export declare type MockFetchOverrideOptions = {
|
|
|
330
334
|
repo: MemoryRepository;
|
|
331
335
|
};
|
|
332
336
|
|
|
337
|
+
export declare class MockReconnectingWebSocket extends TypedEventTarget<WebSocketEventMap_2> implements IReconnectingWebSocket {
|
|
338
|
+
readyState: WebSocket['OPEN'] | WebSocket['CLOSED'];
|
|
339
|
+
close(code?: number, reason?: string): void;
|
|
340
|
+
send(): void;
|
|
341
|
+
reconnect(_code?: number, _reason?: string): void;
|
|
342
|
+
}
|
|
343
|
+
|
|
333
344
|
export declare interface MockSubManagerOptions {
|
|
334
|
-
|
|
345
|
+
mockReconnectingWebSocket?: boolean;
|
|
335
346
|
}
|
|
336
347
|
|
|
337
348
|
export declare class MockSubscriptionManager extends SubscriptionManager {
|
|
@@ -344,6 +355,7 @@ export declare class MockSubscriptionManager extends SubscriptionManager {
|
|
|
344
355
|
addCriteria(criteria: string, subscriptionProps?: Partial<Subscription>): SubscriptionEmitter;
|
|
345
356
|
removeCriteria(criteria: string, subscriptionProps?: Partial<Subscription>): void;
|
|
346
357
|
closeWebSocket(): void;
|
|
358
|
+
openWebSocket(): void;
|
|
347
359
|
getCriteriaCount(): number;
|
|
348
360
|
getMasterEmitter(): SubscriptionEmitter;
|
|
349
361
|
emitEventForCriteria<K extends keyof SubscriptionEventMap = keyof SubscriptionEventMap>(criteria: string, event: SubscriptionEventMap[K], subscriptionProps?: Partial<Subscription>): void;
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -13,6 +13,7 @@ import { DiagnosticReport } from '@medplum/fhirtypes';
|
|
|
13
13
|
import { Encounter } from '@medplum/fhirtypes';
|
|
14
14
|
import { FhirRouter } from '@medplum/fhir-router';
|
|
15
15
|
import { Group } from '@medplum/fhirtypes';
|
|
16
|
+
import { IReconnectingWebSocket } from '@medplum/core';
|
|
16
17
|
import { LoginState } from '@medplum/core';
|
|
17
18
|
import { Media } from '@medplum/fhirtypes';
|
|
18
19
|
import { MedplumClient } from '@medplum/core';
|
|
@@ -42,8 +43,10 @@ import { SubscriptionManager } from '@medplum/core';
|
|
|
42
43
|
import { Task } from '@medplum/fhirtypes';
|
|
43
44
|
import type { TDocumentDefinitions } from 'pdfmake/interfaces';
|
|
44
45
|
import type { TFontDictionary } from 'pdfmake/interfaces';
|
|
46
|
+
import { TypedEventTarget } from '@medplum/core';
|
|
45
47
|
import { UserConfiguration } from '@medplum/fhirtypes';
|
|
46
48
|
import { ValueSet } from '@medplum/fhirtypes';
|
|
49
|
+
import { WebSocketEventMap as WebSocketEventMap_2 } from '@medplum/core';
|
|
47
50
|
|
|
48
51
|
export declare const BartSimpson: Patient;
|
|
49
52
|
|
|
@@ -271,6 +274,7 @@ export declare class MockClient extends MedplumClient {
|
|
|
271
274
|
pushToAgent(agent: Agent | Reference<Agent>, destination: Device | Reference<Device> | string, body: any, contentType?: string | undefined, _waitForResponse?: boolean | undefined, _options?: MedplumRequestOptions | undefined): Promise<any>;
|
|
272
275
|
setAgentAvailable(value: boolean): void;
|
|
273
276
|
getSubscriptionManager(): MockSubscriptionManager;
|
|
277
|
+
setSubscriptionManager(subManager: MockSubscriptionManager): void;
|
|
274
278
|
subscribeToCriteria(criteria: string, subscriptionProps?: Partial<Subscription>): SubscriptionEmitter;
|
|
275
279
|
unsubscribeFromCriteria(criteria: string, subscriptionProps?: Partial<Subscription>): void;
|
|
276
280
|
getMasterSubscriptionEmitter(): SubscriptionEmitter;
|
|
@@ -330,8 +334,15 @@ export declare type MockFetchOverrideOptions = {
|
|
|
330
334
|
repo: MemoryRepository;
|
|
331
335
|
};
|
|
332
336
|
|
|
337
|
+
export declare class MockReconnectingWebSocket extends TypedEventTarget<WebSocketEventMap_2> implements IReconnectingWebSocket {
|
|
338
|
+
readyState: WebSocket['OPEN'] | WebSocket['CLOSED'];
|
|
339
|
+
close(code?: number, reason?: string): void;
|
|
340
|
+
send(): void;
|
|
341
|
+
reconnect(_code?: number, _reason?: string): void;
|
|
342
|
+
}
|
|
343
|
+
|
|
333
344
|
export declare interface MockSubManagerOptions {
|
|
334
|
-
|
|
345
|
+
mockReconnectingWebSocket?: boolean;
|
|
335
346
|
}
|
|
336
347
|
|
|
337
348
|
export declare class MockSubscriptionManager extends SubscriptionManager {
|
|
@@ -344,6 +355,7 @@ export declare class MockSubscriptionManager extends SubscriptionManager {
|
|
|
344
355
|
addCriteria(criteria: string, subscriptionProps?: Partial<Subscription>): SubscriptionEmitter;
|
|
345
356
|
removeCriteria(criteria: string, subscriptionProps?: Partial<Subscription>): void;
|
|
346
357
|
closeWebSocket(): void;
|
|
358
|
+
openWebSocket(): void;
|
|
347
359
|
getCriteriaCount(): number;
|
|
348
360
|
getMasterEmitter(): SubscriptionEmitter;
|
|
349
361
|
emitEventForCriteria<K extends keyof SubscriptionEventMap = keyof SubscriptionEventMap>(criteria: string, event: SubscriptionEventMap[K], subscriptionProps?: Partial<Subscription>): void;
|