@atlaskit/media-client 17.1.3 → 18.1.0

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.
Files changed (42) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/dist/cjs/client/media-client.js +2 -2
  3. package/dist/cjs/client/media-store/index.js +22 -11
  4. package/dist/cjs/client/mobile-upload.js +1 -1
  5. package/dist/cjs/file-streams-cache.js +2 -2
  6. package/dist/cjs/index.js +0 -9
  7. package/dist/cjs/utils/getVideoDimensionsFromBlob.js +23 -19
  8. package/dist/cjs/utils/mobileUpload/servicesCache.js +2 -2
  9. package/dist/cjs/version.json +1 -1
  10. package/dist/es2019/client/media-client.js +2 -2
  11. package/dist/es2019/client/media-store/index.js +14 -5
  12. package/dist/es2019/client/mobile-upload.js +1 -1
  13. package/dist/es2019/file-streams-cache.js +2 -2
  14. package/dist/es2019/index.js +0 -2
  15. package/dist/es2019/utils/getVideoDimensionsFromBlob.js +21 -7
  16. package/dist/es2019/utils/mobileUpload/servicesCache.js +2 -2
  17. package/dist/es2019/version.json +1 -1
  18. package/dist/esm/client/media-client.js +2 -2
  19. package/dist/esm/client/media-store/index.js +19 -10
  20. package/dist/esm/client/mobile-upload.js +1 -1
  21. package/dist/esm/file-streams-cache.js +2 -2
  22. package/dist/esm/index.js +0 -2
  23. package/dist/esm/utils/getVideoDimensionsFromBlob.js +21 -16
  24. package/dist/esm/utils/mobileUpload/servicesCache.js +2 -2
  25. package/dist/esm/version.json +1 -1
  26. package/dist/types/client/media-client.d.ts +1 -1
  27. package/dist/types/client/media-store/index.d.ts +8 -1
  28. package/dist/types/file-streams-cache.d.ts +2 -2
  29. package/dist/types/index.d.ts +0 -1
  30. package/dist/types/utils/getVideoDimensionsFromBlob.d.ts +3 -4
  31. package/dist/types/utils/mobileUpload/servicesCache.d.ts +2 -2
  32. package/dist/types/utils/request/helpers.d.ts +1 -1
  33. package/dist/types-ts4.0/client/media-client.d.ts +1 -1
  34. package/dist/types-ts4.0/client/media-store/index.d.ts +8 -1
  35. package/dist/types-ts4.0/file-streams-cache.d.ts +2 -2
  36. package/dist/types-ts4.0/index.d.ts +0 -1
  37. package/dist/types-ts4.0/utils/getVideoDimensionsFromBlob.d.ts +3 -4
  38. package/dist/types-ts4.0/utils/mobileUpload/servicesCache.d.ts +2 -2
  39. package/dist/types-ts4.0/utils/request/helpers.d.ts +1 -1
  40. package/example-helpers/styles.ts +9 -8
  41. package/package.json +14 -12
  42. package/report.api.md +807 -517
package/report.api.md CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
4
4
 
5
+ <!--
6
+ Generated API Report version: 2.0
7
+ -->
8
+
9
+ [Learn more about API reports](https://hello.atlassian.net/wiki/spaces/UR/pages/1825484529/Package+API+Reports)
10
+
5
11
  ```ts
6
12
  import { AsapBasedAuth } from '@atlaskit/media-core';
7
13
  import { Auth } from '@atlaskit/media-core';
@@ -10,7 +16,6 @@ import { AuthProvider } from '@atlaskit/media-core';
10
16
  import { ChunkinatorFile } from '@atlaskit/chunkinator';
11
17
  import { ClientAltBasedAuth } from '@atlaskit/media-core';
12
18
  import { FileStatus as FileStatus_2 } from '@atlaskit/media-common';
13
- import { LRUCache } from 'lru-fast';
14
19
  import { MediaApiConfig } from '@atlaskit/media-core';
15
20
  import { MediaClientConfig } from '@atlaskit/media-core';
16
21
  import { MediaFeatureFlags } from '@atlaskit/media-common';
@@ -18,114 +23,141 @@ import { MediaType } from '@atlaskit/media-common';
18
23
  import { default as React_2 } from 'react';
19
24
  import { ReplaySubject } from 'rxjs/ReplaySubject';
20
25
 
21
- export declare type AbortFunction = () => void;
26
+ // @public (undocumented)
27
+ export type AbortFunction = () => void;
22
28
 
23
- export declare const addFileAttrsToUrl: (
29
+ // @public (undocumented)
30
+ export const addFileAttrsToUrl: (
24
31
  url: string,
25
32
  fileAttrs: MediaBlobUrlAttrs,
26
33
  ) => string;
27
34
 
28
- export declare type AppendChunksToUploadRequestBody = {
35
+ // @public (undocumented)
36
+ export type AppendChunksToUploadRequestBody = {
29
37
  readonly chunks: string[];
30
38
  readonly hash?: string;
31
39
  readonly offset?: number;
32
40
  };
33
41
 
34
- export declare type Artifacts = {
42
+ // @public (undocumented)
43
+ export type Artifacts = {
35
44
  [name: string]: MediaArtifact;
36
45
  };
37
46
 
38
- /**
39
- * Base class for media errors
40
- */
41
- declare abstract class BaseMediaClientError<
47
+ // @public
48
+ abstract class BaseMediaClientError<
42
49
  Attributes extends MediaClientErrorAttributes
43
50
  >
44
51
  extends Error
45
52
  implements MediaClientError<Attributes> {
46
- readonly message: string;
47
53
  constructor(message: string);
54
+ // (undocumented)
48
55
  abstract get attributes(): Attributes;
56
+ // (undocumented)
57
+ readonly message: string;
49
58
  }
50
59
 
51
- export declare const checkWebpSupport: () => Promise<boolean>;
60
+ // @public (undocumented)
61
+ export const checkWebpSupport: () => Promise<boolean>;
52
62
 
53
- export declare type ClientOptions = {
63
+ // @public (undocumented)
64
+ export type ClientOptions = {
54
65
  readonly retryOptions?: Partial<RetryOptions>;
55
66
  readonly clientTimeout?: number;
56
67
  };
57
68
 
58
- export declare class CollectionFetcher {
59
- readonly mediaStore: MediaStore;
69
+ // @public (undocumented)
70
+ export class CollectionFetcher {
60
71
  constructor(mediaStore: MediaStore);
61
- private createFileStateObserver;
62
- private populateCache;
63
- private removeFromCache;
72
+ // (undocumented)
64
73
  getItems(
65
74
  collectionName: string,
66
75
  params?: MediaStoreGetCollectionItemsParams,
67
76
  ): MediaSubscribable<MediaCollectionItem[]>;
77
+ // (undocumented)
78
+ loadNextPage(
79
+ collectionName: string,
80
+ params?: MediaStoreGetCollectionItemsParams,
81
+ ): Promise<void>;
82
+ // (undocumented)
83
+ readonly mediaStore: MediaStore;
84
+ // (undocumented)
68
85
  removeFile(
69
86
  id: string,
70
87
  collectionName: string,
71
88
  occurrenceKey?: string,
72
89
  ): Promise<void>;
73
- loadNextPage(
74
- collectionName: string,
75
- params?: MediaStoreGetCollectionItemsParams,
76
- ): Promise<void>;
77
90
  }
78
91
 
79
- declare type CompletionObserver<
80
- T extends MediaSubscribableItem
81
- > = PartialObserver<T> & Required<Pick<PartialObserver<T>, 'complete'>>;
92
+ // @public (undocumented)
93
+ type CompletionObserver<T> = PartialObserver<T> &
94
+ Required<Pick<PartialObserver<T>, 'complete'>>;
82
95
 
83
- export declare interface CopyDestination
84
- extends MediaStoreCopyFileWithTokenParams {
96
+ // @public (undocumented)
97
+ export interface CopyDestination extends MediaStoreCopyFileWithTokenParams {
98
+ // (undocumented)
85
99
  authProvider: AuthProvider;
100
+ // (undocumented)
86
101
  mediaStore?: MediaStore;
87
102
  }
88
103
 
89
- export declare interface CopyFileOptions {
90
- preview?: FilePreview | Promise<FilePreview>;
104
+ // @public (undocumented)
105
+ export interface CopyFileOptions {
106
+ // (undocumented)
91
107
  mimeType?: string;
108
+ // (undocumented)
109
+ preview?: FilePreview | Promise<FilePreview>;
92
110
  }
93
111
 
94
- export declare interface CopySourceFile {
95
- id: string;
96
- collection?: string;
112
+ // @public (undocumented)
113
+ export interface CopySourceFile {
114
+ // (undocumented)
97
115
  authProvider: AuthProvider;
116
+ // (undocumented)
117
+ collection?: string;
118
+ // (undocumented)
119
+ id: string;
98
120
  }
99
121
 
100
- export declare interface CreatedTouchedFile {
122
+ // @public (undocumented)
123
+ export interface CreatedTouchedFile {
124
+ // (undocumented)
101
125
  fileId: string;
126
+ // (undocumented)
102
127
  uploadId: string;
103
128
  }
104
129
 
105
- export declare function createMediaSubject<T extends MediaSubscribableItem>(
130
+ // @public (undocumented)
131
+ export function createMediaSubject<T extends MediaSubscribableItem>(
106
132
  initialState?: T | Error,
107
133
  ): ReplaySubject<T>;
108
134
 
109
- export declare function createMediaSubscribable<
110
- T extends MediaSubscribableItem
111
- >(mediaSubscribableItem?: T | Error): MediaSubscribable<T>;
135
+ // @public (undocumented)
136
+ export function createMediaSubscribable<T extends MediaSubscribableItem>(
137
+ mediaSubscribableItem?: T | Error,
138
+ ): MediaSubscribable<T>;
112
139
 
113
- export declare function createUrl(
140
+ // @public (undocumented)
141
+ export function createUrl(
114
142
  url: string,
115
143
  { params, auth }: CreateUrlOptions,
116
144
  ): string;
117
145
 
118
- export declare type CreateUrlOptions = {
146
+ // @public (undocumented)
147
+ export type CreateUrlOptions = {
119
148
  readonly params?: RequestParams;
120
149
  readonly auth?: Auth;
121
150
  };
122
151
 
123
- export declare type Dimensions = {
152
+ // @public (undocumented)
153
+ export type Dimensions = {
124
154
  width: number;
125
155
  height: number;
126
156
  };
127
157
 
128
- export declare interface EdgeData {
158
+ // @public (undocumented)
159
+ export interface EdgeData {
160
+ // (undocumented)
129
161
  data: {
130
162
  clientId: string;
131
163
  token: string;
@@ -135,106 +167,134 @@ export declare interface EdgeData {
135
167
  };
136
168
  }
137
169
 
138
- export declare interface EmptyFile {
139
- readonly id: string;
170
+ // @public (undocumented)
171
+ export interface EmptyFile {
172
+ // (undocumented)
140
173
  readonly createdAt: number;
174
+ // (undocumented)
175
+ readonly id: string;
141
176
  }
142
177
 
143
- export declare interface ErrorFileState {
144
- status: 'error';
178
+ // @public (undocumented)
179
+ export interface ErrorFileState {
180
+ // (undocumented)
145
181
  id: string;
146
- occurrenceKey?: string;
182
+ // (undocumented)
147
183
  message?: string;
184
+ // (undocumented)
185
+ occurrenceKey?: string;
186
+ // (undocumented)
187
+ status: 'error';
148
188
  }
149
189
 
150
- declare type ErrorObserver<T extends MediaSubscribableItem> = PartialObserver<
151
- T
152
- > &
190
+ // @public (undocumented)
191
+ type ErrorObserver<T> = PartialObserver<T> &
153
192
  Required<Pick<PartialObserver<T>, 'error'>>;
154
193
 
155
- export declare type EventPayloadListener<
194
+ // @public (undocumented)
195
+ export type EventPayloadListener<
156
196
  M extends EventPayloadMap<P>,
157
197
  E extends keyof M,
158
198
  P = any
159
199
  > = (payload: M[E]) => void;
160
200
 
161
- declare type EventPayloadMap<P> = {
201
+ // @public (undocumented)
202
+ type EventPayloadMap<P> = {
162
203
  readonly [event: string]: P;
163
204
  };
164
205
 
165
- export declare type Executor = () => Promise<void>;
206
+ // @public (undocumented)
207
+ export type Executor = () => Promise<void>;
166
208
 
167
- export declare interface ExternalImageIdentifier {
168
- readonly mediaItemType: 'external-image';
209
+ // @public (undocumented)
210
+ export interface ExternalImageIdentifier {
211
+ // (undocumented)
169
212
  readonly dataURI: string;
213
+ // (undocumented)
214
+ readonly mediaItemType: 'external-image';
215
+ // (undocumented)
170
216
  readonly name?: string;
171
217
  }
172
218
 
173
- declare type ExternalUploadPayload = {
219
+ // @public (undocumented)
220
+ type ExternalUploadPayload = {
174
221
  uploadableFileUpfrontIds: UploadableFileUpfrontIds;
175
222
  dimensions: Dimensions;
176
223
  };
177
224
 
178
- export declare interface FileDetails {
225
+ // @public (undocumented)
226
+ export interface FileDetails {
227
+ // (undocumented)
228
+ artifacts?: Artifacts;
229
+ // (undocumented)
230
+ createdAt?: number;
231
+ // (undocumented)
232
+ creationDate?: number;
233
+ // (undocumented)
179
234
  id: string;
180
- name?: string;
181
- size?: number;
182
- mimeType?: string;
235
+ // (undocumented)
183
236
  mediaType?: MediaType;
184
- creationDate?: number;
237
+ // (undocumented)
238
+ mimeType?: string;
239
+ // (undocumented)
240
+ name?: string;
241
+ // (undocumented)
185
242
  processingStatus?: FileProcessingStatus;
186
- artifacts?: Artifacts;
187
- createdAt?: number;
243
+ // (undocumented)
244
+ size?: number;
188
245
  }
189
246
 
190
- export declare interface FileFetcher {
191
- getFileState(
247
+ // @public (undocumented)
248
+ export interface FileFetcher {
249
+ // (undocumented)
250
+ copyFile(
251
+ source: CopySourceFile,
252
+ destination: CopyDestination,
253
+ options?: CopyFileOptions,
254
+ ): Promise<MediaFile>;
255
+ // (undocumented)
256
+ downloadBinary(
192
257
  id: string,
193
- options?: GetFileOptions,
194
- ): MediaSubscribable<FileState>;
258
+ name?: string,
259
+ collectionName?: string,
260
+ ): Promise<void>;
261
+ // (undocumented)
195
262
  getArtifactURL(
196
263
  artifacts: MediaFileArtifacts,
197
264
  artifactName: keyof MediaFileArtifacts,
198
265
  collectionName?: string,
199
266
  ): Promise<string>;
267
+ // (undocumented)
268
+ getCurrentState(id: string, options?: GetFileOptions): Promise<FileState>;
269
+ // (undocumented)
270
+ getFileBinaryURL(id: string, collectionName?: string): Promise<string>;
271
+ // (undocumented)
272
+ getFileState(
273
+ id: string,
274
+ options?: GetFileOptions,
275
+ ): MediaSubscribable<FileState>;
276
+ // (undocumented)
200
277
  touchFiles(
201
278
  descriptors: TouchFileDescriptor[],
202
279
  collection?: string,
203
280
  ): Promise<TouchedFiles>;
281
+ // (undocumented)
204
282
  upload(
205
283
  file: UploadableFile,
206
284
  controller?: UploadController,
207
285
  uploadableFileUpfrontIds?: UploadableFileUpfrontIds,
208
286
  ): MediaSubscribable<FileState>;
287
+ // (undocumented)
209
288
  uploadExternal(
210
289
  url: string,
211
290
  collection?: string,
212
291
  ): Promise<ExternalUploadPayload>;
213
- downloadBinary(
214
- id: string,
215
- name?: string,
216
- collectionName?: string,
217
- ): Promise<void>;
218
- getCurrentState(id: string, options?: GetFileOptions): Promise<FileState>;
219
- copyFile(
220
- source: CopySourceFile,
221
- destination: CopyDestination,
222
- options?: CopyFileOptions,
223
- ): Promise<MediaFile>;
224
- getFileBinaryURL(id: string, collectionName?: string): Promise<string>;
225
292
  }
226
293
 
227
- export declare class FileFetcherError extends BaseMediaClientError<
294
+ // @public (undocumented)
295
+ export class FileFetcherError extends BaseMediaClientError<
228
296
  FileFetcherErrorAttributes
229
297
  > {
230
- readonly reason: FileFetcherErrorReason;
231
- readonly id: string;
232
- readonly metadata?:
233
- | {
234
- readonly collectionName?: string | undefined;
235
- readonly occurrenceKey?: string | undefined;
236
- }
237
- | undefined;
238
298
  constructor(
239
299
  reason: FileFetcherErrorReason,
240
300
  id: string,
@@ -245,15 +305,28 @@ export declare class FileFetcherError extends BaseMediaClientError<
245
305
  }
246
306
  | undefined,
247
307
  );
308
+ // (undocumented)
248
309
  get attributes(): {
249
310
  reason: FileFetcherErrorReason;
250
311
  id: string;
251
312
  collectionName: string | undefined;
252
313
  occurrenceKey: string | undefined;
253
314
  };
315
+ // (undocumented)
316
+ readonly id: string;
317
+ // (undocumented)
318
+ readonly metadata?:
319
+ | {
320
+ readonly collectionName?: string | undefined;
321
+ readonly occurrenceKey?: string | undefined;
322
+ }
323
+ | undefined;
324
+ // (undocumented)
325
+ readonly reason: FileFetcherErrorReason;
254
326
  }
255
327
 
256
- export declare type FileFetcherErrorAttributes = {
328
+ // @public (undocumented)
329
+ export type FileFetcherErrorAttributes = {
257
330
  readonly reason: FileFetcherErrorReason;
258
331
  readonly id: string;
259
332
  readonly metadata?: {
@@ -262,128 +335,160 @@ export declare type FileFetcherErrorAttributes = {
262
335
  };
263
336
  };
264
337
 
265
- export declare type FileFetcherErrorReason =
338
+ // @public (undocumented)
339
+ export type FileFetcherErrorReason =
266
340
  | 'invalidFileId'
267
341
  | 'emptyItems'
268
342
  | 'zeroVersionFile';
269
343
 
270
- export declare class FileFetcherImpl implements FileFetcher {
271
- private readonly mediaStore;
272
- private readonly dataloader;
344
+ // @public (undocumented)
345
+ export class FileFetcherImpl implements FileFetcher {
273
346
  constructor(mediaStore: MediaStore);
274
- getFileState(
347
+ // (undocumented)
348
+ copyFile(
349
+ source: CopySourceFile,
350
+ destination: CopyDestination,
351
+ options?: CopyFileOptions,
352
+ ): Promise<MediaFile>;
353
+ // (undocumented)
354
+ downloadBinary(
275
355
  id: string,
276
- options?: GetFileOptions,
277
- ): MediaSubscribable<FileState>;
278
- getCurrentState(id: string, options?: GetFileOptions): Promise<FileState>;
356
+ name?: string,
357
+ collectionName?: string,
358
+ ): Promise<void>;
359
+ // (undocumented)
279
360
  getArtifactURL(
280
361
  artifacts: MediaFileArtifacts,
281
362
  artifactName: keyof MediaFileArtifacts,
282
363
  collectionName?: string,
283
364
  ): Promise<string>;
365
+ // (undocumented)
366
+ getCurrentState(id: string, options?: GetFileOptions): Promise<FileState>;
367
+ // (undocumented)
284
368
  getFileBinaryURL(id: string, collectionName?: string): Promise<string>;
285
- private createDownloadFileStream;
369
+ // (undocumented)
370
+ getFileState(
371
+ id: string,
372
+ options?: GetFileOptions,
373
+ ): MediaSubscribable<FileState>;
374
+ // (undocumented)
286
375
  touchFiles(
287
376
  descriptors: TouchFileDescriptor[],
288
377
  collection?: string,
289
378
  ): Promise<TouchedFiles>;
290
- private generateUploadableFileUpfrontIds;
291
- uploadExternal(
292
- url: string,
293
- collection?: string,
294
- ): Promise<ExternalUploadPayload>;
379
+ // (undocumented)
295
380
  upload(
296
381
  file: UploadableFile,
297
382
  controller?: UploadController,
298
383
  uploadableFileUpfrontIds?: UploadableFileUpfrontIds,
299
384
  ): MediaSubscribable<FileState>;
300
- downloadBinary(
301
- id: string,
302
- name?: string,
303
- collectionName?: string,
304
- ): Promise<void>;
305
- copyFile(
306
- source: CopySourceFile,
307
- destination: CopyDestination,
308
- options?: CopyFileOptions,
309
- ): Promise<MediaFile>;
385
+ // (undocumented)
386
+ uploadExternal(
387
+ url: string,
388
+ collection?: string,
389
+ ): Promise<ExternalUploadPayload>;
310
390
  }
311
391
 
312
- export declare interface FileIdentifier {
313
- readonly mediaItemType: 'file';
392
+ // @public (undocumented)
393
+ export interface FileIdentifier {
394
+ // (undocumented)
395
+ readonly collectionName?: string;
396
+ // (undocumented)
314
397
  readonly id: string;
398
+ // (undocumented)
399
+ readonly mediaItemType: 'file';
400
+ // (undocumented)
315
401
  readonly occurrenceKey?: string;
316
- readonly collectionName?: string;
317
402
  }
318
403
 
319
- export declare interface FileItem {
320
- type: 'file';
404
+ // @public (undocumented)
405
+ export interface FileItem {
406
+ // (undocumented)
321
407
  details: FileDetails;
408
+ // (undocumented)
409
+ type: 'file';
322
410
  }
323
411
 
324
- export declare interface FilePreview {
325
- value: Blob | string;
412
+ // @public (undocumented)
413
+ export interface FilePreview {
414
+ // (undocumented)
326
415
  origin?: 'local' | 'remote';
416
+ // (undocumented)
327
417
  originalDimensions?: {
328
418
  width: number;
329
419
  height: number;
330
420
  };
421
+ // (undocumented)
422
+ value: Blob | string;
331
423
  }
332
424
 
333
- export declare type FileProcessingStatus =
425
+ // @public (undocumented)
426
+ export type FileProcessingStatus =
334
427
  | 'pending'
335
428
  | 'running'
336
429
  | 'succeeded'
337
430
  | 'failed';
338
431
 
339
- export declare type FileState =
432
+ // @public (undocumented)
433
+ export type FileState =
340
434
  | UploadingFileState
341
435
  | ProcessingFileState
342
436
  | ProcessedFileState
343
437
  | ErrorFileState
344
438
  | ProcessingFailedState;
345
439
 
346
- export declare type FileStatus = FileStatus_2;
440
+ // @public (undocumented)
441
+ export type FileStatus = FileStatus_2;
347
442
 
348
- export declare const getArtifactUrl: (
443
+ // @public (undocumented)
444
+ export const getArtifactUrl: (
349
445
  artifacts: MediaFileArtifacts,
350
446
  prop: keyof MediaFileArtifacts,
351
447
  ) => string | undefined;
352
448
 
353
- export declare const getAttrsFromUrl: (
449
+ // @public (undocumented)
450
+ export const getAttrsFromUrl: (
354
451
  blobUrl: string,
355
452
  ) => MediaBlobUrlAttrs | undefined;
356
453
 
357
- export declare const getDimensionsFromBlob: (
454
+ // @public (undocumented)
455
+ export const getDimensionsFromBlob: (
358
456
  mediaType: MediaType,
359
457
  blob: Blob,
360
458
  ) => Promise<Dimensions>;
361
459
 
362
- export declare interface GetFileOptions {
363
- preview?: PreviewOptions;
460
+ // @public (undocumented)
461
+ export interface GetFileOptions {
462
+ // (undocumented)
364
463
  collectionName?: string;
464
+ // (undocumented)
365
465
  occurrenceKey?: string;
466
+ // (undocumented)
467
+ preview?: PreviewOptions;
366
468
  }
367
469
 
368
- export declare const getMediaClient: (
470
+ // @public (undocumented)
471
+ export const getMediaClient: (
369
472
  mediaClientConfig: MediaClientConfig,
370
473
  featureFlags?: MediaFeatureFlags | undefined,
371
474
  ) => MediaClient;
372
475
 
373
- export declare function getMediaClientErrorReason(
476
+ // @public (undocumented)
477
+ export function getMediaClientErrorReason(
374
478
  err: Error,
375
479
  ): MediaClientErrorReason | 'unknown';
376
480
 
377
- export declare const getMediaEnvironment: () => string | undefined;
481
+ // @public (undocumented)
482
+ export const getMediaEnvironment: () => string | undefined;
378
483
 
379
- export declare const getMediaRegion: () => string | undefined;
484
+ // @public (undocumented)
485
+ export const getMediaRegion: () => string | undefined;
380
486
 
381
- /**
382
- * @deprecated This export will be removed. Please use one from @atlaskit/media-common or @atlaskit/media-common/mediaTypeUtils
383
- */
384
- export declare const getMediaTypeFromMimeType: (mimeType: string) => MediaType;
487
+ // @public @deprecated (undocumented)
488
+ export const getMediaTypeFromMimeType: (mimeType: string) => MediaType;
385
489
 
386
- export declare const globalMediaEventEmitter: {
490
+ // @public (undocumented)
491
+ export const globalMediaEventEmitter: {
387
492
  on<E extends keyof UploadEventPayloadMap>(
388
493
  event: E,
389
494
  listener: EventPayloadListener<UploadEventPayloadMap, E, any>,
@@ -398,129 +503,119 @@ export declare const globalMediaEventEmitter: {
398
503
  ): boolean | undefined;
399
504
  };
400
505
 
401
- export declare type Identifier = FileIdentifier | ExternalImageIdentifier;
506
+ // @public (undocumented)
507
+ export type Identifier = FileIdentifier | ExternalImageIdentifier;
402
508
 
403
- export declare interface ImageMetadata {
509
+ // @public (undocumented)
510
+ export interface ImageMetadata {
511
+ // (undocumented)
512
+ original?: ImageMetadataArtifact;
513
+ // (undocumented)
404
514
  pending: boolean;
515
+ // (undocumented)
405
516
  preview?: ImageMetadataArtifact;
406
- original?: ImageMetadataArtifact;
407
517
  }
408
518
 
409
- export declare type ImageMetadataArtifact = {
519
+ // @public (undocumented)
520
+ export type ImageMetadataArtifact = {
410
521
  url?: string;
411
522
  width?: number;
412
523
  height?: number;
413
524
  size?: number;
414
525
  };
415
526
 
416
- export declare type ImageResizeMode =
417
- | 'crop'
418
- | 'fit'
419
- | 'full-fit'
420
- | 'stretchy-fit';
527
+ // @public (undocumented)
528
+ export type ImageResizeMode = 'crop' | 'fit' | 'full-fit' | 'stretchy-fit';
421
529
 
422
- export declare const imageResizeModeToFileImageMode: (
530
+ // @public (undocumented)
531
+ export const imageResizeModeToFileImageMode: (
423
532
  resizeMode?: ImageResizeMode | undefined,
424
533
  ) => MediaStoreGetFileImageParams['mode'];
425
534
 
426
- export declare function isAbortedRequestError(err: any): boolean;
535
+ // @public (undocumented)
536
+ export function isAbortedRequestError(err: any): boolean;
427
537
 
428
- /**
429
- * @deprecated This export will be removed. Please use one from @atlaskit/media-common or @atlaskit/media-common/mediaTypeUtils
430
- */
431
- export declare const isAudioMimeTypeSupportedByServer: (
432
- mimeType: string,
433
- ) => boolean;
538
+ // @public @deprecated (undocumented)
539
+ export const isAudioMimeTypeSupportedByServer: (mimeType: string) => boolean;
434
540
 
435
- export declare const isDifferentIdentifier: (
436
- a: Identifier,
437
- b: Identifier,
438
- ) => boolean;
541
+ // @public (undocumented)
542
+ export const isDifferentIdentifier: (a: Identifier, b: Identifier) => boolean;
439
543
 
440
- /**
441
- * @deprecated This export will be removed. Please use one from @atlaskit/media-common or @atlaskit/media-common/mediaTypeUtils
442
- */
443
- export declare const isDocumentMimeTypeSupportedByBrowser: (
544
+ // @public @deprecated (undocumented)
545
+ export const isDocumentMimeTypeSupportedByBrowser: (
444
546
  mimeType: string,
445
547
  ) => boolean;
446
548
 
447
- /**
448
- * @deprecated This export will be removed. Please use one from @atlaskit/media-common or @atlaskit/media-common/mediaTypeUtils
449
- */
450
- export declare const isDocumentMimeTypeSupportedByServer: (
451
- mimeType: string,
452
- ) => boolean;
549
+ // @public @deprecated (undocumented)
550
+ export const isDocumentMimeTypeSupportedByServer: (mimeType: string) => boolean;
453
551
 
454
- export declare const isErrorFileState: (
552
+ // @public (undocumented)
553
+ export const isErrorFileState: (
455
554
  fileState: FileState,
456
555
  ) => fileState is ErrorFileState;
457
556
 
458
- export declare const isExternalImageIdentifier: (
557
+ // @public (undocumented)
558
+ export const isExternalImageIdentifier: (
459
559
  identifier: Identifier,
460
560
  ) => identifier is ExternalImageIdentifier;
461
561
 
462
- export declare function isFileFetcherError(err: Error): err is FileFetcherError;
562
+ // @public (undocumented)
563
+ export function isFileFetcherError(err: Error): err is FileFetcherError;
463
564
 
464
- export declare const isFileIdentifier: (
565
+ // @public (undocumented)
566
+ export const isFileIdentifier: (
465
567
  identifier: Identifier,
466
568
  ) => identifier is FileIdentifier;
467
569
 
468
- export declare const isFinalFileState: (
570
+ // @public (undocumented)
571
+ export const isFinalFileState: (
469
572
  fileState: FileState,
470
573
  ) => fileState is ProcessedFileState | ProcessingFailedState | ErrorFileState;
471
574
 
472
- /**
473
- * @deprecated This export will be removed. Please use one from @atlaskit/media-common or @atlaskit/media-common/mediaTypeUtils
474
- */
475
- export declare const isImageMimeTypeSupportedByBrowser: (
476
- mimeType: string,
477
- ) => boolean;
575
+ // @public @deprecated (undocumented)
576
+ export const isImageMimeTypeSupportedByBrowser: (mimeType: string) => boolean;
478
577
 
479
- /**
480
- * @deprecated This export will be removed. Please use one from @atlaskit/media-common or @atlaskit/media-common/mediaTypeUtils
481
- */
482
- export declare const isImageMimeTypeSupportedByServer: (
483
- mimeType: string,
484
- ) => boolean;
578
+ // @public @deprecated (undocumented)
579
+ export const isImageMimeTypeSupportedByServer: (mimeType: string) => boolean;
485
580
 
486
- export declare const isImageRemote: (
581
+ // @public (undocumented)
582
+ export const isImageRemote: (
487
583
  imageUrl: string,
488
584
  windowOrigin?: string,
489
585
  ) => boolean;
490
586
 
491
- export declare const isImageRepresentationReady: (
492
- fileState: FileState,
493
- ) => boolean;
587
+ // @public (undocumented)
588
+ export const isImageRepresentationReady: (fileState: FileState) => boolean;
494
589
 
495
- export declare const isMediaBlobUrl: (url: string) => boolean;
590
+ // @public (undocumented)
591
+ export const isMediaBlobUrl: (url: string) => boolean;
496
592
 
497
- export declare function isMediaClientError(
593
+ // @public (undocumented)
594
+ export function isMediaClientError(
498
595
  error: any,
499
596
  ): error is MediaClientError<{
500
597
  reason: MediaClientErrorReason;
501
598
  }>;
502
599
 
503
- export declare const isMediaCollectionItemFullDetails: (
600
+ // @public (undocumented)
601
+ export const isMediaCollectionItemFullDetails: (
504
602
  mediaCollectionItem: MediaCollectionItemDetails,
505
603
  ) => mediaCollectionItem is MediaCollectionItemFullDetails;
506
604
 
507
- export declare function isMediaStoreError(err: Error): err is MediaStoreError;
605
+ // @public (undocumented)
606
+ export function isMediaStoreError(err: Error): err is MediaStoreError;
508
607
 
509
- /**
510
- * @deprecated This export will be removed. Please use one from @atlaskit/media-common or @atlaskit/media-common/mediaTypeUtils
511
- */
512
- export declare const isMimeTypeSupportedByBrowser: (
513
- mimeType: string,
514
- ) => boolean;
608
+ // @public @deprecated (undocumented)
609
+ export const isMimeTypeSupportedByBrowser: (mimeType: string) => boolean;
515
610
 
516
- /**
517
- * @deprecated This export will be removed. Please use one from @atlaskit/media-common or @atlaskit/media-common/mediaTypeUtils
518
- */
519
- export declare const isMimeTypeSupportedByServer: (mimeType: string) => boolean;
611
+ // @public @deprecated (undocumented)
612
+ export const isMimeTypeSupportedByServer: (mimeType: string) => boolean;
520
613
 
521
- export declare function isPollingError(err?: Error): err is PollingError;
614
+ // @public (undocumented)
615
+ export function isPollingError(err?: Error): err is PollingError;
522
616
 
523
- export declare const isPreviewableFileState: (
617
+ // @public (undocumented)
618
+ export const isPreviewableFileState: (
524
619
  fileState: FileState,
525
620
  ) => fileState is (
526
621
  | UploadingFileState
@@ -530,92 +625,100 @@ export declare const isPreviewableFileState: (
530
625
  ) &
531
626
  PreviewableFileState;
532
627
 
533
- export declare const isPreviewableType: (
628
+ // @public (undocumented)
629
+ export const isPreviewableType: (
534
630
  type: MediaType,
535
631
  featureFlags?: MediaFeatureFlags | undefined,
536
632
  ) => boolean;
537
633
 
538
- export declare const isProcessedFileState: (
634
+ // @public (undocumented)
635
+ export const isProcessedFileState: (
539
636
  fileState: FileState,
540
637
  ) => fileState is ProcessedFileState;
541
638
 
542
- export declare const isProcessingFileState: (
639
+ // @public (undocumented)
640
+ export const isProcessingFileState: (
543
641
  fileState: FileState,
544
642
  ) => fileState is ProcessingFileState;
545
643
 
546
- export declare function isRateLimitedError(error: Error | undefined): boolean;
644
+ // @public (undocumented)
645
+ export function isRateLimitedError(error: Error | undefined): boolean;
547
646
 
548
- export declare function isRequestError(err: Error): err is RequestError;
647
+ // @public (undocumented)
648
+ export function isRequestError(err: Error): err is RequestError;
549
649
 
550
- /**
551
- * @deprecated This export will be removed. Please use one from @atlaskit/media-common or @atlaskit/media-common/mediaTypeUtils
552
- */
553
- export declare const isUnknownMimeTypeSupportedByServer: (
554
- mimeType: string,
555
- ) => boolean;
650
+ // @public @deprecated (undocumented)
651
+ export const isUnknownMimeTypeSupportedByServer: (mimeType: string) => boolean;
556
652
 
557
- export declare const isUploadingFileState: (
653
+ // @public (undocumented)
654
+ export const isUploadingFileState: (
558
655
  fileState: FileState,
559
656
  ) => fileState is UploadingFileState;
560
657
 
561
- /**
562
- * @deprecated This export will be removed. Please use one from @atlaskit/media-common or @atlaskit/media-common/mediaTypeUtils
563
- */
564
- export declare const isVideoMimeTypeSupportedByServer: (
565
- mimeType: string,
566
- ) => boolean;
658
+ // @public @deprecated (undocumented)
659
+ export const isVideoMimeTypeSupportedByServer: (mimeType: string) => boolean;
567
660
 
568
- export declare interface ItemsPayload {
661
+ // @public (undocumented)
662
+ export interface ItemsPayload {
663
+ // (undocumented)
569
664
  items: ResponseFileItem[];
570
665
  }
571
666
 
572
- export declare const mapMediaFileToFileState: (
667
+ // @public (undocumented)
668
+ export const mapMediaFileToFileState: (
573
669
  mediaFile: MediaStoreResponse<MediaFile>,
574
670
  ) => FileState;
575
671
 
576
- export declare const mapMediaItemToFileState: (
672
+ // @public (undocumented)
673
+ export const mapMediaItemToFileState: (
577
674
  id: string,
578
675
  item: MediaCollectionItemFullDetails,
579
676
  ) => FileState;
580
677
 
581
- /**
582
- * @deprecated Helper is deprecated and will be removed in the next major version.
583
- * TODO: https://product-fabric.atlassian.net/browse/BMPT-1354
584
- */
585
- export declare function mapResponseToBlob(response: Response): Promise<Blob>;
678
+ // @public @deprecated (undocumented)
679
+ export function mapResponseToBlob(response: Response): Promise<Blob>;
586
680
 
587
- /**
588
- * @deprecated Helper is deprecated and will be removed in the next major version.
589
- * TODO: https://product-fabric.atlassian.net/browse/BMPT-1354
590
- */
591
- export declare function mapResponseToJson(response: Response): Promise<any>;
681
+ // @public @deprecated (undocumented)
682
+ export function mapResponseToJson(response: Response): Promise<any>;
592
683
 
593
- /**
594
- * @deprecated Helper is deprecated and will be removed in the next major version.
595
- * TODO: https://product-fabric.atlassian.net/browse/BMPT-1354
596
- */
597
- export declare function mapResponseToVoid(): Promise<void>;
684
+ // @public @deprecated (undocumented)
685
+ export function mapResponseToVoid(): Promise<void>;
598
686
 
599
- export declare const MAX_RESOLUTION = 4096;
687
+ // @public (undocumented)
688
+ export const MAX_RESOLUTION = 4096;
600
689
 
601
- export declare interface MediaArtifact {
690
+ // @public (undocumented)
691
+ export interface MediaArtifact {
692
+ // (undocumented)
602
693
  processingStatus?: FileProcessingStatus;
694
+ // (undocumented)
603
695
  url?: string;
604
696
  }
605
697
 
606
- export declare interface MediaBlobUrlAttrs {
607
- id: string;
608
- contextId: string;
698
+ // @public (undocumented)
699
+ export interface MediaBlobUrlAttrs {
700
+ // (undocumented)
701
+ alt?: string;
702
+ // (undocumented)
609
703
  collection?: string;
610
- size?: number;
611
- name?: string;
704
+ // (undocumented)
705
+ contextId: string;
706
+ // (undocumented)
707
+ height?: number;
708
+ // (undocumented)
709
+ id: string;
710
+ // (undocumented)
612
711
  mimeType?: string;
712
+ // (undocumented)
713
+ name?: string;
714
+ // (undocumented)
715
+ size?: number;
716
+ // (undocumented)
613
717
  width?: number;
614
- height?: number;
615
- alt?: string;
616
718
  }
617
719
 
618
- export declare type MediaChunksProbe = {
720
+ // @public (undocumented)
721
+ export type MediaChunksProbe = {
619
722
  readonly results: {
620
723
  readonly [etag: string]: {
621
724
  readonly exists: boolean;
@@ -623,69 +726,79 @@ export declare type MediaChunksProbe = {
623
726
  };
624
727
  };
625
728
 
626
- export declare class MediaClient {
627
- readonly mediaClientConfig: MediaClientConfig;
628
- readonly featureFlags?: MediaFeatureFlags | undefined;
629
- readonly mediaStore: MediaStore;
630
- readonly collection: CollectionFetcher;
631
- readonly file: FileFetcher;
632
- readonly stargate: StargateClient;
633
- private readonly eventEmitter;
634
- private mobileUpload?;
635
- readonly config: MediaClientConfig;
729
+ // @public (undocumented)
730
+ export class MediaClient {
636
731
  constructor(
637
732
  mediaClientConfig: MediaClientConfig,
638
733
  featureFlags?: MediaFeatureFlags | undefined,
639
734
  );
735
+ // (undocumented)
736
+ readonly collection: CollectionFetcher;
737
+ // (undocumented)
738
+ readonly config: MediaClientConfig;
739
+ // (undocumented)
740
+ emit<E extends keyof UploadEventPayloadMap>(
741
+ event: E,
742
+ payload: UploadEventPayloadMap[E],
743
+ ): boolean;
744
+ // (undocumented)
745
+ readonly featureFlags?: MediaFeatureFlags | undefined;
746
+ // (undocumented)
747
+ readonly file: FileFetcher;
748
+ // (undocumented)
640
749
  getImage(
641
750
  id: string,
642
751
  params?: MediaStoreGetFileImageParams,
643
752
  controller?: AbortController,
644
753
  fetchMaxRes?: boolean,
645
754
  ): Promise<Blob>;
755
+ // (undocumented)
756
+ getImageMetadata(
757
+ id: string,
758
+ params?: MediaStoreGetFileImageParams,
759
+ ): Promise<ImageMetadata>;
760
+ // (undocumented)
646
761
  getImageUrl(
647
762
  id: string,
648
763
  params?: MediaStoreGetFileImageParams,
649
764
  ): Promise<string>;
765
+ // (undocumented)
650
766
  getImageUrlSync(id: string, params?: MediaStoreGetFileImageParams): string;
651
- getImageMetadata(
652
- id: string,
653
- params?: MediaStoreGetFileImageParams,
654
- ): Promise<ImageMetadata>;
767
+ // (undocumented)
768
+ readonly mediaClientConfig: MediaClientConfig;
769
+ // (undocumented)
770
+ readonly mediaStore: MediaStore;
771
+ // (undocumented)
655
772
  mobileUploadPromise(): Promise<MobileUpload>;
656
- on<E extends keyof UploadEventPayloadMap>(
773
+ // (undocumented)
774
+ off<E extends keyof UploadEventPayloadMap>(
657
775
  event: E,
658
776
  listener: EventPayloadListener<UploadEventPayloadMap, E>,
659
777
  ): void;
660
- off<E extends keyof UploadEventPayloadMap>(
778
+ // (undocumented)
779
+ on<E extends keyof UploadEventPayloadMap>(
661
780
  event: E,
662
781
  listener: EventPayloadListener<UploadEventPayloadMap, E>,
663
782
  ): void;
664
- emit<E extends keyof UploadEventPayloadMap>(
665
- event: E,
666
- payload: UploadEventPayloadMap[E],
667
- ): boolean;
783
+ // (undocumented)
784
+ readonly stargate: StargateClient;
668
785
  }
669
786
 
670
- /**
671
- * MediaClientError is the main interface which all the errors
672
- * in Media Client must implement.
673
- * MediaClientErrorReason is a dictionary that restricts all the possible
674
- * reasons that the erros can define. Its values are private to this file.
675
- * Any new error has to define its own Error Reasons locally, and also declare them
676
- * here to comply with the interface restrictions
677
- */
678
- export declare interface MediaClientError<
679
- Attributes extends MediaClientErrorAttributes
680
- > extends Error {
787
+ // @public
788
+ export interface MediaClientError<Attributes extends MediaClientErrorAttributes>
789
+ extends Error {
790
+ // (undocumented)
681
791
  readonly attributes: Attributes;
682
792
  }
683
793
 
684
- export declare interface MediaClientErrorAttributes {
794
+ // @public (undocumented)
795
+ export interface MediaClientErrorAttributes {
796
+ // (undocumented)
685
797
  reason: MediaClientErrorReason;
686
798
  }
687
799
 
688
- export declare type MediaClientErrorReason =
800
+ // @public (undocumented)
801
+ export type MediaClientErrorReason =
689
802
  | 'clientOffline'
690
803
  | 'clientAbortedRequest'
691
804
  | 'clientTimeoutRequest'
@@ -709,23 +822,27 @@ export declare type MediaClientErrorReason =
709
822
  | 'pollingMaxAttemptsExceeded'
710
823
  | 'fileSizeExceedsLimit';
711
824
 
712
- export declare type MediaCollection = {
825
+ // @public (undocumented)
826
+ export type MediaCollection = {
713
827
  readonly name: string;
714
828
  readonly createdAt: number;
715
829
  };
716
830
 
717
- export declare type MediaCollectionItem = {
831
+ // @public (undocumented)
832
+ export type MediaCollectionItem = {
718
833
  readonly id: string;
719
834
  readonly insertedAt: number;
720
835
  readonly occurrenceKey: string;
721
836
  readonly details: MediaCollectionItemDetails;
722
837
  };
723
838
 
724
- export declare type MediaCollectionItemDetails =
839
+ // @public (undocumented)
840
+ export type MediaCollectionItemDetails =
725
841
  | MediaCollectionItemMinimalDetails
726
842
  | MediaCollectionItemFullDetails;
727
843
 
728
- export declare type MediaCollectionItemFullDetails = {
844
+ // @public (undocumented)
845
+ export type MediaCollectionItemFullDetails = {
729
846
  readonly mediaType: MediaType;
730
847
  readonly mimeType: string;
731
848
  readonly name: string;
@@ -736,17 +853,20 @@ export declare type MediaCollectionItemFullDetails = {
736
853
  readonly createdAt?: number;
737
854
  };
738
855
 
739
- export declare type MediaCollectionItemMinimalDetails = {
856
+ // @public (undocumented)
857
+ export type MediaCollectionItemMinimalDetails = {
740
858
  readonly name: string;
741
859
  readonly size: number;
742
860
  };
743
861
 
744
- export declare type MediaCollectionItems = {
862
+ // @public (undocumented)
863
+ export type MediaCollectionItems = {
745
864
  readonly contents: MediaCollectionItem[];
746
865
  readonly nextInclusiveStartKey?: string;
747
866
  };
748
867
 
749
- export declare type MediaFile = {
868
+ // @public (undocumented)
869
+ export type MediaFile = {
750
870
  readonly id: string;
751
871
  readonly mediaType: MediaType;
752
872
  readonly mimeType: string;
@@ -758,150 +878,180 @@ export declare type MediaFile = {
758
878
  readonly createdAt?: number;
759
879
  };
760
880
 
761
- export declare type MediaFileArtifact = {
881
+ // @public (undocumented)
882
+ export type MediaFileArtifact = {
762
883
  readonly url: string;
763
884
  readonly processingStatus: MediaFileProcessingStatus;
764
885
  };
765
886
 
766
- export declare interface MediaFileArtifacts {
887
+ // @public (undocumented)
888
+ export interface MediaFileArtifacts {
889
+ // (undocumented)
890
+ 'audio.mp3'?: MediaFileArtifact;
891
+ // (undocumented)
892
+ 'document.pdf'?: MediaFileArtifact;
893
+ // (undocumented)
767
894
  'video_1280.mp4'?: MediaFileArtifact;
895
+ // (undocumented)
768
896
  'video_640.mp4'?: MediaFileArtifact;
769
- 'document.pdf'?: MediaFileArtifact;
770
- 'audio.mp3'?: MediaFileArtifact;
771
897
  }
772
898
 
773
- export declare type MediaFileProcessingStatus =
774
- | 'pending'
775
- | 'succeeded'
776
- | 'failed';
899
+ // @public (undocumented)
900
+ export type MediaFileProcessingStatus = 'pending' | 'succeeded' | 'failed';
777
901
 
778
- export declare type MediaItemType = 'file' | 'external-image';
902
+ // @public (undocumented)
903
+ export type MediaItemType = 'file' | 'external-image';
779
904
 
780
- export declare type MediaObserver<T extends MediaSubscribableItem> =
905
+ // @public (undocumented)
906
+ export type MediaObserver<T> =
781
907
  | NextObserver<T>
782
908
  | ErrorObserver<T>
783
909
  | CompletionObserver<T>
784
910
  | ((value: T) => void);
785
911
 
786
- export declare type MediaRepresentations = {
912
+ // @public (undocumented)
913
+ export type MediaRepresentations = {
787
914
  image?: Object;
788
915
  };
789
916
 
790
- export declare class MediaStore {
791
- private readonly config;
792
- readonly featureFlags?: MediaFeatureFlags | undefined;
917
+ // @public (undocumented)
918
+ export class MediaStore {
793
919
  constructor(
794
920
  config: MediaApiConfig,
795
921
  featureFlags?: MediaFeatureFlags | undefined,
796
922
  );
797
- getCollectionItems(
798
- collectionName: string,
799
- params?: MediaStoreGetCollectionItemsParams,
800
- ): Promise<MediaStoreResponse<MediaCollectionItems>>;
801
- removeCollectionFile(
802
- id: string,
803
- collectionName: string,
804
- occurrenceKey?: string,
805
- ): Promise<void>;
806
- createUpload(
807
- createUpTo?: number,
923
+ // (undocumented)
924
+ appendChunksToUpload(
925
+ uploadId: string,
926
+ body: AppendChunksToUploadRequestBody,
808
927
  collectionName?: string,
809
- ): Promise<MediaStoreResponse<MediaUpload[]>>;
810
- uploadChunk(
811
- etag: string,
812
- blob: Blob,
813
- {
814
- collectionName,
815
- uploadId,
816
- partNumber,
817
- }?: {
818
- collectionName?: string;
819
- uploadId?: string;
820
- partNumber?: number;
821
- },
822
928
  ): Promise<void>;
823
- probeChunks(
824
- chunks: string[],
825
- {
826
- collectionName,
827
- uploadId,
828
- }?: {
829
- collectionName?: string;
830
- uploadId?: string;
831
- },
832
- ): Promise<MediaStoreResponse<MediaChunksProbe>>;
929
+ // (undocumented)
930
+ copyFileWithToken(
931
+ body: MediaStoreCopyFileWithTokenBody,
932
+ params: MediaStoreCopyFileWithTokenParams,
933
+ ): Promise<MediaStoreResponse<MediaFile>>;
934
+ // (undocumented)
833
935
  createFileFromUpload(
834
936
  body: MediaStoreCreateFileFromUploadBody,
835
937
  params?: MediaStoreCreateFileFromUploadParams,
836
938
  ): Promise<MediaStoreResponse<MediaFile>>;
837
- touchFiles(
838
- body: MediaStoreTouchFileBody,
839
- params?: MediaStoreTouchFileParams,
840
- ): Promise<MediaStoreResponse<TouchedFiles>>;
939
+ // (undocumented)
940
+ createUpload(
941
+ createUpTo?: number,
942
+ collectionName?: string,
943
+ ): Promise<MediaStoreResponse<MediaUpload[]>>;
944
+ // (undocumented)
945
+ readonly featureFlags?: MediaFeatureFlags | undefined;
946
+ // (undocumented)
947
+ getArtifactURL(
948
+ artifacts: MediaFileArtifacts,
949
+ artifactName: keyof MediaFileArtifacts,
950
+ collectionName?: string,
951
+ ): Promise<string>;
952
+ // (undocumented)
953
+ getCollectionItems(
954
+ collectionName: string,
955
+ params?: MediaStoreGetCollectionItemsParams,
956
+ ): Promise<MediaStoreResponse<MediaCollectionItems>>;
957
+ // (undocumented)
841
958
  getFile(
842
959
  fileId: string,
843
960
  params?: MediaStoreGetFileParams,
844
961
  ): Promise<MediaStoreResponse<MediaFile>>;
962
+ // (undocumented)
963
+ getFileBinaryURL(id: string, collectionName?: string): Promise<string>;
964
+ // (undocumented)
845
965
  getFileImageURL(
846
966
  id: string,
847
967
  params?: MediaStoreGetFileImageParams,
848
968
  ): Promise<string>;
969
+ // (undocumented)
849
970
  getFileImageURLSync(
850
971
  id: string,
851
972
  params?: MediaStoreGetFileImageParams,
852
973
  ): string;
853
- private createFileImageURL;
854
- getFileBinaryURL(id: string, collectionName?: string): Promise<string>;
855
- getArtifactURL(
856
- artifacts: MediaFileArtifacts,
857
- artifactName: keyof MediaFileArtifacts,
858
- collectionName?: string,
859
- ): Promise<string>;
974
+ // (undocumented)
860
975
  getImage(
861
976
  id: string,
862
977
  params?: MediaStoreGetFileImageParams,
863
978
  controller?: AbortController,
864
979
  fetchMaxRes?: boolean,
865
980
  ): Promise<Blob>;
866
- getItems(
867
- ids: string[],
868
- collectionName?: string,
869
- ): Promise<MediaStoreResponse<ItemsPayload>>;
981
+ // (undocumented)
870
982
  getImageMetadata(
871
983
  id: string,
872
984
  params?: MediaStoreGetFileImageParams,
873
985
  ): Promise<{
874
986
  metadata: ImageMetadata;
875
987
  }>;
876
- appendChunksToUpload(
877
- uploadId: string,
878
- body: AppendChunksToUploadRequestBody,
988
+ // (undocumented)
989
+ getItems(
990
+ ids: string[],
879
991
  collectionName?: string,
992
+ ): Promise<MediaStoreResponse<ItemsPayload>>;
993
+ // (undocumented)
994
+ probeChunks(
995
+ chunks: string[],
996
+ {
997
+ collectionName,
998
+ uploadId,
999
+ }?: {
1000
+ collectionName?: string;
1001
+ uploadId?: string;
1002
+ },
1003
+ ): Promise<MediaStoreResponse<MediaChunksProbe>>;
1004
+ // (undocumented)
1005
+ removeCollectionFile(
1006
+ id: string,
1007
+ collectionName: string,
1008
+ occurrenceKey?: string,
880
1009
  ): Promise<void>;
881
- copyFileWithToken(
882
- body: MediaStoreCopyFileWithTokenBody,
883
- params: MediaStoreCopyFileWithTokenParams,
884
- ): Promise<MediaStoreResponse<MediaFile>>;
1010
+ // (undocumented)
885
1011
  request(
886
1012
  path: string,
887
1013
  options?: MediaStoreRequestOptions,
888
1014
  controller?: AbortController,
889
1015
  ): Promise<Response>;
1016
+ // (undocumented)
890
1017
  resolveAuth: (authContext?: AuthContext | undefined) => Promise<Auth>;
1018
+ // (undocumented)
891
1019
  resolveInitialAuth: () => Auth;
1020
+ // (undocumented)
1021
+ touchFiles(
1022
+ body: MediaStoreTouchFileBody,
1023
+ params?: MediaStoreTouchFileParams,
1024
+ ): Promise<MediaStoreResponse<TouchedFiles>>;
1025
+ // (undocumented)
1026
+ uploadChunk(
1027
+ etag: string,
1028
+ blob: Blob,
1029
+ {
1030
+ collectionName,
1031
+ uploadId,
1032
+ partNumber,
1033
+ }?: {
1034
+ collectionName?: string;
1035
+ uploadId?: string;
1036
+ partNumber?: number;
1037
+ },
1038
+ ): Promise<void>;
892
1039
  }
893
1040
 
894
- export declare type MediaStoreCopyFileWithTokenBody = {
1041
+ // @public (undocumented)
1042
+ export type MediaStoreCopyFileWithTokenBody = {
895
1043
  sourceFile: SourceFile;
896
1044
  };
897
1045
 
898
- export declare type MediaStoreCopyFileWithTokenParams = {
1046
+ // @public (undocumented)
1047
+ export type MediaStoreCopyFileWithTokenParams = {
899
1048
  readonly collection?: string;
900
1049
  readonly replaceFileId?: string;
901
1050
  readonly occurrenceKey?: string;
902
1051
  };
903
1052
 
904
- export declare type MediaStoreCreateFileFromBinaryParams = {
1053
+ // @public (undocumented)
1054
+ export type MediaStoreCreateFileFromBinaryParams = {
905
1055
  readonly replaceFileId?: string;
906
1056
  readonly collection?: string;
907
1057
  readonly occurrenceKey?: string;
@@ -910,19 +1060,22 @@ export declare type MediaStoreCreateFileFromBinaryParams = {
910
1060
  readonly name?: string;
911
1061
  };
912
1062
 
913
- export declare type MediaStoreCreateFileFromUploadBody = {
1063
+ // @public (undocumented)
1064
+ export type MediaStoreCreateFileFromUploadBody = {
914
1065
  readonly uploadId: string;
915
1066
  readonly name?: string;
916
1067
  readonly mimeType?: string;
917
1068
  readonly conditions?: MediaStoreCreateFileFromUploadConditions;
918
1069
  };
919
1070
 
920
- export declare type MediaStoreCreateFileFromUploadConditions = {
1071
+ // @public (undocumented)
1072
+ export type MediaStoreCreateFileFromUploadConditions = {
921
1073
  readonly hash: string;
922
1074
  readonly size: number;
923
1075
  };
924
1076
 
925
- export declare type MediaStoreCreateFileFromUploadParams = {
1077
+ // @public (undocumented)
1078
+ export type MediaStoreCreateFileFromUploadParams = {
926
1079
  readonly collection?: string;
927
1080
  readonly occurrenceKey?: string;
928
1081
  readonly expireAfter?: number;
@@ -930,43 +1083,52 @@ export declare type MediaStoreCreateFileFromUploadParams = {
930
1083
  readonly skipConversions?: boolean;
931
1084
  };
932
1085
 
933
- export declare type MediaStoreCreateFileParams = {
1086
+ // @public (undocumented)
1087
+ export type MediaStoreCreateFileParams = {
934
1088
  readonly occurrenceKey?: string;
935
1089
  readonly collection?: string;
936
1090
  };
937
1091
 
938
- export declare class MediaStoreError extends BaseMediaClientError<
1092
+ // @public (undocumented)
1093
+ export class MediaStoreError extends BaseMediaClientError<
939
1094
  MediaStoreErrorAttributes
940
1095
  > {
941
- readonly reason: MediaStoreErrorReason;
942
- readonly innerError?: Error | undefined;
943
1096
  constructor(reason: MediaStoreErrorReason, innerError?: Error | undefined);
1097
+ // (undocumented)
944
1098
  get attributes(): {
945
1099
  reason: MediaStoreErrorReason;
946
1100
  innerError: Error | undefined;
947
1101
  };
1102
+ // (undocumented)
1103
+ readonly innerError?: Error | undefined;
1104
+ // (undocumented)
1105
+ readonly reason: MediaStoreErrorReason;
948
1106
  }
949
1107
 
950
- export declare type MediaStoreErrorAttributes = {
1108
+ // @public (undocumented)
1109
+ export type MediaStoreErrorAttributes = {
951
1110
  readonly reason: MediaStoreErrorReason;
952
1111
  readonly innerError?: Error;
953
1112
  };
954
1113
 
955
- export declare type MediaStoreErrorReason =
1114
+ // @public (undocumented)
1115
+ export type MediaStoreErrorReason =
956
1116
  | 'failedAuthProvider'
957
1117
  | 'tokenExpired'
958
1118
  | 'missingInitialAuth'
959
1119
  | 'emptyAuth'
960
1120
  | 'authProviderTimedOut';
961
1121
 
962
- export declare type MediaStoreGetCollectionItemsParams = {
1122
+ // @public (undocumented)
1123
+ export type MediaStoreGetCollectionItemsParams = {
963
1124
  readonly limit?: number;
964
1125
  readonly inclusiveStartKey?: string;
965
1126
  readonly sortDirection?: 'asc' | 'desc';
966
1127
  readonly details?: 'minimal' | 'full';
967
1128
  };
968
1129
 
969
- export declare type MediaStoreGetFileImageParams = {
1130
+ // @public (undocumented)
1131
+ export type MediaStoreGetFileImageParams = {
970
1132
  readonly allowAnimated?: boolean;
971
1133
  readonly version?: number;
972
1134
  readonly collection?: string;
@@ -977,12 +1139,14 @@ export declare type MediaStoreGetFileImageParams = {
977
1139
  readonly 'max-age'?: number;
978
1140
  };
979
1141
 
980
- export declare type MediaStoreGetFileParams = {
1142
+ // @public (undocumented)
1143
+ export type MediaStoreGetFileParams = {
981
1144
  readonly version?: number;
982
1145
  readonly collection?: string;
983
1146
  };
984
1147
 
985
- export declare type MediaStoreRequestOptions = RequestMetadata & {
1148
+ // @public (undocumented)
1149
+ export type MediaStoreRequestOptions = RequestMetadata & {
986
1150
  readonly method?: RequestMethod;
987
1151
  readonly authContext?: AuthContext;
988
1152
  readonly params?: RequestParams;
@@ -991,64 +1155,87 @@ export declare type MediaStoreRequestOptions = RequestMetadata & {
991
1155
  readonly clientOptions?: ClientOptions;
992
1156
  };
993
1157
 
994
- export declare interface MediaStoreResponse<Data> {
1158
+ // @public (undocumented)
1159
+ export interface MediaStoreResponse<Data> {
1160
+ // (undocumented)
995
1161
  readonly data: Data;
996
1162
  }
997
1163
 
998
- export declare interface MediaStoreTouchFileBody {
1164
+ // @public (undocumented)
1165
+ export interface MediaStoreTouchFileBody {
1166
+ // (undocumented)
999
1167
  descriptors: TouchFileDescriptor[];
1000
1168
  }
1001
1169
 
1002
- export declare interface MediaStoreTouchFileParams {
1170
+ // @public (undocumented)
1171
+ export interface MediaStoreTouchFileParams {
1172
+ // (undocumented)
1003
1173
  readonly collection?: string;
1004
1174
  }
1005
1175
 
1006
- export declare type MediaSubscribable<T extends MediaSubscribableItem> = {
1176
+ // @public (undocumented)
1177
+ export type MediaSubscribable<T> = {
1007
1178
  subscribe(observer?: MediaObserver<T>): MediaSubscription;
1008
1179
  };
1009
1180
 
1010
- export declare type MediaSubscribableItem = FileState | MediaCollectionItem[];
1181
+ // @public (undocumented)
1182
+ export type MediaSubscribableItem = FileState | MediaCollectionItem[];
1011
1183
 
1012
- export declare type MediaSubscription = {
1184
+ // @public (undocumented)
1185
+ export type MediaSubscription = {
1013
1186
  unsubscribe: () => void;
1014
1187
  };
1015
1188
 
1016
1189
  export { MediaType };
1017
1190
 
1018
- export declare type MediaUpload = {
1191
+ // @public (undocumented)
1192
+ export type MediaUpload = {
1019
1193
  readonly id: string;
1020
1194
  readonly created: number;
1021
1195
  readonly expires: number;
1022
1196
  };
1023
1197
 
1024
- export declare interface MediaViewedEventPayload {
1198
+ // @public (undocumented)
1199
+ export interface MediaViewedEventPayload {
1200
+ // (undocumented)
1025
1201
  fileId: string;
1026
- viewingLevel: 'minimal' | 'full' | 'download';
1202
+ // (undocumented)
1027
1203
  isUserCollection?: boolean;
1204
+ // (undocumented)
1205
+ viewingLevel: 'minimal' | 'full' | 'download';
1028
1206
  }
1029
1207
 
1030
- declare interface MobileUpload {
1031
- notifyUploadStart(event: MobileUploadStartEvent): void;
1032
- notifyUploadProgress(event: MobileUploadProgressEvent): void;
1208
+ // @public (undocumented)
1209
+ export interface MobileUpload {
1210
+ // (undocumented)
1033
1211
  notifyUploadEnd(event: MobileUploadEndEvent): void;
1212
+ // (undocumented)
1034
1213
  notifyUploadError(event: MobileUploadErrorEvent): void;
1214
+ // (undocumented)
1215
+ notifyUploadProgress(event: MobileUploadProgressEvent): void;
1216
+ // (undocumented)
1217
+ notifyUploadStart(event: MobileUploadStartEvent): void;
1035
1218
  }
1036
1219
 
1037
- export declare type MobileUploadEndEvent = {
1220
+ // @public (undocumented)
1221
+ export type MobileUploadEndEvent = {
1038
1222
  fileId: string;
1039
1223
  };
1040
1224
 
1041
- export declare type MobileUploadErrorEvent = {
1225
+ // @public (undocumented)
1226
+ export type MobileUploadErrorEvent = {
1042
1227
  fileId: string;
1043
1228
  message: string;
1044
1229
  };
1045
1230
 
1046
- export declare type MobileUploadProgressEvent = {
1231
+ // @public (undocumented)
1232
+ export type MobileUploadProgressEvent = {
1047
1233
  fileId: string;
1048
1234
  progress: number;
1049
1235
  };
1050
1236
 
1051
- export declare type MobileUploadStartEvent = {
1237
+ // @public (undocumented)
1238
+ export type MobileUploadStartEvent = {
1052
1239
  fileId: string;
1053
1240
  collectionName?: string;
1054
1241
  occurrenceKey?: string;
@@ -1059,143 +1246,191 @@ export declare type MobileUploadStartEvent = {
1059
1246
  createdAt?: number;
1060
1247
  };
1061
1248
 
1062
- declare type NextObserver<T extends MediaSubscribableItem> = PartialObserver<
1063
- T
1064
- > &
1249
+ // @public (undocumented)
1250
+ type NextObserver<T> = PartialObserver<T> &
1065
1251
  Required<Pick<PartialObserver<T>, 'next'>>;
1066
1252
 
1067
- export declare type NonErrorFileState = Exclude<FileState, ErrorFileState>;
1253
+ // @public (undocumented)
1254
+ export type NonErrorFileState = Exclude<FileState, ErrorFileState>;
1068
1255
 
1069
- export declare const objectToQueryString: (json: {
1256
+ // @public (undocumented)
1257
+ export const objectToQueryString: (json: {
1070
1258
  [key: string]: string | number | boolean | null | undefined;
1071
1259
  }) => string;
1072
1260
 
1073
- declare type PartialObserver<T extends MediaSubscribableItem> = {
1261
+ // @public (undocumented)
1262
+ type PartialObserver<T> = {
1074
1263
  next?: (value: T) => void;
1075
1264
  error?: (err: any) => void;
1076
1265
  complete?: () => void;
1077
1266
  };
1078
1267
 
1079
- export declare class PollingError extends BaseMediaClientError<
1080
- PollingErrorAttributes
1081
- > {
1082
- readonly reason: PollingErrorReason;
1083
- readonly attempts: number;
1268
+ // @public (undocumented)
1269
+ export class PollingError extends BaseMediaClientError<PollingErrorAttributes> {
1084
1270
  constructor(reason: PollingErrorReason, attempts: number);
1271
+ // (undocumented)
1272
+ readonly attempts: number;
1273
+ // (undocumented)
1085
1274
  get attributes(): {
1086
1275
  reason: 'pollingMaxAttemptsExceeded';
1087
1276
  attempts: number;
1088
1277
  };
1278
+ // (undocumented)
1279
+ readonly reason: PollingErrorReason;
1089
1280
  }
1090
1281
 
1091
- export declare type PollingErrorAttributes = {
1282
+ // @public (undocumented)
1283
+ export type PollingErrorAttributes = {
1092
1284
  readonly reason: PollingErrorReason;
1093
1285
  readonly attempts: number;
1094
1286
  readonly innerError?: Error;
1095
1287
  };
1096
1288
 
1097
- export declare type PollingErrorReason = 'pollingMaxAttemptsExceeded';
1098
-
1099
- /**
1100
- * This class encapsulates polling functionality with the following features:
1101
- *
1102
- * - async executor function provides each attempt
1103
- * - executor will only repeat defined max amount of times (options)
1104
- * - each attempt uses a timeout to the next attempt by an interval (ms)
1105
- * - each attempt increases the timeout interval by a "poll_backoffFactor"
1106
- * - if max attempts are exceeded or executor has exception then onError handler is called
1107
- *
1108
- * IMPORTANT! the executor function must explicitly call ".next()" for the next iteration to run
1109
- */
1110
- export declare class PollingFunction {
1111
- options: PollingOptions;
1112
- poll_intervalMs: number;
1113
- attempt: number;
1114
- shouldIterate: boolean;
1115
- onError?: (error: Error) => void;
1116
- timeoutId: number;
1289
+ // @public (undocumented)
1290
+ export type PollingErrorReason = 'pollingMaxAttemptsExceeded';
1291
+
1292
+ // @public
1293
+ export class PollingFunction {
1117
1294
  constructor(options?: Partial<PollingOptions>);
1295
+ // (undocumented)
1296
+ attempt: number;
1297
+ // (undocumented)
1298
+ cancel(): void;
1299
+ // (undocumented)
1118
1300
  execute(executor: Executor): Promise<void>;
1119
- private fail;
1301
+ // (undocumented)
1120
1302
  getIntervalMsForIteration(iteration: number): number;
1303
+ // (undocumented)
1121
1304
  next(): void;
1122
- cancel(): void;
1305
+ // (undocumented)
1306
+ onError?: (error: Error) => void;
1307
+ // (undocumented)
1308
+ options: PollingOptions;
1309
+ // (undocumented)
1310
+ poll_intervalMs: number;
1311
+ // (undocumented)
1312
+ shouldIterate: boolean;
1313
+ // (undocumented)
1314
+ timeoutId: number;
1123
1315
  }
1124
1316
 
1125
- declare interface PollingOptions {
1317
+ // @public (undocumented)
1318
+ interface PollingOptions {
1319
+ // (undocumented)
1320
+ poll_backoffFactor: number;
1321
+ // (undocumented)
1126
1322
  poll_intervalMs: number;
1323
+ // (undocumented)
1127
1324
  poll_maxAttempts: number;
1128
- poll_backoffFactor: number;
1325
+ // (undocumented)
1129
1326
  poll_maxIntervalMs: number;
1130
1327
  }
1131
1328
 
1132
- export declare interface PreviewableFileState {
1329
+ // @public (undocumented)
1330
+ export interface PreviewableFileState {
1331
+ // (undocumented)
1133
1332
  preview: FilePreview | Promise<FilePreview>;
1134
1333
  }
1135
1334
 
1136
- export declare interface PreviewOptions {}
1335
+ // @public (undocumented)
1336
+ export interface PreviewOptions {}
1137
1337
 
1138
- export declare interface ProcessedFileState {
1139
- status: 'processed';
1140
- id: string;
1141
- occurrenceKey?: string;
1142
- name: string;
1143
- size: number;
1338
+ // @public (undocumented)
1339
+ export interface ProcessedFileState {
1340
+ // (undocumented)
1144
1341
  artifacts: MediaFileArtifacts;
1342
+ // (undocumented)
1343
+ createdAt?: number;
1344
+ // (undocumented)
1345
+ id: string;
1346
+ // (undocumented)
1145
1347
  mediaType: MediaType;
1348
+ // (undocumented)
1146
1349
  mimeType: string;
1350
+ // (undocumented)
1351
+ name: string;
1352
+ // (undocumented)
1353
+ occurrenceKey?: string;
1354
+ // (undocumented)
1147
1355
  preview?: FilePreview | Promise<FilePreview>;
1356
+ // (undocumented)
1148
1357
  representations?: MediaRepresentations;
1149
- createdAt?: number;
1358
+ // (undocumented)
1359
+ size: number;
1360
+ // (undocumented)
1361
+ status: 'processed';
1150
1362
  }
1151
1363
 
1152
- export declare interface ProcessingFailedState {
1153
- status: 'failed-processing';
1154
- id: string;
1155
- occurrenceKey?: string;
1156
- name: string;
1157
- size: number;
1364
+ // @public (undocumented)
1365
+ export interface ProcessingFailedState {
1366
+ // (undocumented)
1158
1367
  artifacts: Object;
1368
+ // (undocumented)
1369
+ createdAt?: number;
1370
+ // (undocumented)
1371
+ id: string;
1372
+ // (undocumented)
1159
1373
  mediaType: MediaType;
1374
+ // (undocumented)
1160
1375
  mimeType: string;
1376
+ // (undocumented)
1377
+ name: string;
1378
+ // (undocumented)
1379
+ occurrenceKey?: string;
1380
+ // (undocumented)
1161
1381
  preview?: FilePreview | Promise<FilePreview>;
1382
+ // (undocumented)
1162
1383
  representations?: MediaRepresentations;
1163
- createdAt?: number;
1384
+ // (undocumented)
1385
+ size: number;
1386
+ // (undocumented)
1387
+ status: 'failed-processing';
1164
1388
  }
1165
1389
 
1166
- export declare interface ProcessingFileState {
1167
- status: 'processing';
1168
- id: string;
1169
- occurrenceKey?: string;
1170
- name: string;
1171
- size: number;
1390
+ // @public (undocumented)
1391
+ export interface ProcessingFileState {
1392
+ // (undocumented)
1172
1393
  artifacts?: MediaFileArtifacts;
1394
+ // (undocumented)
1395
+ createdAt?: number;
1396
+ // (undocumented)
1397
+ id: string;
1398
+ // (undocumented)
1173
1399
  mediaType: MediaType;
1400
+ // (undocumented)
1174
1401
  mimeType: string;
1402
+ // (undocumented)
1403
+ name: string;
1404
+ // (undocumented)
1405
+ occurrenceKey?: string;
1406
+ // (undocumented)
1175
1407
  preview?: FilePreview | Promise<FilePreview>;
1408
+ // (undocumented)
1176
1409
  representations?: MediaRepresentations;
1177
- createdAt?: number;
1410
+ // (undocumented)
1411
+ size: number;
1412
+ // (undocumented)
1413
+ status: 'processing';
1178
1414
  }
1179
1415
 
1180
- export declare const RECENTS_COLLECTION = 'recents';
1416
+ // @public (undocumented)
1417
+ export const RECENTS_COLLECTION = 'recents';
1181
1418
 
1182
- export declare function request(
1419
+ // @public (undocumented)
1420
+ export function request(
1183
1421
  url: string,
1184
1422
  options?: RequestOptions,
1185
1423
  controller?: AbortController,
1186
1424
  ): Promise<Response>;
1187
1425
 
1188
- export declare class RequestError extends BaseMediaClientError<
1189
- RequestErrorAttributes
1190
- > {
1191
- readonly reason: RequestErrorReason;
1192
- readonly metadata?: RequestErrorMetadata | undefined;
1193
- readonly innerError?: Error | undefined;
1426
+ // @public (undocumented)
1427
+ export class RequestError extends BaseMediaClientError<RequestErrorAttributes> {
1194
1428
  constructor(
1195
1429
  reason: RequestErrorReason,
1196
1430
  metadata?: RequestErrorMetadata | undefined,
1197
1431
  innerError?: Error | undefined,
1198
1432
  );
1433
+ // (undocumented)
1199
1434
  get attributes(): {
1200
1435
  reason: RequestErrorReason;
1201
1436
  method: RequestMethod | undefined;
@@ -1207,19 +1442,28 @@ export declare class RequestError extends BaseMediaClientError<
1207
1442
  statusCode: number | undefined;
1208
1443
  innerError: Error | undefined;
1209
1444
  };
1445
+ // (undocumented)
1446
+ readonly innerError?: Error | undefined;
1447
+ // (undocumented)
1448
+ readonly metadata?: RequestErrorMetadata | undefined;
1449
+ // (undocumented)
1450
+ readonly reason: RequestErrorReason;
1210
1451
  }
1211
1452
 
1212
- export declare type RequestErrorAttributes = RequestErrorMetadata & {
1453
+ // @public (undocumented)
1454
+ export type RequestErrorAttributes = RequestErrorMetadata & {
1213
1455
  readonly reason: RequestErrorReason;
1214
1456
  };
1215
1457
 
1216
- export declare type RequestErrorMetadata = RequestMetadata & {
1458
+ // @public (undocumented)
1459
+ export type RequestErrorMetadata = RequestMetadata & {
1217
1460
  readonly attempts?: number;
1218
1461
  readonly clientExhaustedRetries?: boolean;
1219
1462
  readonly statusCode?: number;
1220
1463
  };
1221
1464
 
1222
- export declare type RequestErrorReason =
1465
+ // @public (undocumented)
1466
+ export type RequestErrorReason =
1223
1467
  | 'clientOffline'
1224
1468
  | 'clientAbortedRequest'
1225
1469
  | 'clientTimeoutRequest'
@@ -1233,20 +1477,24 @@ export declare type RequestErrorReason =
1233
1477
  | 'serverBadGateway'
1234
1478
  | 'serverUnexpectedError';
1235
1479
 
1236
- export declare type RequestHeaders = {
1480
+ // @public (undocumented)
1481
+ export type RequestHeaders = {
1237
1482
  [key: string]: string;
1238
1483
  };
1239
1484
 
1240
- export declare type RequestMetadata = {
1485
+ // @public (undocumented)
1486
+ export type RequestMetadata = {
1241
1487
  readonly method?: RequestMethod;
1242
1488
  readonly endpoint?: string;
1243
1489
  readonly mediaRegion?: string;
1244
1490
  readonly mediaEnv?: string;
1245
1491
  };
1246
1492
 
1247
- export declare type RequestMethod = 'GET' | 'POST' | 'PUT' | 'DELETE';
1493
+ // @public (undocumented)
1494
+ export type RequestMethod = 'GET' | 'POST' | 'PUT' | 'DELETE';
1248
1495
 
1249
- export declare type RequestOptions = RequestMetadata & {
1496
+ // @public (undocumented)
1497
+ export type RequestOptions = RequestMetadata & {
1250
1498
  readonly auth?: Auth;
1251
1499
  readonly params?: RequestParams;
1252
1500
  readonly headers?: RequestHeaders;
@@ -1254,136 +1502,178 @@ export declare type RequestOptions = RequestMetadata & {
1254
1502
  readonly clientOptions?: ClientOptions;
1255
1503
  };
1256
1504
 
1257
- export declare type RequestParams = {
1505
+ // @public (undocumented)
1506
+ export type RequestParams = {
1258
1507
  [key: string]: any;
1259
1508
  };
1260
1509
 
1261
- export declare interface ResponseFileItem {
1510
+ // @public (undocumented)
1511
+ export interface ResponseFileItem {
1512
+ // (undocumented)
1513
+ collection?: string;
1514
+ // (undocumented)
1515
+ details: MediaCollectionItemFullDetails;
1516
+ // (undocumented)
1262
1517
  id: string;
1518
+ // (undocumented)
1263
1519
  type: 'file';
1264
- details: MediaCollectionItemFullDetails;
1265
- collection?: string;
1266
1520
  }
1267
1521
 
1268
- export declare type RetryOptions = {
1522
+ // @public (undocumented)
1523
+ export type RetryOptions = {
1269
1524
  readonly startTimeoutInMs: number;
1270
1525
  readonly maxAttempts: number;
1271
1526
  readonly factor: number;
1272
1527
  };
1273
1528
 
1274
- export declare const safeUnsubscribe: (subscription: MediaSubscription) => void;
1529
+ // @public (undocumented)
1530
+ export const safeUnsubscribe: (subscription: MediaSubscription) => void;
1275
1531
 
1276
- export declare interface SourceFile {
1532
+ // @public (undocumented)
1533
+ export interface SourceFile {
1534
+ // (undocumented)
1535
+ collection?: string;
1536
+ // (undocumented)
1277
1537
  id: string;
1538
+ // (undocumented)
1278
1539
  owner: ClientAltBasedAuth | AsapBasedAuth;
1279
- collection?: string;
1540
+ // (undocumented)
1280
1541
  version?: number;
1281
1542
  }
1282
1543
 
1283
- export declare class StargateClient {
1284
- private baseUrl;
1544
+ // @public (undocumented)
1545
+ export class StargateClient {
1285
1546
  constructor(baseUrl: string | undefined);
1547
+ // (undocumented)
1286
1548
  fetchToken(clientId: string): Promise<EdgeData>;
1549
+ // (undocumented)
1287
1550
  isTokenExpired(token: EdgeData): boolean;
1288
1551
  }
1289
1552
 
1290
- export declare class StreamsCache<T> {
1291
- private readonly streams;
1292
- constructor(streams: LRUCache<string, ReplaySubject<T>>);
1293
- has(id: string): boolean;
1294
- set(id: string, stream: ReplaySubject<T>): void;
1295
- get(id: string): ReplaySubject<T> | undefined;
1296
- getOrInsert(id: string, callback: () => ReplaySubject<T>): ReplaySubject<T>;
1297
- removeAll(): void;
1298
- remove(id: string): void;
1299
- get size(): number;
1300
- }
1301
-
1302
- export declare type TouchedFiles = {
1553
+ // @public (undocumented)
1554
+ export type TouchedFiles = {
1303
1555
  created: CreatedTouchedFile[];
1304
1556
  };
1305
1557
 
1306
- export declare interface TouchFileDescriptor {
1307
- fileId: string;
1558
+ // @public (undocumented)
1559
+ export interface TouchFileDescriptor {
1560
+ // (undocumented)
1308
1561
  collection?: string;
1309
- occurrenceKey?: string;
1310
- expireAfter?: number;
1562
+ // (undocumented)
1311
1563
  deletable?: boolean;
1564
+ // (undocumented)
1565
+ expireAfter?: number;
1566
+ // (undocumented)
1567
+ fileId: string;
1568
+ // (undocumented)
1569
+ occurrenceKey?: string;
1312
1570
  }
1313
1571
 
1314
- export declare type UploadableFile = {
1572
+ // @public (undocumented)
1573
+ export type UploadableFile = {
1315
1574
  content: ChunkinatorFile;
1316
1575
  name?: string;
1317
1576
  mimeType?: string;
1318
1577
  collection?: string;
1319
1578
  };
1320
1579
 
1321
- export declare type UploadableFileUpfrontIds = {
1580
+ // @public (undocumented)
1581
+ export type UploadableFileUpfrontIds = {
1322
1582
  id: string;
1323
1583
  deferredUploadId: Promise<string>;
1324
1584
  occurrenceKey?: string;
1325
1585
  };
1326
1586
 
1327
- export declare class UploadController {
1328
- abortFunction?: AbortFunction;
1587
+ // @public (undocumented)
1588
+ export class UploadController {
1329
1589
  constructor();
1330
- setAbort(abortFunction: AbortFunction): void;
1590
+ // (undocumented)
1331
1591
  abort(): void;
1592
+ // (undocumented)
1593
+ abortFunction?: AbortFunction;
1594
+ // (undocumented)
1595
+ setAbort(abortFunction: AbortFunction): void;
1332
1596
  }
1333
1597
 
1334
- export declare type UploadEventPayloadMap = {
1598
+ // @public (undocumented)
1599
+ export type UploadEventPayloadMap = {
1335
1600
  'file-added': FileState;
1336
1601
  'media-viewed': MediaViewedEventPayload;
1337
1602
  };
1338
1603
 
1339
- export declare const uploadFile: (
1604
+ // @public (undocumented)
1605
+ export const uploadFile: (
1340
1606
  file: UploadableFile,
1341
1607
  store: MediaStore,
1342
1608
  uploadableFileUpfrontIds: UploadableFileUpfrontIds,
1343
1609
  callbacks?: UploadFileCallbacks | undefined,
1344
1610
  ) => UploadFileResult;
1345
1611
 
1346
- export declare type UploadFileCallbacks = {
1612
+ // @public (undocumented)
1613
+ export type UploadFileCallbacks = {
1347
1614
  onProgress: (progress: number) => void;
1348
1615
  onUploadFinish: (error?: any) => void;
1349
1616
  };
1350
1617
 
1351
- export declare interface UploadFileResult {
1618
+ // @public (undocumented)
1619
+ export interface UploadFileResult {
1620
+ // (undocumented)
1352
1621
  cancel: () => void;
1353
1622
  }
1354
1623
 
1355
- export declare interface UploadingFileState {
1356
- status: 'uploading';
1624
+ // @public (undocumented)
1625
+ export interface UploadingFileState {
1626
+ // (undocumented)
1627
+ createdAt?: number;
1628
+ // (undocumented)
1357
1629
  id: string;
1358
- occurrenceKey?: string;
1359
- name: string;
1360
- size: number;
1361
- progress: number;
1630
+ // (undocumented)
1362
1631
  mediaType: MediaType;
1632
+ // (undocumented)
1363
1633
  mimeType: string;
1634
+ // (undocumented)
1635
+ name: string;
1636
+ // (undocumented)
1637
+ occurrenceKey?: string;
1638
+ // (undocumented)
1364
1639
  preview?: FilePreview | Promise<FilePreview>;
1365
- createdAt?: number;
1640
+ // (undocumented)
1641
+ progress: number;
1642
+ // (undocumented)
1643
+ size: number;
1644
+ // (undocumented)
1645
+ status: 'uploading';
1366
1646
  }
1367
1647
 
1368
- export declare interface WithMediaClient {
1369
- mediaClient: MediaClient;
1648
+ // @public (undocumented)
1649
+ export interface WithMediaClient {
1650
+ // (undocumented)
1370
1651
  identifier?: Identifier;
1652
+ // (undocumented)
1653
+ mediaClient: MediaClient;
1371
1654
  }
1372
1655
 
1373
- export declare const withMediaClient: WithMediaClientFunction;
1656
+ // @public (undocumented)
1657
+ export const withMediaClient: WithMediaClientFunction;
1374
1658
 
1375
- export declare interface WithMediaClientConfig {
1659
+ // @public (undocumented)
1660
+ export interface WithMediaClientConfig {
1661
+ // (undocumented)
1376
1662
  mediaClientConfig: MediaClientConfig;
1377
1663
  }
1378
1664
 
1379
- export declare type WithMediaClientConfigProps<
1380
- P extends WithMediaClient
1381
- > = Omit<P, 'mediaClient'> & WithMediaClientConfig;
1665
+ // @public (undocumented)
1666
+ export type WithMediaClientConfigProps<P extends WithMediaClient> = Omit<
1667
+ P,
1668
+ 'mediaClient'
1669
+ > &
1670
+ WithMediaClientConfig;
1382
1671
 
1383
- export declare type WithMediaClientFunction = <P extends WithMediaClient>(
1672
+ // @public (undocumented)
1673
+ export type WithMediaClientFunction = <P extends WithMediaClient>(
1384
1674
  Component: React_2.ComponentType<P>,
1385
1675
  featureFlags?: MediaFeatureFlags,
1386
1676
  ) => React_2.ComponentType<WithMediaClientConfigProps<P>>;
1387
1677
 
1388
- export {};
1678
+ // (No @packageDocumentation comment for this package)
1389
1679
  ```