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
Useful tool for exploring TypeScript AST:
TS AST viewer for this example:
Types to infer
Instance
VariableDeclaration + PropertyAccessExpression:
const cache = new Cache()CacheMethod
PropertyAccessExpression:
cache.add("test.html"){ (request: RequestInfo | URL): Promise<void>; (request: RequestInfo | URL): Promise<void>; }Types to ignore
Class
NewExpression + VariableDeclaration:
const _Cache = Cache{ new (): Cache; prototype: Cache; }