@atlaskit/media-client 23.0.0 → 23.0.2

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.
@@ -0,0 +1,1325 @@
1
+ ## API Report File for "@atlaskit/media-client"
2
+
3
+ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
4
+
5
+ ```ts
6
+
7
+ import { AsapBasedAuth } from '@atlaskit/media-core';
8
+ import { Auth } from '@atlaskit/media-core';
9
+ import { AuthContext } from '@atlaskit/media-core';
10
+ import { AuthProvider } from '@atlaskit/media-core';
11
+ import { ChunkinatorFile } from '@atlaskit/chunkinator';
12
+ import { ClientAltBasedAuth } from '@atlaskit/media-core';
13
+ import { FileStatus as FileStatus_2 } from '@atlaskit/media-common';
14
+ import { MediaApiConfig } from '@atlaskit/media-core';
15
+ import { MediaClientConfig } from '@atlaskit/media-core';
16
+ import { MediaFeatureFlags } from '@atlaskit/media-common';
17
+ import { MediaTraceContext } from '@atlaskit/media-common';
18
+ import { MediaType } from '@atlaskit/media-common';
19
+ import { default as React_2 } from 'react';
20
+ import { ReplaySubject } from 'rxjs/ReplaySubject';
21
+
22
+ // @public (undocumented)
23
+ export type AbortFunction = () => void;
24
+
25
+ // @public (undocumented)
26
+ export const addFileAttrsToUrl: (url: string, fileAttrs: MediaBlobUrlAttrs) => string;
27
+
28
+ // @public (undocumented)
29
+ export type AppendChunksToUploadRequestBody = {
30
+ readonly chunks: string[];
31
+ readonly hash?: string;
32
+ readonly offset?: number;
33
+ };
34
+
35
+ // @public (undocumented)
36
+ export type Artifacts = {
37
+ [name: string]: MediaArtifact;
38
+ };
39
+
40
+ // @public (undocumented)
41
+ type BaseFileState = {
42
+ metadataTraceContext?: MediaTraceContext;
43
+ };
44
+
45
+ // @public
46
+ abstract class BaseMediaClientError<Attributes extends MediaClientErrorAttributes> extends Error implements MediaClientError<Attributes> {
47
+ constructor(message: string);
48
+ // (undocumented)
49
+ abstract get attributes(): Attributes;
50
+ // (undocumented)
51
+ readonly message: string;
52
+ }
53
+
54
+ // @public (undocumented)
55
+ export const checkWebpSupport: () => Promise<boolean>;
56
+
57
+ // @public (undocumented)
58
+ export type ClientOptions = {
59
+ readonly retryOptions?: Partial<RetryOptions>;
60
+ readonly clientTimeout?: number;
61
+ };
62
+
63
+ // @public (undocumented)
64
+ type CompletionObserver = PartialObserver & Required<Pick<PartialObserver, 'complete'>>;
65
+
66
+ // @public (undocumented)
67
+ export interface CopyDestination extends MediaStoreCopyFileWithTokenParams {
68
+ // (undocumented)
69
+ authProvider: AuthProvider;
70
+ // (undocumented)
71
+ mediaStore?: MediaStore;
72
+ }
73
+
74
+ // @public (undocumented)
75
+ export interface CopyFileOptions {
76
+ // (undocumented)
77
+ mimeType?: string;
78
+ // (undocumented)
79
+ preview?: FilePreview | Promise<FilePreview>;
80
+ }
81
+
82
+ // @public (undocumented)
83
+ export interface CopySourceFile {
84
+ // (undocumented)
85
+ authProvider: AuthProvider;
86
+ // (undocumented)
87
+ collection?: string;
88
+ // (undocumented)
89
+ id: string;
90
+ }
91
+
92
+ // @public (undocumented)
93
+ export interface CreatedTouchedFile {
94
+ // (undocumented)
95
+ fileId: string;
96
+ // (undocumented)
97
+ uploadId: string;
98
+ }
99
+
100
+ // @public (undocumented)
101
+ export function createMediaSubject<T extends FileState>(initialState?: Error | T): ReplaySubject<T>;
102
+
103
+ // @public (undocumented)
104
+ export function createMediaSubscribable(item?: Error | FileState): MediaSubscribable;
105
+
106
+ // @public (undocumented)
107
+ export function createUrl(url: string, { params, auth }: CreateUrlOptions): string;
108
+
109
+ // @public (undocumented)
110
+ export type CreateUrlOptions = {
111
+ readonly params?: RequestParams;
112
+ readonly auth?: Auth;
113
+ };
114
+
115
+ // @public (undocumented)
116
+ export type Dimensions = {
117
+ width: number;
118
+ height: number;
119
+ };
120
+
121
+ // @public (undocumented)
122
+ export interface EdgeData {
123
+ // (undocumented)
124
+ data: {
125
+ clientId: string;
126
+ token: string;
127
+ baseUrl: string;
128
+ expiresIn: number;
129
+ iat: number;
130
+ };
131
+ }
132
+
133
+ // @public (undocumented)
134
+ export interface EmptyFile {
135
+ // (undocumented)
136
+ readonly createdAt: number;
137
+ // (undocumented)
138
+ readonly id: string;
139
+ }
140
+
141
+ // @public (undocumented)
142
+ export interface ErrorFileState extends BaseFileState {
143
+ // (undocumented)
144
+ id: string;
145
+ // (undocumented)
146
+ message?: string;
147
+ // (undocumented)
148
+ occurrenceKey?: string;
149
+ // (undocumented)
150
+ status: 'error';
151
+ }
152
+
153
+ // @public (undocumented)
154
+ type ErrorObserver = PartialObserver & Required<Pick<PartialObserver, 'error'>>;
155
+
156
+ // @public (undocumented)
157
+ export type EventPayloadListener<M extends EventPayloadMap<P>, E extends keyof M, P = any> = (payload: M[E]) => void;
158
+
159
+ // @public (undocumented)
160
+ type EventPayloadMap<P> = {
161
+ readonly [event: string]: P;
162
+ };
163
+
164
+ // @public (undocumented)
165
+ export type Executor = () => Promise<void>;
166
+
167
+ // @public (undocumented)
168
+ export interface ExternalImageIdentifier {
169
+ // (undocumented)
170
+ readonly dataURI: string;
171
+ // (undocumented)
172
+ readonly mediaItemType: 'external-image';
173
+ // (undocumented)
174
+ readonly name?: string;
175
+ }
176
+
177
+ // @public (undocumented)
178
+ type ExternalUploadPayload = {
179
+ uploadableFileUpfrontIds: UploadableFileUpfrontIds;
180
+ dimensions: Dimensions;
181
+ };
182
+
183
+ // @public (undocumented)
184
+ export interface FileDetails {
185
+ // (undocumented)
186
+ artifacts?: Artifacts;
187
+ // (undocumented)
188
+ createdAt?: number;
189
+ // (undocumented)
190
+ creationDate?: number;
191
+ // (undocumented)
192
+ id: string;
193
+ // (undocumented)
194
+ mediaType?: MediaType;
195
+ // (undocumented)
196
+ mimeType?: string;
197
+ // (undocumented)
198
+ name?: string;
199
+ // (undocumented)
200
+ processingStatus?: FileProcessingStatus;
201
+ // (undocumented)
202
+ size?: number;
203
+ }
204
+
205
+ // @public (undocumented)
206
+ export interface FileFetcher {
207
+ // (undocumented)
208
+ copyFile(source: CopySourceFile, destination: CopyDestination, options?: CopyFileOptions, traceContext?: MediaTraceContext): Promise<MediaFile>;
209
+ // (undocumented)
210
+ downloadBinary(id: string, name?: string, collectionName?: string): Promise<void>;
211
+ // (undocumented)
212
+ getArtifactURL(artifacts: MediaFileArtifacts, artifactName: keyof MediaFileArtifacts, collectionName?: string): Promise<string>;
213
+ // (undocumented)
214
+ getCurrentState(id: string, options?: GetFileOptions): Promise<FileState>;
215
+ // (undocumented)
216
+ getFileBinaryURL(id: string, collectionName?: string): Promise<string>;
217
+ // (undocumented)
218
+ getFileState(id: string, options?: GetFileOptions): MediaSubscribable;
219
+ // (undocumented)
220
+ touchFiles(descriptors: TouchFileDescriptor[], collection?: string, traceContext?: MediaTraceContext): Promise<TouchedFiles>;
221
+ // (undocumented)
222
+ upload(file: UploadableFile, controller?: UploadController, uploadableFileUpfrontIds?: UploadableFileUpfrontIds, traceContext?: MediaTraceContext): MediaSubscribable;
223
+ // (undocumented)
224
+ uploadExternal(url: string, collection?: string, traceContext?: MediaTraceContext): Promise<ExternalUploadPayload>;
225
+ }
226
+
227
+ // @public (undocumented)
228
+ export class FileFetcherError extends BaseMediaClientError<FileFetcherErrorAttributes> {
229
+ constructor(reason: FileFetcherErrorReason, id: string, metadata?: undefined | {
230
+ readonly collectionName?: string | undefined;
231
+ readonly occurrenceKey?: string | undefined;
232
+ });
233
+ // (undocumented)
234
+ get attributes(): {
235
+ reason: FileFetcherErrorReason;
236
+ id: string;
237
+ collectionName: string | undefined;
238
+ occurrenceKey: string | undefined;
239
+ };
240
+ // (undocumented)
241
+ readonly id: string;
242
+ // (undocumented)
243
+ readonly metadata?: undefined | {
244
+ readonly collectionName?: string | undefined;
245
+ readonly occurrenceKey?: string | undefined;
246
+ };
247
+ // (undocumented)
248
+ readonly reason: FileFetcherErrorReason;
249
+ }
250
+
251
+ // @public (undocumented)
252
+ export type FileFetcherErrorAttributes = {
253
+ readonly reason: FileFetcherErrorReason;
254
+ readonly id: string;
255
+ readonly metadata?: {
256
+ readonly collectionName?: string;
257
+ readonly occurrenceKey?: string;
258
+ };
259
+ };
260
+
261
+ // @public (undocumented)
262
+ export type FileFetcherErrorReason = 'emptyFileName' | 'emptyItems' | 'invalidFileId' | 'zeroVersionFile';
263
+
264
+ // @public (undocumented)
265
+ export class FileFetcherImpl implements FileFetcher {
266
+ constructor(mediaStore: MediaStore);
267
+ // (undocumented)
268
+ copyFile(source: CopySourceFile, destination: CopyDestination, options?: CopyFileOptions, traceContext?: MediaTraceContext): Promise<MediaFile>;
269
+ // (undocumented)
270
+ downloadBinary(id: string, name?: string, collectionName?: string): Promise<void>;
271
+ // (undocumented)
272
+ getArtifactURL(artifacts: MediaFileArtifacts, artifactName: keyof MediaFileArtifacts, collectionName?: string): Promise<string>;
273
+ // (undocumented)
274
+ getCurrentState(id: string, options?: GetFileOptions): Promise<FileState>;
275
+ // (undocumented)
276
+ getFileBinaryURL(id: string, collectionName?: string): Promise<string>;
277
+ // (undocumented)
278
+ getFileState(id: string, options?: GetFileOptions): MediaSubscribable;
279
+ // (undocumented)
280
+ touchFiles(descriptors: TouchFileDescriptor[], collection?: string, traceContext?: MediaTraceContext): Promise<TouchedFiles>;
281
+ // (undocumented)
282
+ upload(file: UploadableFile, controller?: UploadController, uploadableFileUpfrontIds?: UploadableFileUpfrontIds, traceContext?: MediaTraceContext): MediaSubscribable;
283
+ // (undocumented)
284
+ uploadExternal(url: string, collection?: string, traceContext?: MediaTraceContext): Promise<ExternalUploadPayload>;
285
+ }
286
+
287
+ // @public (undocumented)
288
+ export interface FileIdentifier {
289
+ // (undocumented)
290
+ readonly collectionName?: string;
291
+ // (undocumented)
292
+ readonly id: string;
293
+ // (undocumented)
294
+ readonly mediaItemType: 'file';
295
+ // (undocumented)
296
+ readonly occurrenceKey?: string;
297
+ }
298
+
299
+ // @public (undocumented)
300
+ export interface FileItem {
301
+ // (undocumented)
302
+ details: FileDetails;
303
+ // (undocumented)
304
+ type: 'file';
305
+ }
306
+
307
+ // @public (undocumented)
308
+ export interface FilePreview {
309
+ // (undocumented)
310
+ origin?: 'local' | 'remote';
311
+ // (undocumented)
312
+ originalDimensions?: {
313
+ width: number;
314
+ height: number;
315
+ };
316
+ // (undocumented)
317
+ value: Blob | string;
318
+ }
319
+
320
+ // @public (undocumented)
321
+ export type FileProcessingStatus = 'failed' | 'pending' | 'running' | 'succeeded';
322
+
323
+ // @public (undocumented)
324
+ export type FileState = ErrorFileState | ProcessedFileState | ProcessingFailedState | ProcessingFileState | UploadingFileState;
325
+
326
+ // @public (undocumented)
327
+ export type FileStatus = FileStatus_2;
328
+
329
+ // @public (undocumented)
330
+ export function fromObservable(observable: ReplaySubject<FileState>): MediaSubscribable;
331
+
332
+ // @public (undocumented)
333
+ export const getArtifactUrl: (artifacts: MediaFileArtifacts, prop: keyof MediaFileArtifacts) => string | undefined;
334
+
335
+ // @public (undocumented)
336
+ export const getAttrsFromUrl: (blobUrl: string) => MediaBlobUrlAttrs | undefined;
337
+
338
+ // @public (undocumented)
339
+ export const getDimensionsFromBlob: (mediaType: MediaType, blob: Blob) => Promise<Dimensions>;
340
+
341
+ // @public (undocumented)
342
+ export interface GetFileOptions {
343
+ // (undocumented)
344
+ collectionName?: string;
345
+ // (undocumented)
346
+ occurrenceKey?: string;
347
+ // (undocumented)
348
+ preview?: PreviewOptions;
349
+ }
350
+
351
+ // @public (undocumented)
352
+ export const getMediaClient: (mediaClientConfig: MediaClientConfig, featureFlags?: MediaFeatureFlags) => MediaClient;
353
+
354
+ // @public (undocumented)
355
+ export function getMediaClientErrorReason(err: Error): 'unknown' | MediaClientErrorReason;
356
+
357
+ // @public (undocumented)
358
+ export const getMediaEnvironment: () => string | undefined;
359
+
360
+ // @public (undocumented)
361
+ export const getMediaRegion: () => string | undefined;
362
+
363
+ // @public @deprecated (undocumented)
364
+ export const getMediaTypeFromMimeType: (mimeType: string) => MediaType;
365
+
366
+ // @public (undocumented)
367
+ export const globalMediaEventEmitter: {
368
+ on<E extends keyof UploadEventPayloadMap>(event: E, listener: EventPayloadListener<UploadEventPayloadMap, E, any>): void;
369
+ off<E_1 extends keyof UploadEventPayloadMap>(event: E_1, listener: EventPayloadListener<UploadEventPayloadMap, E_1, any>): void;
370
+ emit<E_2 extends keyof UploadEventPayloadMap>(event: E_2, payload: UploadEventPayloadMap[E_2]): boolean | undefined;
371
+ };
372
+
373
+ // @public (undocumented)
374
+ export type Identifier = ExternalImageIdentifier | FileIdentifier;
375
+
376
+ // @public (undocumented)
377
+ export interface ImageMetadata {
378
+ // (undocumented)
379
+ original?: ImageMetadataArtifact;
380
+ // (undocumented)
381
+ pending: boolean;
382
+ // (undocumented)
383
+ preview?: ImageMetadataArtifact;
384
+ }
385
+
386
+ // @public (undocumented)
387
+ export type ImageMetadataArtifact = {
388
+ url?: string;
389
+ width?: number;
390
+ height?: number;
391
+ size?: number;
392
+ };
393
+
394
+ // @public (undocumented)
395
+ export type ImageResizeMode = 'crop' | 'fit' | 'full-fit' | 'stretchy-fit';
396
+
397
+ // @public (undocumented)
398
+ export const imageResizeModeToFileImageMode: (resizeMode?: ImageResizeMode) => MediaStoreGetFileImageParams['mode'];
399
+
400
+ // @public (undocumented)
401
+ export function isAbortedRequestError(err: any): boolean;
402
+
403
+ // @public @deprecated (undocumented)
404
+ export const isAudioMimeTypeSupportedByServer: (mimeType: string) => boolean;
405
+
406
+ // @public (undocumented)
407
+ export const isDifferentIdentifier: (a: Identifier, b: Identifier) => boolean;
408
+
409
+ // @public @deprecated (undocumented)
410
+ export const isDocumentMimeTypeSupportedByBrowser: (mimeType: string) => boolean;
411
+
412
+ // @public @deprecated (undocumented)
413
+ export const isDocumentMimeTypeSupportedByServer: (mimeType: string) => boolean;
414
+
415
+ // @public (undocumented)
416
+ export const isErrorFileState: (fileState: FileState) => fileState is ErrorFileState;
417
+
418
+ // @public (undocumented)
419
+ export const isExternalImageIdentifier: (identifier: Identifier) => identifier is ExternalImageIdentifier;
420
+
421
+ // @public (undocumented)
422
+ export function isFileFetcherError(err: Error): err is FileFetcherError;
423
+
424
+ // @public (undocumented)
425
+ export const isFileIdentifier: (identifier: Identifier) => identifier is FileIdentifier;
426
+
427
+ // @public (undocumented)
428
+ export const isFinalFileState: (fileState: FileState) => fileState is ErrorFileState | ProcessedFileState | ProcessingFailedState;
429
+
430
+ // @public @deprecated (undocumented)
431
+ export const isImageMimeTypeSupportedByBrowser: (mimeType: string) => boolean;
432
+
433
+ // @public @deprecated (undocumented)
434
+ export const isImageMimeTypeSupportedByServer: (mimeType: string) => boolean;
435
+
436
+ // @public (undocumented)
437
+ export const isImageRemote: (imageUrl: string, windowOrigin?: string) => boolean;
438
+
439
+ // @public (undocumented)
440
+ export const isImageRepresentationReady: (fileState: FileState) => boolean;
441
+
442
+ // @public (undocumented)
443
+ export const isMediaBlobUrl: (url: string) => boolean;
444
+
445
+ // @public (undocumented)
446
+ export function isMediaClientError(error: any): error is MediaClientError<{
447
+ reason: MediaClientErrorReason;
448
+ }>;
449
+
450
+ // @public (undocumented)
451
+ export function isMediaStoreError(err: Error): err is MediaStoreError;
452
+
453
+ // @public @deprecated (undocumented)
454
+ export const isMimeTypeSupportedByBrowser: (mimeType: string) => boolean;
455
+
456
+ // @public @deprecated (undocumented)
457
+ export const isMimeTypeSupportedByServer: (mimeType: string) => boolean;
458
+
459
+ // @public (undocumented)
460
+ export function isPollingError(err?: Error): err is PollingError;
461
+
462
+ // @public (undocumented)
463
+ export const isPreviewableFileState: (fileState: FileState) => fileState is (ProcessedFileState | ProcessingFailedState | ProcessingFileState | UploadingFileState) & PreviewableFileState;
464
+
465
+ // @public (undocumented)
466
+ export const isPreviewableType: (type: MediaType) => boolean;
467
+
468
+ // @public (undocumented)
469
+ export const isProcessedFileState: (fileState: FileState) => fileState is ProcessedFileState;
470
+
471
+ // @public (undocumented)
472
+ export const isProcessingFileState: (fileState: FileState) => fileState is ProcessingFileState;
473
+
474
+ // @public (undocumented)
475
+ export function isRateLimitedError(error: Error | undefined): boolean;
476
+
477
+ // @public (undocumented)
478
+ export function isRequestError(err: Error): err is RequestError;
479
+
480
+ // @public @deprecated (undocumented)
481
+ export const isUnknownMimeTypeSupportedByServer: (mimeType: string) => boolean;
482
+
483
+ // @public (undocumented)
484
+ export const isUploadingFileState: (fileState: FileState) => fileState is UploadingFileState;
485
+
486
+ // @public @deprecated (undocumented)
487
+ export const isVideoMimeTypeSupportedByServer: (mimeType: string) => boolean;
488
+
489
+ // @public (undocumented)
490
+ export interface ItemsPayload {
491
+ // (undocumented)
492
+ items: ResponseFileItem[];
493
+ }
494
+
495
+ // @public (undocumented)
496
+ export const mapMediaFileToFileState: (mediaFile: MediaStoreResponse<MediaFile>) => FileState;
497
+
498
+ // @public (undocumented)
499
+ export const mapMediaItemToFileState: (id: string, item: MediaItemDetails) => FileState;
500
+
501
+ // @public @deprecated (undocumented)
502
+ export function mapResponseToBlob(response: Response): Promise<Blob>;
503
+
504
+ // @public @deprecated (undocumented)
505
+ export function mapResponseToJson(response: Response): Promise<any>;
506
+
507
+ // @public @deprecated (undocumented)
508
+ export function mapResponseToVoid(): Promise<void>;
509
+
510
+ // @public (undocumented)
511
+ export const MAX_RESOLUTION = 4096;
512
+
513
+ // @public (undocumented)
514
+ export interface MediaArtifact {
515
+ // (undocumented)
516
+ processingStatus?: FileProcessingStatus;
517
+ // (undocumented)
518
+ url?: string;
519
+ }
520
+
521
+ // @public (undocumented)
522
+ export interface MediaBlobUrlAttrs {
523
+ // (undocumented)
524
+ alt?: string;
525
+ // (undocumented)
526
+ collection?: string;
527
+ // (undocumented)
528
+ contextId: string;
529
+ // (undocumented)
530
+ height?: number;
531
+ // (undocumented)
532
+ id: string;
533
+ // (undocumented)
534
+ mimeType?: string;
535
+ // (undocumented)
536
+ name?: string;
537
+ // (undocumented)
538
+ size?: number;
539
+ // (undocumented)
540
+ width?: number;
541
+ }
542
+
543
+ // @public (undocumented)
544
+ export type MediaChunksProbe = {
545
+ readonly results: {
546
+ readonly [etag: string]: {
547
+ readonly exists: boolean;
548
+ };
549
+ };
550
+ };
551
+
552
+ // @public (undocumented)
553
+ export class MediaClient {
554
+ constructor(mediaClientConfig: MediaClientConfig, featureFlags?: MediaFeatureFlags | undefined);
555
+ // (undocumented)
556
+ readonly config: MediaClientConfig;
557
+ // (undocumented)
558
+ emit<E extends keyof UploadEventPayloadMap>(event: E, payload: UploadEventPayloadMap[E]): boolean;
559
+ // (undocumented)
560
+ readonly featureFlags?: MediaFeatureFlags | undefined;
561
+ // (undocumented)
562
+ readonly file: FileFetcher;
563
+ // (undocumented)
564
+ getImage(id: string, params?: MediaStoreGetFileImageParams, controller?: AbortController, fetchMaxRes?: boolean, traceContext?: MediaTraceContext): Promise<Blob>;
565
+ // (undocumented)
566
+ getImageMetadata(id: string, params?: MediaStoreGetFileImageParams): Promise<ImageMetadata>;
567
+ // (undocumented)
568
+ getImageUrl(id: string, params?: MediaStoreGetFileImageParams): Promise<string>;
569
+ // (undocumented)
570
+ getImageUrlSync(id: string, params?: MediaStoreGetFileImageParams): string;
571
+ // (undocumented)
572
+ readonly mediaClientConfig: MediaClientConfig;
573
+ // (undocumented)
574
+ readonly mediaStore: MediaStore;
575
+ // (undocumented)
576
+ mobileUploadPromise(): Promise<MobileUpload>;
577
+ // (undocumented)
578
+ off<E extends keyof UploadEventPayloadMap>(event: E, listener: EventPayloadListener<UploadEventPayloadMap, E>): void;
579
+ // (undocumented)
580
+ on<E extends keyof UploadEventPayloadMap>(event: E, listener: EventPayloadListener<UploadEventPayloadMap, E>): void;
581
+ // (undocumented)
582
+ removeFileFromCollection(id: string, collectionName: string, occurrenceKey?: string, traceContext?: MediaTraceContext): Promise<void>;
583
+ // (undocumented)
584
+ readonly stargate: StargateClient;
585
+ }
586
+
587
+ // @public
588
+ export interface MediaClientError<Attributes extends MediaClientErrorAttributes> extends Error {
589
+ // (undocumented)
590
+ readonly attributes: Attributes;
591
+ }
592
+
593
+ // @public (undocumented)
594
+ export interface MediaClientErrorAttributes {
595
+ // (undocumented)
596
+ reason: MediaClientErrorReason;
597
+ }
598
+
599
+ // @public (undocumented)
600
+ export type MediaClientErrorReason = 'authProviderTimedOut' | 'clientAbortedRequest' | 'clientOffline' | 'clientTimeoutRequest' | 'deprecatedEndpoint' | 'emptyAuth' | 'emptyFileName' | 'emptyItems' | 'failedAuthProvider' | 'fileSizeExceedsLimit' | 'invalidFileId' | 'missingInitialAuth' | 'pollingMaxAttemptsExceeded' | 'serverBadGateway' | 'serverBadRequest' | 'serverForbidden' | 'serverInternalError' | 'serverInvalidBody' | 'serverNotFound' | 'serverRateLimited' | 'serverUnauthorized' | 'serverUnexpectedError' | 'tokenExpired' | 'zeroVersionFile';
601
+
602
+ // @public (undocumented)
603
+ export type MediaFile = {
604
+ readonly id: string;
605
+ readonly mediaType: MediaType;
606
+ readonly mimeType: string;
607
+ readonly name: string;
608
+ readonly processingStatus?: MediaFileProcessingStatus;
609
+ readonly size: number;
610
+ readonly artifacts: MediaFileArtifacts;
611
+ readonly representations: MediaRepresentations;
612
+ readonly createdAt?: number;
613
+ readonly metadataTraceContext?: MediaTraceContext;
614
+ };
615
+
616
+ // @public (undocumented)
617
+ export type MediaFileArtifact = {
618
+ readonly url: string;
619
+ readonly processingStatus: MediaFileProcessingStatus;
620
+ };
621
+
622
+ // @public (undocumented)
623
+ export interface MediaFileArtifacts {
624
+ // (undocumented)
625
+ 'audio.mp3'?: MediaFileArtifact;
626
+ // (undocumented)
627
+ 'document.pdf'?: MediaFileArtifact;
628
+ // (undocumented)
629
+ 'video_1280.mp4'?: MediaFileArtifact;
630
+ // (undocumented)
631
+ 'video_640.mp4'?: MediaFileArtifact;
632
+ }
633
+
634
+ // @public (undocumented)
635
+ export type MediaFileProcessingStatus = 'failed' | 'pending' | 'succeeded';
636
+
637
+ // @public (undocumented)
638
+ export type MediaItemDetails = {
639
+ readonly mediaType: MediaType;
640
+ readonly mimeType: string;
641
+ readonly name: string;
642
+ readonly processingStatus: MediaFileProcessingStatus;
643
+ readonly size: number;
644
+ readonly artifacts: MediaFileArtifacts;
645
+ readonly representations: MediaRepresentations;
646
+ readonly createdAt?: number;
647
+ readonly metadataTraceContext?: MediaTraceContext;
648
+ };
649
+
650
+ // @public (undocumented)
651
+ export type MediaItemType = 'external-image' | 'file';
652
+
653
+ // @public (undocumented)
654
+ export type MediaObserver = ((value: FileState) => void) | CompletionObserver | ErrorObserver | NextObserver;
655
+
656
+ // @public (undocumented)
657
+ export type MediaRepresentations = {
658
+ image?: Object;
659
+ };
660
+
661
+ // @public (undocumented)
662
+ export class MediaStore {
663
+ constructor(config: MediaApiConfig, featureFlags?: MediaFeatureFlags | undefined);
664
+ // (undocumented)
665
+ appendChunksToUpload(uploadId: string, body: AppendChunksToUploadRequestBody, collectionName?: string, traceContext?: MediaTraceContext): Promise<void>;
666
+ // (undocumented)
667
+ copyFileWithToken(body: MediaStoreCopyFileWithTokenBody, params: MediaStoreCopyFileWithTokenParams, traceContext?: MediaTraceContext): Promise<MediaStoreResponse<MediaFile>>;
668
+ // (undocumented)
669
+ createFileFromUpload(body: MediaStoreCreateFileFromUploadBody, params?: MediaStoreCreateFileFromUploadParams, traceContext?: MediaTraceContext): Promise<MediaStoreResponse<MediaFile>>;
670
+ // (undocumented)
671
+ createUpload(createUpTo?: number, collectionName?: string, traceContext?: MediaTraceContext): Promise<MediaStoreResponse<MediaUpload[]>>;
672
+ // (undocumented)
673
+ readonly featureFlags?: MediaFeatureFlags | undefined;
674
+ // (undocumented)
675
+ getArtifactURL(artifacts: MediaFileArtifacts, artifactName: keyof MediaFileArtifacts, collectionName?: string): Promise<string>;
676
+ // (undocumented)
677
+ getFile(fileId: string, params?: MediaStoreGetFileParams, traceContext?: MediaTraceContext): Promise<MediaStoreResponse<MediaFile>>;
678
+ // (undocumented)
679
+ getFileBinaryURL(id: string, collectionName?: string): Promise<string>;
680
+ // (undocumented)
681
+ getFileImageURL(id: string, params?: MediaStoreGetFileImageParams): Promise<string>;
682
+ // (undocumented)
683
+ getFileImageURLSync(id: string, params?: MediaStoreGetFileImageParams): string;
684
+ // (undocumented)
685
+ getImage(id: string, params?: MediaStoreGetFileImageParams, controller?: AbortController, fetchMaxRes?: boolean, traceContext?: MediaTraceContext): Promise<Blob>;
686
+ // (undocumented)
687
+ getImageMetadata(id: string, params?: MediaStoreGetFileImageParams, traceContext?: MediaTraceContext): Promise<{
688
+ metadata: ImageMetadata;
689
+ }>;
690
+ // (undocumented)
691
+ getItems(ids: string[], collectionName?: string, traceContext?: MediaTraceContext): Promise<MediaStoreResponse<ItemsPayload>>;
692
+ // (undocumented)
693
+ getRejectedResponseFromDescriptor(descriptor: TouchFileDescriptor, limit: number): RejectedTouchFile;
694
+ // (undocumented)
695
+ probeChunks(chunks: string[], uploadId: string, collectionName?: string, traceContext?: MediaTraceContext): Promise<MediaStoreResponse<MediaChunksProbe>>;
696
+ // (undocumented)
697
+ removeCollectionFile(id: string, collectionName: string, occurrenceKey?: string, traceContext?: MediaTraceContext): Promise<void>;
698
+ // (undocumented)
699
+ request(path: string, options?: MediaStoreRequestOptions, controller?: AbortController): Promise<Response>;
700
+ // (undocumented)
701
+ resolveAuth: (authContext?: AuthContext) => Promise<Auth>;
702
+ // (undocumented)
703
+ resolveInitialAuth: () => Auth;
704
+ // (undocumented)
705
+ touchFiles(body: MediaStoreTouchFileBody, params?: MediaStoreTouchFileParams, traceContext?: MediaTraceContext): Promise<MediaStoreResponse<TouchedFiles>>;
706
+ // (undocumented)
707
+ uploadChunk(etag: string, blob: Blob, uploadId: string, partNumber: number, collectionName?: string, traceContext?: MediaTraceContext): Promise<void>;
708
+ }
709
+
710
+ // @public (undocumented)
711
+ export type MediaStoreCopyFileWithTokenBody = {
712
+ sourceFile: SourceFile;
713
+ };
714
+
715
+ // @public (undocumented)
716
+ export type MediaStoreCopyFileWithTokenParams = {
717
+ readonly collection?: string;
718
+ readonly replaceFileId?: string;
719
+ readonly occurrenceKey?: string;
720
+ };
721
+
722
+ // @public (undocumented)
723
+ export type MediaStoreCreateFileFromBinaryParams = {
724
+ readonly replaceFileId?: string;
725
+ readonly collection?: string;
726
+ readonly occurrenceKey?: string;
727
+ readonly expireAfter?: number;
728
+ readonly skipConversions?: boolean;
729
+ readonly name?: string;
730
+ };
731
+
732
+ // @public (undocumented)
733
+ export type MediaStoreCreateFileFromUploadBody = {
734
+ readonly uploadId: string;
735
+ readonly name?: string;
736
+ readonly mimeType?: string;
737
+ readonly conditions?: MediaStoreCreateFileFromUploadConditions;
738
+ };
739
+
740
+ // @public (undocumented)
741
+ export type MediaStoreCreateFileFromUploadConditions = {
742
+ readonly hash?: string;
743
+ readonly size?: number;
744
+ };
745
+
746
+ // @public (undocumented)
747
+ export type MediaStoreCreateFileFromUploadParams = {
748
+ readonly collection?: string;
749
+ readonly occurrenceKey?: string;
750
+ readonly expireAfter?: number;
751
+ readonly replaceFileId?: string;
752
+ readonly skipConversions?: boolean;
753
+ };
754
+
755
+ // @public (undocumented)
756
+ export type MediaStoreCreateFileParams = {
757
+ readonly occurrenceKey?: string;
758
+ readonly collection?: string;
759
+ };
760
+
761
+ // @public (undocumented)
762
+ export class MediaStoreError extends BaseMediaClientError<MediaStoreErrorAttributes> {
763
+ constructor(reason: MediaStoreErrorReason, innerError?: Error | undefined);
764
+ // (undocumented)
765
+ get attributes(): {
766
+ reason: MediaStoreErrorReason;
767
+ innerError: Error | undefined;
768
+ };
769
+ // (undocumented)
770
+ readonly innerError?: Error | undefined;
771
+ // (undocumented)
772
+ readonly reason: MediaStoreErrorReason;
773
+ }
774
+
775
+ // @public (undocumented)
776
+ export type MediaStoreErrorAttributes = {
777
+ readonly reason: MediaStoreErrorReason;
778
+ readonly innerError?: Error;
779
+ };
780
+
781
+ // @public (undocumented)
782
+ export type MediaStoreErrorReason = 'authProviderTimedOut' | 'emptyAuth' | 'failedAuthProvider' | 'missingInitialAuth' | 'tokenExpired';
783
+
784
+ // @public (undocumented)
785
+ export type MediaStoreGetFileImageParams = {
786
+ readonly allowAnimated?: boolean;
787
+ readonly version?: number;
788
+ readonly collection?: string;
789
+ readonly width?: number;
790
+ readonly height?: number;
791
+ readonly mode?: 'crop' | 'fit' | 'full-fit';
792
+ readonly upscale?: boolean;
793
+ readonly 'max-age'?: number;
794
+ };
795
+
796
+ // @public (undocumented)
797
+ export type MediaStoreGetFileParams = {
798
+ readonly version?: number;
799
+ readonly collection?: string;
800
+ };
801
+
802
+ // @public (undocumented)
803
+ export type MediaStoreRequestOptions = RequestMetadata & {
804
+ readonly method?: RequestMethod;
805
+ readonly authContext?: AuthContext;
806
+ readonly params?: RequestParams;
807
+ readonly headers?: RequestHeaders;
808
+ readonly body?: any;
809
+ readonly clientOptions?: ClientOptions;
810
+ readonly traceContext?: MediaTraceContext;
811
+ };
812
+
813
+ // @public (undocumented)
814
+ export interface MediaStoreResponse<Data> {
815
+ // (undocumented)
816
+ readonly data: Data;
817
+ }
818
+
819
+ // @public (undocumented)
820
+ export interface MediaStoreTouchFileBody {
821
+ // (undocumented)
822
+ descriptors: TouchFileDescriptor[];
823
+ }
824
+
825
+ // @public (undocumented)
826
+ export interface MediaStoreTouchFileParams {
827
+ // (undocumented)
828
+ readonly collection?: string;
829
+ }
830
+
831
+ // @public (undocumented)
832
+ export type MediaSubscribable = {
833
+ subscribe(observer?: MediaObserver): MediaSubscription;
834
+ };
835
+
836
+ // @public (undocumented)
837
+ export type MediaSubscription = {
838
+ unsubscribe: () => void;
839
+ };
840
+
841
+ export { MediaType }
842
+
843
+ // @public (undocumented)
844
+ export type MediaUpload = {
845
+ readonly id: string;
846
+ readonly created: number;
847
+ readonly expires: number;
848
+ };
849
+
850
+ // @public (undocumented)
851
+ export interface MediaViewedEventPayload {
852
+ // (undocumented)
853
+ fileId: string;
854
+ // (undocumented)
855
+ isUserCollection?: boolean;
856
+ // (undocumented)
857
+ viewingLevel: 'download' | 'full' | 'minimal';
858
+ }
859
+
860
+ // @public (undocumented)
861
+ export interface MobileUpload {
862
+ // (undocumented)
863
+ notifyUploadEnd(event: MobileUploadEndEvent): void;
864
+ // (undocumented)
865
+ notifyUploadError(event: MobileUploadErrorEvent): void;
866
+ // (undocumented)
867
+ notifyUploadProgress(event: MobileUploadProgressEvent): void;
868
+ // (undocumented)
869
+ notifyUploadStart(event: MobileUploadStartEvent): void;
870
+ }
871
+
872
+ // @public (undocumented)
873
+ export type MobileUploadEndEvent = {
874
+ fileId: string;
875
+ };
876
+
877
+ // @public (undocumented)
878
+ export type MobileUploadErrorEvent = {
879
+ fileId: string;
880
+ message: string;
881
+ };
882
+
883
+ // @public (undocumented)
884
+ export type MobileUploadProgressEvent = {
885
+ fileId: string;
886
+ progress: number;
887
+ };
888
+
889
+ // @public (undocumented)
890
+ export type MobileUploadStartEvent = {
891
+ fileId: string;
892
+ collectionName?: string;
893
+ occurrenceKey?: string;
894
+ fileName: string;
895
+ fileSize: number;
896
+ fileMimetype: string;
897
+ preview?: FilePreview;
898
+ createdAt?: number;
899
+ };
900
+
901
+ // @public (undocumented)
902
+ type NextObserver = PartialObserver & Required<Pick<PartialObserver, 'next'>>;
903
+
904
+ // @public (undocumented)
905
+ export type NonErrorFileState = Exclude<FileState, ErrorFileState>;
906
+
907
+ // @public (undocumented)
908
+ export const objectToQueryString: (json: {
909
+ [key: string]: boolean | null | number | string | undefined;
910
+ }) => string;
911
+
912
+ // @public (undocumented)
913
+ type PartialObserver = {
914
+ next?: (value: FileState) => void;
915
+ error?: (err: any) => void;
916
+ complete?: () => void;
917
+ };
918
+
919
+ // @public (undocumented)
920
+ export class PollingError extends BaseMediaClientError<PollingErrorAttributes> {
921
+ constructor(reason: PollingErrorReason, attempts: number);
922
+ // (undocumented)
923
+ readonly attempts: number;
924
+ // (undocumented)
925
+ get attributes(): {
926
+ reason: "pollingMaxAttemptsExceeded";
927
+ attempts: number;
928
+ };
929
+ // (undocumented)
930
+ readonly reason: PollingErrorReason;
931
+ }
932
+
933
+ // @public (undocumented)
934
+ export type PollingErrorAttributes = {
935
+ readonly reason: PollingErrorReason;
936
+ readonly attempts: number;
937
+ readonly innerError?: Error;
938
+ };
939
+
940
+ // @public (undocumented)
941
+ export type PollingErrorReason = 'pollingMaxAttemptsExceeded';
942
+
943
+ // @public
944
+ export class PollingFunction {
945
+ constructor(options?: Partial<PollingOptions>);
946
+ // (undocumented)
947
+ attempt: number;
948
+ // (undocumented)
949
+ cancel(): void;
950
+ // (undocumented)
951
+ execute(executor: Executor): Promise<void>;
952
+ // (undocumented)
953
+ getIntervalMsForIteration(iteration: number): number;
954
+ // (undocumented)
955
+ next(): void;
956
+ // (undocumented)
957
+ onError?: (error: Error) => void;
958
+ // (undocumented)
959
+ options: PollingOptions;
960
+ // (undocumented)
961
+ poll_intervalMs: number;
962
+ // (undocumented)
963
+ shouldIterate: boolean;
964
+ // (undocumented)
965
+ timeoutId: number;
966
+ }
967
+
968
+ // @public (undocumented)
969
+ interface PollingOptions {
970
+ // (undocumented)
971
+ poll_backoffFactor: number;
972
+ // (undocumented)
973
+ poll_intervalMs: number;
974
+ // (undocumented)
975
+ poll_maxAttempts: number;
976
+ // (undocumented)
977
+ poll_maxIntervalMs: number;
978
+ }
979
+
980
+ // @public (undocumented)
981
+ export interface PreviewableFileState {
982
+ // (undocumented)
983
+ preview: FilePreview | Promise<FilePreview>;
984
+ }
985
+
986
+ // @public (undocumented)
987
+ export interface PreviewOptions {
988
+ }
989
+
990
+ // @public (undocumented)
991
+ export interface ProcessedFileState extends BaseFileState {
992
+ // (undocumented)
993
+ artifacts: MediaFileArtifacts;
994
+ // (undocumented)
995
+ createdAt?: number;
996
+ // (undocumented)
997
+ id: string;
998
+ // (undocumented)
999
+ mediaType: MediaType;
1000
+ // (undocumented)
1001
+ mimeType: string;
1002
+ // (undocumented)
1003
+ name: string;
1004
+ // (undocumented)
1005
+ occurrenceKey?: string;
1006
+ // (undocumented)
1007
+ preview?: FilePreview | Promise<FilePreview>;
1008
+ // (undocumented)
1009
+ representations?: MediaRepresentations;
1010
+ // (undocumented)
1011
+ size: number;
1012
+ // (undocumented)
1013
+ status: 'processed';
1014
+ }
1015
+
1016
+ // @public (undocumented)
1017
+ export interface ProcessingFailedState extends BaseFileState {
1018
+ // (undocumented)
1019
+ artifacts: Object;
1020
+ // (undocumented)
1021
+ createdAt?: number;
1022
+ // (undocumented)
1023
+ id: string;
1024
+ // (undocumented)
1025
+ mediaType: MediaType;
1026
+ // (undocumented)
1027
+ mimeType: string;
1028
+ // (undocumented)
1029
+ name: string;
1030
+ // (undocumented)
1031
+ occurrenceKey?: string;
1032
+ // (undocumented)
1033
+ preview?: FilePreview | Promise<FilePreview>;
1034
+ // (undocumented)
1035
+ representations?: MediaRepresentations;
1036
+ // (undocumented)
1037
+ size: number;
1038
+ // (undocumented)
1039
+ status: 'failed-processing';
1040
+ }
1041
+
1042
+ // @public (undocumented)
1043
+ export interface ProcessingFileState extends BaseFileState {
1044
+ // (undocumented)
1045
+ artifacts?: MediaFileArtifacts;
1046
+ // (undocumented)
1047
+ createdAt?: number;
1048
+ // (undocumented)
1049
+ id: string;
1050
+ // (undocumented)
1051
+ mediaType: MediaType;
1052
+ // (undocumented)
1053
+ mimeType: string;
1054
+ // (undocumented)
1055
+ name: string;
1056
+ // (undocumented)
1057
+ occurrenceKey?: string;
1058
+ // (undocumented)
1059
+ preview?: FilePreview | Promise<FilePreview>;
1060
+ // (undocumented)
1061
+ representations?: MediaRepresentations;
1062
+ // (undocumented)
1063
+ size: number;
1064
+ // (undocumented)
1065
+ status: 'processing';
1066
+ }
1067
+
1068
+ // @public (undocumented)
1069
+ export const RECENTS_COLLECTION = "recents";
1070
+
1071
+ // @public (undocumented)
1072
+ interface RejectedTouchFile {
1073
+ // (undocumented)
1074
+ error: RejectionError;
1075
+ // (undocumented)
1076
+ fileId: string;
1077
+ }
1078
+
1079
+ // @public (undocumented)
1080
+ type RejectionError = {
1081
+ code: 'ExceedMaxFileSizeLimit';
1082
+ title: string;
1083
+ href: string;
1084
+ limit: number;
1085
+ size: number;
1086
+ };
1087
+
1088
+ // @public (undocumented)
1089
+ export function request(url: string, options?: RequestOptions, controller?: AbortController): Promise<Response>;
1090
+
1091
+ // @public (undocumented)
1092
+ export class RequestError extends BaseMediaClientError<RequestErrorAttributes> {
1093
+ constructor(reason: RequestErrorReason, metadata?: RequestErrorMetadata | undefined, innerError?: Error | undefined);
1094
+ // (undocumented)
1095
+ get attributes(): {
1096
+ reason: RequestErrorReason;
1097
+ method: RequestMethod | undefined;
1098
+ endpoint: string | undefined;
1099
+ mediaRegion: string | undefined;
1100
+ mediaEnv: string | undefined;
1101
+ attempts: number | undefined;
1102
+ clientExhaustedRetries: boolean | undefined;
1103
+ statusCode: number | undefined;
1104
+ innerError: Error | undefined;
1105
+ };
1106
+ // (undocumented)
1107
+ readonly innerError?: Error | undefined;
1108
+ // (undocumented)
1109
+ readonly metadata?: RequestErrorMetadata | undefined;
1110
+ // (undocumented)
1111
+ readonly reason: RequestErrorReason;
1112
+ }
1113
+
1114
+ // @public (undocumented)
1115
+ export type RequestErrorAttributes = RequestErrorMetadata & {
1116
+ readonly reason: RequestErrorReason;
1117
+ };
1118
+
1119
+ // @public (undocumented)
1120
+ export type RequestErrorMetadata = RequestMetadata & {
1121
+ readonly attempts?: number;
1122
+ readonly clientExhaustedRetries?: boolean;
1123
+ readonly statusCode?: number;
1124
+ };
1125
+
1126
+ // @public (undocumented)
1127
+ export type RequestErrorReason = 'clientAbortedRequest' | 'clientOffline' | 'clientTimeoutRequest' | 'serverBadGateway' | 'serverBadRequest' | 'serverForbidden' | 'serverInternalError' | 'serverInvalidBody' | 'serverNotFound' | 'serverRateLimited' | 'serverUnauthorized' | 'serverUnexpectedError';
1128
+
1129
+ // @public (undocumented)
1130
+ export type RequestHeaders = {
1131
+ [key: string]: string;
1132
+ };
1133
+
1134
+ // @public (undocumented)
1135
+ export type RequestMetadata = {
1136
+ readonly method?: RequestMethod;
1137
+ readonly endpoint?: string;
1138
+ readonly mediaRegion?: string;
1139
+ readonly mediaEnv?: string;
1140
+ readonly traceContext?: MediaTraceContext;
1141
+ };
1142
+
1143
+ // @public (undocumented)
1144
+ export type RequestMethod = 'DELETE' | 'GET' | 'POST' | 'PUT';
1145
+
1146
+ // @public (undocumented)
1147
+ export type RequestOptions = RequestMetadata & {
1148
+ readonly auth?: Auth;
1149
+ readonly traceContext?: Required<MediaTraceContext>;
1150
+ readonly params?: RequestParams;
1151
+ readonly headers?: RequestHeaders;
1152
+ readonly body?: any;
1153
+ readonly clientOptions?: ClientOptions;
1154
+ };
1155
+
1156
+ // @public (undocumented)
1157
+ export type RequestParams = {
1158
+ [key: string]: any;
1159
+ };
1160
+
1161
+ // @public (undocumented)
1162
+ export interface ResponseFileItem {
1163
+ // (undocumented)
1164
+ collection?: string;
1165
+ // (undocumented)
1166
+ details: MediaItemDetails;
1167
+ // (undocumented)
1168
+ id: string;
1169
+ // (undocumented)
1170
+ metadataTraceContext?: MediaTraceContext;
1171
+ // (undocumented)
1172
+ type: 'file';
1173
+ }
1174
+
1175
+ // @public (undocumented)
1176
+ export type RetryOptions = {
1177
+ readonly startTimeoutInMs: number;
1178
+ readonly maxAttempts: number;
1179
+ readonly factor: number;
1180
+ };
1181
+
1182
+ // @public (undocumented)
1183
+ export const safeUnsubscribe: (subscription: MediaSubscription) => void;
1184
+
1185
+ // @public (undocumented)
1186
+ export interface SourceFile {
1187
+ // (undocumented)
1188
+ collection?: string;
1189
+ // (undocumented)
1190
+ id: string;
1191
+ // (undocumented)
1192
+ owner: AsapBasedAuth | ClientAltBasedAuth;
1193
+ // (undocumented)
1194
+ version?: number;
1195
+ }
1196
+
1197
+ // @public (undocumented)
1198
+ export class StargateClient {
1199
+ constructor(baseUrl: string | undefined);
1200
+ // (undocumented)
1201
+ fetchToken(clientId: string): Promise<EdgeData>;
1202
+ // (undocumented)
1203
+ isTokenExpired(token: EdgeData): boolean;
1204
+ }
1205
+
1206
+ // @public (undocumented)
1207
+ export type TouchedFiles = {
1208
+ created: CreatedTouchedFile[];
1209
+ rejected?: RejectedTouchFile[];
1210
+ };
1211
+
1212
+ // @public (undocumented)
1213
+ export interface TouchFileDescriptor {
1214
+ // (undocumented)
1215
+ collection?: string;
1216
+ // (undocumented)
1217
+ deletable?: boolean;
1218
+ // (undocumented)
1219
+ expireAfter?: number;
1220
+ // (undocumented)
1221
+ fileId: string;
1222
+ // (undocumented)
1223
+ occurrenceKey?: string;
1224
+ // (undocumented)
1225
+ size?: number;
1226
+ }
1227
+
1228
+ // @public (undocumented)
1229
+ export type UploadableFile = {
1230
+ content: ChunkinatorFile;
1231
+ name?: string;
1232
+ mimeType?: string;
1233
+ collection?: string;
1234
+ size?: number;
1235
+ };
1236
+
1237
+ // @public (undocumented)
1238
+ export type UploadableFileUpfrontIds = {
1239
+ id: string;
1240
+ deferredUploadId: Promise<string>;
1241
+ occurrenceKey?: string;
1242
+ };
1243
+
1244
+ // @public (undocumented)
1245
+ export class UploadController {
1246
+ constructor();
1247
+ // (undocumented)
1248
+ abort(): void;
1249
+ // (undocumented)
1250
+ abortFunction?: AbortFunction;
1251
+ // (undocumented)
1252
+ setAbort(abortFunction: AbortFunction): void;
1253
+ }
1254
+
1255
+ // @public (undocumented)
1256
+ export type UploadEventPayloadMap = {
1257
+ 'file-added': FileState;
1258
+ 'media-viewed': MediaViewedEventPayload;
1259
+ };
1260
+
1261
+ // @public (undocumented)
1262
+ export const uploadFile: (file: UploadableFile, store: MediaStore, uploadableFileUpfrontIds: UploadableFileUpfrontIds, callbacks?: UploadFileCallbacks, traceContext?: MediaTraceContext) => UploadFileResult;
1263
+
1264
+ // @public (undocumented)
1265
+ export type UploadFileCallbacks = {
1266
+ onProgress: (progress: number) => void;
1267
+ onUploadFinish: (error?: any) => void;
1268
+ };
1269
+
1270
+ // @public (undocumented)
1271
+ export interface UploadFileResult {
1272
+ // (undocumented)
1273
+ cancel: () => void;
1274
+ }
1275
+
1276
+ // @public (undocumented)
1277
+ export interface UploadingFileState extends BaseFileState {
1278
+ // (undocumented)
1279
+ createdAt?: number;
1280
+ // (undocumented)
1281
+ id: string;
1282
+ // (undocumented)
1283
+ mediaType: MediaType;
1284
+ // (undocumented)
1285
+ mimeType: string;
1286
+ // (undocumented)
1287
+ name: string;
1288
+ // (undocumented)
1289
+ occurrenceKey?: string;
1290
+ // (undocumented)
1291
+ preview?: FilePreview | Promise<FilePreview>;
1292
+ // (undocumented)
1293
+ progress: number;
1294
+ // (undocumented)
1295
+ size: number;
1296
+ // (undocumented)
1297
+ status: 'uploading';
1298
+ }
1299
+
1300
+ // @public (undocumented)
1301
+ export interface WithMediaClient {
1302
+ // (undocumented)
1303
+ identifier?: Identifier;
1304
+ // (undocumented)
1305
+ mediaClient: MediaClient;
1306
+ }
1307
+
1308
+ // @public (undocumented)
1309
+ export const withMediaClient: WithMediaClientFunction;
1310
+
1311
+ // @public (undocumented)
1312
+ export interface WithMediaClientConfig {
1313
+ // (undocumented)
1314
+ mediaClientConfig: MediaClientConfig;
1315
+ }
1316
+
1317
+ // @public (undocumented)
1318
+ export type WithMediaClientConfigProps<P extends WithMediaClient> = Omit<P, 'mediaClient'> & WithMediaClientConfig;
1319
+
1320
+ // @public (undocumented)
1321
+ export type WithMediaClientFunction = <P extends WithMediaClient>(Component: React_2.ComponentType<P>, featureFlags?: MediaFeatureFlags) => React_2.ComponentType<WithMediaClientConfigProps<P>>;
1322
+
1323
+ // (No @packageDocumentation comment for this package)
1324
+
1325
+ ```