marko-type-definitions
v1.0.5
Published
Modern Marko js type defintions
Downloads
6
Maintainers
Readme
Marko Type Definitions
Unofficial marko js type definitions for typescript
- 🎉 First class Typescript support
- 👌 Complete support for all component props & methods
- ✨ Typings built while keeping intellisense support on all state / input objects
Table of Contents
Installation
$ npm install --save-dev marko-type-definitions
...
$ yarn add -D marko-type-definitions
...
Usage
import { Marko } from "marko-type-defintions";
/**
* Optional typed state
*
* @interface IState
*/
interface IState {
example: boolean;
};
/**
* Optional typed input
*
* @interface IInput
*/
interface IInput {
example: boolean;
};
class Component extends Marko.Component<IState, IInput> {
public onCreate(input: IInput) {
this.state = {
example: input.example,
};
}
public onMount() {
// Do something
}
...
}
export = Component;
Support
Please open an issue for support.
Contributing
Please contribute using Github Flow. Create a branch, add commits, and open a pull request.
License
MIT : http://opensource.org/licenses/MIT
Author
Jarvis Prestidge | [email protected]