UNPKG

1.62 kBTypeScriptView Raw
1export declare type DefinitionTypeType = string;
2export declare type DefinitionTypeEnum = {
3 _fallback?: DefinitionTypeType;
4} & ({
5 _enum: DefinitionTypeType[];
6} | {
7 _enum: Record<string, DefinitionTypeType | null>;
8});
9export declare type DefinitionTypeSet = {
10 _fallback?: DefinitionTypeType;
11 _set: Record<string, number>;
12};
13declare type DefinitionTypeStructExtra = {
14 _alias?: Record<string, DefinitionTypeType>;
15 _fallback?: DefinitionTypeType;
16} & Record<string, unknown>;
17export declare type DefinitionTypeStruct = Record<string, DefinitionTypeType> | DefinitionTypeStructExtra;
18export declare type DefinitionType = string | DefinitionTypeEnum | DefinitionTypeSet | DefinitionTypeStruct;
19export interface DefinitionRpcParam {
20 isHistoric?: boolean;
21 isOptional?: boolean;
22 name: string;
23 type: DefinitionTypeType;
24}
25export interface DefinitionRpc {
26 alias?: string[];
27 aliasSection?: string;
28 description: string;
29 endpoint?: string;
30 isSigned?: boolean;
31 params: DefinitionRpcParam[];
32 type: DefinitionTypeType;
33}
34export interface DefinitionRpcExt extends DefinitionRpc {
35 isSubscription: boolean;
36 jsonrpc: string;
37 method: string;
38 pubsub?: [string, string, string];
39 section: string;
40}
41export interface DefinitionRpcSub extends DefinitionRpc {
42 pubsub: [string, string, string];
43}
44export declare type DefinitionsRpc = Record<string, DefinitionRpc | DefinitionRpcSub>;
45export declare type DefinitionsTypes = Record<string, DefinitionType>;
46export interface Definitions {
47 rpc: DefinitionsRpc;
48 types: DefinitionsTypes;
49}
50export {};