$config = TypeScriptTransformerConfig::create()
->searchingPath(__DIR__ . '/src')
->outputFile(__DIR__ . '/js/generated.d.ts');
This is the minimal required configuration that should get you started. There are some more configuration options, but we'll go over these later in the documentation.
Let's use this configuration to start the transformation process:
That's it! All the enum classes with a
@typescript annotation are now transformed to TypeScript.
Classes not converted? You probably should write your own transformers.
Using Laravel? Then you can use a Laravel config file, more info about that here.