/** * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @emails oncall+recoil * @flow strict * @format */ 'use strict'; import type { HAMTPlusMap } from 'hamt_plus'; const gkx = require('../util/Recoil_gkx'); const hamt = require('hamt_plus'); export interface PersistentMap { keys(): Iterable, entries(): Iterable<[K, V]>, get(key: K): V | void, has(key: K): boolean, set(key: K, value: V): PersistentMap, delete(key: K): PersistentMap, clone(): PersistentMap, toMap(): Map, } declare class BuiltInMap implements PersistentMap { _map: Map, constructor(existing?: PersistentMap): any, keys(): Iterable, entries(): Iterable<[K, V]>, get(k: K): V | void, has(k: K): boolean, set(k: K, v: V): PersistentMap, delete(k: K): PersistentMap, clone(): PersistentMap, toMap(): Map, } declare class HashArrayMappedTrieMap implements PersistentMap { _hamt: HAMTPlusMap, constructor(existing?: PersistentMap): any, keys(): Iterable, entries(): Iterable<[K, V]>, get(k: K): V | void, has(k: K): boolean, set(k: K, v: V): PersistentMap, delete(k: K): PersistentMap, clone(): PersistentMap, toMap(): Map, } declare function persistentMap(existing?: PersistentMap): PersistentMap; module.exports = { persistentMap };