import { type Attachment, type Feature, type Location, type Pickle, type PickleDocString, type PickleStep, type PickleStepArgument, type PickleTable, type Rule, type Scenario, type Step, type TestStep, type TestStepResult } from '@cucumber/messages'; import Formatter, { type IFormatterOptions } from './'; export interface IJsonFeature { description: string; elements: IJsonScenario[]; id: string; keyword: string; line: number; name: string; tags: IJsonTag[]; uri: string; } export interface IJsonScenario { description: string; id: string; keyword: string; line: number; name: string; steps: IJsonStep[]; tags: IJsonTag[]; type: string; } export interface IJsonDataTable { rows: Array<{ cells: string[]; }>; } export interface IJsonDocString { content: string; line: number; } export type IJsonStepArgument = IJsonDataTable | IJsonDocString; export interface IJsonEmbedding { data: string; mime_type: string; } export interface IJsonStepMatch { location: string; } export interface IJsonStepResult { status: string; duration?: number; error_message?: string; } export interface IJsonStep { arguments?: IJsonStepArgument[]; embeddings?: IJsonEmbedding[]; hidden?: boolean; keyword?: string; line?: number; match?: IJsonStepMatch; name?: string; result: IJsonStepResult; } export interface IJsonTag { name: string; line: number; } interface IBuildJsonFeatureOptions { feature: Feature; elements: IJsonScenario[]; uri: string; } interface IBuildJsonScenarioOptions { feature: Feature; gherkinScenarioMap: Record; gherkinExampleRuleMap: Record; gherkinScenarioLocationMap: Record; pickle: Pickle; steps: IJsonStep[]; } interface IBuildJsonStepOptions { isBeforeHook: boolean; gherkinStepMap: Record; pickleStepMap: Record; testStep: TestStep; testStepAttachments: Attachment[]; testStepResult: TestStepResult; } export default class JsonFormatter extends Formatter { static readonly documentation: string; constructor(options: IFormatterOptions); convertNameToId(obj: Feature | Rule | Pickle): string; formatDataTable(dataTable: PickleTable): IJsonDataTable; formatDocString(docString: PickleDocString, gherkinStep: Step): IJsonDocString; formatStepArgument(stepArgument: PickleStepArgument, gherkinStep: Step): IJsonStepArgument[]; onTestRunFinished(): void; getFeatureData({ feature, elements, uri }: IBuildJsonFeatureOptions): IJsonFeature; getScenarioData({ feature, gherkinScenarioLocationMap, gherkinExampleRuleMap, gherkinScenarioMap, pickle, steps, }: IBuildJsonScenarioOptions): IJsonScenario; private formatScenarioId; getStepData({ isBeforeHook, gherkinStepMap, pickleStepMap, testStep, testStepAttachments, testStepResult, }: IBuildJsonStepOptions): IJsonStep; getFeatureTags(feature: Feature): IJsonTag[]; getScenarioTags({ feature, pickle, gherkinScenarioMap, }: { feature: Feature; pickle: Pickle; gherkinScenarioMap: Record; }): IJsonTag[]; private getScenarioTag; } export {};