@medplum/mock 2.0.3 → 2.0.4

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.
@@ -1,9 +1,15 @@
1
1
  import { LoginState, MedplumClient, ProfileResource } from '@medplum/core';
2
+ import { FhirRouter, MemoryRepository } from '@medplum/fhir-router';
2
3
  import { Binary, UserConfiguration } from '@medplum/fhirtypes';
4
+ /** @ts-ignore */
5
+ import type { CustomTableLayout, TDocumentDefinitions, TFontDictionary } from 'pdfmake/interfaces';
3
6
  export interface MockClientOptions {
4
7
  readonly debug?: boolean;
5
8
  }
6
9
  export declare class MockClient extends MedplumClient {
10
+ readonly router: FhirRouter;
11
+ readonly repo: MemoryRepository;
12
+ readonly client: MockFetchClient;
7
13
  readonly debug: boolean;
8
14
  activeLoginOverride?: LoginState;
9
15
  constructor(clientOptions?: MockClientOptions);
@@ -14,3 +20,27 @@ export declare class MockClient extends MedplumClient {
14
20
  getActiveLogin(): LoginState | undefined;
15
21
  createBinary(data: string | File | Blob | Uint8Array, filename: string | undefined, contentType: string, onProgress?: (e: ProgressEvent) => void): Promise<Binary>;
16
22
  }
23
+ declare class MockFetchClient {
24
+ readonly debug: boolean;
25
+ readonly router: FhirRouter;
26
+ readonly repo: MemoryRepository;
27
+ initialized: boolean;
28
+ initPromise?: Promise<void>;
29
+ constructor(router: FhirRouter, repo: MemoryRepository, debug?: boolean);
30
+ mockFetch(url: string, options: any): Promise<any>;
31
+ mockCreatePdf(docDefinition: TDocumentDefinitions, tableLayouts?: {
32
+ [name: string]: CustomTableLayout;
33
+ }, fonts?: TFontDictionary | undefined): Promise<any>;
34
+ private mockHandler;
35
+ private mockAdminHandler;
36
+ private mockAuthHandler;
37
+ private mockChangePasswordHandler;
38
+ private mockLoginHandler;
39
+ private mockSetPasswordHandler;
40
+ private mockNewUserHandler;
41
+ private mockResetPasswordHandler;
42
+ private mockOAuthHandler;
43
+ private initMockRepo;
44
+ private mockFhirHandler;
45
+ }
46
+ export {};