@medplum/mock 4.1.6 → 4.1.8

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.
@@ -335,7 +335,42 @@ export declare class MockClient extends MedplumClient {
335
335
  setProfile(profile: ProfileResource | undefined): void;
336
336
  getActiveLogin(): LoginState | undefined;
337
337
  getLogins(): LoginState[];
338
- createBinary(arg1: BinarySource | CreateBinaryOptions, arg2: string | undefined | MedplumRequestOptions, arg3?: string, arg4?: (e: ProgressEvent) => void): Promise<WithId<Binary>>;
338
+ /**
339
+ * Creates a FHIR `Binary` resource with the provided data content.
340
+ *
341
+ * The return value is the newly created resource, including the ID and meta.
342
+ *
343
+ * The `data` parameter can be a string or a `File` object.
344
+ *
345
+ * A `File` object often comes from a `<input type="file">` element.
346
+ *
347
+ * @example
348
+ * Example:
349
+ *
350
+ * ```typescript
351
+ * const result = await medplum.createBinary(myFile, 'test.jpg', 'image/jpeg');
352
+ * console.log(result.id);
353
+ * ```
354
+ *
355
+ * See the FHIR "create" operation for full details: https://www.hl7.org/fhir/http.html#create
356
+ *
357
+ * @category Create
358
+ * @param createBinaryOptions -The binary options. See `CreateBinaryOptions` for full details.
359
+ * @param requestOptions - Optional fetch options. **NOTE:** only `options.signal` is respected when `onProgress` is also provided.
360
+ * @returns The result of the create operation.
361
+ */
362
+ createBinary(createBinaryOptions: CreateBinaryOptions, requestOptions?: MedplumRequestOptions): Promise<WithId<Binary>>;
363
+ /**
364
+ * @category Create
365
+ * @param data - The binary data to upload.
366
+ * @param filename - Optional filename for the binary.
367
+ * @param contentType - Content type for the binary.
368
+ * @param onProgress - Optional callback for progress events. **NOTE:** only `options.signal` is respected when `onProgress` is also provided.
369
+ * @param options - Optional fetch options. **NOTE:** only `options.signal` is respected when `onProgress` is also provided.
370
+ * @returns The result of the create operation.
371
+ * @deprecated Use `createBinary` with `CreateBinaryOptions` instead. To be removed in a future version.
372
+ */
373
+ createBinary(data: BinarySource, filename: string | undefined, contentType: string, onProgress?: (e: ProgressEvent) => void, options?: MedplumRequestOptions): Promise<WithId<Binary>>;
339
374
  pushToAgent(agent: Agent | Reference<Agent>, destination: Device | Reference<Device> | string, body: any, contentType?: string, _waitForResponse?: boolean, _options?: MedplumRequestOptions): Promise<any>;
340
375
  setAgentAvailable(value: boolean): void;
341
376
  getSubscriptionManager(): MockSubscriptionManager;
@@ -335,7 +335,42 @@ export declare class MockClient extends MedplumClient {
335
335
  setProfile(profile: ProfileResource | undefined): void;
336
336
  getActiveLogin(): LoginState | undefined;
337
337
  getLogins(): LoginState[];
338
- createBinary(arg1: BinarySource | CreateBinaryOptions, arg2: string | undefined | MedplumRequestOptions, arg3?: string, arg4?: (e: ProgressEvent) => void): Promise<WithId<Binary>>;
338
+ /**
339
+ * Creates a FHIR `Binary` resource with the provided data content.
340
+ *
341
+ * The return value is the newly created resource, including the ID and meta.
342
+ *
343
+ * The `data` parameter can be a string or a `File` object.
344
+ *
345
+ * A `File` object often comes from a `<input type="file">` element.
346
+ *
347
+ * @example
348
+ * Example:
349
+ *
350
+ * ```typescript
351
+ * const result = await medplum.createBinary(myFile, 'test.jpg', 'image/jpeg');
352
+ * console.log(result.id);
353
+ * ```
354
+ *
355
+ * See the FHIR "create" operation for full details: https://www.hl7.org/fhir/http.html#create
356
+ *
357
+ * @category Create
358
+ * @param createBinaryOptions -The binary options. See `CreateBinaryOptions` for full details.
359
+ * @param requestOptions - Optional fetch options. **NOTE:** only `options.signal` is respected when `onProgress` is also provided.
360
+ * @returns The result of the create operation.
361
+ */
362
+ createBinary(createBinaryOptions: CreateBinaryOptions, requestOptions?: MedplumRequestOptions): Promise<WithId<Binary>>;
363
+ /**
364
+ * @category Create
365
+ * @param data - The binary data to upload.
366
+ * @param filename - Optional filename for the binary.
367
+ * @param contentType - Content type for the binary.
368
+ * @param onProgress - Optional callback for progress events. **NOTE:** only `options.signal` is respected when `onProgress` is also provided.
369
+ * @param options - Optional fetch options. **NOTE:** only `options.signal` is respected when `onProgress` is also provided.
370
+ * @returns The result of the create operation.
371
+ * @deprecated Use `createBinary` with `CreateBinaryOptions` instead. To be removed in a future version.
372
+ */
373
+ createBinary(data: BinarySource, filename: string | undefined, contentType: string, onProgress?: (e: ProgressEvent) => void, options?: MedplumRequestOptions): Promise<WithId<Binary>>;
339
374
  pushToAgent(agent: Agent | Reference<Agent>, destination: Device | Reference<Device> | string, body: any, contentType?: string, _waitForResponse?: boolean, _options?: MedplumRequestOptions): Promise<any>;
340
375
  setAgentAvailable(value: boolean): void;
341
376
  getSubscriptionManager(): MockSubscriptionManager;