import { i as LocaleId, n as LatinLocaleId, o as TransliterationTable, r as Locale } from "./shared/types-B3EVWvDh.mjs"; //#region src/slug/bidi.d.ts /** RFC 3987 section 4.2: whether `text` can be a URL component without mixing text directions in a way that renders ambiguously. */ export declare function isBidiSafeComponent(text: string): boolean; //#endregion //#region src/slug/decamelize.d.ts /** Inserts spaces at camelCase and acronym boundaries: `"getHTTPResponse"` becomes `"get HTTP Response"`. */ export declare function decamelize(input: string): string; //#endregion //#region src/slug/scripts.d.ts /** UTS #39 mixed-script restriction levels, from a single script (`"single"`) to no restriction (`"any"`). */ type ScriptRestriction = "single" | "highly-restrictive" | "moderately-restrictive" | "any"; /** The result of `checkScripts`. */ interface ScriptCheck { /** Whether the text stays within the requested restriction level. */ readonly ok: boolean; /** The Unicode scripts found in the text. */ readonly scripts: readonly string[]; } /** The Unicode script names used by `text`, ignoring Common and Inherited characters. */ export declare function detectScripts(text: string): string[]; /** Applies a UTS #39 restriction `level` to the scripts in `text`; `ok` is false when the mix exceeds it. */ export declare function checkScripts(text: string, level?: ScriptRestriction): ScriptCheck; //#endregion //#region src/slug/truncate.d.ts /** How `maxLength` counts: UTF-16 code units (like `.length`), code points, grapheme clusters, or UTF-8 bytes. */ type LengthUnit = "units" | "code-points" | "graphemes" | "bytes"; /** The length of `text` in the given unit. */ export declare function measure(text: string, unit?: LengthUnit): number; /** Cuts `slug` to at most `maxLength` in the given `unit` (UTF-16 code units by default) at a `separator` boundary, never inside a grapheme cluster. */ export declare function truncateSlug(slug: string, maxLength: number, separator?: string, unit?: LengthUnit): string; //#endregion //#region src/slug/options.d.ts /** Options for `slugify` and `createSlugger`. Every option has a default; an empty object is the everyday call. */ interface SlugifyOptions { /** Joins words; `"-"` by default. Any URL-safe punctuation (`- _ . ~ ! $ & ' ( ) * + , ; = @`) or `""`. */ readonly separator?: string; /** Lowercases the result; `true` by default. */ readonly lowercase?: boolean; /** Keeps letters from every script instead of transliterating to ASCII; `false` by default. */ readonly unicode?: boolean; /** Language rules: a Latin locale id such as `"tr"`, the id of a locale passed to `registerLocale`, or a `Locale` object from `cizgile/transliterate`. */ readonly locale?: LatinLocaleId | (string & {}) | Locale; /** `false` skips the Latin and symbol tables (the locale table and accent folding still apply); `"none"` skips every letter table and keeps only accent folding and the symbol words; an array adds script tables such as `cyrillic`. */ readonly transliterate?: boolean | "none" | readonly TransliterationTable[]; /** Splits camelCase before slugging: `"fooBar"` becomes `"foo-bar"`; `false` by default. */ readonly decamelize?: boolean; /** `[from, to]` pairs applied before anything else; spaces in `to` become separators. */ readonly replacements?: ReadonlyArray; /** A global regex of characters to delete rather than turn into separators; apostrophes by default, `false` for none. */ readonly remove?: RegExp | false; /** Extra URL-safe single characters to keep, such as `["."]` for version numbers. */ readonly preserveCharacters?: readonly string[]; /** Keeps a leading `_`: `"_draft"` stays `"_draft"`. */ readonly preserveLeadingUnderscore?: boolean; /** Keeps a trailing separator, for input still being typed. */ readonly preserveTrailingSeparator?: boolean; /** Cuts at a word boundary, never inside a grapheme cluster. Counts in `maxLengthUnit`, UTF-16 code units like `.length` by default. */ readonly maxLength?: number; /** What `maxLength` counts: `"units"` (default), `"code-points"`, `"graphemes"` or UTF-8 `"bytes"`. */ readonly maxLengthUnit?: LengthUnit; /** Used when the result would be `""`: a string, or a function of the input; the value is slugified with the same options. */ readonly fallback?: string | ((input: string) => string); /** Unicode mode only: the UTS #39 restriction level the result must satisfy; `"any"` by default. */ readonly scripts?: ScriptRestriction; /** Unicode mode only: what to do when the result mixes text directions (RFC 3987 section 4.2); `"allow"` by default. */ readonly bidi?: "allow" | "encode" | "throw"; } /** The `slugify` options that shape what a valid slug looks like. */ type IsSlugOptions = Pick; //#endregion //#region src/slug/is-slug.d.ts /** Whether `input` is exactly what `slugify` would produce under the same options. */ export declare function isSlug(input: string, options?: IsSlugOptions): boolean; //#endregion //#region src/slug/slugger.d.ts /** A `slugify` that remembers what it handed out; see `createSlugger`. */ interface Slugger { /** Slugifies `input`, appending `-2`, `-3`, ... when the slug was already handed out. */ (input: string, options?: SlugifyOptions): string; /** Forgets every slug handed out or reserved so far. */ reset(): void; /** Whether `slug` has already been handed out or reserved. */ has(slug: string): boolean; /** Marks `slug` as taken so it is never handed out again. */ reserve(slug: string): void; } /** A slugger that never repeats a slug: the second `"Hello"` becomes `"hello-2"`. `defaults` apply to every call. */ export declare function createSlugger(defaults?: SlugifyOptions): Slugger; /** Alias of `createSlugger`, under the name `@sindresorhus/slugify` uses. */ export declare const slugifyWithCounter: (defaults?: SlugifyOptions) => Slugger; //#endregion //#region src/slug/slugify.d.ts /** * Turns text into a URL slug: an RFC 3986 `segment-nz-nc` in ASCII mode, NFKC letters, digits and marks in unicode mode. * Returns `""` when nothing usable remains and never throws on ordinary text. * @throws {TypeError} when `input` is not a string or an option is malformed (`preserveCharacters`, a non-global `remove`, an unknown locale id). * @throws {RangeError} for an invalid `separator` or `maxLength`, and in unicode mode when `scripts` or `bidi: "throw"` rejects the result. */ export declare function slugify(input: string, options?: SlugifyOptions): string; //#endregion export type { IsSlugOptions, LatinLocaleId, LengthUnit, Locale, LocaleId, ScriptCheck, ScriptRestriction, Slugger, SlugifyOptions, TransliterationTable };