declare const SETS: {
    readonly urdu: "۰۱۲۳۴۵۶۷۸۹";
    readonly english: "0123456789";
    readonly arabic: "٠١٢٣٤٥٦٧٨٩";
};
type DigitStyle = keyof typeof SETS;
/** `12345` -> `۱۲۳۴۵`. Accepts Arabic-Indic digits as input too. */
declare function toUrduDigits(input: string): string;
/** `۱۲۳۴۵` -> `12345`. Safe to feed into `Number()` afterwards. */
declare function toEnglishDigits(input: string): string;
/** `۱۲۳۴۵` -> `١٢٣٤٥` (Arabic-Indic, U+0660 block — a different block from Urdu's). */
declare function toArabicIndicDigits(input: string): string;
/**
 * Rewrite every digit in `input` to one style.
 *
 * @example
 * convertNumbers("12345")            // "۱۲۳۴۵"
 * convertNumbers("۱۲۳۴۵", "english") // "12345"
 */
declare function convertNumbers(input: string, to?: DigitStyle): string;
/**
 * Parse a number written with Urdu or Arabic-Indic digits.
 * Handles the Urdu decimal separator ٫ and thousands separator ٬.
 * Returns `NaN` when the string is not a number.
 */
declare function parseUrduNumber(input: string): number;
/**
 * Spell a whole number in Urdu words, using the South Asian scale
 * (ہزار, لاکھ, کروڑ, ارب) rather than the western million/billion scale.
 *
 * Coverage note: 21-99 that are not multiples of ten are written compositionally
 * (`اکیس` etc. are irregular in real Urdu, so this returns `بیس ایک`-style forms
 * only as a fallback). Marked experimental for that reason.
 *
 * @experimental
 */
declare function numberToUrduWords(value: number): string;

interface NormalizeOptions {
    /** Apply Unicode NFKC first, folding presentation forms (ﻻ, ﮐ) back to real letters. Default `true`. */
    compatibility?: boolean;
    /** Strip harakat and quranic marks. Default `false` — see {@link removeDiacritics}. */
    stripDiacritics?: boolean;
    /** Remove tatweel/kashida padding. Default `true`. */
    stripTatweel?: boolean;
    /** Remove zero-width non-joiner. Default `false`, since ZWNJ can be meaningful. */
    stripZwnj?: boolean;
    /** Collapse whitespace runs to a single space and trim. Default `true`. */
    collapseWhitespace?: boolean;
    /** Rewrite every digit to one style. Default `"preserve"`. */
    digits?: DigitStyle | "preserve";
    /** Map ASCII `,` `;` `?` to Urdu `،` `؛` `؟`. Default `false`. */
    urduPunctuation?: boolean;
}
/**
 * Fold an Urdu string to a single canonical Unicode form.
 *
 * @example
 * normalizeUrdu("كيا حال ہے") // "کیا حال ہے"
 */
declare function normalizeUrdu(input: string, options?: NormalizeOptions): string;
/**
 * Strip harakat, quranic annotation marks and superscript alef.
 * Keeps ۔ ے ۓ, which are letters/punctuation rather than marks.
 *
 * @example
 * removeDiacritics("مُحَمَّد") // "محمد"
 */
declare function removeDiacritics(input: string): string;
/**
 * The comparison key used by {@link searchUrdu} and {@link sortUrdu}:
 * normalized, diacritic-free, lowercased, whitespace-collapsed.
 * Two strings that a reader would call "the same word" should fold to the same key.
 */
declare function foldUrdu(input: string): string;

interface IsUrduOptions {
    /**
     * Minimum share of Arabic-script letters among all letters, 0-1. Default `0.5`.
     * A ratio rather than "contains any Urdu" so that a mostly-English string with
     * one Urdu word does not count as Urdu.
     */
    threshold?: number;
    /** Require at least this many Arabic-script letters. Default `1`. */
    minLetters?: number;
}
/**
 * Ratio of Arabic-script letters to all letters, 0-1.
 * Returns 0 for text with no letters at all (digits, punctuation, emoji).
 */
declare function urduRatio(input: string): number;
/**
 * Is this text Urdu (more precisely: predominantly Arabic-script)?
 *
 * The Arabic script is shared by Urdu, Arabic, Persian, Pashto and others, so
 * this cannot distinguish Urdu from Arabic on script alone. Use
 * {@link hasUrduSpecificLetters} when that distinction matters.
 *
 * @example
 * isUrdu("آپ کیسے ہیں؟") // true
 */
declare function isUrdu(input: string, options?: IsUrduOptions): boolean;
/**
 * True when the text contains at least one letter that Arabic does not use.
 * Cheap way to separate Urdu/Persian-family text from Arabic text.
 */
declare function hasUrduSpecificLetters(input: string): boolean;

/** Words in the text. Splits on whitespace and punctuation, so `ہے۔` counts once. */
declare function countWords(input: string): number;
/** The word list behind {@link countWords}. Useful for tokenizing before search or indexing. */
declare function splitWords(input: string): string[];
interface SplitSentenceOptions {
    /** If true, the sentence-ending punctuation (۔ ؟ ! . etc.) is preserved with each sentence. Default `false`. */
    preserveTerminators?: boolean;
}
/**
 * Sentences count, split on Urdu and standard terminators (۔ ؟ ! . …).
 * Protects common titles, abbreviations, and numeric decimals from false splits.
 */
declare function countSentences(input: string, options?: SplitSentenceOptions): number;
/**
 * Split text into sentences using Urdu punctuation rules.
 *
 * Handles Urdu full stop `۔`, Arabic question mark `؟`, exclamation `!`,
 * ASCII `.`, `?`, `!`, and ellipses `…`, while protecting abbreviations and numbers.
 *
 * @param input - Input text.
 * @param options - Options controlling termination preservation.
 *
 * @example
 * splitSentences("پاکستان ایک خوبصورت ملک ہے۔ اس کی تاریخ پرانی ہے۔")
 * // ["پاکستان ایک خوبصورت ملک ہے", "اس کی تاریخ پرانی ہے"]
 */
declare function splitSentences(input: string, options?: SplitSentenceOptions): string[];
interface UrduStats {
    /** Every codepoint, including spaces and diacritics. */
    characters: number;
    charactersNoSpaces: number;
    words: number;
    sentences: number;
    /** Whitespace-delimited blocks separated by a blank line. */
    paragraphs: number;
    /** Share of Arabic-script letters among all letters, 0-100, rounded. */
    urduPercentage: number;
    diacritics: number;
    digits: number;
    averageWordsPerSentence: number;
    /** At 180 Urdu words per minute — slower than English because the script is denser. */
    readingTimeMinutes: number;
}
/**
 * Character, word, sentence and script statistics for a block of text.
 *
 * @example
 * analyzeUrdu("پاکستان ایک خوبصورت ملک ہے۔ اس کی آبادی زیادہ ہے۔")
 */
declare function analyzeUrdu(input: string): UrduStats;

/**
 * Standard list of Urdu stop words.
 *
 * Covers pronouns, postpositions, auxiliaries, conjunctions, particles,
 * and high-frequency functional words used across Urdu texts.
 * All keys are canonical normalized Urdu.
 */
declare const URDU_STOP_WORDS: Set<string>;
/**
 * Checks if a given Urdu word is a stop word.
 *
 * @param word - Word to test.
 * @param customStopWords - Optional custom stop words set or array. Defaults to {@link URDU_STOP_WORDS}.
 *
 * @example
 * isStopWord("اور") // true
 * isStopWord("کتاب") // false
 */
declare function isStopWord(word: string, customStopWords?: Set<string> | string[]): boolean;
/**
 * Filters out stop words from an array of words.
 *
 * @param words - Array of words to filter.
 * @param customStopWords - Optional custom stop words set or array.
 *
 * @example
 * filterStopWords(["یہ", "ایک", "اچھی", "کتاب", "ہے"]) // ["اچھی", "کتاب"]
 */
declare function filterStopWords(words: string[], customStopWords?: Set<string> | string[]): string[];
/**
 * Removes stop words from an Urdu text string, returning the cleaned text.
 *
 * @param text - Input Urdu text.
 * @param customStopWords - Optional custom stop words set or array.
 *
 * @example
 * removeStopWords("یہ ایک بہترین کتاب ہے") // "بہترین کتاب"
 */
declare function removeStopWords(text: string, customStopWords?: Set<string> | string[]): string;

/**
 * Comparator for Urdu strings, usable directly in `Array.prototype.sort`.
 * Diacritics and Unicode variants are folded first, so spelling noise does not
 * change the order.
 */
declare function compareUrdu(a: string, b: string): number;
interface SortOptions<T> {
    /** Sort descending. Default `false`. */
    descending?: boolean;
    /** Read the sort key out of each item, for sorting objects. */
    getText?: (item: T) => string;
}
/**
 * Sort strings in Urdu alphabetical order.
 *
 * @example
 * sortUrdu(["گل", "آم", "بادام"]) // ["آم", "بادام", "گل"]
 */
declare function sortUrdu<T>(items: readonly T[], options?: SortOptions<T>): T[];

interface SearchOptions<T> {
    /** Read the searchable text out of each item, for searching objects. */
    getText?: (item: T) => string;
    /**
     * Allow small spelling differences via edit distance on individual words.
     * Costs O(query x item) per candidate word, so it runs only after the exact
     * substring pass fails. Default `false`.
     */
    fuzzy?: boolean;
    /** Maximum edit distance per word when `fuzzy` is on. Default `1`. */
    maxDistance?: number;
    /** Cap the number of results. */
    limit?: number;
    /** Return matches ordered by score (best first) instead of input order. Default `true`. */
    sortByScore?: boolean;
}
interface SearchResult<T> {
    item: T;
    /** 1 = exact fold match, 0.9 = prefix, 0.8 = substring, lower = fuzzy word match. */
    score: number;
}
/** Levenshtein distance with early exit once the limit is exceeded. */
declare function editDistance(a: string, b: string, limit?: number): number;
/**
 * Search a list of Urdu strings, ignoring diacritics and Unicode variant spellings.
 *
 * Both sides are folded with {@link foldUrdu} first, so `محمد` matches `مُحَمَّد`
 * and Arabic-keyboard `محمد` (with ه/ي) matches Urdu-keyboard `محمد`.
 *
 * @example
 * searchUrdu("محمد", ["مُحَمَّد علی", "احمد", "محمد خان"])
 * // ["مُحَمَّد علی", "محمد خان"]
 */
declare function searchUrdu<T = string>(query: string, items: readonly T[], options?: SearchOptions<T>): T[];
/** Same as {@link searchUrdu} but keeps the match scores. */
declare function searchUrduRanked<T = string>(query: string, items: readonly T[], options?: SearchOptions<T>): Array<SearchResult<T>>;
/**
 * Highlight every occurrence of `query` in `text` by wrapping it.
 * Matching is diacritic-insensitive, but the returned string keeps the original
 * spelling and diacritics intact — offsets are mapped back to the source.
 */
declare function highlightUrdu(text: string, query: string, wrap?: (match: string) => string): string;

/**
 * Urdu script -> Roman Urdu.
 *
 * @experimental Rule + dictionary based; see the module note on accuracy.
 * @example
 * romanize("آپ کیسے ہیں") // "aap kaisay hain"
 */
declare function romanize(input: string, options?: {
    capitalize?: boolean;
}): string;
/**
 * Roman Urdu -> Urdu script.
 *
 * @experimental Substantially less accurate than {@link romanize}: Roman Urdu has
 * no standard spelling, so anything outside the dictionary is a guess.
 * @example
 * romanToUrdu("mera naam zaid hai") // "میرا نام زید ہے"
 */
declare function romanToUrdu(input: string): string;
interface SlugOptions {
    /** Word separator. Default `"-"`. */
    separator?: string;
    /** Cap the slug length, cutting at a word boundary. */
    maxLength?: number;
    /**
     * Keep Urdu characters instead of transliterating. Produces a percent-encoded
     * but human-readable URL, and avoids the accuracy problem entirely. Default `false`.
     */
    preserveUrdu?: boolean;
}
/**
 * URL slug from an Urdu title.
 *
 * @experimental in transliterating mode, for the reasons in the module note.
 * Pass `preserveUrdu: true` for a lossless slug.
 *
 * @example
 * urduSlug("میرا پہلا مضمون")                      // "mera-pehla-mazmoon"
 * urduSlug("میرا پہلا مضمون", { preserveUrdu: true }) // "میرا-پہلا-مضمون"
 */
declare function urduSlug(input: string, options?: SlugOptions): string;

/**
 * Gregorian month names in Urdu (standard literary transliterations).
 * Index 0 corresponds to January (جنوری).
 */
declare const URDU_MONTHS_GREGORIAN: readonly ["جنوری", "فروری", "مارچ", "اپریل", "مئی", "جون", "جولائی", "اگست", "ستمبر", "اکتوبر", "نومبر", "دسمبر"];
/**
 * Islamic (Hijri) month names in Urdu.
 * Index 0 corresponds to Muharram (محرم).
 */
declare const URDU_MONTHS_HIJRI: readonly ["محرم", "صفر", "ربیع الاول", "ربیع الثانی", "جمادی الاول", "جمادی الثانی", "رجب", "شعبان", "رمضان المبارک", "شوال", "ذی القعدہ", "ذی الحجہ"];
/**
 * Days of the week in Urdu.
 * Index 0 corresponds to Sunday (اتوار).
 */
declare const URDU_WEEKDAYS: readonly ["اتوار", "پیر", "منگل", "بدھ", "جمعرات", "جمعہ", "ہفتہ"];
interface FormatUrduDateOptions {
    /**
     * Digit style to use for numeric tokens (e.g. YYYY, MM, DD, HH, mm, ss).
     * @default "urdu"
     */
    digits?: "urdu" | "english";
    /**
     * Calendar month naming scheme to use for `MMMM` and `MMM`.
     * @default "gregorian"
     */
    calendar?: "gregorian" | "hijri";
}
interface TimeAgoOptions {
    /**
     * Digit style to use for counts (e.g. "۵ منٹ پہلے" vs "5 منٹ پہلے").
     * @default "urdu"
     */
    digits?: "urdu" | "english";
    /**
     * Whether to include the relative suffix/prefix ("پہلے" or "بعد").
     * When `false`, returns only the duration string (e.g. "۵ منٹ", "ایک گھنٹہ").
     * @default true
     */
    addSuffix?: boolean;
}
/**
 * Returns the Urdu name for a given month index (0 to 11).
 *
 * @param monthIndex - 0 for January / Muharram, 11 for December / Dhul Hijjah.
 * @param calendar - "gregorian" or "hijri". Default is "gregorian".
 */
declare function getUrduMonthName(monthIndex: number, calendar?: "gregorian" | "hijri"): string;
/**
 * Returns the Urdu name for a day of the week (0 = Sunday, 6 = Saturday).
 */
declare function getUrduWeekdayName(dayIndex: number): string;
/**
 * Formats a Date object or timestamp into an Urdu formatted date string.
 *
 * Supported formatting tokens:
 * - `YYYY`: Full year (e.g. "۲۰۲۶")
 * - `YY`: Two-digit year (e.g. "۲۶")
 * - `MMMM`: Full Urdu month name (e.g. "اگست")
 * - `MMM`: Full Urdu month name (e.g. "اگست")
 * - `MM`: 2-digit month with leading zero (e.g. "۰۸")
 * - `M`: 1-digit month (e.g. "۸")
 * - `DD`: 2-digit day of month with leading zero (e.g. "۰۵")
 * - `D`: 1-digit day of month (e.g. "۵")
 * - `dddd`: Full day of the week (e.g. "ہفتہ", "جمعہ")
 * - `ddd`: Short day of the week (same in Urdu)
 * - `HH`: 24-hour hour with leading zero (00-23)
 * - `H`: 24-hour hour (0-23)
 * - `hh`: 12-hour hour with leading zero (01-12)
 * - `h`: 12-hour hour (1-12)
 * - `mm`: Minute with leading zero (00-59)
 * - `m`: Minute (0-59)
 * - `ss`: Second with leading zero (00-59)
 * - `s`: Second (0-59)
 * - `A`: Day period indicator in Urdu ("صبح", "دوپہر", "شام", "رات")
 * - `a`: Concise period indicator ("صبح", "شام")
 *
 * @example
 * formatUrduDate(new Date(2026, 7, 22), "DD MMMM YYYY")
 * // "۲۲ اگست ۲۰۲۶"
 *
 * formatUrduDate(new Date(2026, 7, 22, 14, 30), "dddd، D MMMM YYYY، hh:mm A")
 * // "ہفتہ، ۲۲ اگست ۲۰۲۶، ۰۲:۳۰ دوپہر"
 */
declare function formatUrduDate(date: Date | string | number, pattern?: string, options?: FormatUrduDateOptions): string;
/**
 * Returns a human-friendly relative time string in Urdu.
 *
 * @example
 * timeAgoUrdu(Date.now() - 30 * 1000)       // "ابھی"
 * timeAgoUrdu(Date.now() - 5 * 60 * 1000)   // "۵ منٹ پہلے"
 * timeAgoUrdu(Date.now() - 3 * 3600 * 1000) // "۳ گھنٹے پہلے"
 * timeAgoUrdu(Date.now() - 86400 * 1000)    // "کل"
 * timeAgoUrdu(Date.now() + 5 * 60 * 1000)   // "۵ منٹ بعد"
 */
declare function timeAgoUrdu(date: Date | string | number, relativeTo?: Date | string | number, options?: TimeAgoOptions): string;

/**
 * Canonical Urdu prefixes (سابقے) ordered by descending length.
 */
declare const URDU_PREFIXES: readonly ["غیر", "خود", "اہل", "بے", "نا", "لا", "بد", "کم", "ان", "ہم", "با", "پُر"];
/**
 * Canonical Urdu suffixes (لاحقے) ordered by descending length.
 */
declare const URDU_SUFFIXES: readonly ["یںگے", "ینگے", "ےگا", "ےگی", "ینگی", "داری", "گاری", "کاری", "سازی", "بازی", "مندی", "ترین", "ستان", "خانہ", "نامہ", "جات", "گان", "دار", "گار", "کار", "ساز", "باز", "مند", "ناک", "وار", "دان", "زار", "یت", "پن", "ائی", "تر", "یاں", "ئیں", "ؤں", "یوں", "وں", "یں", "ات", "ہا", "ین", "تیں", "تا", "تی", "تے", "نا"];
interface StemmerOptions {
    /**
     * Whether to strip canonical Urdu prefixes (e.g. بے-, نا-, غیر-, لا-).
     * @default true
     */
    stripPrefixes?: boolean;
    /**
     * Whether to strip canonical Urdu suffixes (e.g. -وں, -یں, -یاں, -دار, -تے).
     * @default true
     */
    stripSuffixes?: boolean;
    /**
     * Minimum character length of the remaining root word.
     * Prevents over-stemming of short roots.
     * @default 2
     */
    minStemLength?: number;
    /**
     * Custom list of prefixes to strip in addition to or in place of defaults.
     */
    customPrefixes?: string[];
    /**
     * Custom list of suffixes to strip in addition to or in place of defaults.
     */
    customSuffixes?: string[];
    /**
     * Map of exact exception words to their canonical stems.
     */
    exceptions?: Record<string, string>;
}
interface AffixBreakdown {
    /** The stripped prefix, if any */
    prefix?: string;
    /** The stemmed base root */
    stem: string;
    /** The stripped suffix, if any */
    suffix?: string;
}
/**
 * Analyzes an Urdu word and extracts its prefix, stem, and suffix.
 *
 * @example
 * getAffixes("بےوقوف")
 * // { prefix: "بے", stem: "وقوف" }
 *
 * getAffixes("کتابیں")
 * // { stem: "کتاب", suffix: "یں" }
 *
 * getAffixes("نااہلی")
 * // { prefix: "نا", stem: "اہل", suffix: "ی" }
 */
declare function getAffixes(input: string, options?: StemmerOptions): AffixBreakdown;
/**
 * Reduces an Urdu word to its morphological root/stem by stripping common prefixes,
 * plurals, tense inflections, and adjectival/nominal suffixes.
 *
 * @example
 * stemUrdu("کتابیں")     // "کتاب"
 * stemUrdu("لڑکیاں")     // "لڑکی"
 * stemUrdu("دعاؤں")      // "دعا"
 * stemUrdu("بےوقوف")     // "وقوف"
 * stemUrdu("نااہل")      // "اہل"
 * stemUrdu("خوبصورت ترین") // "خوبصورت"
 */
declare function stemUrdu(word: string, options?: StemmerOptions): string;
/**
 * Stems all words within a block of Urdu text while preserving punctuation,
 * whitespaces, and document formatting.
 *
 * Ideal for search engine indexing, TF-IDF scoring, and AI/LLM embeddings preprocessing.
 *
 * @example
 * stemUrduText("طلباء کتابیں پڑھتے ہیں اور کہانیاں سنتے ہیں۔")
 * // "طلباء کتاب پڑھ ہیں اور کہانی سن ہیں۔"
 */
declare function stemUrduText(text: string, options?: StemmerOptions): string;

interface NameTransliterationOptions {
    /** Preserve the original case of the English name. Default: true (capitalized). */
    preserveCase?: boolean;
    /** Include honorifics in the output. Default: true. */
    includeHonorifics?: boolean;
}
/**
 * Transliterate an Urdu name to English.
 *
 * @example
 * transliterateNameToEnglish("محمد علی") // "Muhammad Ali"
 * transliterateNameToEnglish("جناب خان صاحب") // "Janab Khan Sahib"
 */
declare function transliterateNameToEnglish(urduName: string, options?: NameTransliterationOptions): string;
/**
 * Transliterate an English name to Urdu script.
 *
 * @example
 * transliterateNameToUrdu("Muhammad Ali") // "محمد علی"
 * transliterateNameToUrdu("Janab Khan Sahib") // "جناب خان صاحب"
 */
declare function transliterateNameToUrdu(englishName: string): string;
/**
 * Extract name parts from a full Urdu name.
 *
 * @example
 * extractNameParts("جناب محمد علی خان صاحب")
 * // { honorific: "جناب", firstName: "محمد علی", familyName: "خان", suffix: "صاحب" }
 */
declare function extractNameParts(fullName: string): {
    honorific?: string;
    firstName: string;
    familyName?: string;
    suffix?: string;
};

export { type AffixBreakdown, type DigitStyle, type FormatUrduDateOptions, type IsUrduOptions, type NameTransliterationOptions, type NormalizeOptions, type SearchOptions, type SearchResult, type SlugOptions, type SortOptions, type SplitSentenceOptions, type StemmerOptions, type TimeAgoOptions, URDU_MONTHS_GREGORIAN, URDU_MONTHS_HIJRI, URDU_PREFIXES, URDU_STOP_WORDS, URDU_SUFFIXES, URDU_WEEKDAYS, type UrduStats, analyzeUrdu, compareUrdu, convertNumbers, countSentences, countWords, editDistance, extractNameParts, filterStopWords, foldUrdu, formatUrduDate, getAffixes, getUrduMonthName, getUrduWeekdayName, hasUrduSpecificLetters, highlightUrdu, isStopWord, isUrdu, normalizeUrdu, numberToUrduWords, parseUrduNumber, removeDiacritics, removeStopWords, romanToUrdu, romanize, searchUrdu, searchUrduRanked, sortUrdu, splitSentences, splitWords, stemUrdu, stemUrduText, timeAgoUrdu, toArabicIndicDigits, toEnglishDigits, toUrduDigits, transliterateNameToEnglish, transliterateNameToUrdu, urduRatio, urduSlug };
