Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(estree-ast-utils): add missing d.ts #193

Merged
merged 1 commit into from
Dec 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions workspaces/estree-ast-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"description": "Utilities for AST (ESTree compliant)",
"type": "module",
"exports": "./src/index.js",
"types": "./src/index.d.ts",
"scripts": {
"lint": "eslint src test",
"prepublishOnly": "pkg-ok",
Expand All @@ -20,6 +21,9 @@
"ast",
"utils"
],
"files": [
"src"
],
"author": "GENTILHOMME Thomas <[email protected]>",
"license": "MIT",
"bugs": {
Expand Down
28 changes: 28 additions & 0 deletions workspaces/estree-ast-utils/src/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// Import Internal Dependencies
import { VariableTracer } from "./utils/VariableTracer";

export { VariableTracer };

export function arrayExpressionToString(
node: any, options?: { tracer?: VariableTracer }
): IterableIterator<string>;

export function concatBinaryExpression(
node: any, options?: { tracer?: VariableTracer, stopOnUnsupportedNode?: boolean }
): IterableIterator<string>;

export function getCallExpressionArguments(
node: any, options?: { tracer?: VariableTracer }
): string[] | null;

export function getCallExpressionIdentifier(
node: any
): string | null;

export function getMemberExpressionIdentifier(
node: any, options?: { tracer?: VariableTracer }
): IterableIterator<string>;

export function getVariableDeclarationIdentifiers(
node: any, options?: { prefix?: string | null }
): IterableIterator<{ name: string; assignmentId: any }>;
27 changes: 27 additions & 0 deletions workspaces/estree-ast-utils/src/utils/VariableTracer.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// Import Node.js Dependencies
import EventEmitter from "node:events";

declare class VariableTracer extends EventEmitter {
static AssignmentEvent: Symbol;

literalIdentifiers: Map<string, string>;
importedModules: Set<string>;

enableDefaultTracing(): VariableTracer;
debug(): void;
trace(identifierOrMemberExpr: string, options?: {
followConsecutiveAssignment?: boolean;
moduleName?: string;
name?: string;
}): VariableTracer;
getDataFromIdentifier(identifierOrMemberExpr: string): null | {
name: string;
identifierOrMemberExpr: string;
assignmentMemory: string[];
}
walk(node: any): void;
}

export {
VariableTracer
}
Loading