/** * XPath2Functions (G6 — v1.5.0) * ───────────────────────────────── * XPath 2.0 string and sequence functions as a standalone library. * * These functions are implemented as pure TypeScript and can be called * directly without the XPath engine (for type validation, codegen, etc.) * or registered as extension functions in the XPath engine. * * String functions * ──────────────── * upperCase(s) upper-case() * lowerCase(s) lower-case() * matchesXPath(s, p) matches() — XPath 2.0 regex subset * replaceXPath(s,p,r) replace() * tokenize(s, p) tokenize() — split by regex pattern * normalizeUnicode(s) normalize-unicode() — NFC only * encodeForUri(s) encode-for-uri() * iriToUri(s) iri-to-uri() * substringBefore(s,x) substring-before() * substringAfter(s,x) substring-after() * * Sequence / aggregate functions * ────────────────────────────── * distinctValues(xs) distinct-values() * isEmpty(xs) empty() * exists(xs) exists() * stringJoin(xs, sep) string-join() * sum(xs) sum() * avg(xs) avg() * minValue(xs) min() * maxValue(xs) max() * insertBefore(xs,p,v) insert-before() * remove(xs, p) remove() * subsequence(xs,s,l?) subsequence() * reverseSeq(xs) reverse() * indexOf(xs, v) index-of() */ /** upper-case(string) */ export declare function upperCase(s: string): string; /** lower-case(string) */ export declare function lowerCase(s: string): string; /** * matches(string, pattern, flags?) * XPath 2.0 regex — flags: 'i' (case-insensitive), 's' (dot-all), 'm' (multi-line), 'x' (extended). */ export declare function matchesXPath(s: string, pattern: string, flags?: string): boolean; /** * replace(string, pattern, replacement, flags?) * XPath 2.0 regex replace. Replacement uses $0, $1… for captured groups. */ export declare function replaceXPath(s: string, pattern: string, replacement: string, flags?: string): string; /** * tokenize(string, pattern, flags?) * Split string by regex pattern; returns empty array for empty/whitespace input. */ export declare function tokenize(s: string, pattern: string, flags?: string): string[]; /** normalize-unicode(string) — NFC normalisation only */ export declare function normalizeUnicode(s: string): string; /** encode-for-uri(string) */ export declare function encodeForUri(s: string): string; /** iri-to-uri(string) — minimal: encode non-ASCII and reserved chars */ export declare function iriToUri(s: string): string; /** substring-before(string, search) */ export declare function substringBefore(s: string, search: string): string; /** substring-after(string, search) */ export declare function substringAfter(s: string, search: string): string; /** distinct-values(sequence) — returns unique values (using ===) */ export declare function distinctValues(xs: T[]): T[]; /** empty(sequence) — true if the sequence has zero items */ export declare function isEmpty(xs: T[]): boolean; /** exists(sequence) — true if the sequence has one or more items */ export declare function exists(xs: T[]): boolean; /** string-join(sequence, separator) */ export declare function stringJoin(xs: string[], sep?: string): string; /** * sum(sequence, zero?) — numeric sum. * Returns `zero` (default 0) for an empty sequence. */ export declare function sum(xs: number[], zero?: number): number; /** * avg(sequence) — arithmetic mean. * Returns NaN for an empty sequence (XPath 2.0 §15.4.3). */ export declare function avg(xs: number[]): number; /** * min(sequence) — minimum value. * Accepts numbers or strings (strings compared lexicographically). */ export declare function minValue(xs: Array): number | string | undefined; /** * max(sequence) — maximum value. * Accepts numbers or strings (strings compared lexicographically). */ export declare function maxValue(xs: Array): number | string | undefined; /** insert-before(sequence, position, insert) — 1-based position */ export declare function insertBefore(xs: T[], position: number, insert: T[]): T[]; /** remove(sequence, position) — 1-based position */ export declare function remove(xs: T[], position: number): T[]; /** * subsequence(sequence, startingLoc, length?) * 1-based starting location; length optional (to end of sequence). */ export declare function subsequence(xs: T[], startingLoc: number, length?: number): T[]; /** reverse(sequence) */ export declare function reverseSeq(xs: T[]): T[]; /** index-of(sequence, value) — returns 1-based positions of matching items */ export declare function indexOf(xs: T[], value: T): number[]; //# sourceMappingURL=XPath2Functions.d.ts.map