1.3.3 • Published 7 years ago

ts-interface-enum v1.3.3

Weekly downloads
3
License
MIT
Repository
github
Last release
7 years ago

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

1.3.3

7 years ago

1.3.1

7 years ago

1.3.0

7 years ago

1.2.0

7 years ago

1.1.0

7 years ago

1.0.0

7 years ago