@systemfsoftware/storybook-gherkin 3.0.3 → 3.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/dist/index.d.ts +313 -248
- package/package.json +6 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @systemfsoftware/storybook-gherkin
|
|
2
2
|
|
|
3
|
+
## 3.0.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Type declarations for `@systemfsoftware/npm-package` and `@systemfsoftware/storybook-gherkin` are now flattened: every exported type is declared inline, so no published type refers to a declaration file you would have to resolve yourself.
|
|
8
|
+
|
|
9
|
+
The declarations of `@systemfsoftware/effect-atom` and `@systemfsoftware/effect-atom-react` are unchanged.
|
|
10
|
+
|
|
3
11
|
## 3.0.3
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
package/dist/index.d.ts
CHANGED
|
@@ -1,248 +1,313 @@
|
|
|
1
|
-
import { Context
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
}>,
|
|
49
|
-
|
|
50
|
-
declare
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
declare const
|
|
58
|
-
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
declare
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
declare
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
/**
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
declare
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
declare
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
declare
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
declare
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
/**
|
|
236
|
-
*
|
|
237
|
-
*
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
declare
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
1
|
+
import { Context } from 'effect';
|
|
2
|
+
import { Effect } from 'effect';
|
|
3
|
+
import { Schema } from 'effect';
|
|
4
|
+
import { screen as screen_2 } from 'storybook/test';
|
|
5
|
+
import { Simplify } from 'type-fest';
|
|
6
|
+
import { UnionToIntersection } from 'type-fest';
|
|
7
|
+
import { UserEventObject } from 'storybook/test';
|
|
8
|
+
import { within } from 'storybook/test';
|
|
9
|
+
import { YieldableError } from 'effect/Cause';
|
|
10
|
+
|
|
11
|
+
export declare const And: StepCtor;
|
|
12
|
+
|
|
13
|
+
export declare class BackgroundNotGiven extends BackgroundNotGiven_base {}
|
|
14
|
+
|
|
15
|
+
declare const BackgroundNotGiven_base: Schema.Class<BackgroundNotGiven, Schema.TaggedStruct<"BackgroundNotGiven", {
|
|
16
|
+
readonly step: Schema.String;
|
|
17
|
+
readonly resolved: Schema.Literals<readonly ["Given", "When", "Then"]>;
|
|
18
|
+
}>, YieldableError>;
|
|
19
|
+
|
|
20
|
+
export declare const But: StepCtor;
|
|
21
|
+
|
|
22
|
+
export declare type Canvas = ReturnType<typeof within>;
|
|
23
|
+
|
|
24
|
+
export declare type CapsOf<THoles extends readonly Hole[]> = THoles extends readonly [] ? {} : Simplify<UnionToIntersection<{ [K in keyof THoles]: THoles[K] extends Capture<infer N, infer A> ? { [P in N]: A; } : {}; }[number]>>;
|
|
25
|
+
|
|
26
|
+
export declare interface Capture<Name extends string = string, _A = unknown> extends CaptureTag {
|
|
27
|
+
readonly name: Name;
|
|
28
|
+
readonly schema: Schema.ConstraintDecoder<unknown> | undefined;
|
|
29
|
+
readonly default: string | undefined;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export declare function capture<Name extends string, A>(name: Name, options: {
|
|
33
|
+
readonly schema: Schema.Codec<A, string>;
|
|
34
|
+
readonly default?: string;
|
|
35
|
+
}): Capture<Name, A>;
|
|
36
|
+
|
|
37
|
+
export declare function capture<Name extends string>(name: Name, options?: {
|
|
38
|
+
readonly default?: string;
|
|
39
|
+
}): Capture<Name, string>;
|
|
40
|
+
|
|
41
|
+
export declare class CaptureDecodeFailed extends CaptureDecodeFailed_base {}
|
|
42
|
+
|
|
43
|
+
declare const CaptureDecodeFailed_base: Schema.Class<CaptureDecodeFailed, Schema.TaggedStruct<"CaptureDecodeFailed", {
|
|
44
|
+
readonly step: Schema.String;
|
|
45
|
+
readonly capture: Schema.String;
|
|
46
|
+
readonly value: Schema.String;
|
|
47
|
+
readonly cause: Schema.Unknown;
|
|
48
|
+
}>, YieldableError>;
|
|
49
|
+
|
|
50
|
+
export declare interface CaptureModel {
|
|
51
|
+
readonly name: string;
|
|
52
|
+
/** Service-free decode view — the v4 counterpart of the removed no-context alias. */
|
|
53
|
+
readonly schema: Schema.ConstraintDecoder<unknown> | undefined;
|
|
54
|
+
readonly default: string | undefined;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
declare const CaptureTag: {
|
|
58
|
+
readonly _tag: 'Capture';
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
declare type CaptureTag = typeof CaptureTag;
|
|
62
|
+
|
|
63
|
+
export declare type ConcreteKeyword = 'Given' | 'When' | 'Then';
|
|
64
|
+
|
|
65
|
+
export declare class DuplicateCapture extends DuplicateCapture_base {}
|
|
66
|
+
|
|
67
|
+
declare const DuplicateCapture_base: Schema.Class<DuplicateCapture, Schema.TaggedStruct<"DuplicateCapture", {
|
|
68
|
+
readonly step: Schema.String;
|
|
69
|
+
readonly name: Schema.String;
|
|
70
|
+
}>, YieldableError>;
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Two channels:
|
|
74
|
+
* - Declaration time: every violation except `CaptureDecodeFailed` is thrown
|
|
75
|
+
* during module evaluation of the story file, so a malformed spec fails the
|
|
76
|
+
* Storybook import before any story runs.
|
|
77
|
+
* - Run time: `CaptureDecodeFailed` travels the typed error channel of
|
|
78
|
+
* `Step.run` and surfaces when the play edge interprets the scenario.
|
|
79
|
+
*/
|
|
80
|
+
export declare class EmptyScenario extends EmptyScenario_base {}
|
|
81
|
+
|
|
82
|
+
declare const EmptyScenario_base: Schema.Class<EmptyScenario, Schema.TaggedStruct<"EmptyScenario", {
|
|
83
|
+
readonly scenario: Schema.String;
|
|
84
|
+
}>, YieldableError>;
|
|
85
|
+
|
|
86
|
+
export declare type ExampleRow = {
|
|
87
|
+
readonly name: string;
|
|
88
|
+
} & Readonly<Record<string, string>>;
|
|
89
|
+
|
|
90
|
+
export declare interface Feature<M, TArgs = unknown> {
|
|
91
|
+
readonly meta: M;
|
|
92
|
+
readonly type: <TNext>() => Feature<M, TNext>;
|
|
93
|
+
readonly background: (...steps: readonly Step<TArgs>[]) => void;
|
|
94
|
+
readonly scenario: ScenarioFn<TArgs>;
|
|
95
|
+
readonly scenarioOutline: OutlineFn<TArgs>;
|
|
96
|
+
readonly rule: (name: string) => RuleScope<TArgs>;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Declare a feature: a story set whose scenarios execute as CSF `play`
|
|
101
|
+
* functions. `options.context` (default `Context.empty()`) is the Effect
|
|
102
|
+
* context interpreting each scenario's composed step program exactly once,
|
|
103
|
+
* at the play edge.
|
|
104
|
+
*/
|
|
105
|
+
export declare const feature: <M>(meta: M, options?: FeatureOptions) => Feature<M>;
|
|
106
|
+
|
|
107
|
+
export declare interface FeatureOptions {
|
|
108
|
+
/**
|
|
109
|
+
* Context that interprets a scenario's step program at the play edge,
|
|
110
|
+
* defaulting to `Context.empty()`. Supply a context carrying services
|
|
111
|
+
* or a custom scheduler to make them available to the run.
|
|
112
|
+
*/
|
|
113
|
+
readonly context?: Context.Context<never>;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
export declare const From: <TArgs>(story: StoryWithPlay<TArgs>) => Step<TArgs>[];
|
|
117
|
+
|
|
118
|
+
export declare const Given: StepCtor;
|
|
119
|
+
|
|
120
|
+
export declare type Hole = Capture | string | number;
|
|
121
|
+
|
|
122
|
+
export declare type Keyword = 'Given' | 'When' | 'Then' | 'And' | 'But' | 'Star';
|
|
123
|
+
|
|
124
|
+
/** Without a Then-phase step nothing is asserted — the scenario is not a spec. */
|
|
125
|
+
export declare class MissingThen extends MissingThen_base {}
|
|
126
|
+
|
|
127
|
+
declare const MissingThen_base: Schema.Class<MissingThen, Schema.TaggedStruct<"MissingThen", {
|
|
128
|
+
readonly scenario: Schema.String;
|
|
129
|
+
}>, YieldableError>;
|
|
130
|
+
|
|
131
|
+
export declare interface OutlineBuilder<TArgs> {
|
|
132
|
+
readonly examples: (rows: readonly ExampleRow[]) => Record<string, StorySpec<TArgs>>;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
/** Row names become the exported story names, so duplicates would collide. */
|
|
136
|
+
export declare class OutlineDuplicateRowName extends OutlineDuplicateRowName_base {}
|
|
137
|
+
|
|
138
|
+
declare const OutlineDuplicateRowName_base: Schema.Class<OutlineDuplicateRowName, Schema.TaggedStruct<"OutlineDuplicateRowName", {
|
|
139
|
+
readonly outline: Schema.String;
|
|
140
|
+
readonly name: Schema.String;
|
|
141
|
+
}>, YieldableError>;
|
|
142
|
+
|
|
143
|
+
export declare class OutlineEmpty extends OutlineEmpty_base {}
|
|
144
|
+
|
|
145
|
+
declare const OutlineEmpty_base: Schema.Class<OutlineEmpty, Schema.TaggedStruct<"OutlineEmpty", {
|
|
146
|
+
readonly outline: Schema.String;
|
|
147
|
+
}>, YieldableError>;
|
|
148
|
+
|
|
149
|
+
export declare interface OutlineFn<TArgs> {
|
|
150
|
+
<TName extends string>(name: ScenarioTitle<TName>, ...steps: readonly StepArg<TArgs>[]): OutlineBuilder<TArgs>;
|
|
151
|
+
<TName extends string>(name: ScenarioTitle<TName>, options: ScenarioOptions, ...steps: readonly StepArg<TArgs>[]): OutlineBuilder<TArgs>;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
export declare class OutlineInconsistentKeys extends OutlineInconsistentKeys_base {}
|
|
155
|
+
|
|
156
|
+
declare const OutlineInconsistentKeys_base: Schema.Class<OutlineInconsistentKeys, Schema.TaggedStruct<"OutlineInconsistentKeys", {
|
|
157
|
+
readonly outline: Schema.String;
|
|
158
|
+
readonly row: Schema.String;
|
|
159
|
+
readonly expected: Schema.$Array<Schema.String>;
|
|
160
|
+
readonly actual: Schema.$Array<Schema.String>;
|
|
161
|
+
}>, YieldableError>;
|
|
162
|
+
|
|
163
|
+
export declare class OutlineMissingCapture extends OutlineMissingCapture_base {}
|
|
164
|
+
|
|
165
|
+
declare const OutlineMissingCapture_base: Schema.Class<OutlineMissingCapture, Schema.TaggedStruct<"OutlineMissingCapture", {
|
|
166
|
+
readonly outline: Schema.String;
|
|
167
|
+
readonly row: Schema.String;
|
|
168
|
+
readonly capture: Schema.String;
|
|
169
|
+
}>, YieldableError>;
|
|
170
|
+
|
|
171
|
+
export declare interface PlayContext<TArgs = unknown> {
|
|
172
|
+
readonly canvas: Canvas;
|
|
173
|
+
readonly canvasElement: HTMLElement;
|
|
174
|
+
readonly step: StepFn;
|
|
175
|
+
readonly userEvent: UserEventObject;
|
|
176
|
+
readonly args: TArgs;
|
|
177
|
+
readonly globals: Record<string, unknown>;
|
|
178
|
+
readonly parameters: Record<string, unknown>;
|
|
179
|
+
readonly loaded: Record<string, unknown>;
|
|
180
|
+
readonly abortSignal: AbortSignal;
|
|
181
|
+
readonly reporting: ReportingAPI;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
declare interface Report_2 {
|
|
185
|
+
readonly type: string;
|
|
186
|
+
readonly version?: number;
|
|
187
|
+
readonly result: unknown;
|
|
188
|
+
readonly status: 'failed' | 'passed' | 'warning';
|
|
189
|
+
}
|
|
190
|
+
export { Report_2 as Report }
|
|
191
|
+
|
|
192
|
+
export declare interface ReportingAPI {
|
|
193
|
+
readonly reports: Report_2[];
|
|
194
|
+
readonly addReport: (report: Report_2) => void;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
export declare interface RuleScope<TArgs> {
|
|
198
|
+
readonly scenario: ScenarioFn<TArgs>;
|
|
199
|
+
readonly scenarioOutline: OutlineFn<TArgs>;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
export declare interface ScenarioFn<TArgs> {
|
|
203
|
+
<TName extends string>(name: ScenarioTitle<TName>, ...steps: readonly StepArg<TArgs>[]): StorySpec<TArgs>;
|
|
204
|
+
<TName extends string>(name: ScenarioTitle<TName>, options: ScenarioOptions, ...steps: readonly StepArg<TArgs>[]): StorySpec<TArgs>;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
export declare interface ScenarioOptions {
|
|
208
|
+
/** Capture values for a plain (non-outline) scenario, keyed by capture name. */
|
|
209
|
+
readonly with?: Readonly<Record<string, string>>;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
declare type ScenarioTitle<T extends string> = T extends `Should${string}` ? ScenarioTitleRejected<T> : T extends `${string} ${string}` ? T : ScenarioTitleRejected<T>;
|
|
213
|
+
|
|
214
|
+
/**
|
|
215
|
+
* A scenario title names a concrete situation in natural-language prose. Two
|
|
216
|
+
* shape checks keep DAMP `Should_[Behavior]_When_[Condition]` unit-test names —
|
|
217
|
+
* and every concatenated-token title shaped like one — out of the call site:
|
|
218
|
+
* 1. the literal must not start with `Should`;
|
|
219
|
+
* 2. the literal must contain at least one ASCII space (a single-word title is
|
|
220
|
+
* a test name, not prose).
|
|
221
|
+
* Either check failing maps to `ScenarioTitleRejected`, so the call fails to
|
|
222
|
+
* type-check with the rule in the diagnostic. Non-literal titles (widened
|
|
223
|
+
* `string`) pass through untouched — a runtime guard would catch those, but
|
|
224
|
+
* the brand is the contract this skill ships.
|
|
225
|
+
*/
|
|
226
|
+
declare type ScenarioTitleRejected<T extends string> = `Scenario titles are natural-language prose of a concrete situation, not DAMP Should_[Behavior]_When_[Condition] unit-test names. Got: ${T}` | `Scenario title must be natural-language prose (at least one space separates words); got: ${T}`;
|
|
227
|
+
|
|
228
|
+
export declare const Star: StepCtor;
|
|
229
|
+
|
|
230
|
+
export declare interface Step<TArgs = unknown> extends StepTag {
|
|
231
|
+
readonly model: StepModel;
|
|
232
|
+
readonly run: (values: Readonly<Record<string, string>>, ctx: StepContext<TArgs>) => Effect.Effect<void, CaptureDecodeFailed>;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
/**
|
|
236
|
+
* Anything positional after the scenario name: a step, a step group from
|
|
237
|
+
* `Steps(...)` / `From(...)`, or — in first position only — an options object.
|
|
238
|
+
*/
|
|
239
|
+
export declare type StepArg<TArgs> = Step<TArgs> | readonly Step<TArgs>[];
|
|
240
|
+
|
|
241
|
+
export declare interface StepBuilder<THoles extends readonly Hole[], TArgs = unknown> {
|
|
242
|
+
(handler: StepHandler<CapsOf<THoles>, TArgs>): Step<TArgs>;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
export declare interface StepContext<TArgs = unknown> {
|
|
246
|
+
readonly canvas: Canvas;
|
|
247
|
+
readonly screen: typeof screen_2;
|
|
248
|
+
readonly userEvent: UserEventObject;
|
|
249
|
+
readonly step: StepFn;
|
|
250
|
+
readonly args: TArgs;
|
|
251
|
+
readonly globals: Record<string, unknown>;
|
|
252
|
+
readonly parameters: Record<string, unknown>;
|
|
253
|
+
readonly loaded: Record<string, unknown>;
|
|
254
|
+
readonly canvasElement: HTMLElement;
|
|
255
|
+
/**
|
|
256
|
+
* Fires on story teardown (remount, navigation, HMR). Since the 2026-08-09
|
|
257
|
+
* Effect-composition refactor, the play edge interrupts the in-flight step
|
|
258
|
+
* on abort — steps no longer run to completion after teardown. The step
|
|
259
|
+
* handler's own promise is abandoned, not cancelled: observe this signal
|
|
260
|
+
* for cleanup or to race long-running work.
|
|
261
|
+
*/
|
|
262
|
+
readonly abortSignal: AbortSignal;
|
|
263
|
+
readonly reporting: ReportingAPI;
|
|
264
|
+
readonly context: PlayContext<TArgs>;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
export declare type StepCtor = {
|
|
268
|
+
<const THoles extends readonly Hole[]>(statics: TemplateStringsArray, ...holes: THoles): StepBuilder<THoles>;
|
|
269
|
+
<TArgs, const THoles extends readonly Hole[] = readonly Hole[]>(statics: TemplateStringsArray, ...holes: THoles): StepBuilder<THoles, TArgs>;
|
|
270
|
+
};
|
|
271
|
+
|
|
272
|
+
export declare type StepFn = (label: string, fn: () => Promise<void>) => Promise<void> | void;
|
|
273
|
+
|
|
274
|
+
export declare type StepHandler<TCaps, TArgs = unknown> = (ctx: StepContext<TArgs>, caps: TCaps) => void | Promise<void>;
|
|
275
|
+
|
|
276
|
+
export declare interface StepModel {
|
|
277
|
+
readonly keyword: Keyword;
|
|
278
|
+
/** Static segments around the holes — length is always captures.length + 1. */
|
|
279
|
+
readonly parts: readonly string[];
|
|
280
|
+
readonly captures: readonly CaptureModel[];
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
export declare const Steps: <TArgs>(...steps: readonly Step<TArgs>[]) => Step<TArgs>[];
|
|
284
|
+
|
|
285
|
+
declare const StepTag: {
|
|
286
|
+
readonly _tag: "Step";
|
|
287
|
+
};
|
|
288
|
+
|
|
289
|
+
declare type StepTag = typeof StepTag;
|
|
290
|
+
|
|
291
|
+
export declare interface StorySpec<TArgs = unknown> {
|
|
292
|
+
readonly name: string;
|
|
293
|
+
readonly play: (context: PlayContext<TArgs>) => Promise<void>;
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
declare interface StoryWithPlay<TArgs> {
|
|
297
|
+
readonly play?: (context: PlayContext<TArgs>) => Promise<void> | void;
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
export declare const Then: StepCtor;
|
|
301
|
+
|
|
302
|
+
/** Capture values come from a literal hole, `with`, or an outline row — none matched. */
|
|
303
|
+
export declare class UnresolvedCapture extends UnresolvedCapture_base {}
|
|
304
|
+
|
|
305
|
+
declare const UnresolvedCapture_base: Schema.Class<UnresolvedCapture, Schema.TaggedStruct<"UnresolvedCapture", {
|
|
306
|
+
readonly scenario: Schema.String;
|
|
307
|
+
readonly step: Schema.String;
|
|
308
|
+
readonly capture: Schema.String;
|
|
309
|
+
}>, YieldableError>;
|
|
310
|
+
|
|
311
|
+
export declare const When: StepCtor;
|
|
312
|
+
|
|
313
|
+
export { }
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@systemfsoftware/storybook-gherkin",
|
|
3
3
|
"license": "Apache-2.0",
|
|
4
|
-
"version": "3.0.
|
|
4
|
+
"version": "3.0.4",
|
|
5
5
|
"author": "Ryan Lee <drdgvhbh@gmail.com>",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -43,6 +43,7 @@
|
|
|
43
43
|
"storybook": ">=10.0.0"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
|
+
"@microsoft/api-extractor": "^7.58.7",
|
|
46
47
|
"@storybook/addon-vitest": "^10.5.0",
|
|
47
48
|
"@storybook/react-vite": "^10.5.0",
|
|
48
49
|
"@systemfsoftware/arethetypeswrong-cli": "^4.1.0",
|
|
@@ -70,13 +71,15 @@
|
|
|
70
71
|
},
|
|
71
72
|
"scripts": {
|
|
72
73
|
"clean": "rimraf dist",
|
|
73
|
-
"build": "tsdown && pnpm dts:check",
|
|
74
|
+
"build": "tsdown && pnpm dts:check && pnpm api:check",
|
|
74
75
|
"typecheck": "tsc --noEmit --incremental",
|
|
75
76
|
"lint": "f=${OXLINT_FORMAT:-${AGENT:+agent}}; oxlint . --config oxlint.config.ts --format=${f:-default}",
|
|
76
77
|
"lint:tsgo": "effect-tsgo diagnostics --project tsconfig.json --format ${TSGO_FORMAT:-text}",
|
|
77
78
|
"attw": "attw --pack .",
|
|
78
79
|
"dts:check": "node scripts/check-dts.mjs",
|
|
79
80
|
"storybook": "storybook dev -p 6006 --no-open",
|
|
80
|
-
"test:browser": "pnpm build && vitest run"
|
|
81
|
+
"test:browser": "pnpm build && vitest run",
|
|
82
|
+
"api:check": "tsdown && api-extractor run",
|
|
83
|
+
"api:update": "api-extractor run --local"
|
|
81
84
|
}
|
|
82
85
|
}
|