import type { ProcessedCodegenParameters } from "../parameters.js"; import type { CompiledTsType, JsonSchema, LogLevel } from "../shared.js"; import type { CompileContext } from "./compile.js"; import type { TypeDependencyMap } from "./shared.js"; import type { DataType, EntityType, PropertyType, VersionedUrl } from "@blockprotocol/type-system"; type IdentifierSource = { definingPath: string; } & ({ kind: "external"; } | { kind: "local"; compiledContents: string; dependentOnIdentifiers: string[]; }); /** * Defines the source, or sources, associated with a given identifier. * * Duplicate identifiers can exist when they're defined but not importable during codegen. */ export type IdentifierSources = { locallyImportable: true; source: IdentifierSource; } | { locallyImportable: false; source: IdentifierSource[]; }; export declare class PostprocessContext { readonly parameters: ProcessedCodegenParameters; readonly logLevel: LogLevel; readonly dataTypes: Record; readonly propertyTypes: Record; readonly entityTypes: Record; readonly metadataSchemas: Record; readonly allTypes: Record; readonly typeDependencyMap: TypeDependencyMap; /** Map of entity type IDs to whether or not they are link entity types */ readonly linkTypeMap: Record; /** Map of sourceTypeIds to their compiled schemas */ readonly typeIdsToCompiledTypes: Record; /** * Map of TypeScript identifiers, to their source (the file that exports them) and the contents required to define * them if they're a locally defined type */ IdentifiersToSources: Record; /** Map of files to the identifiers of types that they will **depend on**, either by defining or importing them */ filesToDependentIdentifiers: Record>; /** Map of files to the identifiers of types that they will **define** */ filesToDefinedIdentifiers: Record>; /** Map of files to the actual TypeScript contents */ filesToContents: Record; constructor(compileContext: CompileContext); logWarn(message: string): void; logInfo(message: string): void; logDebug(message: string): void; logTrace(message: string): void; addDependentIdentifierInFile(identifier: string, path: string): void; defineIdentifierInFile(identifier: string, { definingPath, compiledContents, dependentOnIdentifiers, }: { definingPath: string; compiledContents: string; dependentOnIdentifiers: string[]; }, locallyImportable: boolean): void; } export {};