import { Tag } from "polar-shared/src/tags/Tags" ; import { SparseDict } from "./SparseDict" ; import { KeyMemberSet } from "./KeyMemberSet" ; const toKey = ( key ) : string => { return key . id ; } ; const newValue = ( key ) : KeyMemberSet < Tag , string > => { return new KeyMemberSet ( key ) ; } ; export class ForwardTagToDocIDIndex { private backing : SparseDict < Tag , KeyMemberSet < Tag , string > > ; constructor ( ) { this . backing = new SparseDict ( toKey , newValue ) ; } public get ( key ) { return this . backing . get ( key ) ; } public keys ( ) { return this . backing . keys ( ) ; } public values ( ) { return this . backing . values ( ) ; } public delete ( key ) { this . backing . delete ( key ) ; } public purge ( predicate ) { this . backing . purge ( predicate ) ; } public getWithKey ( k ) { return this . backing . getWithKey ( k ) ; } }