import type { Token } from '../core/types';

export type BreakpointKind = 'PUNCT' | 'SPACE' | 'BALANCE' | 'OTHER';

export type Breakpoint = {
  /** 断点位置（token 边界）：切分为 [0..pos) + [pos..N) */
  pos: number;
  kind: BreakpointKind;
  /** 候选优先级（用于去重/裁剪阶段），越大越优先 */
  priority: number;
};

export type BreakpointMeta = {
  pruned: boolean;
  originalCount: number;
  finalCount: number;
};

export type BreakpointConstraints = {
  protectedPhrases?: string[];
  forbiddenBreakRanges?: Array<{ start: number; end: number }>;
};

export type BreakpointConfig = {
  tcMaxCandidateBreaks: number;
  tcPunctuations: string[];
  balanceRange: number;
};

export type GenerateBreakpointsInput = {
  tokens: Token[];
  lang: 'TC' | 'EN';
  maxLines: number;
  constraints?: BreakpointConstraints;
  config: BreakpointConfig;
};

