Skip to content
This repository has been archived by the owner on Feb 13, 2024. It is now read-only.
/ treetype-ts Public archive

Generate TS module definitions based on a tree structure

License

Notifications You must be signed in to change notification settings

redstonekasi/treetype-ts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

treetype-ts

Warning

treetype-ts has been superceded by a much better version making proper use of the TypeScript API at https://github.com/uwu/treetype

Usage

This usage might not always be up-to-date, please check ttgen -h.

ttgen [flags...] <input> <interface> [additions...]

Flags

Flag Description
-h, --help Show help
-n, --notice <string> An optional comment to add to the output
-o, --output <string> Where to output the result, defaults to standard output
-r, --root <string> Custom name to use for the root namespace, it defaults to a kebab case version of <interface> prefixed by an @.

Additions

Additions specify if and how to merge interfaces into the main one, they are defined as follows:

<path>:<property>:<name>

Where <path> is the path on the main interface on which to set <property> to the value of the interface name <name>.
/ may be used as a substitute for the root namespace name.

Examples

ttgen src/def.d.ts VendettaObject -o output.d.ts
# Outputs definitions to the inferred module name '@vendeta-object'
ttgen src/def.d.ts VendettaObject -n 'Hello world!'
# Prepends '// Hello world' to the file
ttgen src/def.d.ts VendettaObject /:plugin:VendettaPluginObject -o output.d.ts
# Pretends that at path '/' a property called 'plugin' containing the props of an interface called VendettaPluginObject exists.

About

Generate TS module definitions based on a tree structure

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published