import type {
  CaptureDefinition,
  RegexSyntaxRequest,
  RegexSyntaxResult,
  ReplacementSyntaxResult,
  SyntaxCoverage,
} from "../model/syntax";
import type { RegexFlavourId } from "../model/flavour";

export interface ReplacementSyntaxRequest {
  readonly flavour: RegexFlavourId;
  readonly replacement: string;
  readonly captureMetadata: readonly CaptureDefinition[];
}

export interface RegexSyntaxProvider {
  readonly id: string;
  readonly version: string;
  readonly supportedFlavours: readonly RegexFlavourId[];
  parsePattern(request: RegexSyntaxRequest): Promise<RegexSyntaxResult>;
  parseReplacement(
    request: ReplacementSyntaxRequest,
  ): Promise<ReplacementSyntaxResult>;
  getCoverage(flavour: RegexFlavourId): SyntaxCoverage;
}
