2015-04-08 01:26:09 +00:00
|
|
|
/**
|
|
|
|
* Copyright (c) 2015-present, Facebook, Inc.
|
|
|
|
*
|
2018-02-17 02:24:55 +00:00
|
|
|
* This source code is licensed under the MIT license found in the
|
|
|
|
* LICENSE file in the root directory of this source tree.
|
2015-04-08 01:26:09 +00:00
|
|
|
*
|
|
|
|
* @flow
|
2018-01-15 03:32:26 +00:00
|
|
|
* @format
|
2015-04-08 01:26:09 +00:00
|
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
|
2017-02-16 23:01:56 +00:00
|
|
|
// This is to sync with ImageSourcePropTypes.js.
|
2018-06-20 04:28:04 +00:00
|
|
|
// We explicitly don't want this to be strict so that we can pass in objects
|
|
|
|
// that might have more keys. This also has to be inexact to support taking
|
|
|
|
// instances of classes like FBIcon.
|
|
|
|
// https://fburl.com/8lynhvtw
|
|
|
|
type ImageURISource = $ReadOnly<{
|
2018-06-15 02:42:38 +00:00
|
|
|
uri?: ?string,
|
|
|
|
bundle?: ?string,
|
|
|
|
method?: ?string,
|
|
|
|
headers?: ?Object,
|
|
|
|
body?: ?string,
|
|
|
|
cache?: ?('default' | 'reload' | 'force-cache' | 'only-if-cached'),
|
|
|
|
width?: ?number,
|
|
|
|
height?: ?number,
|
|
|
|
scale?: ?number,
|
2018-06-20 04:28:04 +00:00
|
|
|
}>;
|
2017-02-16 23:01:56 +00:00
|
|
|
|
2018-06-20 04:28:04 +00:00
|
|
|
// We have to export any because of an issue in Flow with objects that come from Relay:
|
|
|
|
// https://fburl.com/8ljo5tmr
|
|
|
|
// https://fb.facebook.com/groups/flow/permalink/1824103160971624/
|
|
|
|
// $FlowFixMe T26861415
|
2017-02-16 23:01:56 +00:00
|
|
|
export type ImageSource = ImageURISource | number | Array<ImageURISource>;
|