import type { IExpression } from '../typings/expression'; import { LineInfo } from '../misc/utils'; import { MichelsonType } from '../core/enums/type'; /** * Open a variant * * ```typescript * OpenVariant(Left(Nat(1)), "Left", String("COULD NOT OPEN VARIANT")) * ``` * * @category | Variant * * @param variant Variant expression * @param branch The branch name of the variant * @param errorMsg The 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 OpenVariant: (variant: IExpression, branch?: string, errorMsg?: IExpression | undefined, line?: LineInfo) => IExpression; /** * Unwrap a option value * * ```typescript * GetSome(Some(Nat(1)), String("COULD NOT UNWRAP OPTION")) * ``` * * @category | Variant * * @param variant Variant expression * @param errorMsg The 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 GetSome: (variant: IExpression, errorMsg?: IExpression | undefined, line?: LineInfo) => IExpression; /** * Checks if option variant is Some. * * ```typescript * isSome(Some(Nat(1))) * ``` * * @category | Variant * * @param variant Option expression * @param {LineInfo} line Source code line information (Used in error messages) * * @returns {IExpression} An expression of type bool. */ export declare const isSome: (variant: IExpression, line?: LineInfo) => IExpression; /** * Checks if option variant is None. * * ```typescript * isNone(None()) * ``` * * @category | Variant * * @param variant Option expression * @param {LineInfo} line Source code line information (Used in error messages) * * @returns {IExpression} An expression of type bool. */ export declare const isNone: (variant: IExpression, line?: LineInfo) => IExpression; /** * Check if a variant literal matches a given branch. * * ```typescript * IsVariant(Left(Nat(1)), "Left") // true * IsVariant(Right(Nat(1)), "Left") // false * ``` * * @category | Variant * * @param variant Variant expression * @param branch The branch name of the variant * @param {LineInfo} line Source code line information (Used in error messages) * * @returns {IExpression} An expression */ export declare const IsVariant: (variant: IExpression, branch: string, line?: LineInfo) => IExpression; declare const Variant: { OpenVariant: (variant: IExpression, branch?: string, errorMsg?: IExpression | undefined, line?: LineInfo) => IExpression; IsVariant: (variant: IExpression, branch: string, line?: LineInfo) => IExpression; GetSome: (variant: IExpression, errorMsg?: IExpression | undefined, line?: LineInfo) => IExpression; }; export default Variant;