marko-type-definitions
TypeScript icon, indicating that this package has built-in type declarations

1.0.5 • Public • Published

Marko Type Definitions

Language Node Version Yarn Version Licence Info

KoaJs Slack

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

Package Sidebar

Install

npm i marko-type-definitions

Weekly Downloads

4

Version

1.0.5

License

MIT

Unpacked Size

13.3 kB

Total Files

5

Last publish

Collaborators

  • jarvisprestidge