roadiz/dts-generator

Roadiz sub-package which generates Typescript interfaces skeleton based on your schema


README

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