import { Entity } from "../../../common/abstracts/entity"; import { DataModelInterface } from "../../../common/interfaces/datamodel.interface"; import { EntityDescriptor, RelationshipDef } from "../../../common/interfaces/entity.schema.interface"; import type { User } from "../../user/entities/user"; import { ContentExtensionConfig } from "../interfaces/content.extension.interface"; /** * Content entity type representing polymorphic content (Article, Document, etc.). * * The index signature allows extension relationships to be added dynamically * when ContentExtensionConfig is provided. APIs can narrow this type using * intersection types for better type safety. * * @example * ```typescript * // In API - narrow type for specific extensions * type ExtendedContent = Content & { * topic: Topic[]; * expertise: Expertise[]; * }; * ``` */ export type Content = Entity & { name: string; contentType: string; abstract?: string; tldr?: string; aiStatus?: string; relevance?: number; owner: User; author: User; /** Index signature for extension relationships added via ContentExtensionConfig */ [relationshipName: string]: unknown; }; /** * Builds the Content entity descriptor, optionally shaped by a * {@link ContentExtensionConfig}. * * With NO config the descriptor is the exact wire contract of the legacy * `ContentSerialiser`/`ContentModel` pair it replaces: * - attributes: `name`, `abstract`, `tldr` * - meta: `aiStatus`, `contentType`, `relevance` * - relationships: `owner`, `author` * * Config effects: * - `serialiseAuthor: false` removes the `author` relationship * - `metaFields` adds one computed meta entry per entry, read from the Cypher * RETURN alias produced by {@link ContentCypherService} * - `additionalRelationships` adds one relationship per entry, keyed by the * related model's `nodeName` (the key the Cypher RETURN alias * `content_` maps onto) * * @param config - Optional Content extension configuration */ export declare function buildContentDescriptor(config?: ContentExtensionConfig): EntityDescriptor>; /** * Content Entity Descriptor (no extension config). * * This is the descriptor to register in a graph catalog and to import from * consuming apps. The descriptor actually used for serialisation at runtime is * built by `ContentModule.forRoot()` from the module's configuration and * published through `modelRegistry` — read it with {@link getContentModel}. */ export declare const ContentDescriptor: EntityDescriptor>; export type ContentDescriptorType = typeof ContentDescriptor; /** * Get the Content model from the registry. * * `ContentModule.forRoot()` registers the CONFIGURED model (extension * relationships, config-driven meta fields, optional author), so every read * path must resolve the model through the registry rather than capturing * {@link ContentDescriptor}.model at import time. */ export declare function getContentModel(): DataModelInterface; //# sourceMappingURL=content.d.ts.map