1 | import { ComponentType } from 'react'
|
2 | import { StandardProps, CommonEventFunction } from './common'
|
3 | import { AdProps } from './Ad'
|
4 | interface AdCustomProps extends StandardProps {
|
5 | /** 广告单元id,可在[小程序管理后台](https://mp.weixin.qq.com/)的流量主模块新建
|
6 | * @supported weapp
|
7 | */
|
8 | unitId: string
|
9 |
|
10 | /** 广告自动刷新的间隔时间,单位为秒,参数值必须大于等于30(该参数不传入时 Banner 广告不会自动刷新)
|
11 | * @supported weapp
|
12 | */
|
13 | adIntervals?: number
|
14 |
|
15 | /** 广告加载成功的回调
|
16 | * @supported weapp
|
17 | */
|
18 | onLoad?: CommonEventFunction
|
19 |
|
20 | /** 当广告发生错误时,触发的事件,可以通过该事件获取错误码及原因
|
21 | * @supported weapp
|
22 | */
|
23 | onError?: CommonEventFunction<AdProps.onErrorEventDetail>
|
24 | }
|
25 |
|
26 | /** Banner 广告
|
27 | * @classification open
|
28 | * @supported weapp
|
29 | * @example
|
30 | * ```tsx
|
31 | * class App extends Component {
|
32 | * render () {
|
33 | * return (
|
34 | * <AdCustom
|
35 | * unitId=''
|
36 | * adIntervals={60}
|
37 | * onLoad={() => console.log('ad onLoad')}
|
38 | * onError={() => console.log('ad onError')}
|
39 | * onClose={() => console.log('ad onClose')}
|
40 | * />
|
41 | * )
|
42 | * }
|
43 | * }
|
44 | * ```
|
45 | * @see https://developers.weixin.qq.com/miniprogram/dev/component/ad.html
|
46 | */
|
47 | declare const AdCustom: ComponentType<AdCustomProps>
|
48 | export { AdCustom, AdCustomProps }
|