@atlaskit/media-client 27.0.0 → 27.0.1

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 (105) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/cjs/client/file-fetcher/index.js +13 -4
  3. package/dist/es2019/client/file-fetcher/index.js +7 -1
  4. package/dist/esm/client/file-fetcher/index.js +13 -4
  5. package/dist/types/client/__mocks__/media-client.d.ts +2 -2
  6. package/dist/types/client/events.d.ts +1 -1
  7. package/dist/types/client/media-client.d.ts +7 -7
  8. package/dist/types/client/media-store/MediaStore.d.ts +4 -4
  9. package/dist/types/client/media-store/resolveAuth.d.ts +1 -1
  10. package/dist/types/client/media-store/types.d.ts +6 -6
  11. package/dist/types/client/mobile-upload.d.ts +3 -3
  12. package/dist/types/file-streams-cache.d.ts +3 -3
  13. package/dist/types/globalMediaEventEmitter.d.ts +1 -1
  14. package/dist/types/models/artifacts.d.ts +1 -1
  15. package/dist/types/models/auth-headers.d.ts +1 -1
  16. package/dist/types/models/auth-query-parameters.d.ts +1 -1
  17. package/dist/types/models/errors/helpers.d.ts +1 -1
  18. package/dist/types/models/errors/index.d.ts +1 -1
  19. package/dist/types/models/file-state.d.ts +4 -4
  20. package/dist/types/models/item.d.ts +1 -1
  21. package/dist/types/models/media.d.ts +2 -2
  22. package/dist/types/models/mobile-upload.d.ts +1 -1
  23. package/dist/types/uploader/index.d.ts +3 -3
  24. package/dist/types/utils/createFileDataLoader.d.ts +2 -2
  25. package/dist/types/utils/createMediaSubject.d.ts +1 -1
  26. package/dist/types/utils/detectEmptyFile.d.ts +1 -1
  27. package/dist/types/utils/getDimensionsFromBlob.d.ts +1 -1
  28. package/dist/types/utils/getMediaTypeFromUploadableFile.d.ts +2 -2
  29. package/dist/types/utils/hashing/hasherCreator.d.ts +1 -1
  30. package/dist/types/utils/hashing/sha256SimpleHasher.d.ts +1 -1
  31. package/dist/types/utils/hashing/simpleHasher.d.ts +1 -1
  32. package/dist/types/utils/hashing/workerHasher.d.ts +1 -1
  33. package/dist/types/utils/imageResizeModeToFileImageMode.d.ts +1 -1
  34. package/dist/types/utils/mediaSubscribable/fromObservable.d.ts +3 -3
  35. package/dist/types/utils/mediaSubscribable/toPromise.d.ts +2 -2
  36. package/dist/types/utils/mediaSubscribable/types.d.ts +1 -1
  37. package/dist/types/utils/mobileUpload/helpers.d.ts +5 -5
  38. package/dist/types/utils/mobileUpload/servicesCache.d.ts +2 -2
  39. package/dist/types/utils/mobileUpload/stateMachine/index.d.ts +5 -5
  40. package/dist/types/utils/mobileUpload/stateMachine/states/error.d.ts +2 -2
  41. package/dist/types/utils/mobileUpload/stateMachine/states/processed.d.ts +2 -2
  42. package/dist/types/utils/mobileUpload/stateMachine/states/processing.d.ts +2 -2
  43. package/dist/types/utils/mobileUpload/stateMachine/states/processingFailed.d.ts +2 -2
  44. package/dist/types/utils/mobileUpload/stateMachine/states/uploading.d.ts +2 -2
  45. package/dist/types/utils/mobileUpload/stateMachine/types.d.ts +2 -2
  46. package/dist/types/utils/overrideMediaTypeIfUnknown.d.ts +2 -2
  47. package/dist/types/utils/polling/errors.d.ts +1 -1
  48. package/dist/types/utils/polling/index.d.ts +1 -1
  49. package/dist/types/utils/request/errors.d.ts +1 -1
  50. package/dist/types/utils/request/helpers.d.ts +3 -3
  51. package/dist/types/utils/request/index.d.ts +1 -1
  52. package/dist/types/utils/request/types.d.ts +1 -1
  53. package/dist/types/utils/shouldFetchRemoteFileStates.d.ts +2 -2
  54. package/dist/types-ts4.5/client/__mocks__/media-client.d.ts +2 -2
  55. package/dist/types-ts4.5/client/events.d.ts +1 -1
  56. package/dist/types-ts4.5/client/media-client.d.ts +7 -7
  57. package/dist/types-ts4.5/client/media-store/MediaStore.d.ts +4 -4
  58. package/dist/types-ts4.5/client/media-store/resolveAuth.d.ts +1 -1
  59. package/dist/types-ts4.5/client/media-store/types.d.ts +6 -6
  60. package/dist/types-ts4.5/client/mobile-upload.d.ts +3 -3
  61. package/dist/types-ts4.5/file-streams-cache.d.ts +3 -3
  62. package/dist/types-ts4.5/globalMediaEventEmitter.d.ts +1 -1
  63. package/dist/types-ts4.5/models/artifacts.d.ts +1 -1
  64. package/dist/types-ts4.5/models/auth-headers.d.ts +1 -1
  65. package/dist/types-ts4.5/models/auth-query-parameters.d.ts +1 -1
  66. package/dist/types-ts4.5/models/errors/helpers.d.ts +1 -1
  67. package/dist/types-ts4.5/models/errors/index.d.ts +1 -1
  68. package/dist/types-ts4.5/models/file-state.d.ts +4 -4
  69. package/dist/types-ts4.5/models/item.d.ts +1 -1
  70. package/dist/types-ts4.5/models/media.d.ts +2 -2
  71. package/dist/types-ts4.5/models/mobile-upload.d.ts +1 -1
  72. package/dist/types-ts4.5/uploader/index.d.ts +3 -3
  73. package/dist/types-ts4.5/utils/createFileDataLoader.d.ts +2 -2
  74. package/dist/types-ts4.5/utils/createMediaSubject.d.ts +1 -1
  75. package/dist/types-ts4.5/utils/detectEmptyFile.d.ts +1 -1
  76. package/dist/types-ts4.5/utils/getDimensionsFromBlob.d.ts +1 -1
  77. package/dist/types-ts4.5/utils/getMediaTypeFromUploadableFile.d.ts +2 -2
  78. package/dist/types-ts4.5/utils/hashing/hasherCreator.d.ts +1 -1
  79. package/dist/types-ts4.5/utils/hashing/sha256SimpleHasher.d.ts +1 -1
  80. package/dist/types-ts4.5/utils/hashing/simpleHasher.d.ts +1 -1
  81. package/dist/types-ts4.5/utils/hashing/workerHasher.d.ts +1 -1
  82. package/dist/types-ts4.5/utils/imageResizeModeToFileImageMode.d.ts +1 -1
  83. package/dist/types-ts4.5/utils/mediaSubscribable/fromObservable.d.ts +3 -3
  84. package/dist/types-ts4.5/utils/mediaSubscribable/toPromise.d.ts +2 -2
  85. package/dist/types-ts4.5/utils/mediaSubscribable/types.d.ts +1 -1
  86. package/dist/types-ts4.5/utils/mobileUpload/helpers.d.ts +5 -5
  87. package/dist/types-ts4.5/utils/mobileUpload/servicesCache.d.ts +2 -2
  88. package/dist/types-ts4.5/utils/mobileUpload/stateMachine/index.d.ts +5 -5
  89. package/dist/types-ts4.5/utils/mobileUpload/stateMachine/states/error.d.ts +2 -2
  90. package/dist/types-ts4.5/utils/mobileUpload/stateMachine/states/processed.d.ts +2 -2
  91. package/dist/types-ts4.5/utils/mobileUpload/stateMachine/states/processing.d.ts +2 -2
  92. package/dist/types-ts4.5/utils/mobileUpload/stateMachine/states/processingFailed.d.ts +2 -2
  93. package/dist/types-ts4.5/utils/mobileUpload/stateMachine/states/uploading.d.ts +2 -2
  94. package/dist/types-ts4.5/utils/mobileUpload/stateMachine/types.d.ts +2 -2
  95. package/dist/types-ts4.5/utils/overrideMediaTypeIfUnknown.d.ts +2 -2
  96. package/dist/types-ts4.5/utils/polling/errors.d.ts +1 -1
  97. package/dist/types-ts4.5/utils/polling/index.d.ts +1 -1
  98. package/dist/types-ts4.5/utils/request/errors.d.ts +1 -1
  99. package/dist/types-ts4.5/utils/request/helpers.d.ts +3 -3
  100. package/dist/types-ts4.5/utils/request/index.d.ts +1 -1
  101. package/dist/types-ts4.5/utils/request/types.d.ts +1 -1
  102. package/dist/types-ts4.5/utils/shouldFetchRemoteFileStates.d.ts +2 -2
  103. package/example-helpers/styles.ts +1 -1
  104. package/example-helpers/stylesWrapper.tsx +2 -2
  105. package/package.json +2 -2
package/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # @atlaskit/media-client
2
2
 
3
+ ## 27.0.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#103775](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/103775)
8
+ [`ce306a2407b0`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/ce306a2407b0) -
9
+ Fix updateExternal function never resolves
10
+
3
11
  ## 27.0.0
4
12
 
5
13
  ### Major Changes
@@ -357,19 +357,28 @@ var FileFetcherImpl = exports.FileFetcherImpl = /*#__PURE__*/function () {
357
357
  });
358
358
  // we don't want to wait for the file to be upload
359
359
  _this3.upload(file, undefined, uploadableFileUpfrontIds, traceContext);
360
- _context3.next = 12;
360
+ _context3.prev = 10;
361
+ _context3.next = 13;
361
362
  return (0, _getDimensionsFromBlob.getDimensionsFromBlob)(mediaType, blob);
362
- case 12:
363
+ case 13:
363
364
  dimensions = _context3.sent;
365
+ _context3.next = 20;
366
+ break;
367
+ case 16:
368
+ _context3.prev = 16;
369
+ _context3.t0 = _context3["catch"](10);
370
+ reject(_context3.t0);
371
+ return _context3.abrupt("return");
372
+ case 20:
364
373
  resolve({
365
374
  dimensions: dimensions,
366
375
  uploadableFileUpfrontIds: uploadableFileUpfrontIds
367
376
  });
368
- case 14:
377
+ case 21:
369
378
  case "end":
370
379
  return _context3.stop();
371
380
  }
372
- }, _callee3);
381
+ }, _callee3, null, [[10, 16]]);
373
382
  }));
374
383
  return function (_x6, _x7) {
375
384
  return _ref4.apply(this, arguments);
@@ -265,7 +265,13 @@ export class FileFetcherImpl {
265
265
  });
266
266
  // we don't want to wait for the file to be upload
267
267
  this.upload(file, undefined, uploadableFileUpfrontIds, traceContext);
268
- const dimensions = await getDimensionsFromBlob(mediaType, blob);
268
+ let dimensions;
269
+ try {
270
+ dimensions = await getDimensionsFromBlob(mediaType, blob);
271
+ } catch (error) {
272
+ reject(error);
273
+ return;
274
+ }
269
275
  resolve({
270
276
  dimensions,
271
277
  uploadableFileUpfrontIds
@@ -340,19 +340,28 @@ export var FileFetcherImpl = /*#__PURE__*/function () {
340
340
  });
341
341
  // we don't want to wait for the file to be upload
342
342
  _this3.upload(file, undefined, uploadableFileUpfrontIds, traceContext);
343
- _context3.next = 12;
343
+ _context3.prev = 10;
344
+ _context3.next = 13;
344
345
  return getDimensionsFromBlob(mediaType, blob);
345
- case 12:
346
+ case 13:
346
347
  dimensions = _context3.sent;
348
+ _context3.next = 20;
349
+ break;
350
+ case 16:
351
+ _context3.prev = 16;
352
+ _context3.t0 = _context3["catch"](10);
353
+ reject(_context3.t0);
354
+ return _context3.abrupt("return");
355
+ case 20:
347
356
  resolve({
348
357
  dimensions: dimensions,
349
358
  uploadableFileUpfrontIds: uploadableFileUpfrontIds
350
359
  });
351
- case 14:
360
+ case 21:
352
361
  case "end":
353
362
  return _context3.stop();
354
363
  }
355
- }, _callee3);
364
+ }, _callee3, null, [[10, 16]]);
356
365
  }));
357
366
  return function (_x6, _x7) {
358
367
  return _ref4.apply(this, arguments);
@@ -1,6 +1,6 @@
1
1
  /// <reference types="jest" />
2
- import { MediaClientConfig } from '@atlaskit/media-core';
3
- import { FileFetcher } from '../file-fetcher';
2
+ import { type MediaClientConfig } from '@atlaskit/media-core';
3
+ import { type FileFetcher } from '../file-fetcher';
4
4
  export declare class MediaClient {
5
5
  readonly config: MediaClientConfig;
6
6
  readonly file: FileFetcher;
@@ -1,4 +1,4 @@
1
- import { FileState } from '@atlaskit/media-state';
1
+ import { type FileState } from '@atlaskit/media-state';
2
2
  export type EventPayloadMap<P> = {
3
3
  readonly [event: string]: P;
4
4
  };
@@ -1,11 +1,11 @@
1
- import { MediaClientConfig } from '@atlaskit/media-core';
2
- import { MediaTraceContext } from '@atlaskit/media-common';
3
- import { MediaStore as MediaApi, MediaStoreGetFileImageParams, ImageMetadata } from './media-store';
4
- import { FileFetcher } from './file-fetcher';
5
- import { UploadEventPayloadMap, EventPayloadListener } from './events';
1
+ import { type MediaClientConfig } from '@atlaskit/media-core';
2
+ import { type MediaTraceContext } from '@atlaskit/media-common';
3
+ import { MediaStore as MediaApi, type MediaStoreGetFileImageParams, type ImageMetadata } from './media-store';
4
+ import { type FileFetcher } from './file-fetcher';
5
+ import { type UploadEventPayloadMap, type EventPayloadListener } from './events';
6
6
  import { StargateClient } from './stargate-client';
7
- import { MobileUpload } from '../models/mobile-upload';
8
- import { MediaStore } from '@atlaskit/media-state';
7
+ import { type MobileUpload } from '../models/mobile-upload';
8
+ import { type MediaStore } from '@atlaskit/media-state';
9
9
  export declare class MediaClient {
10
10
  readonly mediaClientConfig: MediaClientConfig;
11
11
  private readonly store;
@@ -1,8 +1,8 @@
1
- import { AuthContext, MediaApiConfig, Auth } from '@atlaskit/media-core';
2
- import { MediaTraceContext } from '@atlaskit/media-common';
3
- import { MediaFileArtifacts } from '@atlaskit/media-state';
1
+ import { type AuthContext, type MediaApiConfig, type Auth } from '@atlaskit/media-core';
2
+ import { type MediaTraceContext } from '@atlaskit/media-common';
3
+ import { type MediaFileArtifacts } from '@atlaskit/media-state';
4
4
  import type { ItemsPayload, ImageMetadata, MediaStoreResponse, MediaStoreTouchFileParams, TouchFileDescriptor, MediaStoreTouchFileBody, RejectedTouchFile, MediaStoreRequestOptions, MediaStoreCreateFileFromUploadParams, MediaStoreCreateFileFromUploadBody, MediaStoreGetFileParams, MediaStoreGetFileImageParams, MediaStoreCopyFileWithTokenBody, MediaStoreCopyFileWithTokenParams, AppendChunksToUploadRequestBody, TouchedFiles, MediaApi } from './types';
5
- import { MediaFile, MediaUpload } from '../../models/media';
5
+ import { type MediaFile, type MediaUpload } from '../../models/media';
6
6
  import { ChunkHashAlgorithm } from '@atlaskit/media-core';
7
7
  export declare class MediaStore implements MediaApi {
8
8
  private readonly config;
@@ -1,4 +1,4 @@
1
- import { Auth, AuthContext, AuthProvider } from '@atlaskit/media-core';
1
+ import { type Auth, type AuthContext, type AuthProvider } from '@atlaskit/media-core';
2
2
  export declare const DEFAULT_AUTH_PROVIDER_TIMEOUT = 10000;
3
3
  export declare const resolveAuth: (authProvider: AuthProvider, authContext?: AuthContext, authProviderTimeout?: number) => Promise<Auth>;
4
4
  export declare const resolveInitialAuth: (auth?: Auth) => Auth;
@@ -1,9 +1,9 @@
1
- import { Auth, AsapBasedAuth, AuthContext, ClientAltBasedAuth } from '@atlaskit/media-core';
2
- import { MediaTraceContext } from '@atlaskit/media-common';
3
- import { MediaFileArtifacts } from '@atlaskit/media-state';
4
- import { MediaItemDetails, MediaFile, MediaUpload } from '../../models/media';
5
- import { ClientOptions, RequestHeaders, RequestMethod, RequestParams, RequestMetadata } from '../../utils/request/types';
6
- import { ChunkHashAlgorithm } from '@atlaskit/media-core';
1
+ import { type Auth, type AsapBasedAuth, type AuthContext, type ClientAltBasedAuth } from '@atlaskit/media-core';
2
+ import { type MediaTraceContext } from '@atlaskit/media-common';
3
+ import { type MediaFileArtifacts } from '@atlaskit/media-state';
4
+ import { type MediaItemDetails, type MediaFile, type MediaUpload } from '../../models/media';
5
+ import { type ClientOptions, type RequestHeaders, type RequestMethod, type RequestParams, type RequestMetadata } from '../../utils/request/types';
6
+ import { type ChunkHashAlgorithm } from '@atlaskit/media-core';
7
7
  export interface ResponseFileItem {
8
8
  id: string;
9
9
  type: 'file';
@@ -1,6 +1,6 @@
1
- import { MediaStore } from '@atlaskit/media-state';
2
- import { MobileUpload, MobileUploadStartEvent, MobileUploadProgressEvent, MobileUploadEndEvent, MobileUploadErrorEvent } from '../models/mobile-upload';
3
- import { MediaStore as MediaApi } from './media-store';
1
+ import { type MediaStore } from '@atlaskit/media-state';
2
+ import { type MobileUpload, type MobileUploadStartEvent, type MobileUploadProgressEvent, type MobileUploadEndEvent, type MobileUploadErrorEvent } from '../models/mobile-upload';
3
+ import { type MediaStore as MediaApi } from './media-store';
4
4
  export declare class MobileUploadImpl implements MobileUpload {
5
5
  private readonly store;
6
6
  private readonly dataloader;
@@ -1,6 +1,6 @@
1
- import { LRUMap } from 'lru_map';
2
- import { ReplaySubject } from 'rxjs/ReplaySubject';
3
- import { FileState } from '@atlaskit/media-state';
1
+ import { type LRUMap } from 'lru_map';
2
+ import { type ReplaySubject } from 'rxjs/ReplaySubject';
3
+ import { type FileState } from '@atlaskit/media-state';
4
4
  export declare class StreamsCache<T> {
5
5
  private readonly streams;
6
6
  constructor(streams: LRUMap<string, ReplaySubject<T>>);
@@ -1,4 +1,4 @@
1
- import { UploadEventPayloadMap, EventPayloadListener } from './client/events';
1
+ import { type UploadEventPayloadMap, type EventPayloadListener } from './client/events';
2
2
  export declare const globalMediaEventEmitter: {
3
3
  on<E extends keyof UploadEventPayloadMap>(event: E, listener: EventPayloadListener<UploadEventPayloadMap, E>): void;
4
4
  off<E_1 extends keyof UploadEventPayloadMap>(event: E_1, listener: EventPayloadListener<UploadEventPayloadMap, E_1>): void;
@@ -1,2 +1,2 @@
1
- import { MediaFileArtifacts } from '@atlaskit/media-state';
1
+ import { type MediaFileArtifacts } from '@atlaskit/media-state';
2
2
  export declare const getArtifactUrl: (artifacts: MediaFileArtifacts, prop: keyof MediaFileArtifacts) => string | undefined;
@@ -1,4 +1,4 @@
1
- import { Auth } from '@atlaskit/media-core';
1
+ import { type Auth } from '@atlaskit/media-core';
2
2
  export interface ClientBasedAuthHeaders {
3
3
  readonly 'X-Client-Id': string;
4
4
  readonly Authorization: string;
@@ -1,4 +1,4 @@
1
- import { Auth } from '@atlaskit/media-core';
1
+ import { type Auth } from '@atlaskit/media-core';
2
2
  export interface ClientBasedQueryParameters {
3
3
  readonly client: string;
4
4
  readonly token: string;
@@ -1,5 +1,5 @@
1
1
  export type { MediaClientError, MediaClientErrorReason } from './types';
2
- import { MediaClientError, MediaClientErrorReason } from './types';
2
+ import { type MediaClientError, type MediaClientErrorReason } from './types';
3
3
  export declare function isMediaClientError(error: any): error is MediaClientError<{
4
4
  reason: MediaClientErrorReason;
5
5
  }>;
@@ -1,4 +1,4 @@
1
- import { MediaClientError, MediaClientErrorAttributes } from './types';
1
+ import { type MediaClientError, type MediaClientErrorAttributes } from './types';
2
2
  export type { MediaClientError, MediaClientErrorReason, MediaClientErrorAttributes, } from './types';
3
3
  export { isMediaClientError, getMediaClientErrorReason } from './helpers';
4
4
  /**
@@ -1,7 +1,7 @@
1
- import { FileStatus as CommonFileStatus } from '@atlaskit/media-common';
2
- import { MediaStoreResponse } from '../client/media-store';
3
- import { MediaItemDetails, MediaFile } from './media';
4
- import { FilePreview, FileState, ErrorFileState, UploadingFileState, ProcessingFileState, ProcessedFileState, ProcessingFailedState } from '@atlaskit/media-state';
1
+ import { type FileStatus as CommonFileStatus } from '@atlaskit/media-common';
2
+ import { type MediaStoreResponse } from '../client/media-store';
3
+ import { type MediaItemDetails, type MediaFile } from './media';
4
+ import { type FilePreview, type FileState, type ErrorFileState, type UploadingFileState, type ProcessingFileState, type ProcessedFileState, type ProcessingFailedState } from '@atlaskit/media-state';
5
5
  export type FileStatus = CommonFileStatus;
6
6
  export interface PreviewOptions {
7
7
  }
@@ -1,4 +1,4 @@
1
- import { MediaType } from './media';
1
+ import { type MediaType } from './media';
2
2
  export type MediaItemType = 'file' | 'external-image';
3
3
  export interface FileItem {
4
4
  type: 'file';
@@ -1,5 +1,5 @@
1
- import { MediaTraceContext, MediaType } from '@atlaskit/media-common';
2
- import { MediaFileArtifacts } from '@atlaskit/media-state';
1
+ import { type MediaTraceContext, type MediaType } from '@atlaskit/media-common';
2
+ import { type MediaFileArtifacts } from '@atlaskit/media-state';
3
3
  export type MediaFileProcessingStatus = 'pending' | 'succeeded' | 'failed';
4
4
  export type { MediaType } from '@atlaskit/media-common';
5
5
  export declare const isPreviewableType: (type: MediaType) => boolean;
@@ -1,4 +1,4 @@
1
- import { FilePreview } from '@atlaskit/media-state';
1
+ import { type FilePreview } from '@atlaskit/media-state';
2
2
  export type MobileUploadStartEvent = {
3
3
  fileId: string;
4
4
  collectionName?: string;
@@ -1,6 +1,6 @@
1
- import { ChunkinatorFile } from '@atlaskit/chunkinator';
2
- import { MediaStore } from '../client/media-store';
3
- import { MediaTraceContext } from '@atlaskit/media-common';
1
+ import { type ChunkinatorFile } from '@atlaskit/chunkinator';
2
+ import { type MediaStore } from '../client/media-store';
3
+ import { type MediaTraceContext } from '@atlaskit/media-common';
4
4
  export type UploadableFile = {
5
5
  content: ChunkinatorFile;
6
6
  name?: string;
@@ -1,7 +1,7 @@
1
1
  import 'setimmediate';
2
2
  import Dataloader from 'dataloader';
3
- import { MediaStore, ResponseFileItem } from '../client/media-store';
4
- import { MediaItemDetails } from '../models/media';
3
+ import { type MediaStore, type ResponseFileItem } from '../client/media-store';
4
+ import { type MediaItemDetails } from '../models/media';
5
5
  export declare const MAX_BATCH_SIZE = 100;
6
6
  export type DataloaderKey = {
7
7
  readonly id: string;
@@ -1,3 +1,3 @@
1
1
  import { ReplaySubject } from 'rxjs/ReplaySubject';
2
- import { FileState } from '@atlaskit/media-state';
2
+ import { type FileState } from '@atlaskit/media-state';
3
3
  export declare function createMediaSubject<T extends FileState>(initialState?: T | Error): ReplaySubject<T>;
@@ -1,4 +1,4 @@
1
- import { MediaItemDetails } from '../models/media';
1
+ import { type MediaItemDetails } from '../models/media';
2
2
  /**
3
3
  * EMPTY_FILE_HOURS_ELAPSED_TOLERANCE - how many hours since this file was
4
4
  * created until we give up on expecting metadata?
@@ -1,4 +1,4 @@
1
- import { MediaType } from '@atlaskit/media-common';
1
+ import { type MediaType } from '@atlaskit/media-common';
2
2
  export type Dimensions = {
3
3
  width: number;
4
4
  height: number;
@@ -1,3 +1,3 @@
1
- import { MediaType } from '../models/media';
2
- import { UploadableFile } from '../uploader';
1
+ import { type MediaType } from '../models/media';
2
+ import { type UploadableFile } from '../uploader';
3
3
  export declare const getMediaTypeFromUploadableFile: (file: UploadableFile) => MediaType;
@@ -1,4 +1,4 @@
1
- import { Hasher } from './hasher';
1
+ import { type Hasher } from './hasher';
2
2
  import { ChunkHashAlgorithm } from '@atlaskit/media-core';
3
3
  export declare const destroyHasher: () => null;
4
4
  export declare const createHasher: (algorithm: ChunkHashAlgorithm) => Promise<Hasher>;
@@ -1,4 +1,4 @@
1
- import { Hasher } from './hasher';
1
+ import { type Hasher } from './hasher';
2
2
  export declare class SimpleHasher implements Hasher {
3
3
  hash(blob: Blob): Promise<string>;
4
4
  }
@@ -1,4 +1,4 @@
1
- import { Hasher } from './hasher';
1
+ import { type Hasher } from './hasher';
2
2
  export declare class SimpleHasher implements Hasher {
3
3
  hash(blob: Blob): Promise<string>;
4
4
  }
@@ -1,4 +1,4 @@
1
- import { Hasher } from './hasher';
1
+ import { type Hasher } from './hasher';
2
2
  export interface Deferred {
3
3
  resolve: (hash: string) => void;
4
4
  reject: (error: any) => void;
@@ -1,3 +1,3 @@
1
- import { MediaStoreGetFileImageParams } from '../client/media-store';
1
+ import { type MediaStoreGetFileImageParams } from '../client/media-store';
2
2
  export type ImageResizeMode = 'crop' | 'fit' | 'full-fit' | 'stretchy-fit';
3
3
  export declare const imageResizeModeToFileImageMode: (resizeMode?: ImageResizeMode) => MediaStoreGetFileImageParams['mode'];
@@ -1,5 +1,5 @@
1
- import { ReplaySubject } from 'rxjs/ReplaySubject';
2
- import { FileState } from '@atlaskit/media-state';
3
- import { MediaSubscribable } from './types';
1
+ import { type ReplaySubject } from 'rxjs/ReplaySubject';
2
+ import { type FileState } from '@atlaskit/media-state';
3
+ import { type MediaSubscribable } from './types';
4
4
  export declare function fromObservable(observable: ReplaySubject<FileState>): MediaSubscribable;
5
5
  export declare function createMediaSubscribable(item?: FileState | Error): MediaSubscribable;
@@ -1,6 +1,6 @@
1
1
  import { Subscription } from 'rxjs/Subscription';
2
- import { MediaSubscribable } from './types';
3
- import { FileState } from '@atlaskit/media-state';
2
+ import { type MediaSubscribable } from './types';
3
+ import { type FileState } from '@atlaskit/media-state';
4
4
  /**
5
5
  * This is a helper to transform the first value emitted by an MediaSubscribable into a Promise.
6
6
  *
@@ -1,4 +1,4 @@
1
- import { FileState } from '@atlaskit/media-state';
1
+ import { type FileState } from '@atlaskit/media-state';
2
2
  export type MediaSubscription = {
3
3
  unsubscribe: () => void;
4
4
  };
@@ -1,8 +1,8 @@
1
- import Dataloader from 'dataloader';
1
+ import type Dataloader from 'dataloader';
2
2
  import { ReplaySubject } from 'rxjs/ReplaySubject';
3
- import { Interpreter } from 'xstate';
4
- import { FileState } from '@atlaskit/media-state';
5
- import { DataloaderKey, DataloaderResult } from '../createFileDataLoader';
6
- import { StateMachineContext, StateMachineEvent, StateMachineTypestate } from './stateMachine/types';
3
+ import { type Interpreter } from 'xstate';
4
+ import { type FileState } from '@atlaskit/media-state';
5
+ import { type DataloaderKey, type DataloaderResult } from '../createFileDataLoader';
6
+ import { type StateMachineContext, type StateMachineEvent, type StateMachineTypestate } from './stateMachine/types';
7
7
  export declare const createMobileFileStateSubject: (service: Interpreter<StateMachineContext, any, StateMachineEvent, StateMachineTypestate>) => ReplaySubject<FileState>;
8
8
  export declare const createMobileDownloadFileStream: (dataloader: Dataloader<DataloaderKey, DataloaderResult>, id: string, collectionName?: string, occurrenceKey?: string) => ReplaySubject<FileState>;
@@ -1,4 +1,4 @@
1
1
  import { LRUMap } from 'lru_map';
2
- import { Interpreter } from 'xstate';
3
- import { StateMachineContext, StateMachineEvent, StateMachineTypestate } from './stateMachine/types';
2
+ import { type Interpreter } from 'xstate';
3
+ import { type StateMachineContext, type StateMachineEvent, type StateMachineTypestate } from './stateMachine/types';
4
4
  export declare function createServicesCache(): LRUMap<string, Interpreter<StateMachineContext, any, StateMachineEvent, StateMachineTypestate>>;
@@ -1,7 +1,7 @@
1
- import DataLoader from 'dataloader';
2
- import { Interpreter, StateMachine } from 'xstate';
3
- import { UploadingFileState } from '@atlaskit/media-state';
4
- import { DataloaderKey, DataloaderResult } from '../../createFileDataLoader';
5
- import { StateMachineContext, StateMachineEvent, StateMachineSchema, StateMachineTypestate } from './types';
1
+ import type DataLoader from 'dataloader';
2
+ import { type Interpreter, type StateMachine } from 'xstate';
3
+ import { type UploadingFileState } from '@atlaskit/media-state';
4
+ import { type DataloaderKey, type DataloaderResult } from '../../createFileDataLoader';
5
+ import { type StateMachineContext, type StateMachineEvent, type StateMachineSchema, type StateMachineTypestate } from './types';
6
6
  export declare const createMobileUploadStateMachine: (dataloader: DataLoader<DataloaderKey, DataloaderResult>, initialState: UploadingFileState, collectionName?: string) => StateMachine<StateMachineContext, any, StateMachineEvent, StateMachineTypestate>;
7
7
  export declare function createMobileUploadService(machine: StateMachine<StateMachineContext, StateMachineSchema, StateMachineEvent, StateMachineTypestate>): Interpreter<StateMachineContext, StateMachineSchema, StateMachineEvent, StateMachineTypestate>;
@@ -1,3 +1,3 @@
1
- import { StateNodeConfig } from 'xstate';
2
- import { StateMachineContext, StateMachineSchema, StateMachineEvent } from '../types';
1
+ import { type StateNodeConfig } from 'xstate';
2
+ import { type StateMachineContext, type StateMachineSchema, type StateMachineEvent } from '../types';
3
3
  export declare const machineErrorState: StateNodeConfig<StateMachineContext, StateMachineSchema, StateMachineEvent>;
@@ -1,3 +1,3 @@
1
- import { StateNodeConfig } from 'xstate';
2
- import { StateMachineContext, StateMachineSchema, StateMachineEvent } from '../types';
1
+ import { type StateNodeConfig } from 'xstate';
2
+ import { type StateMachineContext, type StateMachineSchema, type StateMachineEvent } from '../types';
3
3
  export declare const machineProcessedState: StateNodeConfig<StateMachineContext, StateMachineSchema, StateMachineEvent>;
@@ -1,3 +1,3 @@
1
- import { StateNodeConfig } from 'xstate';
2
- import { ProcessingStateMachineSchema, StateMachineContext, StateMachineEvent } from '../types';
1
+ import { type StateNodeConfig } from 'xstate';
2
+ import { type ProcessingStateMachineSchema, type StateMachineContext, type StateMachineEvent } from '../types';
3
3
  export declare const machineProcessingState: StateNodeConfig<StateMachineContext, ProcessingStateMachineSchema, StateMachineEvent>;
@@ -1,3 +1,3 @@
1
- import { StateNodeConfig } from 'xstate';
2
- import { StateMachineContext, StateMachineSchema, StateMachineEvent } from '../types';
1
+ import { type StateNodeConfig } from 'xstate';
2
+ import { type StateMachineContext, type StateMachineSchema, type StateMachineEvent } from '../types';
3
3
  export declare const machineProcessingFailedState: StateNodeConfig<StateMachineContext, StateMachineSchema, StateMachineEvent>;
@@ -1,3 +1,3 @@
1
- import { StateNodeConfig } from 'xstate';
2
- import { StateMachineContext, StateMachineSchema, StateMachineEvent } from '../types';
1
+ import { type StateNodeConfig } from 'xstate';
2
+ import { type StateMachineContext, type StateMachineSchema, type StateMachineEvent } from '../types';
3
3
  export declare const machineUploadingState: StateNodeConfig<StateMachineContext, StateMachineSchema, StateMachineEvent>;
@@ -1,5 +1,5 @@
1
- import { StateSchema } from 'xstate';
2
- import { FileState, UploadingFileState, ProcessingFileState, ProcessedFileState, ErrorFileState, ProcessingFailedState } from '@atlaskit/media-state';
1
+ import { type StateSchema } from 'xstate';
2
+ import { type FileState, type UploadingFileState, type ProcessingFileState, type ProcessedFileState, type ErrorFileState, type ProcessingFailedState } from '@atlaskit/media-state';
3
3
  export type StateMachineContext = {
4
4
  currentFileState: FileState;
5
5
  };
@@ -1,5 +1,5 @@
1
- import { FileState } from '@atlaskit/media-state';
2
- import { MediaType } from '../models/media';
1
+ import { type FileState } from '@atlaskit/media-state';
2
+ import { type MediaType } from '../models/media';
3
3
  export declare const overrideMediaTypeIfUnknown: (fileState: FileState, mediaType?: MediaType) => {
4
4
  mediaType?: MediaType | undefined;
5
5
  };
@@ -1,5 +1,5 @@
1
1
  import { BaseMediaClientError } from '../../models/errors';
2
- import { PollingErrorReason, PollingErrorAttributes } from './types';
2
+ import { type PollingErrorReason, type PollingErrorAttributes } from './types';
3
3
  export declare class PollingError extends BaseMediaClientError<PollingErrorAttributes> {
4
4
  readonly reason: PollingErrorReason;
5
5
  readonly attempts: number;
@@ -1,4 +1,4 @@
1
- import { Executor } from './types';
1
+ import { type Executor } from './types';
2
2
  export interface PollingOptions {
3
3
  poll_intervalMs: number;
4
4
  poll_maxAttempts: number;
@@ -1,5 +1,5 @@
1
1
  import { BaseMediaClientError } from '../../models/errors';
2
- import { RequestErrorReason, RequestErrorMetadata, RequestErrorAttributes } from './types';
2
+ import { type RequestErrorReason, type RequestErrorMetadata, type RequestErrorAttributes } from './types';
3
3
  export declare class RequestError extends BaseMediaClientError<RequestErrorAttributes> {
4
4
  readonly reason: RequestErrorReason;
5
5
  readonly metadata?: RequestErrorMetadata | undefined;
@@ -1,7 +1,7 @@
1
- import { Auth } from '@atlaskit/media-core';
2
- import { MediaTraceContext } from '@atlaskit/media-common';
1
+ import { type Auth } from '@atlaskit/media-core';
2
+ import { type MediaTraceContext } from '@atlaskit/media-common';
3
3
  import { RequestError } from './errors';
4
- import { CreateUrlOptions, RequestErrorReason, RequestErrorMetadata, RequestHeaders, RequestMetadata, RetryOptions } from './types';
4
+ import { type CreateUrlOptions, type RequestErrorReason, type RequestErrorMetadata, type RequestHeaders, type RequestMetadata, type RetryOptions } from './types';
5
5
  export declare function waitPromise(timeout: number): Promise<void>;
6
6
  export declare function isAbortedRequestError(err: any): boolean;
7
7
  export declare function isFetchNetworkError(err: any): err is TypeError;
@@ -1,4 +1,4 @@
1
- import { RequestOptions } from './types';
1
+ import { type RequestOptions } from './types';
2
2
  export type { RequestErrorReason, RequestErrorMetadata, RequestErrorAttributes, } from './types';
3
3
  export { RequestError, isRequestError } from './errors';
4
4
  export { isRateLimitedError, createRequestErrorReason } from './helpers';
@@ -1,4 +1,4 @@
1
- import { Auth } from '@atlaskit/media-core';
1
+ import { type Auth } from '@atlaskit/media-core';
2
2
  import type { MediaTraceContext } from '@atlaskit/media-common';
3
3
  export type RequestMethod = 'GET' | 'POST' | 'PUT' | 'DELETE';
4
4
  export type RequestParams = {
@@ -1,5 +1,5 @@
1
- import { FilePreview } from '@atlaskit/media-state';
2
- import { MediaType } from '../models/media';
1
+ import { type FilePreview } from '@atlaskit/media-state';
2
+ import { type MediaType } from '../models/media';
3
3
  /**
4
4
  * Async helper determining if we should fetch remote fileStates from the backend:
5
5
  * - we poll the backend for all supported documents,
@@ -1,6 +1,6 @@
1
1
  /// <reference types="jest" />
2
- import { MediaClientConfig } from '@atlaskit/media-core';
3
- import { FileFetcher } from '../file-fetcher';
2
+ import { type MediaClientConfig } from '@atlaskit/media-core';
3
+ import { type FileFetcher } from '../file-fetcher';
4
4
  export declare class MediaClient {
5
5
  readonly config: MediaClientConfig;
6
6
  readonly file: FileFetcher;
@@ -1,4 +1,4 @@
1
- import { FileState } from '@atlaskit/media-state';
1
+ import { type FileState } from '@atlaskit/media-state';
2
2
  export type EventPayloadMap<P> = {
3
3
  readonly [event: string]: P;
4
4
  };
@@ -1,11 +1,11 @@
1
- import { MediaClientConfig } from '@atlaskit/media-core';
2
- import { MediaTraceContext } from '@atlaskit/media-common';
3
- import { MediaStore as MediaApi, MediaStoreGetFileImageParams, ImageMetadata } from './media-store';
4
- import { FileFetcher } from './file-fetcher';
5
- import { UploadEventPayloadMap, EventPayloadListener } from './events';
1
+ import { type MediaClientConfig } from '@atlaskit/media-core';
2
+ import { type MediaTraceContext } from '@atlaskit/media-common';
3
+ import { MediaStore as MediaApi, type MediaStoreGetFileImageParams, type ImageMetadata } from './media-store';
4
+ import { type FileFetcher } from './file-fetcher';
5
+ import { type UploadEventPayloadMap, type EventPayloadListener } from './events';
6
6
  import { StargateClient } from './stargate-client';
7
- import { MobileUpload } from '../models/mobile-upload';
8
- import { MediaStore } from '@atlaskit/media-state';
7
+ import { type MobileUpload } from '../models/mobile-upload';
8
+ import { type MediaStore } from '@atlaskit/media-state';
9
9
  export declare class MediaClient {
10
10
  readonly mediaClientConfig: MediaClientConfig;
11
11
  private readonly store;
@@ -1,8 +1,8 @@
1
- import { AuthContext, MediaApiConfig, Auth } from '@atlaskit/media-core';
2
- import { MediaTraceContext } from '@atlaskit/media-common';
3
- import { MediaFileArtifacts } from '@atlaskit/media-state';
1
+ import { type AuthContext, type MediaApiConfig, type Auth } from '@atlaskit/media-core';
2
+ import { type MediaTraceContext } from '@atlaskit/media-common';
3
+ import { type MediaFileArtifacts } from '@atlaskit/media-state';
4
4
  import type { ItemsPayload, ImageMetadata, MediaStoreResponse, MediaStoreTouchFileParams, TouchFileDescriptor, MediaStoreTouchFileBody, RejectedTouchFile, MediaStoreRequestOptions, MediaStoreCreateFileFromUploadParams, MediaStoreCreateFileFromUploadBody, MediaStoreGetFileParams, MediaStoreGetFileImageParams, MediaStoreCopyFileWithTokenBody, MediaStoreCopyFileWithTokenParams, AppendChunksToUploadRequestBody, TouchedFiles, MediaApi } from './types';
5
- import { MediaFile, MediaUpload } from '../../models/media';
5
+ import { type MediaFile, type MediaUpload } from '../../models/media';
6
6
  import { ChunkHashAlgorithm } from '@atlaskit/media-core';
7
7
  export declare class MediaStore implements MediaApi {
8
8
  private readonly config;