import { HttpParams } from "@angular/common/http";
export declare const JSONRPC_VERSION_2: string;
export declare const JSONRPC_VERSION: string;
/** Type of `id` property. The value SHOULD normally not be Null and Numbers SHOULD NOT contain fractional parts */
export type JsonRpcId = number | string | null;
/** Parameters for the rpc call MUST be provided as a Structured value. Either by-position through an Array or by-name through an Object. */
export type JsonRpcParams = {
    [key: string]: any;
} | [];
/** Type of JSON-RPC `Request` object */
export type JsonRpcRequest = {
    jsonrpc: typeof JSONRPC_VERSION_2;
    method: string;
    id: JsonRpcId;
    params?: JsonRpcParams;
};
/** Type of JSON-RPC `Notification` object */
export type JsonRpcNotification = Omit<JsonRpcRequest, "id">;
/** When a rpc call encounters an error, the Response Object MUST contain the error member with a value that is an Object */
export type JsonRpcError = {
    code: number;
    message: string;
    data?: any;
};
/** Type of JSON-RPC `Response` object. `result` member is REQUIRED on success. `error` member is REQUIRED on error. */
export type JsonRpcResponse = {
    jsonrpc: typeof JSONRPC_VERSION_2;
    id: JsonRpcId;
    result?: any;
    error?: JsonRpcError;
};
/** Type of JSON-RPC `Result` Response object */
export type JsonRpcResultResponse = Omit<JsonRpcResponse, "error">;
/** Type of JSON-RPC `Error` Response object */
export type JsonRpcErrorResponse = Omit<JsonRpcResponse, "result">;
/**
 * This class consists exclusively of the static methods that operate on or return Request/Response objects that follow [JSON-RPC 2.0 Specification](https://www.jsonrpc.org/specification)
 * @since 0.5.0
 */
export declare class JsonRpc {
    /**
     * Creates a `Request` object to a Server that follows JSON-RPC protocol
     * @param method A String containing the name of the method to be invoked. Method names that begin with the word rpc followed by a period character (U+002E or ASCII 46) are reserved for rpc-internal methods and extensions and MUST NOT be used for anything else.
     * @param params A Structured value that holds the parameter values to be used during the invocation of the method. This member MAY be omitted.
     * @param id An identifier established by the Client that MUST contain a String, Number, or NULL value if included.
     * @returns `Request` object in JSON-RPC 2.0 specification
     */
    static createRequest<T extends JsonRpcRequest>(method: string, params?: JsonRpcParams | HttpParams | string, id?: JsonRpcId): T;
    /**
     * Creates a `Notification` object to a Server that follows JSON-RPC protocol
     * @param method A String containing the name of the method to be invoked. Method names that begin with the word rpc followed by a period character (U+002E or ASCII 46) are reserved for rpc-internal methods and extensions and MUST NOT be used for anything else.
     * @param params A Structured value that holds the parameter values to be used during the invocation of the method. This member MAY be omitted.
     * @returns `Notification` object in JSON-RPC 2.0 specification
     */
    static createNotification<T extends JsonRpcNotification>(method: string, params?: JsonRpcParams | HttpParams | string): T;
    /**
     * Creates a `Response` object to a Server that follows JSON-RPC protocol
     * @param id An identifier established by the Client that MUST contain a String, Number, or NULL value if included.
     * @param data A value that is applied to a _result_ or an _error_ property depending on the `success` value
     * @param success A boolean value that determines the type of the `Response` object
     * @returns `Response` object in JSON-RPC 2.0 specification
     */
    static createResponse<T extends JsonRpcResponse>(id: JsonRpcId, data?: any, success?: boolean): T;
    private static toResultResponse;
    private static toErrorResponse;
    /**
     * Converts a specified object to a valid JSON-RPC `Response` object
     * @param obj  Object to transform
     * @returns `Response` object in JSON-RPC 2.0 specification
     */
    static toResponse<T extends JsonRpcResponse>(obj: {
        id: JsonRpcId;
        result?: any;
        error?: any;
    }): T;
    /**
     * Checks if the specified object `obj` is a valid `Request` object of the JSON-RPC 2.0 specification
     * @param obj Object to test
     * @returns _true_ if the object `obj` is a valid JSON-RPC 2.0 `Request` object, else _false_
     */
    static isRequestObject(obj: any): obj is JsonRpcRequest;
    /**
     * Checks if the specified object `obj` is a valid `Notification` object of the JSON-RPC 2.0 specification
     * @param obj Object to test
     * @returns _true_ if the object `obj` is a valid JSON-RPC 2.0 `Notification` object, else _false_
     */
    static isNotificationObject(obj: any): obj is JsonRpcNotification;
    /**
     * Checks if the specified object `obj` is a valid `Response` object of the JSON-RPC 2.0 specification
     * @param obj Object to test
     * @returns _true_ if the object `obj` is a valid JSON-RPC 2.0 `Response` object, else _false_
     */
    static isResponseObject(obj: any): obj is JsonRpcResponse;
    static isResultResponse(obj: any): boolean;
    static isErrorResponse(obj: any): boolean;
}
