/** * Language def for a file extension, or null when no tree-sitter grammar applies (md, or an * unsupported extension — the chunker falls back to a file-level chunk). * @param {string} ext lowercased extension including the dot, e.g. ".py" * @returns {LangDef | null} */ export function langForExt(ext: string): LangDef | null; /** * @typedef {Object} LangDef * @property {string} format format tag (matches indexer FORMAT) * @property {string} grammar vendored wasm filename under ./grammars * @property {string[]} defTypes tree-sitter node types that become symbol chunks * @property {string[]} importTypes tree-sitter node types that carry an import specifier (slice 4) * @property {boolean} [requireCalls] also treat `require("…")` call-expressions as imports (CJS) * @property {string[]} callTypes tree-sitter node types that are a call site (impact, slice 5) * @property {string[]} branchTypes node types counted as decision points for cyclomatic-ish complexity (slice 5) * @property {string[]} [decoratorTypes] node types where a bare `@name` applies (= uses) `name` (slice 5) */ /** @type {Record} */ export const LANGDEFS: Record; export type LangDef = { /** * format tag (matches indexer FORMAT) */ format: string; /** * vendored wasm filename under ./grammars */ grammar: string; /** * tree-sitter node types that become symbol chunks */ defTypes: string[]; /** * tree-sitter node types that carry an import specifier (slice 4) */ importTypes: string[]; /** * also treat `require("…")` call-expressions as imports (CJS) */ requireCalls?: boolean | undefined; /** * tree-sitter node types that are a call site (impact, slice 5) */ callTypes: string[]; /** * node types counted as decision points for cyclomatic-ish complexity (slice 5) */ branchTypes: string[]; /** * node types where a bare `@name` applies (= uses) `name` (slice 5) */ decoratorTypes?: string[] | undefined; };