Skip to content

feat: track target nodes with TypeScript AST #44

Description

@MengLinMaker

Useful tool for exploring TypeScript AST:

TS AST viewer for this example:

const _Cache = Cache
const cache = new _Cache()
cache.add("test.html")

const keys = cache.keys()
const _keys =  new Cache().keys()
_keys.then((request) =>{
    const len = request.length
})

Types to infer

Instance

VariableDeclaration + PropertyAccessExpression:

  • Example: const cache = new Cache()
  • Type: Cache

Method

PropertyAccessExpression:

  • Example: cache.add("test.html")
  • Type: { (request: RequestInfo | URL): Promise<void>; (request: RequestInfo | URL): Promise<void>; }
  • Note: Type can be complex

Types to ignore

Class

NewExpression + VariableDeclaration:

  • Example: const _Cache = Cache
  • Type: { new (): Cache; prototype: Cache; }
  • Note: Type can be complex

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions