示例工程 52-ci-matrix-smoke

52-ci-matrix-smoke/app/shared/ipc.ts

typescript · 0.9 KB

import type { Finding, Flags, Rule } from "./rules";

export const CH = {
  snapshot: "ci:snapshot",
  scan: "ci:scan",
  refresh: "ci:refresh",
} as const;

export type EventRow = {
  at: number;
  kind: string;
  detail: string;
};

export type Check = {
  id: string;
  label: string;
  pass: boolean;
  detail: string;
};

export type WorkflowReport = {
  id: string;
  file: string;
  name: string;
  flags: Flags;
  findings: Finding[];
  score: number;
  high: number;
  medium: number;
};

export type ExpectedState = {
  match: boolean;
  checked: number;
  mismatches: string[];
};

export type Snapshot = {
  platform: string;
  electronVersion: string;
  nodeVersion: string;
  workflows: WorkflowReport[];
  rules: Rule[];
  expected: ExpectedState;
  checks: Check[];
  score: number;
  totals: {
    findings: number;
    high: number;
    medium: number;
    echo: number;
  };
  events: EventRow[];
};