import { CueApi } from './api'; import { CueProjectSchema } from './schema'; import { CueProjectEntities } from './entities'; import { CueProjectDocuments } from './documents'; import { ReadonlySignal } from './signal'; import { SearchOptions, SearchResponse, CategoryDef, RelationshipDef, EntityDetailedData, EntityRelationships, ProjectEntitiesData, DocumentInfo, ProjectDocumentsData } from './models'; export interface CueProjectViewOptions { language: string; /** Override the RDF resource base URL. Defaults to `https://cue.qaecy.com/r/`. */ rdfBase?: string; /** Graph engine type from projectSettings.graph.type (e.g. 'qlever' or 'fuseki'). */ graphType?: string; /** Enable verbose debug logging for entity and document fetch stats. */ verbose?: boolean; } /** * Framework-agnostic facade over `CueProjectSchema`, `CueProjectEntities`, and * `CueProjectDocuments`. Exposes a flat, ergonomic API for all knowledge-graph * view state needed by the portal. * * Create via `cue.createProjectView()` rather than constructing directly. * * @example * ```ts * const view = cue.createProjectView('my-project', { language: 'en' }); * view.entityInfoMap.subscribe(map => render(map)); * view.requestEntityData(['uuid1', 'uuid2']); * ``` */ export declare class CueProjectView { private readonly _api; private readonly _projectId; /** Direct access to the schema data class (available categories / relationships). */ readonly schema: CueProjectSchema; /** Direct access to the entity data class. */ readonly entities: CueProjectEntities; /** Direct access to the document data class. */ readonly documents: CueProjectDocuments; /** Available content category definitions for this project. Auto-fetched on init. */ readonly availableContentCategories: ReadonlySignal; /** Available entity category definitions for this project. Auto-fetched on init. */ readonly availableEntityCategories: ReadonlySignal; /** Available entity relationship types. Auto-fetched on init. */ readonly availableEntityRelationships: ReadonlySignal; /** * Resolves when the initial schema load has completed. Await before reading * schema signal values imperatively. */ readonly schemaReady: Promise; /** Merged per-entity detail map. Populated lazily via `requestEntityData()` etc. */ readonly entityInfoMap: ReadonlySignal>; /** Project-level entity co-occurrence graph. Fetched once on init. */ readonly entityGraph: ReadonlySignal; /** Per-document info map. Populated lazily via `requestDocumentData()`. */ readonly documentInfoMap: ReadonlySignal>; /** Project document overview (counts by suffix and category). Fetched on init. */ readonly projectDocumentsData: ReadonlySignal; private readonly _searchResults; /** The result of the most recent `search()` call. `undefined` before first search. */ readonly searchResults: ReadonlySignal; private _destroyed; constructor(_api: CueApi, _projectId: string, { language, rdfBase, graphType, verbose }: CueProjectViewOptions); /** * Lazily batch-fetch core data (label + categories) for the given entity UUIDs. * Already-fetched UUIDs are skipped. Populates `entityInfoMap`. */ requestEntityData(uuids: string[], includeMentionCount?: boolean): void; /** * Lazily fetch OSM location data for the given entity UUIDs. * Already-fetched UUIDs are skipped. Populates `entityInfoMap` geometry fields. */ requestEntityLocations(uuids: string[]): Promise; /** * Fetch incoming and outgoing relationships for a single entity IRI. * Result is stored in `entityInfoMap[uuid].relationshipData`. */ fetchEntityRelationships(iri: string): Promise; /** * Fetch UUIDs of documents that reference the given entity IRI. * Result is stored in `entityInfoMap[uuid].documentRefs`. */ fetchEntityDocuments(iri: string): Promise; /** Constructs the full RDF IRI for an entity UUID. */ entityIri(uuid: string): string; /** * Lazily batch-fetch document info for the given UUIDs. * Already-fetched UUIDs are skipped. Populates `documentInfoMap`. */ requestDocumentData(uuids: string[]): void; /** * Run a natural-language search against the project. * The result is stored in `searchResults` and replaces any previous result. */ search(term: string, options?: SearchOptions): Promise; /** * Switch the active language for schema labels and document text fields. * Schema responses are cached per language (instant if previously loaded). * The document info map is cleared and lazily re-populated on next access. */ setLanguage(lang: string): void; /** * Reset all entity and document state and re-fetch the project overview. * Prefer creating a fresh `CueProjectView` when switching projects. * Use `reset()` only when the same project's data needs to be invalidated. */ reset(): void; /** * Tear down this view instance. Clears all reactive state and blocks further * updates. Call from the Angular adapter's `ngOnDestroy` or equivalent. */ destroy(): void; }