taro-hooks
Version:
为 Taro 而设计的 Hooks Library
19 lines (18 loc) • 866 B
TypeScript
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;