You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

22 lines
552 B

import { GenerateDtsOptions, Rule } from "@chevrotain/types";
import { buildModel } from "./model.js";
import { genDts } from "./generate.js";
const defaultOptions: Required<GenerateDtsOptions> = {
includeVisitorInterface: true,
visitorInterfaceName: "ICstNodeVisitor",
};
export function generateCstDts(
productions: Record<string, Rule>,
options?: GenerateDtsOptions,
): string {
const effectiveOptions = {
...defaultOptions,
...options,
};
const model = buildModel(productions);
return genDts(model, effectiveOptions);
}