@oxog/string
Version:
Comprehensive string manipulation utilities with zero dependencies
166 lines (165 loc) • 7.92 kB
TypeScript
export * from './core/case';
export * from './core/cleaning';
export * from './core/validation';
export * from './core/analysis';
export * from './core/manipulation';
export * from './core/encoding';
export * from './core/advanced';
export * from './types';
export * from './plugins/plugin-interface';
export * from './utils/unicode';
export * from './utils/algorithms';
export { removeAccents } from './utils/unicode';
import * as Case from './core/case';
import * as Cleaning from './core/cleaning';
import * as Validation from './core/validation';
import * as Analysis from './core/analysis';
import * as Manipulation from './core/manipulation';
import * as Encoding from './core/encoding';
import * as Advanced from './core/advanced';
import type { ChainableString, PadType, TruncateOptions, WrapOptions, SlugifyOptions, MaskOptions } from './types';
import { StringCoreImpl } from './plugins/plugin-interface';
export declare class Str {
static toCamelCase: typeof Case.toCamelCase;
static toPascalCase: typeof Case.toPascalCase;
static toSnakeCase: typeof Case.toSnakeCase;
static toKebabCase: typeof Case.toKebabCase;
static toConstantCase: typeof Case.toConstantCase;
static toTitleCase: typeof Case.toTitleCase;
static toSentenceCase: typeof Case.toSentenceCase;
static trim: typeof Cleaning.trim;
static trimStart: typeof Cleaning.trimStart;
static trimEnd: typeof Cleaning.trimEnd;
static removeExtraSpaces: typeof Cleaning.removeExtraSpaces;
static normalizeWhitespace: typeof Cleaning.normalizeWhitespace;
static removeNonPrintable: typeof Cleaning.removeNonPrintable;
static stripHtml: typeof Cleaning.stripHtml;
static stripAnsi: typeof Cleaning.stripAnsi;
static removeAccents: typeof Cleaning.removeAccents;
static isEmail: typeof Validation.isEmail;
static isUrl: typeof Validation.isUrl;
static isUuid: typeof Validation.isUuid;
static isHexColor: typeof Validation.isHexColor;
static isBase64: typeof Validation.isBase64;
static isJson: typeof Validation.isJson;
static isNumeric: typeof Validation.isNumeric;
static isAlpha: typeof Validation.isAlpha;
static isAlphanumeric: typeof Validation.isAlphanumeric;
static isEmpty: typeof Validation.isEmpty;
static contains: typeof Analysis.contains;
static count: typeof Analysis.count;
static indexOfAll: typeof Analysis.indexOfAll;
static words: typeof Analysis.words;
static chars: typeof Analysis.chars;
static codePoints: typeof Analysis.codePoints;
static graphemes: typeof Analysis.graphemes;
static reverse: typeof Manipulation.reverse;
static shuffle: typeof Manipulation.shuffle;
static repeat: typeof Manipulation.repeat;
static truncate: typeof Manipulation.truncate;
static pad: typeof Manipulation.pad;
static wrap: typeof Manipulation.wrap;
static slugify: typeof Manipulation.slugify;
static encodeBase64: typeof Encoding.encodeBase64;
static decodeBase64: typeof Encoding.decodeBase64;
static encodeHex: typeof Encoding.encodeHex;
static decodeHex: typeof Encoding.decodeHex;
static encodeHtml: typeof Encoding.encodeHtml;
static decodeHtml: typeof Encoding.decodeHtml;
static encodeUri: typeof Encoding.encodeUri;
static decodeUri: typeof Encoding.decodeUri;
static similarity: typeof Advanced.similarity;
static fuzzyMatch: typeof Advanced.fuzzyMatch;
static soundsLike: typeof Advanced.soundsLike;
static findPatterns: typeof Advanced.findPatterns;
static isRepeating: typeof Advanced.isRepeating;
static extractEmails: typeof Advanced.extractEmails;
static extractUrls: typeof Advanced.extractUrls;
static extractNumbers: typeof Advanced.extractNumbers;
static random: typeof Advanced.random;
static generatePronounceable: typeof Advanced.generatePronounceable;
static generateFromPattern: typeof Advanced.generateFromPattern;
static mask: typeof Advanced.mask;
static maskEmail: typeof Advanced.maskEmail;
static maskCreditCard: typeof Advanced.maskCreditCard;
static hash: typeof Advanced.hash;
static toTable: typeof Advanced.toTable;
static boxify: typeof Advanced.boxify;
static progressBar: typeof Advanced.progressBar;
}
export declare function chain(str: string): ChainableString;
export declare const core: StringCoreImpl;
declare const _default: {
Str: typeof Str;
chain: typeof chain;
core: StringCoreImpl;
similarity(str1: string, str2: string, algorithm?: import("./types").SimilarityAlgorithm): number;
fuzzyMatch(str: string, pattern: string, threshold?: number): boolean;
soundsLike(str1: string, str2: string, algorithm?: import("./types").SoundsLikeAlgorithm): boolean;
findPatterns(str: string, minLength?: number): import("./types").Pattern[];
isRepeating(str: string): boolean;
extractEmails(str: string): string[];
extractUrls(str: string): string[];
extractNumbers(str: string): string[];
random(length: number, options?: import("./types").RandomOptions): string;
generatePronounceable(length: number): string;
generateFromPattern(pattern: string): string;
mask(str: string, options?: MaskOptions): string;
maskEmail(email: string): string;
maskCreditCard(cc: string): string;
hash(str: string, algorithm: import("./types").HashAlgorithm): string;
toTable(data: string[][], options?: import("./types").TableOptions): string;
boxify(str: string, options?: import("./types").BoxOptions): string;
progressBar(value: number, options?: import("./types").ProgressOptions): string;
encodeBase64(str: string): string;
decodeBase64(str: string): string;
encodeHex(str: string): string;
decodeHex(str: string): string;
encodeHtml(str: string): string;
decodeHtml(str: string): string;
encodeUri(str: string): string;
decodeUri(str: string): string;
reverse(str: string): string;
shuffle(str: string): string;
repeat(str: string, count: number, separator?: string): string;
truncate(str: string, length: number, options?: TruncateOptions): string;
pad(str: string, length: number, fillString?: string, type?: PadType): string;
wrap(str: string, width: number, options?: WrapOptions): string;
slugify(str: string, options?: SlugifyOptions): string;
contains(str: string, search: string, caseSensitive?: boolean): boolean;
count(str: string, search: string): number;
indexOfAll(str: string, search: string): number[];
words(str: string, locale?: string): string[];
chars(str: string): string[];
codePoints(str: string): number[];
graphemes(str: string): string[];
isEmail(str: string): boolean;
isUrl(str: string, options?: import("./types").UrlOptions): boolean;
isUuid(str: string, version?: number): boolean;
isHexColor(str: string): boolean;
isBase64(str: string): boolean;
isJson(str: string): boolean;
isNumeric(str: string): boolean;
isAlpha(str: string, locale?: string): boolean;
isAlphanumeric(str: string, locale?: string): boolean;
isEmpty(str: string, options?: {
ignoreWhitespace?: boolean;
}): boolean;
trim(str: string, chars?: string): string;
trimStart(str: string, chars?: string): string;
trimEnd(str: string, chars?: string): string;
removeExtraSpaces(str: string): string;
normalizeWhitespace(str: string): string;
removeNonPrintable(str: string): string;
stripHtml(str: string): string;
stripAnsi(str: string): string;
removeAccents(str: string): string;
toCamelCase(str: string): string;
toPascalCase(str: string): string;
toSnakeCase(str: string): string;
toKebabCase(str: string): string;
toConstantCase(str: string): string;
toTitleCase(str: string, locale?: string): string;
toSentenceCase(str: string): string;
};
export default _default;