mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
babel__traverse: allow undefined scope for both traverse functions (#35840)
This commit is contained in:
parent
50578128bb
commit
d689e2b616
@ -149,6 +149,8 @@ const VisitorStateTest: Visitor<SomeVisitorState> = {
|
||||
}
|
||||
};
|
||||
|
||||
traverse(ast, VisitorStateTest, undefined, { someState: "test" });
|
||||
|
||||
const VisitorAliasTest: Visitor = {
|
||||
Function() {},
|
||||
Expression() {},
|
||||
|
||||
16
types/babel__traverse/index.d.ts
vendored
16
types/babel__traverse/index.d.ts
vendored
@ -11,8 +11,20 @@ import * as t from "@babel/types";
|
||||
|
||||
export type Node = t.Node;
|
||||
|
||||
export default function traverse<S>(parent: Node | Node[], opts: TraverseOptions<S>, scope: Scope, state: S, parentPath?: NodePath): void;
|
||||
export default function traverse(parent: Node | Node[], opts: TraverseOptions, scope?: Scope, state?: any, parentPath?: NodePath): void;
|
||||
export default function traverse<S>(
|
||||
parent: Node | Node[],
|
||||
opts: TraverseOptions<S>,
|
||||
scope: Scope | undefined,
|
||||
state: S,
|
||||
parentPath?: NodePath,
|
||||
): void;
|
||||
export default function traverse(
|
||||
parent: Node | Node[],
|
||||
opts: TraverseOptions,
|
||||
scope?: Scope,
|
||||
state?: any,
|
||||
parentPath?: NodePath,
|
||||
): void;
|
||||
|
||||
export interface TraverseOptions<S = Node> extends Visitor<S> {
|
||||
scope?: Scope;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user