/****************************************************************************** * Copyright 2024 - 2025 TypeFox GmbH * This program and the accompanying materials are made available under the * terms of the MIT License, which is available in the project root. ******************************************************************************/ import { type AstNode } from 'langium'; import type { LangiumServicesLike } from '../types.js'; interface SplitterOptions { /** * List of comment rule names to include in the chunk. * If not provided comments are ignored. * Default: ['ML_COMMENT', 'SL_COMMENT'] */ commentRuleNames?: string[]; } /** * Splits a document into text chunks based on AST nodes that match the provided predicates. * Finds the relevant nodes and then extracts corresponding text chunks from them * @param document - Document to split * @param nodePredicates - Predicates to determine the nodes for splitting * @param services - Langium grammar services used for parsing * @param options - The splitter configuration. See {@link SplitterOptions} * @returns Decoded text chunks from the document */ export declare function splitByNode(document: string, nodePredicates: Array<(node: AstNode) => boolean> | ((node: AstNode) => boolean), services: LangiumServicesLike, options?: SplitterOptions): string[]; /** * Splits a document into AST nodes based on the given predicates. * Directly returns the matched AST nodes * @param document - The text document to be split * @param nodePredicates - The predicates to determine which nodes to include * @param services - Langium grammar services used for parsing * @returns The nodes picked up by the splitter */ export declare function splitByNodeToAst(document: string, nodePredicates: Array<(node: AstNode) => boolean> | ((node: AstNode) => boolean), services: LangiumServicesLike): AstNode[]; export {}; //# sourceMappingURL=splitter.d.ts.map