No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

task.d.ts 2.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /**
  2. * @license
  3. * Copyright 2020 Google LLC
  4. *
  5. * Licensed under the Apache License, Version 2.0 (the "License");
  6. * you may not use this file except in compliance with the License.
  7. * You may obtain a copy of the License at
  8. *
  9. * http://www.apache.org/licenses/LICENSE-2.0
  10. *
  11. * Unless required by applicable law or agreed to in writing, software
  12. * distributed under the License is distributed on an "AS IS" BASIS,
  13. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. * See the License for the specific language governing permissions and
  15. * limitations under the License.
  16. */
  17. import { UploadTask, StorageError, TaskEvent, StorageObserver } from '@firebase/storage';
  18. import { UploadTaskSnapshotCompat } from './tasksnapshot';
  19. import { ReferenceCompat } from './reference';
  20. import * as types from '@firebase/storage-types';
  21. import { Compat } from '@firebase/util';
  22. export declare class UploadTaskCompat implements types.UploadTask, Compat<UploadTask> {
  23. readonly _delegate: UploadTask;
  24. private readonly _ref;
  25. constructor(_delegate: UploadTask, _ref: ReferenceCompat);
  26. get snapshot(): UploadTaskSnapshotCompat;
  27. cancel: () => boolean;
  28. catch: (onRejected: (error: StorageError) => unknown) => Promise<unknown>;
  29. pause: () => boolean;
  30. resume: () => boolean;
  31. then(onFulfilled?: ((a: UploadTaskSnapshotCompat) => unknown) | null, onRejected?: ((a: StorageError) => unknown) | null): Promise<unknown>;
  32. on(type: TaskEvent, nextOrObserver?: types.StorageObserver<UploadTaskSnapshotCompat> | null | ((a: UploadTaskSnapshotCompat) => unknown), error?: (error: StorageError) => void | null, completed?: () => void | null): Unsubscribe | Subscribe<UploadTaskSnapshotCompat>;
  33. }
  34. /**
  35. * Subscribes to an event stream.
  36. */
  37. export declare type Subscribe<T> = (next?: NextFn<T> | StorageObserver<T>, error?: ErrorFn, complete?: CompleteFn) => Unsubscribe;
  38. /**
  39. * Unsubscribes from a stream.
  40. */
  41. export declare type Unsubscribe = () => void;
  42. /**
  43. * Function that is called once for each value in a stream of values.
  44. */
  45. export declare type NextFn<T> = (value: T) => void;
  46. /**
  47. * A function that is called with a `FirebaseStorageError`
  48. * if the event stream ends due to an error.
  49. */
  50. export declare type ErrorFn = (error: StorageError) => void;
  51. /**
  52. * A function that is called if the event stream ends normally.
  53. */
  54. export declare type CompleteFn = () => void;