fortmatic
Version:
Fortmatic Javascript SDK
39 lines (38 loc) • 1.65 kB
TypeScript
/**
* This file contains our type guards.
*
* Type guards are a feature of TypeScript which narrow the type signature of
* intesection types (types that can be one thing or another).
*
* @see
* https://www.typescriptlang.org/docs/handbook/advanced-types.html#type-guards-and-differentiating-types
*/
import { FmBatchRequest, FmPayloadMethod, FmRequest, JsonRpcBatchRequestPayload, JsonRpcRequestPayload, JsonRpcResponsePayload, RPCErrorCode } from '../types';
/**
* Assert `value` is a `JsonRpcBatchRequestPayload` object.
*/
export declare function isJsonRpcBatchRequestPayload(value?: JsonRpcRequestPayload | JsonRpcBatchRequestPayload): value is JsonRpcBatchRequestPayload;
/**
* Assert `value` is a `JsonRpcRequestPayload` object.
*/
export declare function isJsonRpcRequestPayload(value?: JsonRpcRequestPayload | JsonRpcBatchRequestPayload): value is JsonRpcRequestPayload;
/**
* Assert `value` is a `JsonRpcResponsePayload` object.
*/
export declare function isJsonRpcResponsePayload(value: any): value is JsonRpcResponsePayload;
/**
* Assert `value` is a `FmRequest` object.
*/
export declare function isFmRequest(value?: FmRequest | FmBatchRequest): value is FmRequest;
/**
* Assert `value` is a `FmBatchRequest` object.
*/
export declare function isFmBatchRequest(value?: FmRequest | FmBatchRequest): value is FmBatchRequest;
/**
* Assert `value` is a Fortmatic payload method identifier.
*/
export declare function isFmPayloadMethod(value?: any): value is FmPayloadMethod;
/**
* Assert `value` is an expected JSON RPC error code.
*/
export declare function isJsonRpcErrorCode(value?: any): value is RPCErrorCode;