import { a as SectionMode, b as WordCounterOptions, g as LocaleChunk, m as LocaleDetectOptions, o as SectionedResult, x as WordCounterResult, y as WordCounterMode } from "./index.mjs"; //#region src/detector/policy.d.ts type DetectorContentGatePolicy = "latinProse" | "none"; type DetectorDiagnosticTextSource = "focus" | "borrowed-context"; type DetectorBorrowedContext = { leftChunkIndex?: number; rightChunkIndex?: number; }; type DetectorContentGateResult = { applied: boolean; passed: boolean; policy: DetectorContentGatePolicy; mode: DetectorContentGateMode; }; //#endregion //#region src/detector/debug.d.ts type DetectorDebugVerbosity = "compact" | "verbose"; type DetectorEvidenceConfig = { verbosity: DetectorDebugVerbosity; mode: WordCounterMode; section: SectionMode; }; type DetectorDebugSummary = { mode: DetectorMode; engine: "none" | "whatlang-wasm"; windowsTotal: number; accepted: number; fallback: number; routes: { latin: number; han: number; }; acceptancePaths: { reliable: number; corroborated: number; }; fallbackReasons: { notEligible: number; noCandidate: number; belowThreshold: number; qualityGate: number; corroborationUnreliable: number; }; }; type DetectorDebugContext = { emit?: (event: string, details?: Record, options?: { verbosity?: DetectorDebugVerbosity; }) => void; summary?: DetectorDebugSummary; evidence?: DetectorEvidenceConfig; }; type DetectorFallbackReason = "notEligible" | "noCandidate" | "belowThreshold" | "qualityGate" | "corroborationUnreliable"; declare function createDetectorDebugSummary(mode: DetectorMode, engine?: DetectorDebugSummary["engine"]): DetectorDebugSummary; declare function mergeDetectorDebugSummaries(summaries: Array): DetectorDebugSummary | undefined; //#endregion //#region src/detector/types.d.ts type DetectorMode = "regex" | "wasm"; type DetectorSource = "script" | "hint" | "wasm"; type DetectorContentGateMode = "default" | "strict" | "loose" | "off"; interface DetectorContentGateOptions { mode?: DetectorContentGateMode; } interface DetectorResult { tag: string; confidence?: number; reliable?: boolean; source: DetectorSource; } interface DetectorRuntimeOptions { detector?: DetectorMode; detectorDebug?: DetectorDebugContext; contentGate?: DetectorContentGateOptions; } interface DetectorLocaleOptions extends LocaleDetectOptions, DetectorRuntimeOptions {} interface DetectorWordCounterOptions extends WordCounterOptions, DetectorRuntimeOptions {} type DetectorCountSectionsOptions = DetectorWordCounterOptions; type DetectorCountResult = WordCounterResult | SectionedResult; type DetectorCountSections = (input: string, section: SectionMode, options?: DetectorCountSectionsOptions) => Promise; //#endregion //#region src/detector/inspect-types.d.ts type DetectorInspectSchemaVersion = 1; type DetectorInspectKind = "detector-inspect"; type DetectorInspectView = "engine" | "pipeline"; type DetectorInspectInputSourceType = "inline" | "path"; type DetectorInspectInputOptions = { sourceType?: DetectorInspectInputSourceType; path?: string; }; interface DetectorInspectOptions extends DetectorLocaleOptions { detector?: DetectorMode; view?: DetectorInspectView; input?: DetectorInspectInputOptions; } type DetectorInspectInput = { sourceType: DetectorInspectInputSourceType; path?: string; textLength: number; textPreview: string; textPreviewTruncated: boolean; }; type DetectorInspectSample = { text: string; textLength: number; normalizedText: string; normalizedApplied: boolean; textSource: DetectorDiagnosticTextSource; borrowedContext?: DetectorBorrowedContext; }; type DetectorInspectEngineRaw = { lang: string; script: string; confidence: number; reliable: boolean; }; type DetectorInspectEngineRemapped = { rawTag: string | null; normalizedTag: string | null; }; type DetectorInspectEngine = { name: "whatlang-wasm"; raw: DetectorInspectEngineRaw; normalized?: DetectorInspectEngineRaw; remapped: DetectorInspectEngineRemapped; }; type DetectorInspectDecision = { kind: "empty"; notes: string[]; } | { kind: "deterministic"; notes: string[]; } | { accepted: boolean; path: "reliable" | "corroborated" | null; finalTag: string; finalLocales?: string[]; fallbackReason: string | null; }; type DetectorInspectChunk = { index: number; locale: string; textPreview: string; textPreviewTruncated: boolean; source?: "script" | "hint" | "fallback" | DetectorResult["source"]; reason?: string; }; type DetectorInspectWindow = { windowIndex: number; routeTag: string; chunkRange: { start: number; end: number; }; focusTextPreview: string; focusTextPreviewTruncated: boolean; diagnosticSample: { textPreview: string; textPreviewTruncated: boolean; normalizedTextPreview: string; normalizedTextPreviewTruncated: boolean; normalizedApplied: boolean; borrowedContext?: DetectorBorrowedContext; }; eligibility: { scriptChars: number; minScriptChars: number; passed: boolean; }; contentGate: DetectorContentGateResult; engine: { executed: boolean; reason?: string; }; decision: Exclude; }; type DetectorInspectBaseResult = { schemaVersion: DetectorInspectSchemaVersion; kind: DetectorInspectKind; view: DetectorInspectView; detector: DetectorMode; input: DetectorInspectInput; }; type DetectorInspectEngineResult = DetectorInspectBaseResult & { view: "engine"; detector: "wasm"; routeTag?: string; sample: DetectorInspectSample; engine?: DetectorInspectEngine; decision?: Extract; }; type DetectorInspectPipelineResult = DetectorInspectBaseResult & { view: "pipeline"; chunks: DetectorInspectChunk[]; resolvedChunks: DetectorInspectChunk[]; windows?: DetectorInspectWindow[]; decision?: DetectorInspectDecision; }; type DetectorInspectResult = DetectorInspectEngineResult | DetectorInspectPipelineResult; //#endregion //#region src/detector/none.d.ts declare function inspectTextWithRegexDetector(text: string, options?: DetectorInspectOptions): Promise; //#endregion //#region src/detector/whatlang-wasm.d.ts declare const WASM_DETECTOR_RUNTIME_UNAVAILABLE_MESSAGE = "WASM detector runtime is unavailable. Run `bun run build:wasm` to generate it."; //#endregion //#region src/detector/wasm.d.ts declare function inspectTextWithWasmDetector(text: string, options?: DetectorInspectOptions): Promise; //#endregion //#region src/detector/inspect.d.ts declare function inspectTextWithDetector(text: string, options?: DetectorInspectOptions): Promise; //#endregion //#region src/detector/index.d.ts declare const DETECTOR_MODES: DetectorMode[]; declare const DEFAULT_DETECTOR_MODE: DetectorMode; declare function resolveDetectorMode(mode?: DetectorMode): DetectorMode; declare function assertDetectorModeImplemented(mode?: DetectorMode): void; declare function segmentTextByLocaleWithDetector(text: string, options?: DetectorLocaleOptions): Promise; declare function wordCounterWithDetector(text: string, options?: DetectorWordCounterOptions): Promise; declare function countSectionsWithDetector(input: string, section: SectionMode, options?: DetectorCountSectionsOptions): Promise; declare const DETECTOR_SOURCES: DetectorSource[]; declare const DEFAULT_DETECTOR_RESULT_SOURCE: DetectorSource; declare function createDetectorResult(tag: string, source?: DetectorSource, confidence?: number, reliable?: boolean): DetectorResult; //#endregion export { DEFAULT_DETECTOR_MODE, DEFAULT_DETECTOR_RESULT_SOURCE, DETECTOR_MODES, DETECTOR_SOURCES, type DetectorContentGateMode, type DetectorContentGateOptions, type DetectorCountResult, type DetectorCountSections, type DetectorCountSectionsOptions, type DetectorDebugContext, type DetectorDebugSummary, type DetectorDebugVerbosity, type DetectorEvidenceConfig, type DetectorFallbackReason, type DetectorInspectChunk, type DetectorInspectDecision, type DetectorInspectEngine, type DetectorInspectEngineRaw, type DetectorInspectEngineResult, type DetectorInspectInput, type DetectorInspectInputOptions, type DetectorInspectInputSourceType, type DetectorInspectKind, type DetectorInspectOptions, type DetectorInspectPipelineResult, type DetectorInspectResult, type DetectorInspectSample, type DetectorInspectSchemaVersion, type DetectorInspectView, type DetectorInspectWindow, type DetectorLocaleOptions, type DetectorMode, type DetectorResult, type DetectorRuntimeOptions, type DetectorSource, type DetectorWordCounterOptions, WASM_DETECTOR_RUNTIME_UNAVAILABLE_MESSAGE, assertDetectorModeImplemented, countSectionsWithDetector, createDetectorDebugSummary, createDetectorResult, inspectTextWithDetector, inspectTextWithRegexDetector, inspectTextWithWasmDetector, mergeDetectorDebugSummaries, resolveDetectorMode, segmentTextByLocaleWithDetector, wordCounterWithDetector };