/** * Shared utilities for AiDex commands */ import { type AiDexDatabase } from '../db/index.js'; import type { Queries } from '../db/queries.js'; /** * Normalize path separators to forward slashes (consistent storage format). * Use this instead of inline .replace(/\\/g, '/') everywhere. */ export declare function normalizePath(p: string): string; /** * Escape a term for use in SQLite LIKE queries (with ESCAPE '\'). * Handles: backslash, percent, underscore. */ export declare function escapeLikeTerm(term: string): string; /** * Validate that a project has an AiDex index. Returns dbPath or null. */ export declare function validateIndex(projectPath: string): string | null; /** * Standard error message when no index is found. */ export declare function noIndexError(projectPath: string): string; /** * Open a project database, run a function, and ensure the DB is always closed. * Returns whatever the function returns. */ export declare function withDatabase(dbPath: string, readonly: boolean, fn: (db: AiDexDatabase, queries: Queries) => T): T; /** * Validate index + open database + run function. Combines validateIndex + withDatabase. * Returns the error result if no index found, otherwise runs fn. */ export declare function withProjectDb(projectPath: string, readonly: boolean, onError: (error: string) => T, fn: (db: AiDexDatabase, queries: Queries) => T): T; /** * Parse an interval string to milliseconds. * Supports: "30s" (seconds), "30m" (minutes), "2h" (hours), "3d" (days), "1w" (weeks) */ export declare function parseIntervalToMs(interval: string): number | null; /** * Parse a due date input to a timestamp. * - Relative: "3d" = 3 days from now (future) * - ISO date: "2026-04-10" or "2026-04-10T14:00:00Z" */ export declare function parseDueDate(input: string): number | null; //# sourceMappingURL=shared.d.ts.map