export type RegexFlavourId =
  | "ecmascript"
  | "pcre2"
  | "pcre"
  | "php"
  | "perl"
  | "python"
  | "ruby"
  | "cpp"
  | "go"
  | "rust"
  | "dotnet"
  | "java"
  | "scala";

export type RegexOptionValue = boolean | number | string;

export type RegexEngineOptions = Readonly<Record<string, RegexOptionValue>>;

export interface RegexEngineCapabilities {
  readonly compilation: boolean;
  readonly matching: boolean;
  readonly replacement: boolean;
  readonly namedCaptures: boolean;
  readonly captureHistory: boolean;
  readonly actualTrace: boolean;
  readonly benchmark: boolean;
}

export interface RegexEngineInfo {
  readonly flavour: RegexFlavourId;
  readonly adapterVersion: string;
  readonly engineName: string;
  readonly engineVersion: string;
  readonly runtimeVersion?: string;
  readonly offsetUnit: "utf16" | "code-point" | "utf8-byte" | "byte";
  readonly capabilities: RegexEngineCapabilities;
}

export interface FlavourCapability {
  readonly flavour: RegexFlavourId;
  readonly label: string;
  readonly syntaxProvider: string;
  readonly syntaxCoverage: "full-tested" | "partial" | "unavailable";
  readonly executionEngine: string;
  readonly engineVersion: string;
  readonly execution: "full-tested" | "experimental" | "unavailable";
  readonly replacement: boolean;
  readonly namedCaptures: boolean;
  readonly captureHistory: boolean;
  readonly actualTrace: boolean;
  readonly offsetModel: string;
  readonly notes: readonly string[];
}
