-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: choose-image support bytedance
- Loading branch information
siteng.xst
committed
Apr 25, 2020
1 parent
78428ff
commit c94db43
Showing
7 changed files
with
44 additions
and
15 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
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
24 changes: 24 additions & 0 deletions
24
packages/choose-image/src/miniapp/bytedance-microapp/index.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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { Options } from '../../types'; | ||
|
||
declare const tt: any; | ||
|
||
const choose = (options: Options = {}): Promise<null> => { | ||
return new Promise((resolve, reject): void => { | ||
const { count = 1, sourceType = ['camera', 'album'], sizeType }: Options = options; | ||
tt.chooseImage({ | ||
sourceType, | ||
count, | ||
sizeType, | ||
success: (res) => { | ||
resolve(Object.assign({}, { | ||
data: res.tempFilePaths | ||
}, res)); | ||
}, | ||
fail: (e) => { | ||
reject(e); | ||
} | ||
}); | ||
}); | ||
}; | ||
|
||
export default choose; |