Skip to content

Commit 5e3f657

Browse files
committed
Fix type declarations
`matchId` and `matchMessage` should be mutually exclusive, and both also accept a `RegExp`.
1 parent 6f143a1 commit 5e3f657

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

index.d.ts

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,16 @@
1+
interface WorkflowMatchId {
2+
handler?: 'log' | 'silence' | 'throw';
3+
matchId: string | RegExp;
4+
}
5+
6+
interface WorkflowMatchMessage {
7+
handler?: 'log' | 'silence' | 'throw';
8+
matchMessage: string | RegExp;
9+
}
10+
11+
type Workflow = WorkflowMatchId | WorkflowMatchMessage;
12+
113
export default function setupDeprecationWorkflow(config?: {
214
throwOnUnhandled?: boolean;
3-
workflow?: {
4-
handler: 'log' | 'silence' | 'throw';
5-
matchId: string;
6-
matchMessage: string;
7-
}[];
15+
workflow?: Workflow[];
816
}): void;

0 commit comments

Comments
 (0)