README
Polymer 1.0's elements using Typescript based on PolymerTS project
Yeoman generator to scaffold outIntroduction
PolymerTS is a project that allow to develop Polymer 1.0 element using Typescript @decorated classes.
It is thought to work joined with Polymer Starter Kit
Features
- PolymerTS's element scaffold
Installation
npm install -g generator-polymerts
Generators
Element (alias: El)
Generates a polymer element in app/elements
and optionally appends an import to app/elements/elements.html
.
Example:
$ yo polymerts:el my-element [--path <output dir>] [--nodecorator]
Note: You must pass in an element name, and the name must contain a dash "-"
Options
--path, element output path. By default is 'app' and will put your element in folder 'app/elements'.
--nodecorator, generate element without decorator. TS < 1.5 compatibility.
Generate Typescript from Element
Generates a Typescript definition (.d.ts) from an installed Polymer element present in bower_components
.
Example:
$ yo polymerts:gen polymer-element [--path <output dir>] [--elpath <source dir>] [--refpath true|false]
Note:
It generates also the related Polymer Behaviors but only if they are in the same element's folder (eg. iron-selector).
In other cases you have to generate each requested Behavior. So find it and rerun the generator.
Options
--path, element output path. By default generated element (and dependencies) will put in folder 'typings/polymer'.
--elpath, element source path. Just in case (eg. Behaviors ) the element folder hasn't the same name of the element
--refpath, generate reference path (default: false). The reference path will be generated using a path extracted from name prefix (eg. IronButtonState.d.ts will be referenced as ../iron/IronButtonState.d.ts).