import type { SchemaParserContext } from '#src/parser/types.js'; import type { PluginSpecStore } from '#src/plugins/index.js'; import type { DefinitionEntity, DefinitionReference, FixRefDeletionResult, ResolvedZodRefPayload } from '#src/references/index.js'; import type { ProjectDefinition, ProjectDefinitionSchema } from '#src/schema/index.js'; import type { EntityServiceContext } from '#src/tools/entity-service/types.js'; /** * Container for a project definition that includes references and entities. * * This class provides utility methods for working with a project definition * such as the ability to fetch an entity by ID. */ export declare class ProjectDefinitionContainer { refPayload: ResolvedZodRefPayload; definition: ProjectDefinition; references: DefinitionReference[]; entities: DefinitionEntity[]; parserContext: SchemaParserContext; pluginStore: PluginSpecStore; schema: ProjectDefinitionSchema; private _entityTypeMap; constructor(config: ResolvedZodRefPayload, parserContext: SchemaParserContext, pluginStore: PluginSpecStore, schema: ProjectDefinitionSchema); /** * Fetches a DefinitionEntity by its ID, returning undefined if not found. * * @param id The ID of the entity to fetch * @returns The DefinitionEntity, or undefined if not found */ entityFromId(id: string | undefined): DefinitionEntity | undefined; /** * Fetches the name of an entity by its ID. * * @param id The ID of the entity to fetch * @returns The name of the entity */ nameFromId(id: string): string; nameFromId(id: string | undefined): string | undefined; /** * Fetches the name of an entity by its ID, returning undefined if the ID is not found. * * @param id The ID of the entity to fetch * @returns The name of the entity, or undefined if the ID is not found */ safeNameFromId(id: string | undefined): string | undefined; /** * Fix any reference deletions that would occur when applying the given setter. * * @param setter A function that modifies the project definition * @returns A result indicating whether the reference deletions were fixed */ fixRefDeletions(setter: (draftConfig: ProjectDefinition) => void): FixRefDeletionResult; /** * Creates an EntityServiceContext for use with entity read/write operations. * * Builds the entity type map from the schema and serializes the definition * with references resolved to names. */ private getEntityTypeMap; toEntityServiceContext(): EntityServiceContext; /** * Serializes the project definition resolving references to their names for easier reading. * * @returns The serialized contents of the project definition */ toSerializedContents(): string; /** * Creates a new ProjectDefinitionContainer from a serialized configuration. * * @param config The serialized configuration * @param context The parser context to use * @returns A new ProjectDefinitionContainer */ static fromSerializedConfig(config: unknown, context: SchemaParserContext): ProjectDefinitionContainer; } //# sourceMappingURL=project-definition-container.d.ts.map