XuqmGroup-H5SDK/node_modules/diff/libesm/util/string.d.ts
徐勤民 e34fa2052a feat(private): add private deployment SDK module
Adds @xuqm/h5-sdk/private entry point with JSON-based initialization,
feature gating, and error codes for private deployment scenarios.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-18 21:08:08 +08:00

30 行
1.8 KiB
TypeScript

export declare function longestCommonPrefix(str1: string, str2: string): string;
export declare function longestCommonSuffix(str1: string, str2: string): string;
export declare function replacePrefix(string: string, oldPrefix: string, newPrefix: string): string;
export declare function replaceSuffix(string: string, oldSuffix: string, newSuffix: string): string;
export declare function removePrefix(string: string, oldPrefix: string): string;
export declare function removeSuffix(string: string, oldSuffix: string): string;
export declare function maximumOverlap(string1: string, string2: string): string;
/**
* Returns true if the string consistently uses Windows line endings.
*/
export declare function hasOnlyWinLineEndings(string: string): boolean;
/**
* Returns true if the string consistently uses Unix line endings.
*/
export declare function hasOnlyUnixLineEndings(string: string): boolean;
/**
* Split a string into segments using a word segmenter, merging consecutive
* segments if they are both whitespace segments. Whitespace segments can
* appear adjacent to one another for two reasons:
* - newlines always get their own segment
* - where a diacritic is attached to a whitespace character in the text, the
* segment ends after the diacritic, so e.g. " \u0300 " becomes two segments.
* This function therefore runs the segmenter's .segment() method and then
* merges consecutive segments of whitespace into a single part.
*/
export declare function segment(string: string, segmenter: Intl.Segmenter): string[];
export declare function trailingWs(string: string, segmenter?: Intl.Segmenter): string;
export declare function leadingWs(string: string, segmenter?: Intl.Segmenter): string;
export declare function leadingAndTrailingWs(string: string, segmenter?: Intl.Segmenter): [string, string];
//# sourceMappingURL=string.d.ts.map