Skip to content

Commit d1e0ed7

Browse files
author
Himanshu Jain
committed
build: commit pre-built dist for GitHub dependency install
npm install from github: requires dist/ present — the prepack script uses rm -rf (POSIX-only) and bun, so GitHub Actions/npm won't rebuild it reliably. Pre-committing the dist built from our patched source (PRs chenglou#160, chenglou#161, chenglou#132) ensures consumers get the correct artifact.
1 parent bd956e3 commit d1e0ed7

16 files changed

Lines changed: 4610 additions & 0 deletions

dist/analysis.d.ts

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
export type WhiteSpaceMode = 'normal' | 'pre-wrap';
2+
export type WordBreakMode = 'normal' | 'keep-all';
3+
export type SegmentBreakKind = 'text' | 'space' | 'preserved-space' | 'tab' | 'glue' | 'zero-width-break' | 'soft-hyphen' | 'hard-break';
4+
export type MergedSegmentation = {
5+
len: number;
6+
texts: string[];
7+
isWordLike: boolean[];
8+
kinds: SegmentBreakKind[];
9+
starts: number[];
10+
};
11+
export type AnalysisChunk = {
12+
startSegmentIndex: number;
13+
endSegmentIndex: number;
14+
consumedEndSegmentIndex: number;
15+
};
16+
export type TextAnalysis = {
17+
normalized: string;
18+
chunks: AnalysisChunk[];
19+
} & MergedSegmentation;
20+
export type AnalysisProfile = {
21+
carryCJKAfterClosingQuote: boolean;
22+
breakKeepAllAfterPunctuation: boolean;
23+
};
24+
export declare function normalizeWhitespaceNormal(text: string): string;
25+
export declare function clearAnalysisCaches(): void;
26+
export declare function setAnalysisLocale(locale?: string): void;
27+
export declare function isCJK(s: string): boolean;
28+
export declare function canContinueKeepAllTextRun(previousText: string, breakAfterPunctuation: boolean): boolean;
29+
export declare const kinsokuStart: Set<string>;
30+
export declare const kinsokuEnd: Set<string>;
31+
export declare const leftStickyPunctuation: Set<string>;
32+
export declare function endsWithClosingQuote(text: string): boolean;
33+
export declare function isNumericRunSegment(text: string): boolean;
34+
export declare function analyzeText(text: string, profile: AnalysisProfile, whiteSpace?: WhiteSpaceMode, wordBreak?: WordBreakMode): TextAnalysis;

0 commit comments

Comments
 (0)