UNPKG

1.38 kBTypeScriptView Raw
1import { ComponentType } from 'react'
2import { StandardProps } from './common'
3interface ArCameraProps extends StandardProps {
4 /** AR 项目唯一标识,在 DuMixAR 内容开放平台上传生成 AR 项目后获取 AR Key
5 * @supported swan
6 */
7 key?: string
8
9 /** AR 相机类型,在 DuMixAR 内容开放平台上传生成 AR 项目后获取 AR Type:
10 * 2D 跟踪类型:0
11 * SLAM 类型:5
12 * IMU 类型:8
13 * @supported swan
14 */
15 type?: '0' | '5' | '8'
16
17 /** 闪光灯,值为 auto、on、off
18 * @supported swan
19 * @default "off"
20 */
21 flash?: 'auto' | 'on' | 'off'
22
23 /** 用户不允许使用摄像头或扫码失败时触发
24 * @supported swan
25 */
26 onError?: CommonEventFunction
27
28 /** AR 加载成功时触发
29 * @supported swan
30 */
31 onLoad?: CommonEventFunction
32
33 /** 开发者制作 AR 项目时可自定义按键,用户点击时会收到事件和数据,用户自定义事件格式参见代码示例 2:用户自定义事件
34 * @supported swan
35 */
36 onMessage?: CommonEventFunction
37
38 /** 扫描识图结束后触发
39 * @supported swan
40 */
41 onScanCode?: CommonEventFunction
42}
43
44/** AR 相机
45 * @classification media
46 * @supported swan
47 * @see https://smartprogram.baidu.com/docs/develop/component/media_ar-camera/
48 */
49declare const ArCamera: ComponentType<ArCameraProps>
50export { ArCamera, ArCameraProps }