mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
de667fffa4
Summary: For some reason the specs were internal, but the native impl is still in github. So let's move these to github for consistency. Changelog: [Internal] Reviewed By: hramos Differential Revision: D21419934 fbshipit-source-id: f2c4486edca43c4348f3a3c6ce98f76a322bab0b
42 lines
1.1 KiB
JavaScript
42 lines
1.1 KiB
JavaScript
/**
|
|
* (c) Facebook, Inc. and its affiliates. Confidential and proprietary.
|
|
*
|
|
* @flow strict-local
|
|
* @format
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
import type {TurboModule} from '../TurboModule/RCTExport';
|
|
import * as TurboModuleRegistry from '../TurboModule/TurboModuleRegistry';
|
|
|
|
export interface Spec extends TurboModule {
|
|
+getConstants: () => {||};
|
|
// Common
|
|
+getBase64ForTag: (
|
|
uri: string,
|
|
successCallback: (base64ImageData: string) => void,
|
|
|
|
/**
|
|
* On Android, the failure callback is called with a string.
|
|
* On iOS, the failure callback is called with an error object.
|
|
*
|
|
* TODO(T47527939) Unify this inconsistency
|
|
*/
|
|
errorCallback: (error: {|message: string|} | string) => void,
|
|
) => void;
|
|
|
|
// iOS-only
|
|
+hasImageForTag: (uri: string, callback: (hasImage: boolean) => void) => void;
|
|
+removeImageForTag: (uri: string) => void;
|
|
+addImageFromBase64: (
|
|
base64ImageData: string,
|
|
successCallback: (uri: string) => void,
|
|
errorCallback: (error: {|message: string|}) => void,
|
|
) => void;
|
|
}
|
|
|
|
export default (TurboModuleRegistry.getEnforcing<Spec>(
|
|
'ImageStoreManager',
|
|
): Spec);
|