Skip to content

Roadiz sub-package which generates Typescript interfaces skeleton based on your schema. (read-only)

License

Notifications You must be signed in to change notification settings

roadiz/dts-generator

Repository files navigation

dts-generator

Roadiz sub-package which generates Typescript interface declaration skeleton based on your schema.

Unit tests, static analysis and code style

Usage

use RZ\Roadiz\Contracts\NodeType\NodeTypeInterface;
use RZ\Roadiz\Typescript\Declaration\DeclarationGeneratorFactory;
use RZ\Roadiz\Typescript\Declaration\Generators\DeclarationGenerator;
use Symfony\Component\HttpFoundation\ParameterBag;

/** @var ParameterBag<NodeTypeInterface> $nodeTypesBag */
$nodeTypesBag = $serviceContainer->get('nodeTypesBag');

$declarationFactory = new DeclarationGeneratorFactory($nodeTypesBag);
$declaration = new DeclarationGenerator($declarationFactory);

echo $declaration->getContents();

Contributing

Report issues and send Pull Requests in the main Roadiz repository

About

Roadiz sub-package which generates Typescript interfaces skeleton based on your schema. (read-only)

Resources

License

Stars

Watchers

Forks