Skip to content

Commit

Permalink
Add ReportingAPI interface and reporting property to StoryContext
Browse files Browse the repository at this point in the history
  • Loading branch information
valentinpalkovic committed Nov 14, 2024
1 parent 18dbdbe commit bb5bb77
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/story.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,18 @@ interface ControlBase {
disable?: boolean;
}

interface Report {
id: string;
version: number;
result: unknown;
status: 'failed' | 'passed' | 'warning';
}

interface ReportingAPI {
reports: Report[];
addReport: (report: Report) => void;
}

type Control =
| ControlType
| false
Expand Down Expand Up @@ -278,6 +290,7 @@ export interface StoryContext<TRenderer extends Renderer = Renderer, TArgs = Arg
context: this;
canvas: Canvas;
mount: TRenderer['mount'];
reporting: ReportingAPI;
}

/** @deprecated Use {@link StoryContext} instead. */
Expand Down

0 comments on commit bb5bb77

Please sign in to comment.