import * as t from 'io-ts';
export declare const Primitive: t.UnionC<[t.StringC, t.NumberC, t.BooleanC, t.NullC]>;
export declare type Primitive = t.TypeOf<typeof Primitive>;
export declare const Structured: t.UnionC<[t.RecordC<t.StringC, t.AnyC>, t.UnknownArrayC]>;
export declare type Structured = t.TypeOf<typeof Structured>;
export declare const Some: t.UnionC<[t.UnionC<[t.StringC, t.NumberC, t.BooleanC, t.NullC]>, t.UnionC<[t.RecordC<t.StringC, t.AnyC>, t.UnknownArrayC]>]>;
export declare type Some = t.TypeOf<typeof Some>;
export declare const RPCID: t.UnionC<[t.RefinementC<t.NumberC>, t.StringC]>;
export declare type RPCID = t.TypeOf<typeof RPCID>;
export declare const RPCParams: t.UnionC<[t.UnionC<[t.RecordC<t.StringC, t.AnyC>, t.UnknownArrayC]>, t.UndefinedC]>;
export declare type RPCParams = t.TypeOf<typeof RPCParams>;
export declare const RPCError: t.IntersectionC<[t.TypeC<{
    code: t.RefinementC<t.NumberC>;
    message: t.StringC;
}>, t.PartialC<{
    data: t.UnionC<[t.UnionC<[t.StringC, t.NumberC, t.BooleanC, t.NullC]>, t.UnionC<[t.RecordC<t.StringC, t.AnyC>, t.UnknownArrayC]>]>;
}>]>;
export declare type RPCError = t.TypeOf<typeof RPCError>;
export declare const RequestJSON: t.IntersectionC<[t.TypeC<{
    jsonrpc: t.LiteralC<"2.0">;
    method: t.StringC;
    id: t.UnionC<[t.RefinementC<t.NumberC>, t.StringC]>;
}>, t.PartialC<{
    params: t.UnionC<[t.UnionC<[t.RecordC<t.StringC, t.AnyC>, t.UnknownArrayC]>, t.UndefinedC]>;
    result: t.UndefinedC;
    error: t.UndefinedC;
}>]>;
export declare type RequestJSON = t.TypeOf<typeof RequestJSON>;
export declare const NotificationJSON: t.IntersectionC<[t.TypeC<{
    jsonrpc: t.LiteralC<"2.0">;
    method: t.StringC;
}>, t.PartialC<{
    params: t.UnionC<[t.UnionC<[t.RecordC<t.StringC, t.AnyC>, t.UnknownArrayC]>, t.UndefinedC]>;
    id: t.UndefinedC;
    result: t.UndefinedC;
    error: t.UndefinedC;
}>]>;
export declare type NotificationJSON = t.TypeOf<typeof NotificationJSON>;
export declare const ResponseJSON: t.IntersectionC<[t.TypeC<{
    jsonrpc: t.LiteralC<"2.0">;
    result: t.UnionC<[t.UnionC<[t.StringC, t.NumberC, t.BooleanC, t.NullC]>, t.UnionC<[t.RecordC<t.StringC, t.AnyC>, t.UnknownArrayC]>]>;
    id: t.UnionC<[t.RefinementC<t.NumberC>, t.StringC]>;
}>, t.PartialC<{
    method: t.UndefinedC;
    params: t.UndefinedC;
    error: t.UndefinedC;
}>]>;
export declare type ResponseJSON = t.TypeOf<typeof ResponseJSON>;
export declare const ErrorJSON: t.IntersectionC<[t.TypeC<{
    jsonrpc: t.LiteralC<"2.0">;
    error: t.IntersectionC<[t.TypeC<{
        code: t.RefinementC<t.NumberC>;
        message: t.StringC;
    }>, t.PartialC<{
        data: t.UnionC<[t.UnionC<[t.StringC, t.NumberC, t.BooleanC, t.NullC]>, t.UnionC<[t.RecordC<t.StringC, t.AnyC>, t.UnknownArrayC]>]>;
    }>]>;
    id: t.UnionC<[t.UnionC<[t.RefinementC<t.NumberC>, t.StringC]>, t.NullC]>;
}>, t.PartialC<{
    method: t.UndefinedC;
    params: t.UndefinedC;
    result: t.UndefinedC;
}>]>;
export declare type ErrorJSON = t.TypeOf<typeof ErrorJSON>;
export interface Request {
    kind: 'request';
    method: string;
    params?: Structured;
    id: RPCID;
}
export interface Notification {
    kind: 'notification';
    method: string;
    params?: Structured;
}
export interface Response {
    kind: 'response';
    result: Some;
    id: RPCID;
}
export interface Error {
    kind: 'error';
    error: {
        code: number;
        message: string;
        data?: Some;
    };
    id: RPCID | null;
}
export declare type Message = Request | Notification | Response | Error;
export declare function parse(obj: object): Message;
export declare function request(id: RPCID, method: string, params?: RPCParams): RequestJSON;
export declare function notification(method: string, params?: RPCParams): NotificationJSON;
export declare function response(id: RPCID, result?: Some): ResponseJSON;
export interface ErrorObject extends RPCError {
    id?: RPCID | null;
}
export declare function error(error: ErrorObject): ErrorJSON;
