mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-10 11:40:16 +08:00
add more test
This commit is contained in:
@@ -37,6 +37,44 @@ if(module.hot) {
|
||||
});
|
||||
}
|
||||
|
||||
class ModuleData {
|
||||
updated: boolean;
|
||||
}
|
||||
|
||||
if (module.hot) {
|
||||
module.hot.accept((err: Error) => {
|
||||
//...
|
||||
});
|
||||
|
||||
module.hot.decline("./someModule");
|
||||
|
||||
module.hot.dispose((data: ModuleData) => {
|
||||
data.updated = true;
|
||||
// ...
|
||||
});
|
||||
|
||||
let disposeHandler: ((data: ModuleData) => void) = data => {
|
||||
// ...
|
||||
};
|
||||
module.hot.addDisposeHandler(disposeHandler);
|
||||
module.hot.removeDisposeHandler(disposeHandler);
|
||||
|
||||
module.hot.check(true, (err: Error, outdatedModules: (string|number)[]) => {
|
||||
// ...
|
||||
});
|
||||
|
||||
module.hot.apply({ ignoreUnaccepted: true }, (err: Error, outdatedModules: (string|number)[]) => {
|
||||
// ...
|
||||
});
|
||||
|
||||
var status: string = module.hot.status();
|
||||
let statusHandler: ((status: string) => void) = status => {
|
||||
// ...
|
||||
};
|
||||
module.hot.status(statusHandler);
|
||||
module.hot.addStatusHandler(statusHandler);
|
||||
module.hot.removeStatusHandler(statusHandler);
|
||||
}
|
||||
|
||||
|
||||
var status: string = module.hot.status();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user