import { Result } from "neverthrow"; declare type Error = { type: "Error"; message: string; }; declare type MalformedInput = { type: "MalformedInput"; message: string; }; declare type SignFailed = { type: "SignFailed"; message: string; }; declare type VerifyFailed = { type: "VerifyFailed"; message: string; }; /** * A utility function to get the value from a {@link Result} or throw if there was an error * * @remarks * Allows you to get the value of a result directly or handle an error {@link Result} as an exception * * @param result - The {@link Result} to unwrap * @param errMessage - Error message used when unwrap failed * @typeParam T - the expected value of an ok result */ export declare const unwrap: (result: Result, errMessage?: string) => T; /** * Instance of an exception * * @remarks * Used to raise exception when something unexpeced occurs * * @example * ``` * throw new Exception(); * throw new Exception(erorr); * throw new Exception("Unexpected error occur signing", error); * ``` */ export declare class Exception extends Error { readonly cause?: unknown; constructor(message: string); constructor(cause: unknown); constructor(message: string | unknown, cause: unknown); } export declare type CreateSignatureHeaderError = Error | MalformedInput | SignFailed; export declare type VerifySignatureHeaderError = Error | VerifyFailed; export {};