/** * (c) Facebook, Inc. and its affiliates. Confidential and proprietary. * * @emails oncall+recoil * @flow strict-local * @format */ 'use strict'; import type { Handlers } from 'Recoil_NodeCache'; import type { Loadable } from '../adt/Recoil_Loadable'; import type { NodeKey } from '../core/Recoil_State'; import type { GetNodeValue, NodeCacheRoute } from './Recoil_NodeCache'; const invariant = require('../util/Recoil_invariant'); export type TreeCacheNode = TreeCacheResult | TreeCacheBranch; export type TreeCacheResult = { type: 'result', result: Loadable, }; export type TreeCacheBranch = { type: 'branch', nodeKey: NodeKey, branches: Map>, }; declare function setInTreeCache(root: ?TreeCacheNode, route: NodeCacheRoute, result: Loadable): TreeCacheNode; declare function getFromTreeCache(root: ?TreeCacheNode, getNodeValue: GetNodeValue, handlers: Handlers): Loadable | void; module.exports = { setInTreeCache, getFromTreeCache };