forked from Expensify/App
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request Expensify#28449 from fvlvte/24917-migrate-fileDown…
…load-lib-to-typescript [TS migration] Migrate 'fileDownload' lib to TypeScript
- Loading branch information
Showing
13 changed files
with
197 additions
and
187 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 4 additions & 5 deletions
9
...fileDownload/getImageResolution.native.js → ...fileDownload/getImageResolution.native.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,13 @@ | ||
import {Asset} from 'react-native-image-picker'; | ||
import type {GetImageResolution} from './types'; | ||
|
||
/** | ||
* Get image resolution | ||
* Image object is returned as a result of a user selecting image using the react-native-image-picker | ||
* Image already has width and height properties coming from library so we just need to return them on native | ||
* Opposite to web where we need to create a new Image object and get dimensions from it | ||
* | ||
* @param {*} file Picked file blob | ||
* @returns {Promise} | ||
*/ | ||
function getImageResolution(file) { | ||
return Promise.resolve({width: file.width, height: file.height}); | ||
} | ||
const getImageResolution: GetImageResolution = (file: Asset) => Promise.resolve({width: file.width ?? 0, height: file.height ?? 0}); | ||
|
||
export default getImageResolution; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.