UNPKG

taro-hooks

Version:
19 lines (18 loc) 866 B
import type { CameraContext, CameraFrameListener } from '@tarojs/taro'; import type { ExcludeOption, PromiseAction, PromiseOptionalAction } from '../type'; export type Zoom = PromiseAction<number, CameraContext.StartRecordSuccessCallbackResult>; export type Start = PromiseOptionalAction<ExcludeOption<CameraContext.StartRecordOption>>; export type Stop = PromiseOptionalAction<boolean, CameraContext.StopRecordSuccessCallbackResult>; export type Take = PromiseOptionalAction<ExcludeOption<CameraContext.TakePhotoOption>, CameraContext.TakePhotoSuccessCallbackResult>; export type Listener = (callback: CameraContext.OnCameraFrameCallback) => CameraFrameListener; declare function useCamera(): [ CameraContext, { zoom: Zoom; start: Start; stop: Stop; take: Take; listener: Listener; } ]; export default useCamera;