/** * Copyright 2013-2026 the original author or authors from the JHipster project. * * This file is part of the JHipster project, see https://www.jhipster.tech/ * for more information. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ import type { CstNode, IToken } from 'chevrotain'; import type { ParsedJDLAnnotation, ParsedJDLApplications, ParsedJDLEntityField, ParsedJDLOption, ParsedJDLValidation } from '../types/parsed.ts'; import type { JDLRuntime } from '../types/runtime.ts'; type VisitorContext = { applicationDeclaration?: CstNode[]; entityDeclaration?: CstNode[]; constantDeclaration?: CstNode[]; deploymentDeclaration?: CstNode[]; relationDeclaration?: CstNode[]; enumDeclaration?: CstNode[]; unaryOptionDeclaration?: CstNode[]; binaryOptionDeclaration?: CstNode[]; useOptionDeclaration?: CstNode[]; }; export declare const buildJDLAstBuilderVisitor: (runtime: JDLRuntime) => { prog(context: VisitorContext): ParsedJDLApplications; constantDeclaration(context: Record<"INTEGER" | "NAME" | "DECIMAL", IToken[]>): { name: string; value: string; }; entityDeclaration(context: Record<"ENTITY" | "NAME" | "JAVADOC", IToken[]> & Record<"annotationDeclaration" | "entityTableNameDeclaration" | "entityBody", CstNode[]>): { annotations: ParsedJDLAnnotation[]; name: string; tableName: string | undefined; body: ParsedJDLEntityField[]; documentation: string | null; }; annotationDeclaration(context: Record<"AT" | "value" | "option", IToken[]>): { optionName: string; type: string; optionValue?: undefined; } | { optionName: string; optionValue: unknown; type: string; }; entityTableNameDeclaration(context: Record<"NAME", IToken[]>): string; entityBody(context: Record<"fieldDeclaration", CstNode[]>): any[]; fieldDeclaration(context: Record<"JAVADOC" | "NAME", IToken[]> & Record<"annotationDeclaration" | "validation" | "type", CstNode[]>): { name: string; type: any; validations: ParsedJDLValidation[]; documentation: string | null; annotations: any[]; }; type(context: Record<"NAME", IToken[]>): string; validation(context: Record<"REQUIRED" | "UNIQUE", IToken[]> & Record<"minMaxValidation" | "pattern", CstNode[]>): any; minMaxValidation(context: Record<"NAME" | "MIN_MAX_KEYWORD" | "INTEGER" | "DECIMAL", IToken[]>): { key: string; value: string; constant: boolean; } | { key: string; value: string; constant?: undefined; }; pattern(context: Record<"REGEX", IToken[]>): { key: "pattern"; value: string; }; relationDeclaration(context: Record<"relationshipType" | "relationshipBody", CstNode[]>): any[]; relationshipType(context: Record<"RELATIONSHIP_TYPE", IToken[]>): string; relationshipBody(context: Record<"from" | "to" | "annotationOnSourceSide" | "annotationOnDestinationSide" | "relationshipOptions", CstNode[]>): { from: any; to: any; options: { global: ParsedJDLOption[]; source: any[]; destination: any[]; }; }; relationshipSide(context: Record<"NAME" | "injectedField" | "injectedFieldParam" | "REQUIRED", IToken[]> & Record<"comment", CstNode[]>): any; relationshipOptions(context: Record<"relationshipOption", CstNode[]>): any; relationshipOption(context: Record<"BUILT_IN_ENTITY", IToken[]>): { optionName: "builtInEntity"; type: string; }; enumDeclaration(context: Record<"NAME" | "JAVADOC", IToken[]> & Record<"enumPropList", CstNode[]>): { name: string; values: any; documentation: string | null; }; enumPropList(context: Record<"enumProp", CstNode[]>): any[]; enumProp(context: Record<"enumPropKey" | "enumPropValue" | "enumPropValueWithQuotes" | "JAVADOC", IToken[]>): any; entityList(context: Record<"NAME" | "STAR" | "method" | "methodPath", IToken[]>): string[]; exclusion(context: Record<"NAME", IToken[]>): string[]; unaryOptionDeclaration(context: Record<"UNARY_OPTION", IToken[]> & Record<"filterDef" | "exclusion", CstNode[]>): { optionName: string; list: any; excluded: any; }; binaryOptionDeclaration(context: Record<"BINARY_OPTION", IToken[]> & Record<"entityList" | "exclusion", CstNode[]>): { optionName: string; optionValue: string; list: string[]; excluded: any; }; useOptionDeclaration(context: Record<"NAME", IToken[]> & Record<"filterDef" | "exclusion", CstNode[]>): { optionValues: string[]; list: any; excluded: any; }; filterDef(context: Record<"NAME" | "STAR", IToken[]>): any[]; comment(context: Record<"JAVADOC", IToken[]>): string | null; deploymentDeclaration(context: Record<"deploymentConfigDeclaration", CstNode[]>): Record; deploymentConfigDeclaration(context: Record<"DEPLOYMENT_KEY", IToken[]> & Record<"deploymentConfigValue", CstNode[]>): { key: string; value: any; }; deploymentConfigValue(context: Record<"INTEGER" | "STRING" | "BOOLEAN", IToken[]> & Record<"qualifiedName" | "list" | "quotedList", CstNode[]>): any; applicationDeclaration(context: Record<"applicationSubDeclaration", CstNode[]>): any; applicationSubDeclaration(context: Record<"applicationSubConfig" | "applicationSubNamespaceConfig" | "applicationSubEntities" | "unaryOptionDeclaration" | "binaryOptionDeclaration" | "useOptionDeclaration", CstNode[]>): import("../types/parsed.ts").ParsedJDLApplication & { entitiesOptions?: { entityList: string[]; excluded: string[]; }; }; applicationSubNamespaceConfig(context: Record<"namespace", IToken[]> & Record<"applicationNamespaceConfigDeclaration", CstNode[]>): { namespace: string; config: any; }; applicationNamespaceConfigDeclaration(context: Record<"NAME", IToken[]> & Record<"namespaceConfigValue", CstNode[]>): { key: string; value: any; }; namespaceConfigValue(context: Record<"INTEGER" | "STRING" | "BOOLEAN", IToken[]> & Record<"qualifiedName" | "list" | "quotedList", CstNode[]>): any; applicationSubConfig(context: Record<"applicationConfigDeclaration", CstNode[]>): any; applicationSubEntities(context: Record<"UNARY_OPTION", IToken[]> & Record<"filterDef" | "exclusion", CstNode[]>): any; applicationConfigDeclaration(context: Record<"CONFIG_KEY", IToken[]> & Record<"configValue", CstNode[]>): { key: string; value: any; }; configValue(context: Record<"INTEGER" | "STRING" | "BOOLEAN", IToken[]> & Record<"qualifiedName" | "list" | "quotedList", CstNode[]>): any; qualifiedName(context: Record<"NAME", IToken[]>): string; list(context: Record<"NAME", IToken[]>): string[]; quotedList(context: Record<"STRING", IToken[]>): string[]; visit(cstNode: CstNode | CstNode[], param?: any): any; validateVisitor(): void; }; export {};