mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
ea1e8bbd34
Summary: [iOS] [Added] - Add definition for `queryCache` in ImageLoader This diff is related to moving RCTImageViewManager's commands to a native module, ImageLoader. Reviewed By: zackargyle, TheSavior Differential Revision: D17714521 fbshipit-source-id: 722cc17a2ebb03e72d7c080dfc4d0aa6d7440e85
31 lines
913 B
JavaScript
31 lines
913 B
JavaScript
/**
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*
|
|
* @flow
|
|
* @format
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
import type {TurboModule} from '../TurboModule/RCTExport';
|
|
import * as TurboModuleRegistry from '../TurboModule/TurboModuleRegistry';
|
|
|
|
export interface Spec extends TurboModule {
|
|
+getConstants: () => {||};
|
|
// Return [width, height] of image uri
|
|
+getSize: (uri: string) => Promise<$ReadOnlyArray<number>>;
|
|
+getSizeWithHeaders: (
|
|
uri: string,
|
|
headers: {[string]: string},
|
|
) => Promise<$ReadOnly<{width: number, height: number}>>;
|
|
+prefetchImage: (uri: string) => Promise<boolean>;
|
|
+queryCache: (
|
|
uris: Array<string>,
|
|
) => Promise<{[string]: 'memory' | 'disk' | 'disk/memory'}>;
|
|
}
|
|
|
|
export default (TurboModuleRegistry.getEnforcing<Spec>('ImageLoader'): Spec);
|