Move Fresco plugin to oss directory
Summary: Moved the fresco plugin folder to open source directory Reviewed By: passy Differential Revision: D14126407 fbshipit-source-id: 15b2d1698e18b951742ec37ca94642e6511094b0
This commit is contained in:
committed by
Facebook Github Bot
parent
aac9c40183
commit
6ee8d72a1e
67
src/plugins/fresco/api.js
Normal file
67
src/plugins/fresco/api.js
Normal file
@@ -0,0 +1,67 @@
|
||||
/**
|
||||
* Copyright 2018-present Facebook.
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
* @format
|
||||
*/
|
||||
|
||||
export type ImageId = string;
|
||||
|
||||
// Listing images
|
||||
|
||||
export type CacheInfo = {|
|
||||
cacheType: string,
|
||||
clearKey?: null, // set this if this cache level supports clear(<key>)
|
||||
sizeBytes: number,
|
||||
maxSizeBytes?: number,
|
||||
imageIds: Array<ImageId>,
|
||||
|};
|
||||
|
||||
export type ImagesList = Array<CacheInfo>;
|
||||
|
||||
// The iOS Flipper api does not support a top-level array, so we wrap it in an object
|
||||
export type ImagesListResponse = {|
|
||||
levels: ImagesList,
|
||||
|};
|
||||
|
||||
// listImages() -> ImagesListResponse
|
||||
|
||||
// Getting details on a specific image
|
||||
|
||||
export type ImageBytes = string;
|
||||
|
||||
export type ImageData = {|
|
||||
imageId: ImageId,
|
||||
uri?: string,
|
||||
width: number,
|
||||
height: number,
|
||||
sizeBytes: number,
|
||||
data: ImageBytes,
|
||||
|};
|
||||
|
||||
// getImage({imageId: string}) -> ImageData
|
||||
|
||||
// Subscribing to image events (requests and prefetches)
|
||||
|
||||
export type Timestamp = number;
|
||||
|
||||
export type ViewportData = {|
|
||||
width: number,
|
||||
height: number,
|
||||
scanDisplayTime: {[scan_number: number]: Timestamp},
|
||||
|};
|
||||
|
||||
export type ImageEvent = {
|
||||
imageIds: Array<ImageId>,
|
||||
attribution: Array<string>,
|
||||
startTime: Timestamp,
|
||||
endTime: Timestamp,
|
||||
source: string,
|
||||
viewport?: ViewportData, // not set for prefetches
|
||||
};
|
||||
|
||||
// Misc
|
||||
|
||||
export type FrescoDebugOverlayEvent = {|
|
||||
enabled: boolean,
|
||||
|};
|
||||
Reference in New Issue
Block a user