NativeBlobModule.js 855 B

1234567891011121314151617181920212223242526
  1. /**
  2. * Copyright (c) Facebook, Inc. and its affiliates.
  3. *
  4. * This source code is licensed under the MIT license found in the
  5. * LICENSE file in the root directory of this source tree.
  6. *
  7. * @flow
  8. * @format
  9. */
  10. 'use strict';
  11. import type {TurboModule} from '../TurboModule/RCTExport';
  12. import * as TurboModuleRegistry from '../TurboModule/TurboModuleRegistry';
  13. export interface Spec extends TurboModule {
  14. +getConstants: () => {|BLOB_URI_SCHEME: ?string, BLOB_URI_HOST: ?string|};
  15. +addNetworkingHandler: () => void;
  16. +addWebSocketHandler: (id: number) => void;
  17. +removeWebSocketHandler: (id: number) => void;
  18. +sendOverSocket: (blob: Object, socketID: number) => void;
  19. +createFromParts: (parts: Array<Object>, withId: string) => void;
  20. +release: (blobId: string) => void;
  21. }
  22. export default (TurboModuleRegistry.get<Spec>('BlobModule'): ?Spec);