Skip to content
This repository has been archived by the owner on Mar 7, 2024. It is now read-only.

Commit

Permalink
fix: 补全 useAppEvent usePageEvent 类型
Browse files Browse the repository at this point in the history
  • Loading branch information
Darmody committed Jun 29, 2020
1 parent 875182d commit e9f6af2
Showing 1 changed file with 32 additions and 2 deletions.
34 changes: 32 additions & 2 deletions packages/remax-macro/src/macro.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,39 @@ export declare function requirePluginComponent<P = any>(pluginName: string): Rea

export declare function requirePlugin<P = any>(pluginName: string): P;

export declare function usePageEvent(eventName: string, callback: (...params: any[]) => any): void;
type PageEventName =
| 'onLoad'
| 'onShow'
| 'onHide'
| 'onReady'
| 'onPullDownRefresh'
| 'onReachBottom'
| 'onPageScroll'
| 'onShareAppMessage'
| 'onTitleClick'
| 'onOptionMenuClick'
| 'onPopMenuClick'
| 'onPullIntercept'
| 'onBack'
| 'onKeyboardHeight'
| 'onTabItemTap'
| 'beforeTabItemTap'
| 'onResize'
| 'onUnload';

export declare function useAppEvent(eventName: string, callback: (...params: any[]) => any): void;
type AppEventName =
| 'onLaunch'
| 'onShow'
| 'onHide'
| 'onError'
| 'onShareAppMessage'
| 'onPageNotFound'
| 'onUnhandledRejection'
| 'onThemeChange';

export declare function usePageEvent(eventName: PageEventName, callback: (...params: any[]) => any): void;

export declare function useAppEvent(eventName: AppEventName, callback: (...params: any[]) => any): void;

export { hostComponents, nativeComponents, registerNativeComponent, pageEvents, appEvents };

Expand Down

0 comments on commit e9f6af2

Please sign in to comment.