export const HashMapSym = Symbol.for("@tsplus/stdlib/collection/HashMap") export type HashMapSym = typeof HashMapSym export const _K = Symbol.for("@tsplus/stdlib/collection/HashMap/K") export type _K = typeof _K export const _V = Symbol.for("@tsplus/stdlib/collection/HashMap/V") export type _V = typeof _V /** * @tsplus type HashMap */ export interface HashMap extends Collection, Equals { readonly [HashMapSym]: HashMapSym readonly [_K]: () => K readonly [_V]: () => V [Symbol.iterator](): Iterator } /** * @tsplus type HashMap.Ops */ export interface HashMapOps { $: HashMapAspects } export const HashMap: HashMapOps = { $: {} } /** * @tsplus type HashMap.Aspects */ export interface HashMapAspects {} /** * @tsplus unify HashMap */ export function unifyHashMap>( self: X ): HashMap< [X] extends [HashMap] ? K : never, [X] extends [HashMap] ? V : never > { return self } /** * @tsplus static HashMap.Ops isHashMap */ export function isHashMap(u: Iterable): u is HashMap export function isHashMap(u: unknown): u is HashMap export function isHashMap(u: unknown): u is HashMap { return typeof u === "object" && u != null && HashMapSym in u }