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