@juspay/neurolink
Version:
The pipe layer of an AI nervous system: one interface connecting provider neurons to your application, across three inference types — generate, stream and decide. `decide` returns typed, calibrated judgements from a non-generative model (~400ms, ~$0.00002
36 lines (35 loc) • 1.3 kB
TypeScript
/**
* Markdown-aware Chunker
*
* Splits markdown documents based on header structure while preserving formatting.
* Best for documentation, README files, and structured markdown content.
*/
import type { BaseChunkerConfig, Chunk, Chunker, ChunkerValidationResult, MarkdownChunkerConfig } from "../../types/index.js";
/**
* Markdown-aware chunker implementation
* Splits based on markdown structure (headers, code blocks, etc.)
*/
export declare class MarkdownChunker implements Chunker {
readonly strategy: "markdown";
chunk(text: string, config?: MarkdownChunkerConfig): Promise<Chunk[]>;
private splitByHeaders;
private splitContent;
/**
* Detect contiguous table blocks in lines.
* Returns array of { start, end } line index ranges (inclusive).
*/
private detectTableRanges;
/** Check if a line is a markdown table separator (e.g. |---|---|). */
private isTableSeparator;
/**
* Split content while preserving markdown tables.
*/
private splitContentTableAware;
/**
* Split a table on row boundaries, repeating header + separator in each chunk.
*/
private splitTableByRows;
private splitPlainContent;
private stripMarkdown;
validateConfig(config: BaseChunkerConfig): ChunkerValidationResult;
}