Package Exports
- marko-type-definitions
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (marko-type-definitions) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
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 | jarvisprestidge@gmail.com