/** * Decimal digits 0-9. * [πŸ“˜](https://github.com/nodef/extra-string/wiki/DIGITS) */ declare const DIGITS: string; /** * Octal digits 0-7. * [πŸ“˜](https://github.com/nodef/extra-string/wiki/OCT_DIGITS) */ declare const OCT_DIGITS: string; /** * Hexadecimal digits 0-9, A-F, a-f. * [πŸ“˜](https://github.com/nodef/extra-string/wiki/HEX_DIGITS) */ declare const HEX_DIGITS: string; /** * English letters A-Z. * [πŸ“˜](https://github.com/nodef/extra-string/wiki/UPPERCASE) */ declare const UPPERCASE: string; /** * English letters a-z. * [πŸ“˜](https://github.com/nodef/extra-string/wiki/LOWERCASE) */ declare const LOWERCASE: string; /** * Combination of uppercase, lowercase english letters. * [πŸ“˜](https://github.com/nodef/extra-string/wiki/LETTERS) */ declare const LETTERS: string; /** * Punctuation symbols (ASCII). * [πŸ“˜](https://github.com/nodef/extra-string/wiki/PUNCTUATION) */ declare const PUNCTUATION: string; /** * The string "\t\n\x0b\x0c\r ". * [πŸ“˜](https://github.com/nodef/extra-string/wiki/WHITESPACE) */ declare const WHITESPACE: string; /** * Combination of digits, letters, punctuation, and whitespace (ASCII). * [πŸ“˜](https://github.com/nodef/extra-string/wiki/PRINTABLE) */ declare const PRINTABLE: string; /** * Minimum unicode code point. * [πŸ“˜](https://github.com/nodef/extra-string/wiki/MIN_CODE_POINT) */ declare const MIN_CODE_POINT: number; /** * Maximum unicode code point. * [πŸ“˜](https://github.com/nodef/extra-string/wiki/MAX_CODE_POINT) */ declare const MAX_CODE_POINT: number; /** * Get characters whose UTF-16 code units are given. * [πŸ“˜](https://github.com/nodef/extra-string/wiki/fromCharCode) * @param codes UTF-16 code units * @returns characters */ declare function fromCharCode(...codes: number[]): string; /** * Get characters whose unicode code points are given. * [πŸ“˜](https://github.com/nodef/extra-string/wiki/fromCodePoint) * @param codes unicode code points * @returns characters */ declare function fromCodePoint(...codes: number[]): string; /** * Combine multiple values into a string. * [πŸ“˜](https://github.com/nodef/extra-string/wiki/concat) * @param values values * @returns combined string */ declare function concat(...values: any[]): string; /** * Repeat string given number of times. * [πŸ“˜](https://github.com/nodef/extra-string/wiki/repeat) * @param x a string * @param times number of times * @returns repeated string */ declare function repeat(x: string, times: number): string; /** * Get primitive value of string object. * [πŸ“˜](https://github.com/nodef/extra-string/wiki/valueOf) * @param x a string object * @returns primitive value */ declare function valueOf(x: string): string; /** * Get length of string. * [πŸ“˜](https://github.com/nodef/extra-string/wiki/length) * @param x a string * @returns length of string */ declare function length(x: string): number; /** * Get character at given index in string. * [πŸ“˜](https://github.com/nodef/extra-string/wiki/charAt) * @param x a string * @param at character index */ declare function charAt(x: string, at: number): string; /** * Get UTF-16 code unit of a character in string. * [πŸ“˜](https://github.com/nodef/extra-string/wiki/charCodeAt) * @param x a string * @param at character index * @returns UTF-16 code unit */ declare function charCodeAt(x: string, at: number): number; /** * Get unicode code point of a character in string. * [πŸ“˜](https://github.com/nodef/extra-string/wiki/codePointAt) * @param x a string * @param at character index * @returns unicode code point */ declare function codePointAt(x: string, at: number): number; /** * Compare two strings in the current or given locale. * [πŸ“˜](https://github.com/nodef/extra-string/wiki/localeCompare) * @param x a string * @param y another string * @param locales language or locale tag(s) * @param options comparison options * @returns xy: +ve */ declare function localeCompare(x: string, y: string, locales?: string | string[], options?: Intl.CollatorOptions): number; /** * Check if string has a given infix. * [πŸ“˜](https://github.com/nodef/extra-string/wiki/includes) * @param x a string * @param infix infix to look for * @param start start index [0] * @returns has infix? */ declare function includes(x: string, infix: string, start?: number): boolean; /** * Check if string has a given prefix. * [πŸ“˜](https://github.com/nodef/extra-string/wiki/startsWith) * @param x a string * @param prefix prefix to look for * @param start start index [0] * @returns has prefix? */ declare function startsWith(x: string, prefix: string, start?: number): boolean; /** * Check if string has a given suffix. * [πŸ“˜](https://github.com/nodef/extra-string/wiki/endsWith) * @param x a string * @param suffix suffix to look for * @param end end index [end] * @returns has suffix? */ declare function endsWith(x: string, suffix: string, end?: number): boolean; /** * Get first index of a given infix in string. * [πŸ“˜](https://github.com/nodef/extra-string/wiki/indexOf) * @param x a string * @param infix infix to look for * @param start start index [0] * @returns first index of infix */ declare function indexOf(x: string, infix: string, start?: number): number; /** * Get last index of a given infix in string. * [πŸ“˜](https://github.com/nodef/extra-string/wiki/lastIndexOf) * @param x a string * @param infix infix to look for * @param rstart reverse start index [end-1] * @returns last index of infix */ declare function lastIndexOf(x: string, infix: string, rstart?: number): number; /** * Get first index of regular expression match in string. * [πŸ“˜](https://github.com/nodef/extra-string/wiki/search) * @param x a string * @param regexp regular expression * @returns first index of match */ declare function search(x: string, regexp: string | RegExp): number; /** * Get results of matching string with regular expression. * [πŸ“˜](https://github.com/nodef/extra-string/wiki/match) * @param x a string * @param regexp regular expression * @returns /g: all matches, else: match with capturing groups or null */ declare function match(x: string, regexp: string | RegExp): RegExpMatchArray; /** * Get detailed results of matching string with regular expression. * [πŸ“˜](https://github.com/nodef/extra-string/wiki/matchAll) * @param x a string * @param regexp regular expression (with /g) * @returns match with capturing groups ... */ declare function matchAll(x: string, regexp: RegExp): IterableIterator; /** * Get string representation of string. * [πŸ“˜](https://github.com/nodef/extra-string/wiki/toString) * @param x a string * @returns string representation */ declare function toString(x: string): string; /** * Extract section of string. * [πŸ“˜](https://github.com/nodef/extra-string/wiki/slice) * @param x a string * @param start start index (-ve β‡’ from right) [0] * @param end end index (-ve β‡’ from right) [end] * @returns section of string */ declare function slice(x: string, start?: number, end?: number): string; /** * Extract section of string. * [πŸ“˜](https://github.com/nodef/extra-string/wiki/substring) * @param x a string * @param start start index (-ve β‡’ 0) [0] * @param end end index (-ve β‡’ 0) [end] * @returns section of string */ declare function substring(x: string, start: number, end?: number): string; /** * Split string by a given separator into substrings. * [πŸ“˜](https://github.com/nodef/extra-string/wiki/split) * @param x a string * @param separator separator string or regular expression * @param limit maximum number of substrings * @returns substrings */ declare function split(x: string, separator?: string | RegExp, limit?: number): string[]; /** * Remove whitespace from begining of string. * [πŸ“˜](https://github.com/nodef/extra-string/wiki/trimStart) * @param x a string * @returns trimmed string */ declare function trimStart(x: string): string; /** * Remove whitespace from end of string. * [πŸ“˜](https://github.com/nodef/extra-string/wiki/trimEnd) * @param x a string * @returns trimmed string */ declare function trimEnd(x: string): string; /** * Remove whitespace from begining and end of string. * [πŸ“˜](https://github.com/nodef/extra-string/wiki/trim) * @param x a string * @returns trimmed string */ declare function trim(x: string): string; /** * Pad start of string to fit a desired length. * [πŸ“˜](https://github.com/nodef/extra-string/wiki/padStart) * @param x a string * @param length desired length * @param padding pad with [ ] * @returns padded string */ declare function padStart(x: string, length: number, padding?: string): string; /** * Pad end of string to fit a desired length. * [πŸ“˜](https://github.com/nodef/extra-string/wiki/padEnd) * @param x a string * @param length desired length * @param padding pad with [ ] * @returns padded string */ declare function padEnd(x: string, length: number, padding?: string): string; /** * Convert string to upper case. * [πŸ“˜](https://github.com/nodef/extra-string/wiki/toUpperCase) * @param x a string * @returns upper cased string */ declare function toUpperCase(x: string): string; /** * Convert string to upper case, as per locale-specific case mappings. * [πŸ“˜](https://github.com/nodef/extra-string/wiki/toLocaleUpperCase) * @param x a string * @param locales BCP 47 language tag(s) * @returns upper cased string */ declare function toLocaleUpperCase(x: string, locales?: string | string[]): string; /** * Convert string to lower case. * [πŸ“˜](https://github.com/nodef/extra-string/wiki/toLowerCase) * @param x a string * @returns lower cased string */ declare function toLowerCase(x: string): string; /** * Convert string to lower case, as per locale-specific case mappings. * [πŸ“˜](https://github.com/nodef/extra-string/wiki/toLocaleLowerCase) * @param x a string * @param locales BCP 47 language tag(s) * @returns lower cased string */ declare function toLocaleLowerCase(x: string, locales?: string | string[]): string; /** * Handle replacement of matched string and parameters with another string. * [πŸ“˜](https://github.com/nodef/extra-string/wiki/ReplaceFunction) */ type ReplaceFunction = (substring: string, ...args: any[]) => string; /** * Replace first match of given pattern by replacement. * [πŸ“˜](https://github.com/nodef/extra-string/wiki/replace) * @param x a string * @param pattern substring to match * @param replacement replacement substring * @returns replaced string */ declare function replace(x: string, pattern: string, replacement: string): string; /** * Replace first or all matches of given pattern by replacement. * [πŸ“˜](https://github.com/nodef/extra-string/wiki/replace) * @param x a string * @param pattern pattern to match * @param replacement replacement substring or replacer * @returns replaced string */ declare function replace(x: string, pattern: string | RegExp, replacement: string | ReplaceFunction): string; /** * Normalize string by given form, as per Unicode Standard Annex #15. * [πŸ“˜](https://github.com/nodef/extra-string/wiki/normalize) * @param x a string * @param form normalization form (NFC, NFD, NFKC, NFKD) * @returns normalized string */ declare function normalize(x: string, form?: string): string; /** * Create string from arguments, like `Array.of()`. * [πŸ“˜](https://github.com/nodef/extra-string/wiki/of) * @param args arguments * @returns p + q + ... | [p, q, ...] = args */ declare function of(...args: string[]): string; /** * Handle transformation of a substring (or character) to another. * [πŸ“˜](https://github.com/nodef/extra-string/wiki/MapFunction) * @param v a substring (or character) * @param i index of substring * @param x string containing the substring * @returns transformed substring */ type MapFunction = (v: string, i: number, x?: string) => string; /** * Create string from iterable, like `Array.from()`. * [πŸ“˜](https://github.com/nodef/extra-string/wiki/from) * @param xs list of strings (iterable) * @param fm map function (x, i) * @param ths this argument */ declare function from(xs: Iterable, fm?: MapFunction, ths?: any): string; /** * Remove/replace characters in a string. * [πŸ“˜](https://github.com/nodef/extra-string/wiki/splice) * @param x a string * @param start start index * @param remove number of characters to remove * @param add substring to add * @returns x[0:i] + add + x[i+r] | i = start, r = remove */ declare function splice(x: string, start: number, remove?: number, add?: string): string; /** * Reverse a string. * [πŸ“˜](https://github.com/nodef/extra-string/wiki/reverse) * @param x a string * @returns reversed string */ declare function reverse(x: string): string; /** * Handle comparison of two strings. * [πŸ“˜](https://github.com/nodef/extra-string/wiki/CompareFunction) * @param a a string * @param b another string * @returns xy: +ve */ type CompareFunction = (a: string, b: string) => number; /** * Arrange characters in an order. * [πŸ“˜](https://github.com/nodef/extra-string/wiki/sort) * @param x a string * @param fc compare function (a, b) */ declare function sort(x: string, fc?: CompareFunction): string; /** * Handle selection of a substring (or character) in string. * [πŸ“˜](https://github.com/nodef/extra-string/wiki/TestFunction) * @param v a substring (or character) * @param i index of substring in string * @param x string containing the substring * @returns whether it is selected */ type TestFunction = (v: string, i: number, x: string) => boolean; /** * Filter characters which pass a test. * [πŸ“˜](https://github.com/nodef/extra-string/wiki/filter) * @param x a string * @param ft test function (v, i, x) * @param ths this argument * @returns characters which pass the test */ declare function filter(x: string, ft: TestFunction, ths?: any): string; /** * Get a string of spaces. * [πŸ“˜](https://github.com/nodef/extra-string/wiki/spaces) * @param n number of spaces */ declare function spaces(n: number): string; /** * Check if value is a string. * [πŸ“˜](https://github.com/nodef/extra-string/wiki/is) * @param v a value * @returns whether value is a string */ declare function is(v: any): boolean; /** * Check if string is empty. * [πŸ“˜](https://github.com/nodef/extra-string/wiki/isEmpty) * @param x a string * @returns whether string is empty */ declare function isEmpty(x: string): boolean; /** * Check if string is a character. * [πŸ“˜](https://github.com/nodef/extra-string/wiki/isCharacter) * @param x a string * @returns whether string is a character */ declare function isCharacter(x: string): boolean; /** * Get non-negative index within string. * [πŸ“˜](https://github.com/nodef/extra-string/wiki/index) * @param x a string * @param at character index * @returns +ve index */ declare function index(x: string, at: number): number; /** * Get non-negative index range within string. * [πŸ“˜](https://github.com/nodef/extra-string/wiki/indexRange) * @param x a string * @param start start index * @param end end index * @returns +ve index range [start, end] */ declare function indexRange(x: string, start: number, end: number): [number, number]; /** * Get unicode code point range of string. * [πŸ“˜](https://github.com/nodef/extra-string/wiki/codePointRange) * @param x a string * @returns code point range [min, max] */ declare function codePointRange(x: string): [number, number]; /** * Compare two strings. * [πŸ“˜](https://github.com/nodef/extra-string/wiki/compare) * @param x a string * @param y another string * @returns xy: +ve */ declare function compare(x: string, y: string): number; /** * Check if two strings are equal. * [πŸ“˜](https://github.com/nodef/extra-string/wiki/isEqual) * @param x a string * @param y another string * @returns x=y? */ declare function isEqual(x: string, y: string): boolean; /** * Get character at a given index in string. * [πŸ“˜](https://github.com/nodef/extra-string/wiki/get) * @param x a string * @param at character index (-ve β‡’ from right) * @returns x[i] | i = at */ declare function get(x: string, at: number): string; /** * Get characters at indices. * [πŸ“˜](https://github.com/nodef/extra-string/wiki/getAll) * @param x a string * @param ats character indices (-ve β‡’ from right) * @returns x[i] + x[j] + ... | [i, j, ...] = ats */ declare function getAll(x: string, ats: Iterable): string; /** * Write a substring at specified index in string. * [πŸ“˜](https://github.com/nodef/extra-string/wiki/set) * @param x a string * @param at write index (-ve β‡’ from right) * @param write substring to write * @returns x[0:i] + w + x[i+|w|:] | i = at, w = write */ declare function set(x: string, at: number, write: string): string; /** * Get leftmost part of string. * [πŸ“˜](https://github.com/nodef/extra-string/wiki/begin) * @param x a string * @param count number of characters [1] * @returns x[0:n] | n = count */ declare function begin(x: string, count?: number): string; /** * Get a portion of string from middle. * [πŸ“˜](https://github.com/nodef/extra-string/wiki/middle) * @param x a string * @param start start index * @param count number of characters [1] * @returns x[i:i+n] | i = start, n = count */ declare function middle(x: string, start: number, count?: number): string; /** * Get rightmost part of string. * [πŸ“˜](https://github.com/nodef/extra-string/wiki/end) * @param x a string * @param count number of characters [1] * @returns x[|x|-n:] | n = count */ declare function end(x: string, count?: number): string; /** * Get the longest common infix between strings. * [πŸ“˜](https://github.com/nodef/extra-string/wiki/longestCommonInfix) * @param x a string * @param y another string * @returns longest common infix */ declare function longestCommonInfix(x: string, y: string): string; /** * Get the longest common prefix of strings. * [πŸ“˜](https://github.com/nodef/extra-string/wiki/longestCommonPrefix) * @param x a string * @param y another string * @returns longest common prefix */ declare function longestCommonPrefix(x: string, y: string): string; /** * Get the longest common suffix of strings. * [πŸ“˜](https://github.com/nodef/extra-string/wiki/longestCommonSuffix) * @param x a string * @param y another string * @returns longest common suffix */ declare function longestCommonSuffix(x: string, y: string): string; /** * Get the longest uncommon infixes of strings. * [πŸ“˜](https://github.com/nodef/extra-string/wiki/longestUncommonInfixes) * @param x a string * @param y another string * @returns [infix1, infix2] */ declare function longestUncommonInfixes(x: string, y: string): [string, string]; /** * Convert a string to baseline characters (limited support). * [πŸ“˜](https://github.com/nodef/extra-string/wiki/toBaseline) * @param x a string * @param fsup map function for superscript characters (v, i, x) * @param fsub map function for subscript characters (v, i, x) * @returns baselined string */ declare function toBaseline(x: string, fsup?: MapFunction, fsub?: MapFunction): string; /** * Convert a string to superscript characters (limited support). * [πŸ“˜](https://github.com/nodef/extra-string/wiki/toSuperscript) * @param x a string * @returns superscripted characters */ declare function toSuperscript(x: string): string; /** * Convert a string to superscript characters (limited support). * [πŸ“˜](https://github.com/nodef/extra-string/wiki/toSubscript) * @param x a string * @returns superscripted characters */ declare function toSubscript(x: string): string; /** * Convert a string to kebab-case. * [πŸ“˜](https://github.com/nodef/extra-string/wiki/toKebabCase) * @param x a string * @param re word seperator pattern [/[^0-9A-Za-z]+/g] * @param sep separator to join with [-] * @returns kebab-case | kebabcase */ declare function toKebabCase(x: string, re?: RegExp | null, sep?: string): string; /** * Convert a string to snake-case. * [πŸ“˜](https://github.com/nodef/extra-string/wiki/toSnakeCase) * @param x a string * @param re word seperator pattern [/[^0-9A-Za-z]+/g] * @returns snake_case */ declare function toSnakeCase(x: string, re?: RegExp): string; /** * Convert a string to camel-case. * [πŸ“˜](https://github.com/nodef/extra-string/wiki/toCamelCase) * @param x a string * @param re word seperator pattern [/[^0-9A-Za-z]+/g] * @param upper upper camel case? * @returns camelCase | CamelCase */ declare function toCamelCase(x: string, re?: RegExp, upper?: boolean): string; /** * Convert a string to pascal-case. * [πŸ“˜](https://github.com/nodef/extra-string/wiki/toPascalCase) * @param x a string * @param re word seperator pattern [/[^0-9A-Za-z]+/g] * @returns PascalCase */ declare function toPascalCase(x: string, re?: RegExp): string; /** * Get characters that cycle through string. * @param x a string * @param start start index * @param count number of characters [length] */ /** * Rotate characters in string. * @param x a string * @param n rotate amount (+ve: left, -ve: right) */ /** * Breaks string at given indices. * @param x a string * @param is split indices (sorted) */ /** * Breaks string after given indices. * @param x a string * @param is split indices (sorted) */ /** * Gives characters present in any string. * @param x a string * @param y another string * @param fc compare function (a, b) * @param fm map function (v, i, x) */ /** * Get n-grams of a string. * [πŸ“˜](https://github.com/nodef/extra-string/wiki/ngrams) * @param x a string * @param n n-gram length * @returns [x[0:n], x[1:n+1], ...] */ declare function ngrams(x: string, n: number): string[]; /** * Find unique n-grams of a string. * [πŸ“˜](https://github.com/nodef/extra-string/wiki/uniqueNgrams) * @param x a string * @param n n-gram length * @returns Set \{gα΅’\} | gα΅’ = iα΅—Κ° n-gram */ declare function uniqueNgrams(x: string, n: number): Set; /** * Count the total number of n-grams of a string. * [πŸ“˜](https://github.com/nodef/extra-string/wiki/countNgrams) * @param x a string * @param n n-gram length * @returns |gα΅’| | gα΅’ = iα΅—Κ° n-gram */ declare function countNgrams(x: string, n: number): number; /** * Count the total number of unique n-grams of a string. * [πŸ“˜](https://github.com/nodef/extra-string/wiki/countUniqueNgrams) * @param x a string * @param n n-gram length * @returns |Set \{gα΅’\}| | gα΅’ = iα΅—Κ° n-gram */ declare function countUniqueNgrams(x: string, n: number): number; /** * Count each n-gram of a string. * [πŸ“˜](https://github.com/nodef/extra-string/wiki/countEachNgram) * @param x a string * @param n n-gram length * @returns Map \{gα΅’: count(gα΅’)\} | gα΅’ = iα΅—Κ° n-gram */ declare function countEachNgram(x: string, n: number): Map; /** * Get matching n-grams between strings. * [πŸ“˜](https://github.com/nodef/extra-string/wiki/matchingNgrams) * @param x a string * @param y another string * @param n n-gram length * @returns [gα΅’] | gα΅’ = iα΅—Κ° matching n-gram */ declare function matchingNgrams(x: string, y: string, n: number): string[]; /** * Get unique matching n-grams between strings. * [πŸ“˜](https://github.com/nodef/extra-string/wiki/uniqueMatchingNgrams) * @param x a string * @param y another string * @param n n-gram length * @returns Set \{gα΅’\} | gα΅’ = iα΅—Κ° unique matching n-gram */ declare function uniqueMatchingNgrams(x: string, y: string, n: number): Set; /** * Count the total number of matching n-grams between strings. * [πŸ“˜](https://github.com/nodef/extra-string/wiki/countMatchingNgrams) * @param x a string * @param y another string * @param n n-gram length * @returns |[gα΅’]| | gα΅’ = iα΅—Κ° matching n-gram */ declare function countMatchingNgrams(x: string, y: string, n: number): number; /** * Count each matching n-gram between strings. * [πŸ“˜](https://github.com/nodef/extra-string/wiki/countEachMatchingNgram) * @param x a string * @param y another string * @param n n-gram length * @returns Map \{gα΅’: count(gα΅’)\} | gα΅’ = iα΅—Κ° matching n-gram */ declare function countEachMatchingNgram(x: string, y: string, n: number): Map; /** * Count the total number of unique matching n-grams between strings. * [πŸ“˜](https://github.com/nodef/extra-string/wiki/countUniqueMatchingNgrams) * @param x a string * @param y another string * @param n n-gram length * @returns |Set \{gα΅’\}| | gα΅’ = iα΅—Κ° unique matching n-gram */ declare function countUniqueMatchingNgrams(x: string, y: string, n: number): number; /** * Get euclidean distance between strings. * [πŸ“˜](https://github.com/nodef/extra-string/wiki/euclideanDistance) * @param x a string * @param y another string * @returns euclidean distance */ declare function euclideanDistance(x: string, y: string): number; /** * Get hamming distance between strings. * [πŸ“˜](https://github.com/nodef/extra-string/wiki/hammingDistance) * @param x a string * @param y another string * @returns hamming distance */ declare function hammingDistance(x: string, y: string): number; /** * Get jaccard index between strings. * [πŸ“˜](https://github.com/nodef/extra-string/wiki/jaccardIndex) * @param x a string * @param y another string * @param n n-gram length * @returns |X ∩ Y|/|X βˆͺ Y| | X,Y = n-grams of x,y */ declare function jaccardIndex(x: string, y: string, n: number): number; /** * Get jaccard distance between strings. * [πŸ“˜](https://github.com/nodef/extra-string/wiki/jaccardDistance) * @param x a string * @param y another string * @param n n-gram length * @returns 1 - jaccardIndex(x, y) */ declare function jaccardDistance(x: string, y: string, n: number): number; /** * Get SΓΈrensen-Dice index between strings. * [πŸ“˜](https://github.com/nodef/extra-string/wiki/sorensenDiceIndex) * @param x a string * @param y another string * @param n n-gram length * @returns 2|X ∩ Y|/(|X| + |Y|) | X,Y = n-grams of x,y */ declare function sorensenDiceIndex(x: string, y: string, n: number): number; /** * Get SΓΈrensen-Dice distance between strings. * [πŸ“˜](https://github.com/nodef/extra-string/wiki/sorensenDiceDistance) * @param x a string * @param y another string * @param n n-gram length * @returns 1 - sorensenDiceIndex(x, y) */ declare function sorensenDiceDistance(x: string, y: string, n: number): number; /** * Get Tversky index between strings. * [πŸ“˜](https://github.com/nodef/extra-string/wiki/tverskyIndex) * @param x a string * @param y another string * @param n n-gram length * @param a alpha [1] * @param b beta [1] * @returns |X ∩ Y|/(|X ∩ Y| + Ξ±|X \ Y| + Ξ²|Y \ X|) | X,Y = n-grams of x,y */ declare function tverskyIndex(x: string, y: string, n: number, a?: number, b?: number): number; /** * Get Tversky distance between strings. * [πŸ“˜](https://github.com/nodef/extra-string/wiki/tverskyDistance) * @param x a string * @param y another string * @param n n-gram length * @param a alpha [1] * @param b beta [1] * @returns 1 - tverskyIndex(x, y) */ declare function tverskyDistance(x: string, y: string, n: number, a?: number, b?: number): number; /** * Get Jaro similarity between strings. * [πŸ“˜](https://github.com/nodef/extra-string/wiki/jaroSimilarity) * @param x a string * @param y another string * @returns (m/|x| + m/|y| + (m-t)/m)/3 | m = # matches, t = # transpositions */ declare function jaroSimilarity(x: string, y: string): number; /** * Get Jaro distance between strings. * [πŸ“˜](https://github.com/nodef/extra-string/wiki/jaroDistance) * @param x a string * @param y another string * @returns 1 - jaroSimilarity(x, y) */ declare function jaroDistance(x: string, y: string): number; /** * Get Jaro-Winkler similarity between strings. * [πŸ“˜](https://github.com/nodef/extra-string/wiki/jaroWinklerSimilarity) * @param x a string * @param y another string * @param p scaling factor for common prefix (0.1 - 0.25) [0.1] * @returns simβ±Ό + β„“p(1 - simβ±Ό) | simβ±Ό = jaro similarity, β„“ = |longest common prefix| */ declare function jaroWinklerSimilarity(x: string, y: string, p?: number): number; /** * Get Jaro-Winkler distance between strings. * [πŸ“˜](https://github.com/nodef/extra-string/wiki/jaroWinklerDistance) * @param x a string * @param y another string * @param p scaling factor for common prefix (0.1 - 0.25) [0.1] * @returns 1 - jaroWinklerSimilarity(x, y) */ declare function jaroWinklerDistance(x: string, y: string, p?: number): number; /** * Get Levenshtein distance between strings. * [πŸ“˜](https://github.com/nodef/extra-string/wiki/levenshteinDistance) * @param x a string * @param y another string * @param ins insertion cost [1] * @param del deletion cost [1] * @param sub substitution cost [1] * @returns levenshtein distance */ declare function levenshteinDistance(x: string, y: string, ins?: number, del?: number, sub?: number): number; /** * Get Damerau–Levenshtein distance between strings. * [πŸ“˜](https://github.com/nodef/extra-string/wiki/damerauLevenshteinDistance) * @param x a string * @param y another string * @param ins insertion cost [1] * @param del deletion cost [1] * @param sub substitution cost [1] * @param tra transposition cost [1] * @returns damerau–levenshtein distance */ declare function damerauLevenshteinDistance(x: string, y: string, ins?: number, del?: number, sub?: number, tra?: number): number; export { type CompareFunction, DIGITS, HEX_DIGITS, LETTERS, LOWERCASE, MAX_CODE_POINT, MIN_CODE_POINT, type MapFunction, OCT_DIGITS, PRINTABLE, PUNCTUATION, type ReplaceFunction, type TestFunction, UPPERCASE, WHITESPACE, get as at, begin, charAt, charCodeAt, codePointAt, codePointRange, compare, concat, countEachMatchingNgram, countEachNgram, countMatchingNgrams, countNgrams, countUniqueMatchingNgrams, countUniqueNgrams, damerauLevenshteinDistance, end, endsWith, euclideanDistance, filter, from, fromCharCode, fromCodePoint, get, getAll, hammingDistance, includes, index, indexOf, indexRange, middle as infix, is, isCharacter, isEmpty, isEqual, includes as isInfix, startsWith as isPrefix, endsWith as isSuffix, jaccardDistance, jaccardIndex, jaroDistance, jaroSimilarity, jaroWinklerDistance, jaroWinklerSimilarity, lastIndexOf, begin as left, length, levenshteinDistance, localeCompare, longestCommonInfix, longestCommonPrefix, longestCommonSuffix, longestUncommonInfixes, match, matchAll, matchingNgrams, middle, ngrams, normalize, of, padEnd, padStart, begin as prefix, repeat, replace, reverse, end as right, search, set, length as size, slice, sorensenDiceDistance, sorensenDiceIndex, sort, spaces, splice, split, startsWith, substring, end as suffix, toBaseline, toCamelCase, toKebabCase, toLocaleLowerCase, toLocaleUpperCase, toLowerCase, toPascalCase, toSnakeCase, toString, toSubscript, toSuperscript, toUpperCase, trim, trimEnd, trimStart, tverskyDistance, tverskyIndex, uniqueMatchingNgrams, uniqueNgrams, valueOf };