@autometa/cucumber-expressions 0.4.4 → 1.0.0-rc.0

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/dist/index.d.cts DELETED
@@ -1,104 +0,0 @@
1
- import { Change } from 'diff';
2
- import { Expression, ParameterTypeRegistry } from '@cucumber/cucumber-expressions';
3
- import { Class } from '@autometa/types';
4
- import { App } from '@autometa/app';
5
-
6
- type CachedStep = {
7
- keyword: string;
8
- type: string;
9
- expression: Expression;
10
- matches: (text: string) => boolean;
11
- };
12
-
13
- type StepDiff = {
14
- merged: string;
15
- step: CachedStep;
16
- gherkin: string;
17
- distance: number;
18
- };
19
- type StepDiffs = StepDiff[];
20
- type LimitedStepDiffs = {
21
- same: StepDiffs;
22
- other: StepDiffs;
23
- };
24
- declare function checkMatch(text: string, it: CachedStep): boolean;
25
- declare function limitDiffs(sameStepType: StepDiffs, differentStepType: StepDiffs, max: number): LimitedStepDiffs;
26
- declare function getDiffs(text: string, maxResults: number, step: CachedStep[]): {
27
- merged: string;
28
- step: CachedStep;
29
- gherkin: string;
30
- distance: number;
31
- }[];
32
- declare function getDiff(text: string, it: CachedStep): Change[];
33
- declare function refineDiff(diff: Change[]): string;
34
- declare function isExpressionCandidate(change1: Change, change2: Change): boolean;
35
-
36
- declare class SameStepTypeMatch {
37
- readonly keyword: string;
38
- readonly text: string;
39
- readonly source: string;
40
- readonly distance: number;
41
- constructor(diff: StepDiff);
42
- toString(): string;
43
- }
44
- declare class DifferentStepTypeMatch {
45
- readonly keyword: string;
46
- readonly text: string;
47
- readonly source: string;
48
- readonly distance: number;
49
- constructor(diff: StepDiff);
50
- toString(): string;
51
- }
52
- declare class FuzzySearchReport {
53
- #private;
54
- readonly depth: number;
55
- headingText: string;
56
- matches: (SameStepTypeMatch | DifferentStepTypeMatch)[];
57
- children: FuzzySearchReport[];
58
- constructor(depth?: number);
59
- get length(): number;
60
- addHeading(headingText: string): this;
61
- addMatch(match: SameStepTypeMatch | DifferentStepTypeMatch): this;
62
- addChild(child: FuzzySearchReport): this;
63
- toString(): string;
64
- }
65
- declare function buildFuzzySearchReport({ same, other }: LimitedStepDiffs, depth: number): FuzzySearchReport;
66
-
67
- declare module "@cucumber/cucumber-expressions" {
68
- interface ParameterType<T> {
69
- transform(groupValues: string[] | null, app: App): T;
70
- }
71
- }
72
- type ParamTypeDefinition = {
73
- name: string;
74
- regex: RegExp | RegExp[];
75
- /**
76
- * @deprecated use regex instead
77
- */
78
- regexpPattern?: RegExp | RegExp[];
79
- transform?: (value: any, app: App) => unknown;
80
- type?: Class<unknown>;
81
- primitive?: typeof String | typeof Number | typeof Boolean | typeof BigInt | typeof Date;
82
- };
83
- declare function defineParameterType<T extends ParamTypeDefinition[]>(registry: ParameterTypeRegistry, ...params: T): void;
84
-
85
- type AutoParamTypeDefinition = Omit<ParamTypeDefinition, "transform">;
86
- declare const OrdinalParam: ParamTypeDefinition;
87
- declare const NumberParam: AutoParamTypeDefinition;
88
- declare const AnyParam: AutoParamTypeDefinition;
89
- declare const UnknownParam: AutoParamTypeDefinition;
90
- declare const TextParam: ParamTypeDefinition;
91
- declare const BooleanParam: {
92
- name: string;
93
- regex: RegExp;
94
- primitive: BooleanConstructor;
95
- };
96
- declare const BoolParam: {
97
- name: string;
98
- regex: RegExp;
99
- primitive: BooleanConstructor;
100
- };
101
- declare const DateParam: AutoParamTypeDefinition;
102
- declare const PrimitiveParam: ParamTypeDefinition;
103
-
104
- export { AnyParam, BoolParam, BooleanParam, DateParam, DifferentStepTypeMatch, FuzzySearchReport, LimitedStepDiffs, NumberParam, OrdinalParam, ParamTypeDefinition, PrimitiveParam, SameStepTypeMatch, StepDiff, StepDiffs, TextParam, UnknownParam, buildFuzzySearchReport, checkMatch, defineParameterType, getDiff, getDiffs, isExpressionCandidate, limitDiffs, refineDiff };
package/tsup.config.ts DELETED
@@ -1,14 +0,0 @@
1
- import { defineConfig } from "tsup";
2
-
3
- export default defineConfig({
4
- clean: true, // clean up the dist folder
5
- format: ["cjs", "esm"], // generate cjs and esm files
6
- dts: true,
7
- sourcemap: true, // generate sourcemaps
8
- skipNodeModulesBundle: true,
9
- entryPoints: ["src/index.ts"],
10
- target: "es2020",
11
- outDir: "dist",
12
- legacyOutput: true,
13
- external: ["dist"],
14
- });