ts-interface-enum
Converts typescript interfaces to enums.
Last updated a year ago by combarnea .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install ts-interface-enum 
SYNC missed versions from official npm registry.

TsInterfaceEnum

NPM version Downloads

Converts typescript interfaces to enums

Pre-requisites

Use of typescript in your code

Install

npm i ts-interface-enum --save--dev

Config

Config file

In your root directory create a file called interface-enum.config.json The json should look as follows

{
  "paths": [
    "./app/model/schemes"
  ]
}

Mark interfaces

For each interface to convert add comment one line above For now only interface with export are supported due to new file created.

// my file /app/model/schemes/main.schemes.ts

// generateInterfaceToEnum
export interface IMySchemaInterface {
    id: number;
    moreData: string;
}



Usage

Call the module from where your code, works well inside gulp or npm as pre build script. Afterwards a new file will be created in the same directory of the found interface with the name of [foundTsFile].interfaceEnums.ts On re-run if the file was found to generate again it will be deleted.

License

MIT © Tomer Barnea

Current Tags

  • 1.3.3                                ...           latest (a year ago)

6 Versions

  • 1.3.3                                ...           a year ago
  • 1.3.1                                ...           a year ago
  • 1.3.0                                ...           a year ago
  • 1.2.0                                ...           a year ago
  • 1.1.0                                ...           a year ago
  • 1.0.0                                ...           a year ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 7
Last Day 0
Last Week 0
Last Month 0
Dependencies (6)
Dev Dependencies (13)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |