UNPKG

@docuify/engine

Version:

A flexible, pluggable engine for building and transforming documentation content from source files.

28 lines (25 loc) 890 B
import { DocuifyNode } from '../base/types.js'; type DeepPartial<T> = { [K in keyof T]?: T[K] extends object ? DeepPartial<T[K]> : T[K]; }; declare class QueryContext { private readonly flatNodes; constructor(flatNodes: DocuifyNode[]); /** * Filters nodes by a deep partial `where` clause. * Returns a new array of matching nodes (immutable). */ findMany(where?: DeepPartial<DocuifyNode>): ReadonlyArray<DocuifyNode>; /** * Finds the first node matching `where`. * Returns undefined if none found. */ findFirst(where?: DeepPartial<DocuifyNode>): DocuifyNode | undefined; /** * Loads content from a given node if possible. * Throws if the node has no loadContent action or is not a file. * Returns loaded content as string. */ loadContent(node: DocuifyNode): Promise<string>; } export { QueryContext };