import type * as ts from 'typescript' ; export class DeclarationCache { private _declarationKeyMap : WeakMap < ts . Declaration , string > ; constructor ( ) { this . _declarationKeyMap = new WeakMap ( ) ; } public set ( declaration , key ) { this . _declarationKeyMap . set ( declaration , key ) ; } public get ( declaration ) { return this . _declarationKeyMap . get ( declaration ) ; } public has ( declaration ) { return this . _declarationKeyMap . has ( declaration ) ; } }