import { Slot } from '@revesuite/global/utils'; import type { Workspace } from '../workspace.js'; import type { BlockIndexer } from './base.js'; type PageId = string; type BlockId = string; type LinkedNode = { type: 'LinkedPage' | 'Subpage'; pageId: PageId; blockId: BlockId; }; export type IndexUpdatedEvent = { action: 'delete'; pageId: PageId; blockId?: BlockId; } | { action: 'add' | 'update'; pageId: PageId; blockId: BlockId; }; export declare class BacklinkIndexer { private _linkIndexMap; private _disposables; slots: { /** * Note: sys:children update will not trigger event */ indexUpdated: Slot; }; constructor(blockIndexer: BlockIndexer); private _backlinkIndexMapCache; /** * Get the list of backlinks for a given page */ getBacklink(targetPageId: PageId): LinkedNode[]; /** * Returns all valid subpage nodes in the given page. * * Note: this method will ignore invalid subpage nodes. * * @example * ```ts * const subpages = workspace.indexer.backlink * .getSubpageNodes(pageId) * .map(node => node.pageId); * ``` */ getSubpageNodes(pageId: PageId): LinkedNode[]; getParentPage(pageId: string): string | null; /** * Delete the specified subpage nodes from the workspace. */ removeSubpageNode(workspace: Workspace, subpageId: PageId): void; private _onRefreshIndex; private _onPageRemoved; private _onBlockUpdated; private _indexDelta; private _removeIndex; dispose(): void; } export {}; //# sourceMappingURL=backlink.d.ts.map