mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-06-27 19:53:36 +00:00
Merge pull request #1121 from henrikra/master
Add basic typescript types for module
This commit is contained in:
commit
b63aa62985
@ -7,6 +7,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
|||||||
### Added
|
### Added
|
||||||
|
|
||||||
- Add system notification `MODULE_DOM_CREATED` for notifying each module when their Dom has been fully loaded.
|
- Add system notification `MODULE_DOM_CREATED` for notifying each module when their Dom has been fully loaded.
|
||||||
|
- Add types for module.
|
||||||
|
|
||||||
*This release is scheduled to be released on 2018-04-01.*
|
*This release is scheduled to be released on 2018-04-01.*
|
||||||
|
|
||||||
|
31
module-types.ts
Normal file
31
module-types.ts
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
type ModuleProperties = {
|
||||||
|
defaults?: object,
|
||||||
|
start?(): void,
|
||||||
|
getHeader?(): string,
|
||||||
|
getTemplate?(): string,
|
||||||
|
getTemplateData?(): object,
|
||||||
|
notificationReceived?(notification: string, payload: any, sender: object): void,
|
||||||
|
socketNotificationReceived?(notification: string, payload: any): void,
|
||||||
|
suspend?(): void,
|
||||||
|
resume?(): void,
|
||||||
|
getDom?(): HTMLElement,
|
||||||
|
getStyles?(): string[],
|
||||||
|
[key: string]: any,
|
||||||
|
};
|
||||||
|
|
||||||
|
export declare const Module: {
|
||||||
|
register(moduleName: string, moduleProperties: ModuleProperties): void;
|
||||||
|
};
|
||||||
|
|
||||||
|
export declare const Log: {
|
||||||
|
info(message?: any, ...optionalParams: any[]): void,
|
||||||
|
log(message?: any, ...optionalParams: any[]): void,
|
||||||
|
error(message?: any, ...optionalParams: any[]): void,
|
||||||
|
warn(message?: any, ...optionalParams: any[]): void,
|
||||||
|
group(groupTitle?: string, ...optionalParams: any[]): void,
|
||||||
|
groupCollapsed(groupTitle?: string, ...optionalParams: any[]): void,
|
||||||
|
groupEnd(): void,
|
||||||
|
time(timerName?: string): void,
|
||||||
|
timeEnd(timerName?: string): void,
|
||||||
|
timeStamp(timerName?: string): void,
|
||||||
|
};
|
Loading…
x
Reference in New Issue
Block a user