/// import { IndexMetadata } from 'typeorm/metadata/IndexMetadata'; import { RelationType } from 'typeorm/metadata/types/RelationTypes'; import { AsyncReturnType, SetOptional } from 'type-fest'; import puppeteer from 'puppeteer'; import { DataSource, EntityMetadata } from 'typeorm'; import { Argv } from 'yargs'; import Fuse from 'fuse.js'; import { BigNumber } from 'mathjs'; import * as awilix from 'awilix'; import findUp from 'find-up'; import { GlobOptions, Glob } from 'glob'; import { LogLevel, LogType, InputLogObject } from 'consola'; import { ColumnMetadata } from 'typeorm/metadata/ColumnMetadata'; import { RelationMetadata } from 'typeorm/metadata/RelationMetadata'; import { PassFailEither } from 'my-only-either'; /** * ER Diagram column attribute * * - PK: primary key * - FK: foreign key * - UK: unique key */ declare const CE_COLUMN_ATTRIBUTE: { readonly PK: "PK"; readonly FK: "FK"; readonly UK: "UK"; }; type CE_COLUMN_ATTRIBUTE = (typeof CE_COLUMN_ATTRIBUTE)[keyof typeof CE_COLUMN_ATTRIBUTE]; declare const CE_RECORD_KIND: { readonly COLUMN: "column"; readonly ENTITY: "entity"; readonly RELATION: "relation"; readonly INDEX: "index"; }; type CE_RECORD_KIND = (typeof CE_RECORD_KIND)[keyof typeof CE_RECORD_KIND]; declare const CE_CHANGE_KIND: { readonly CHANGE: "change"; readonly ADD: "add"; readonly DELETE: "delete"; readonly NONE: "none"; }; type CE_CHANGE_KIND = (typeof CE_CHANGE_KIND)[keyof typeof CE_CHANGE_KIND]; interface IRecordMetadata { /** * Project name, default option use database name. You can choose this value from database name or package.json name */ name: string; /** html document title */ title?: string; /** * entity version, default option use timestamp. developer can set that use package.json version * */ version: string; /** * This record created-at. if you don't use version field in package.json field, maybe it same * version field. * * @format date-time */ createdAt: string; /** * This record updated-at. if you don't use version field in package.json field, maybe it same * version field. * * @format date-time */ updatedAt: string; } interface IEntityRecord extends IBaseRecord { /** kind of record */ $kind: typeof CE_RECORD_KIND.ENTITY; /** name from property name */ name: string; /** name from database */ dbName: string; /** entity has relation that is set true otherwise false */ hasRelation: boolean; } interface IIndexRecord extends IBaseRecord { /** kind of record */ $kind: typeof CE_RECORD_KIND.INDEX; /** name from property name */ name: string; /** name from database */ dbName: string; /** the table name(entity) that containing index */ tableName: string; /** the table name(db) that containing index */ tableDBName: string; /** Indicates if this index must be unique. */ isUnique: IndexMetadata['isUnique']; /** * The FULLTEXT modifier indexes the entire column and does not allow prefixing. * Works only in MySQL. */ isFulltext: IndexMetadata['isFulltext']; /** * The SPATIAL modifier indexes the entire column and does not allow indexed columns to contain NULL values. * Works only in MySQL. */ isSpatial: IndexMetadata['isSpatial']; /** the column name that building index */ columnNames: string[]; } interface IRelationRecord extends IBaseRecord { $kind: typeof CE_RECORD_KIND.RELATION; /** relation property name */ name: string; /** relation database name */ dbName: string; /** inverse property name */ inverseEntityName: string; /** inverse entity database name */ inverseEntityDBName: string; /** join property name of entity */ joinPropertyName: string; /** join entity name of database */ joinColumnName: string; inverseJoinColumnName?: string; joinColumnOne: boolean; joinColumnNullable: boolean; inverseJoinColumnOne: boolean; inverseJoinColumnNullable: boolean; /** relation type */ relationType: RelationType; /** hash of sort entity name pair */ relationHash: string; /** order of entity name */ order: number; /** will be deduped */ isDuplicate: boolean; } type TDatabaseRecord = IColumnRecord | IEntityRecord | IRelationRecord | IIndexRecord; interface IBaseRecord extends IRecordMetadata { $kind: CE_RECORD_KIND; /** entity name of metadata */ entity: string; /** database value change kind */ change: CE_CHANGE_KIND; /** prev entity */ prev?: TDatabaseRecord; } interface IColumnRecord extends IBaseRecord { $kind: typeof CE_RECORD_KIND.COLUMN; /** property name of entity */ name: string; /** table name of database */ dbName: string; /** column attribute key, (e.g., PK, FK) */ attributeKey: CE_COLUMN_ATTRIBUTE[]; /** column type */ columnType: string; /** column is nullable */ isNullable: string; /** column charset */ charset: string; /** column type with column length(if column is lengthed typed) */ columnTypeWithLength: string; /** column sort weight */ weight: number; /** comment of entity, column */ comment: string; } declare function getColumnHash(column: Pick): string; declare function getDatabaseName(options: { database?: string | Uint8Array | undefined; }): string; declare function getEntityHash(entity: Pick): string; declare function getFileVersion(buf: Buffer): string; declare function getIndexHash(column: Pick): string; /** * Entity document version using package.json version or specific file, timestamp * * - timestamp: use timestamp * - file: use version file * - package.json: use package.json */ declare const CE_ENTITY_VERSION_FROM: { readonly TIMESTAMP: "timestamp"; readonly PACKAGE_JSON: "package.json"; readonly FILE: "file"; }; type CE_ENTITY_VERSION_FROM = (typeof CE_ENTITY_VERSION_FROM)[keyof typeof CE_ENTITY_VERSION_FROM]; /** * mermaid.js theme configuration * * @see https://mermaid-js.github.io/mermaid/#/Setup?id=theme * * - default * - forest * - dark * - neutral * - null */ declare const CE_MERMAID_THEME: { readonly DEFAULT: "default"; readonly FOREST: "forest"; readonly DARK: "dark"; readonly NEUTRAL: "neutral"; readonly NULL: "null"; }; type CE_MERMAID_THEME = (typeof CE_MERMAID_THEME)[keyof typeof CE_MERMAID_THEME]; /** * ER Diagram output component * * - table: Entity spec. * - er: ER diagram */ declare const CE_OUTPUT_COMPONENT: { readonly TABLE: "table"; readonly ER: "er"; }; type CE_OUTPUT_COMPONENT = (typeof CE_OUTPUT_COMPONENT)[keyof typeof CE_OUTPUT_COMPONENT]; declare const CE_OUTPUT_FORMAT: { readonly HTML: "html"; readonly MARKDOWN: "md"; readonly PDF: "pdf"; readonly IMAGE: "image"; }; type CE_OUTPUT_FORMAT = (typeof CE_OUTPUT_FORMAT)[keyof typeof CE_OUTPUT_FORMAT]; /** * determine whether project name will come from the name in `package.json` or database name * * - db: database name from TypeORM * - app: application name from package.json */ declare const CE_PROJECT_NAME_FROM: { readonly DATABASE: "db"; readonly APPLICATION: "app"; }; type CE_PROJECT_NAME_FROM = (typeof CE_PROJECT_NAME_FROM)[keyof typeof CE_PROJECT_NAME_FROM]; interface ICommonOption { /** define the path to to configuration file: .erdiarc */ config: string; /** define the directory to output file */ output?: string; /** define the path to TypeORM data source file */ dataSourcePath: string; /** define the logo display on cli interface */ showLogo?: boolean; } interface IDocumentOption extends ICommonOption { /** define the output component to builded documents */ components: CE_OUTPUT_COMPONENT[]; /** * define whether project name will come from the `package.json` name field or database name * * - db: database name from TypeORM * - app: application name from package.json * */ projectName: CE_PROJECT_NAME_FROM; /** define the directory to store `erdiadb.json` */ databasePath?: string; /** define the directory to ETA templates. `erdia` are using [ETA](https://eta.js.org/) template engine */ templatePath?: string; /** enabling the this option will skip attaching the ER diagram image file to the html document */ skipImageInHtml?: boolean; /** * define the output format to builded documents * * - html * - markdown * - pdf * - image * */ format: CE_OUTPUT_FORMAT; /** * define whether document version will come from the `package.json` version field or specific file, timestamp * */ versionFrom: CE_ENTITY_VERSION_FROM; /** If the versionFrom option set `file`, read the file from this path */ versionPath?: string; /** * define the mermaid.js plugin theme * * @url https://mermaid-js.github.io/mermaid/#/Setup?id=theme * */ theme: CE_MERMAID_THEME; } interface IBuildCommandOption extends IDocumentOption { /** * define the route base path. The route base path is used as the base path for navbar anchor when generating HTML documents * @format html * */ routeBasePath?: string; /** * define what will be written in the HTML document title tag * @format html * */ title?: string; /** define the path to the prettier configuration file */ prettierConfig?: string; /** * define the path to the puppeteer configuration file * @format html, pdf, image * */ puppeteerConfig?: string; /** * define the ER diagram width. The width is defined by the HTML document css attribute width * @format html, pdf, image * */ width?: string; /** * define the viewport width to puppeteer. The width is defined by the HTML document css attribute width * @format html, pdf, image * */ viewportWidth?: number; /** * define the viewport height to puppeteer. The width is defined by the HTML document css attribute height * @format html, pdf, image * */ viewportHeight?: number; /** * define the background color to html documents. eg. transparent, red, '#F0F0F0' * @format pdf, image * */ backgroundColor?: string; /** * define the format to image file * @format image * */ imageFormat?: 'png' | 'svg'; } declare function getMetadata(option: Pick): Promise; declare function getPackageName(json: Record): string; declare function getPlainRelationType(relationType: IRelationRecord['relationType']): "one-to-one" | "one-to-many" | "many-to-many"; declare function getProjectName(dataSource: { options: { database?: string | Uint8Array | undefined; }; }, json: Record, option: Pick): Promise; declare function getRelationHash(relation: Pick): string; declare function getVersion(json: Record, option: Pick): Promise<{ version: string; }>; declare function applyPrettier(document: string, format: 'html' | 'md' | 'json', configPath?: string): Promise; interface IEntityWithColumnAndRelationAndIndex extends IBaseRecord { /** kind of record */ $kind: typeof CE_RECORD_KIND.ENTITY; /** name from property name */ name: string; /** name from database */ dbName: string; /** entity has relation that is set true otherwise false */ hasRelation: boolean; /** column record in this entity */ columns: IColumnRecord[]; /** relation record in this entity */ relations: IRelationRecord[]; /** index record in this entity */ indices: IIndexRecord[]; } interface IRenderData { versions: { version: string; latest: boolean; entities: IEntityWithColumnAndRelationAndIndex[]; }[]; option: Omit; metadata: IRecordMetadata; } declare function getRenderData(records: TDatabaseRecord[], metadata: IRecordMetadata, option: Omit): Promise; interface IErdiaDocument { filename: string; dirname: string; content: string; } declare function createHtml(option: Pick, renderData: AsyncReturnType): Promise; declare function createImageHtml(option: Pick, renderData: AsyncReturnType): Promise; declare function createMarkdown(option: Pick, renderData: AsyncReturnType): Promise; declare function createPdfHtml(option: Pick, renderData: AsyncReturnType): Promise<{ dirname: string; content: string; filename: string; }>; declare function writeToImage(document: IErdiaDocument, option: Pick, renderData: AsyncReturnType): Promise; declare function writeToPdf(document: IErdiaDocument, option: Pick, renderData: AsyncReturnType): Promise; declare function compareDatabase(metadata: IRecordMetadata, next: TDatabaseRecord[], prev: TDatabaseRecord[]): TDatabaseRecord[]; declare function flushDatabase(option: Pick, records: TDatabaseRecord[]): Promise; declare function openDatabase(option: Pick): Promise; declare function processDatabase(metadata: IRecordMetadata, db: TDatabaseRecord[], option: Pick): Promise<{ next: TDatabaseRecord[]; deleted: TDatabaseRecord[]; prev: TDatabaseRecord[]; }>; declare function getPuppeteerConfig(confgFilePath?: string): Promise[0]>; declare function getSlashEndRoutePath(basePath: string): string; declare class TemplateRenderer { #private; constructor(templates: Map, defaultTemplates: Map); evaluate(name: string, data: T): Promise; } declare function getDataSource(options: Pick): Promise; /** * load dataSource, from [CommandUtils.ts](https://github.com/typeorm/typeorm/blob/master/src/commands/CommandUtils.ts#L13) * * @param dataSourceFilePath dataSource file path * @returns */ declare function loadDataSource(dataSourceFilePath: string): Promise; declare function buildOptionBuilder(args: Argv): Argv; declare function commonOptionBuilder(args: Argv): Argv; declare function documentOptionBuilder(args: Argv): Argv; declare function outputOptionBuilder(args: Argv): Argv; declare function buildDocumentCommandHandler(option: IBuildCommandOption): Promise; declare function cleanDocumentCommandHandler(option: ICommonOption): Promise; declare function initConfigCommandHandler(): Promise; declare function templateEjectCommandHandler(option: Pick): Promise; declare const CE_COMMAND_LIST: { readonly BUILD: "build"; readonly INIT: "init"; readonly CLEAN: "clean"; readonly EJECT: "eject"; readonly BUILD_ALIAS: "b"; readonly INIT_ALIAS: "i"; readonly CLEAN_ALIAS: "c"; readonly EJECT_ALIAS: "e"; }; type CE_COMMAND_LIST = (typeof CE_COMMAND_LIST)[keyof typeof CE_COMMAND_LIST]; declare const CE_DEFAULT_VALUE: { readonly CONFIG_FILE_NAME: ".erdiarc"; readonly TSCONFIG_FILE_NAME: "tsconfig.json"; readonly HTML_INDEX_FILENAME: "index.html"; readonly HTML_MERMAID_FILENAME: "mermaid.html"; readonly MARKDOWN_FILENAME: "erdia.md"; readonly DATABASE_FILENAME: "erdiadb.json"; readonly VERSION_FILENAME: ".erdiaverrc"; readonly TEMPLATES_PATH: "templates"; readonly DATA_SOURCE_FILE_FUZZY_SCORE_LIMIT: 50; readonly OUTPUT_DIRECTORY_FUZZY_SCORE_LIMIT: 50; }; type CE_DEFAULT_VALUE = (typeof CE_DEFAULT_VALUE)[keyof typeof CE_DEFAULT_VALUE]; /** * ER diagram export image file format * * @format image * * - svg: svg image format * - png: png image format * */ declare const CE_IMAGE_FORMAT: { readonly SVG: "svg"; readonly PNG: "png"; }; type CE_IMAGE_FORMAT = (typeof CE_IMAGE_FORMAT)[keyof typeof CE_IMAGE_FORMAT]; interface IInitDocAnswer { format: CE_OUTPUT_FORMAT; dataSourceFile: string; isEjectTemplate: boolean; templatePath?: string; isSelectDatabasePath: boolean; databasePath: string; isEnterRouteBasePath: boolean; routeBasePath?: string; projectName: CE_PROJECT_NAME_FROM; versionFrom: CE_ENTITY_VERSION_FROM; versionPath?: string; output: string; components: CE_OUTPUT_COMPONENT[]; theme: CE_MERMAID_THEME; imageFormat?: 'svg' | 'png'; } type TBuildCommandOptionWithVersion = { version: string; } & T; declare function getAutoCompleteSource(fuse: Fuse, limit: number): (_answersSoFar: unknown, input: string | undefined) => string[]; declare function getConfigContent(): Promise; declare function getConfigFilePath(argv: Record): string | undefined; declare function getCwd(env: NodeJS.ProcessEnv): string; declare function preLoadConfig(): {}; declare function getColumnWeight(column: Omit): BigNumber; interface IReason { entityName: string; columnName?: string; message: string; } declare function building(option: SetOptional, logging?: boolean): Promise; declare function cleaning(option: ICommonOption): Promise; declare function ejecting(option: Pick, logging?: boolean): Promise; declare function initializing(logging?: boolean): Promise; declare const container: awilix.AwilixContainer; declare function betterMkdir(filePath: string): Promise; declare function getFindFile(filename: string | readonly string[], option?: findUp.Options): Promise; declare function getGlobFiles(glob: Glob): string[]; declare function getOutputDirPath(option: Pick, cwd: string): Promise; declare function getTemplateDirPath(option: Pick, cwd: string): Promise; declare function createLogger(enable?: boolean): void; declare class Logger { #private; get enable(): boolean; set enable(value: boolean); constructor(enable?: boolean); get level(): LogLevel; set level(level: LogLevel); logging(level: LogType, message: InputLogObject | any, ...args: any[]): void; info: (message: any, ...args: any[]) => void; warn: (message: any, ...args: any[]) => void; silent: (message: any, ...args: any[]) => void; error: (message: any, ...args: any[]) => void; success: (message: any, ...args: any[]) => void; fail: (message: any, ...args: any[]) => void; fatal: (message: any, ...args: any[]) => void; debug: (message: any, ...args: any[]) => void; trace: (message: any, ...args: any[]) => void; verbose: (message: any, ...args: any[]) => void; ready: (message: any, ...args: any[]) => void; box: (message: any, ...args: any[]) => void; log: (message: any, ...args: any[]) => void; } declare const defaultExclude: string[]; declare const CE_TEMPLATE_NAME: { readonly HTML_DOCUMENT_TOC: "html-document-toc"; readonly HTML_DOCUMENT: "html-document"; readonly HTML_MERMAID: "html-mermaid"; readonly HTML_MERMAID_TOC: "html-mermaid-toc"; readonly HTML_MERMAID_DIAGRAM: "html-mermaid-diagram"; readonly HTML_STYLE: "html-style"; readonly HTML_TABLE: "html-table"; readonly IMAGE_DOCUMENT: "image-document"; readonly IMAGE_MERMAID_DIAGRAM: "image-mermaid-diagram"; readonly IMAGE_STYLE: "image-style"; readonly MARKDOWN_DOCUMENT: "markdown-document"; readonly MARKDOWN_MERMAID_DIAGRAM: "markdown-mermaid-diagram"; readonly MARKDOWN_TABLE: "markdown-table"; readonly MARKDOWN_TOC: "markdown-toc"; readonly PDF_DOCUMENT_TOC: "pdf-document-toc"; readonly PDF_DOCUMENT: "pdf-document"; readonly PDF_MERMAID_DIAGRAM: "pdf-mermaid-diagram"; readonly PDF_STYLE: "pdf-style"; readonly PDF_TABLE: "pdf-table"; readonly CONFIG_JSON: "config-json"; }; type CE_TEMPLATE_NAME = (typeof CE_TEMPLATE_NAME)[keyof typeof CE_TEMPLATE_NAME]; interface ITemplate { key: string; content: string; } declare const configTemplate = "\n{\n // directory for output files\n \"output\": \"<%= it.config.output %>\",\n\n // typeorm dataSourcePath\n \"data-source-path\": \"<%= it.config.dataSourceFile %>\",\n\n // type of generated document\n \"components\": <%~ JSON.stringify(it.config.components) %>,\n\n // kind of document name\n // - db: database name from TypeORM\n // - app: application name from package.json\n \"project-name\": \"<%= it.config.projectName %>\",\n\n // custom template file path. erdia are using [ETA](https://eta.js.org/) template engine\n <% if (it.config.templatePath != null) { %>\n \"template-path\": \"<%= it.config.templatePath %>\",\n <% } else { %>\n // \"template-path\": \"\",\n <% } %>\n\n // erdia entity database file path\n <% if (it.config.databasePath != null) { %>\n \"database-path\": \"<%= it.config.databasePath %>\",\n <% } else { %>\n // \"database-path\": \"\",\n <% } %>\n\n // erdia entity database file path\n<% if (it.config.routeBasePath != null) { %>\n \"route-base-path\": \"<%= it.config.routeBasePath %>\",\n<% } else { %>\n // \"route-base-path\": \"\",\n<% } %>\n\n // document version using package.json version or timestamp\n \"version-from\": \"<%= it.config.versionFrom %>\",\n\n // If the versionFrom option set file, read the file from this path\n<% if (it.config.versionPath != null) { %>\n \"version-path\": \"<%= it.config.versionPath %>\",\n<% } else { %>\n // \"version-path\": \"\",\n<% } %>\n\n // output format of generated documents\n // - html\n // - md\n // - pdf\n // - image\n \"format\": \"<%= it.config.format %>\",\n\n // skip image file attachment in html document\n \"skipImageInHtml\": false,\n\n // mermaid.js plugin theme configuration\n // @url https://mermaid-js.github.io/mermaid/#/Setup?id=theme\n \"theme\": \"<%= it.config.theme %>\",\n\n // prettier config path\n // \"prettier-config\": \"set your .prettierrc file path\",\n\n // title tag content that inside of html document\n // \"title\": \"set title tag content in html document\",\n\n // ER diagram width, it will be set width css attribute\n // @format pdf, image\n <% if (it.config.format === 'pdf' || it.config.format === 'image') { -%>\n \"width\": \"100%\",\n <% } else { -%>\n // \"width\": \"100%\",\n <% } -%>\n\n // puppeteer viewport width\n // @format pdf, image\n <% if (it.config.format === 'pdf' || it.config.format === 'image') { -%>\n \"viewport-width\": 1280,\n <% } else { -%>\n // \"viewport-width\": 1280,\n <% } -%>\n\n // puppeteer viewport height\n // @format pdf, image\n <% if (it.config.format === 'pdf' || it.config.format === 'image') { -%>\n \"viewport-height\": 1440,\n <% } else { -%>\n // \"viewport-height\": 1440,\n <% } -%>\n\n // puppeteer config file path\n // @format pdf, image\n // \"puppeteer-config-path\": \"set your puppeteer configuration file path\",\n\n // Background color. Example: transparent, red, '#F0F0F0'. Optional. Default: white\n // @format pdf, image\n // \"background-color\": \"#FFFFFF\",\n\n // ER diagram export image file format\n // @format image\n <% if (it.config.format === 'image') { %>\n \"image-format\": \"<%= it.config.imageFormat %>\",\n <% } else { %>\n // \"image-format\": \"svg\",\n <% } %>\n}\n"; declare function getTemplate(dirPath: string, filePath: string): Promise; declare function getTemplateModulePath(templatePathParam?: string): Promise; declare function getTemplatePath(templatePathParam?: string): Promise; declare function getTemplates(templatePath: string, globOptions?: GlobOptions): Promise; declare function loadTemplates(option?: Pick): Promise<{ default: Map; template: Map; }>; declare function getColumnAttributeKey(columnMetadata: Pick, dbName: string, tableDBName: string, indexRecords: IIndexRecord[]): CE_COLUMN_ATTRIBUTE[]; declare function getColumnRecord(columnMetadata: ColumnMetadata, option: Pick, metadata: IRecordMetadata, indices: IIndexRecord[]): IColumnRecord; declare function getColumnType(columnMetadata: Pick, includeLength?: boolean): string; declare function getComment(option: Pick, comment: undefined | null | string): string; declare function getIsNullable(metadata: { isNullable: ColumnMetadata['isNullable']; isPrimary: ColumnMetadata['isPrimary']; }): "" | "nullable"; /** * 엔티티 메타 데이터를 받아서 다이어그램에서 사용할 이름을 반환한다. * 괄호나 엘리어스를 표시할 수 있는 방법이 없어서 테이블 이름을 사용한다. * 테이블 이름이 없는 경우에만 엔티티 이름을 사용한다. * * @param entityMeta 엔티티 메타 데이터 * @returns entity name in CF-ER Diagram */ declare function getEntityName(entityMeta: Pick | IEntityRecord): string; /** * 엔티티 메타 데이터를 받아서 다이어그램에서 사용할 이름을 반환한다. * 괄호나 엘리어스를 표시할 수 있는 방법이 없어서 테이블 이름을 사용한다. * 테이블 이름이 없는 경우에만 엔티티 이름을 사용한다. * * @param entityMeta 엔티티 메타 데이터 * @returns entity name in CF-ER Diagram */ declare function getEntityPropertyName(entityMeta: Pick | IEntityRecord): string; declare function getEntityRecord(entityMetadata: EntityMetadata, metadata: IRecordMetadata): IEntityRecord; declare function getEntityRecords(dataSource: DataSource, metadata: IRecordMetadata): IEntityRecord[]; declare function getIndexRecord(entityMetadata: EntityMetadata, metadata: IRecordMetadata): IIndexRecord[]; declare function getIndexRecords(dataSource: DataSource, metadata: IRecordMetadata): IIndexRecord[]; declare function dedupeManyToManyRelationRecord(relations: IRelationRecord[]): IRelationRecord[]; declare function getInverseRelationMetadata(relationMetadata: Pick): RelationMetadata; declare function getJoinColumn(relationMetadata: RelationMetadata): Pick; declare function getManyToManyEntityMetadata(entityMetadatas: EntityMetadata[], relationMetadata: Pick): EntityMetadata; declare function getManyToManyJoinColumn(relationMetadata: Pick): Pick; declare function getManyToOneJoinColumn(relationMetadata: Pick): Pick; declare function getRelationRecord(entityMetadatas: EntityMetadata[], relationMetadata: RelationMetadata, metadata: IRecordMetadata): PassFailEither; declare function getRelationRecords(dataSource: DataSource, metadata: IRecordMetadata): ReturnType[]; declare const SymbolDataSource: unique symbol; declare const SymbolDefaultTemplate: unique symbol; declare const SymbolLogger: unique symbol; declare const SymbolTemplate: unique symbol; declare const SymbolTemplateRenderer: unique symbol; export { CE_CHANGE_KIND, CE_COLUMN_ATTRIBUTE, CE_COMMAND_LIST, CE_DEFAULT_VALUE, CE_ENTITY_VERSION_FROM, CE_IMAGE_FORMAT, CE_MERMAID_THEME, CE_OUTPUT_COMPONENT, CE_OUTPUT_FORMAT, CE_PROJECT_NAME_FROM, CE_RECORD_KIND, CE_TEMPLATE_NAME, type IBaseRecord, type IBuildCommandOption, type IColumnRecord, type ICommonOption, type IDocumentOption, type IEntityRecord, type IEntityWithColumnAndRelationAndIndex, type IErdiaDocument, type IIndexRecord, type IInitDocAnswer, type IReason, type IRecordMetadata, type IRelationRecord, type IRenderData, type ITemplate, Logger, SymbolDataSource, SymbolDefaultTemplate, SymbolLogger, SymbolTemplate, SymbolTemplateRenderer, type TBuildCommandOptionWithVersion, type TDatabaseRecord, TemplateRenderer, applyPrettier, betterMkdir, buildDocumentCommandHandler, buildOptionBuilder, building, cleanDocumentCommandHandler, cleaning, commonOptionBuilder, compareDatabase, configTemplate, container, createHtml, createImageHtml, createLogger, createMarkdown, createPdfHtml, dedupeManyToManyRelationRecord, defaultExclude, documentOptionBuilder, ejecting, flushDatabase, getAutoCompleteSource, getColumnAttributeKey, getColumnHash, getColumnRecord, getColumnType, getColumnWeight, getComment, getConfigContent, getConfigFilePath, getCwd, getDataSource, getDatabaseName, getEntityHash, getEntityName, getEntityPropertyName, getEntityRecord, getEntityRecords, getFileVersion, getFindFile, getGlobFiles, getIndexHash, getIndexRecord, getIndexRecords, getInverseRelationMetadata, getIsNullable, getJoinColumn, getManyToManyEntityMetadata, getManyToManyJoinColumn, getManyToOneJoinColumn, getMetadata, getOutputDirPath, getPackageName, getPlainRelationType, getProjectName, getPuppeteerConfig, getRelationHash, getRelationRecord, getRelationRecords, getRenderData, getSlashEndRoutePath, getTemplate, getTemplateDirPath, getTemplateModulePath, getTemplatePath, getTemplates, getVersion, initConfigCommandHandler, initializing, loadDataSource, loadTemplates, openDatabase, outputOptionBuilder, preLoadConfig, processDatabase, templateEjectCommandHandler, writeToImage, writeToPdf };