ts2typebox
Version:
Creates TypeBox code from Typescript code
48 lines (47 loc) • 1.19 kB
text/typescript
/**
* For providing your own transform functions, you can basically copy paste this
* file into your root directory, name it ".ts2typeboxrc.cjs" and adapt the
* functions to your needs!
*
* Only options which have to be passed via code (options that are functions) may
* be specified here. For now, these are transformTypeName and
* transformValueName.
*/
/**
* This function will be run on every type name. For a given code
*
* ```
* type T = number
* ```
*
* the default output would be:
*
* ```
* type T = Static<typeof T>
* const T = Type.Number()
* ```
* This function will run on the first "T". The generated code will contain the
* transformed values.
*
* @param input {string}
*/
export function transformTypeName(input: string): string;
/**
* This function will be run on every value name. For a given code
*
* ```
* type T = number
* ```
*
* the default output would be:
* ```
* type T = Static<typeof T>
* const T = Type.Number()
* ```
*
* This function will run on the second and third "T". The generated code will
* contain the transformed values.
*
* @param input {string}
*/
export function transformValueName(input: string): string;