ES6 Map TypeScript Interface with Async Support
npm install async-map-like


ECMAScript Map like type definition (plus Async).

It has same API Interface with Map - JavaScript | MDN, with additional Async support.
``ts
import { MapLike } from 'async-map-like'
const mapLike: MapLike
`
That's it, enjoy the Duck Typing!
`ts
/**
* ES6 Map like Async API
*/
export interface AsyncMapLike
size : Promise
get (key: K) : Promise
set (key: K, value: V) : Promise
has (key: K) : Promise
delete (key: K) : Promise
clear () : Promise
entries () : AsyncIterableIterator<[K, V]>
keys () : AsyncIterableIterator
values () : AsyncIterableIterator
[Symbol.asyncIterator]() : AsyncIterableIterator<[K, V]>
forEach (
callbackfn: (
value : V,
key : K,
map : AsyncMapLike
) => void,
thisArg?: AsyncMapLike
): Promise
}
`
1. Remove sync interface: [Symbol.toStringTag]() and [Symbol.iterator]()[Symbol.asyncIterator]()
1. Add async interface:
1. Create MapLike interface for ES6 MapAsyncMapLike` for ES6 Map like Async interface
1. Create
Huan LI (李卓桓), Microsoft AI MVP, zixia@zixia.net

* Docs released under Creative Commons
* Code released under the Apache-2.0 License
* Code & Docs © 2018 Huan LI \