mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-09-21 08:30:24 +00:00
Merge pull request #26724 from Jimexist/update-wepy
add .use method to wepy app
This commit is contained in:
Vendored
+20
-1
@@ -8,6 +8,25 @@ export interface AppConstructor {
|
||||
new (): app;
|
||||
}
|
||||
|
||||
/* the supported add-ons */
|
||||
export type AddOn = "requestfix" | "promisify";
|
||||
|
||||
export interface WindowConfig {
|
||||
backgroundTextStyle: string;
|
||||
navigationBarBackgroundColor: string;
|
||||
navigationBarTitleText: string;
|
||||
navigationBarTextStyle: string;
|
||||
}
|
||||
|
||||
export default class app {
|
||||
$init(wepy: any, config: AppConfig): any;
|
||||
config: {
|
||||
window: WindowConfig;
|
||||
pages: string[];
|
||||
};
|
||||
$init(wepy: any, config: AppConfig): void;
|
||||
use(addonName: AddOn, ...args: any[]): void;
|
||||
$initAPI(
|
||||
wepy: any,
|
||||
noPromiseAPI: string[] | { [name: string]: boolean }
|
||||
): void;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
import wepy from "wepy";
|
||||
|
||||
export class MyApp extends wepy.app {
|
||||
async onLoad() {
|
||||
this.use("requestfix");
|
||||
}
|
||||
}
|
||||
|
||||
export class MyComponent extends wepy.component {
|
||||
data = {
|
||||
reveal: false,
|
||||
|
||||
Reference in New Issue
Block a user