/** * Copyright (c) Whales Corp. * All Rights Reserved. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ import { Address } from "@ton/core"; import { Slice, Cell } from "@ton/core"; import { BitString } from "@ton/core"; import { Maybe } from "@ton/core/src/utils/maybe"; import { CodeBuilder } from "../runtime/builder"; export type DictionaryKeyTypes = Address | number | bigint | Buffer | BitString; export type DictionaryKey = { bits: number; serialize(src: K): bigint; parse(src: bigint): K; }; export type DictionaryValue = { serialize(src: V, builder: CodeBuilder): void; parse(src: Slice): V; }; export declare class Dictionary { static Keys: { /** * Create integer key * @param bits bits of integer * @returns DictionaryKey */ Int: (bits: number) => DictionaryKey; }; /** * Create an empty map * @param key key type * @param value value type * @returns Dictionary */ static empty(key?: Maybe>, value?: Maybe>): Dictionary; private readonly _key; private readonly _value; private readonly _map; private constructor(); set(key: K, value: V): this; [Symbol.iterator](): IterableIterator<[K, V]>; /** * Low level method for rare dictionaries from system contracts. * Loads dictionary from slice directly without going to the ref. * * @param key key description * @param value value description * @param sc slice * @returns Dictionary */ static loadDirect(key: DictionaryKey, value: DictionaryValue, sc: Slice | Cell | null): Dictionary; storeDirect(builder: CodeBuilder): void; }