import { LineInfo } from '../misc/utils'; import { IExpression } from '../typings/expression'; import { Expression } from '../core/expression'; import { MichelsonType } from '../core/enums/type'; /** * Get map entries. * * ```typescript * GetMapEntries( * Map( [ [String("some_key_a"), Nat(1)], [String("some_key_b"), Nat(2)] ] ) ); * ``` * * @category | Map expressions * * @param source Map expression * @param {LineInfo} line Source code line information (Used in error messages) * * @returns {IExpression} An expression of type TList(TRecord({ key: ..., value: ... })). */ export declare const GetMapEntries: (source: IExpression, line?: LineInfo) => Expression; /** * Get map keys. * * ```typescript * GetMapKeys( * Map( [ [String("some_key_a"), Nat(1)], [String("some_key_b"), Nat(2)] ] ) ); * ``` * * @category | Map expressions * * @param source Map expression * @param {LineInfo} line Source code line information (Used in error messages) * * @returns {IExpression} An expression of type TList(). */ export declare const GetMapKeys: (source: IExpression, line?: LineInfo) => Expression; /** * Get map values. * * ```typescript * GetMapValues( * Map( [ [String("some_key_a"), Nat(1)], [String("some_key_b"), Nat(2)] ] ) ); * ``` * * @category | Map expressions * * @param source Map expression * @param {LineInfo} line Source code line information (Used in error messages) * * @returns {IExpression} An expression of type TList(). */ export declare const GetMapValues: (source: IExpression, line?: LineInfo) => Expression; /** * Update an entry on map or big map. * * ```typescript * // Update/Insert entry * UpdateMap(ContractStorage().metadata, String("some_key"), Some(Nat(10))); * // Remove entry * UpdateMap(ContractStorage().metadata, String("some_key"), None()); * ``` * * @category | Map expressions * * @param source A map expression. * @param key The map key. * @param value An optional value to be indexed by the given key. (The entry is removed if None() is provided as value) * @param {LineInfo} line Source code line information (Used in error messages) * * @returns {IExpression} An expression */ export declare const UpdateMap: (source: IExpression, key: IExpression, value: IExpression, line?: LineInfo) => Expression; /** * Accesss by key the value stored in a map or big map. * * ```typescript * AccessMapByKey(ContractStorage().metadata, String("key")) * ``` * * @category | Map expressions * * @param source Map expression * @param key Map key. * @param default_value An optional default value when the key does not exist. * @param error_message An optional value to be included in the error trace. * @param {LineInfo} line Source code line information (Used in error messages) * * @returns {IExpression} An expression */ export declare const AccessMapByKey: (source: IExpression, key: IExpression, default_value?: IExpression | undefined, error_message?: IExpression | undefined, line?: LineInfo) => import("../misc/proxy").Proxied>; /** * Checks if a given key exists in map or big_map. * * ```typescript * MapContainsKey(ContractStorage().metadata, String("sone_key")) * ``` * * @category | Map expressions * * @param expression Map expression * @param key Map key. * @param {LineInfo} line Source code line information (Used in error messages) * * @returns {IExpression} An expression that resolves to a boolean value. */ export declare const MapContainsKey: (expression: IExpression, key: IExpression, line?: LineInfo) => Expression; declare const MapExpressions: { GetMapEntries: (source: IExpression, line?: LineInfo) => Expression; UpdateMap: (source: IExpression, key: IExpression, value: IExpression, line?: LineInfo) => Expression; AccessMapByKey: (source: IExpression, key: IExpression, default_value?: IExpression | undefined, error_message?: IExpression | undefined, line?: LineInfo) => import("../misc/proxy").Proxied>; MapContainsKey: (expression: IExpression, key: IExpression, line?: LineInfo) => Expression; }; export default MapExpressions;