UNPKG

1.14 kBTypeScriptView Raw
1import { Error } from "./types.js";
2export declare function auth(accessToken: string): {
3 type: string;
4 access_token: string;
5};
6export declare function states(): {
7 type: string;
8};
9export declare function config(): {
10 type: string;
11};
12export declare function services(): {
13 type: string;
14};
15export declare function user(): {
16 type: string;
17};
18declare type ServiceCallMessage = {
19 type: "call_service";
20 domain: string;
21 service: string;
22 service_data?: object;
23};
24export declare function callService(domain: string, service: string, serviceData?: object): ServiceCallMessage;
25declare type SubscribeEventMessage = {
26 type: "subscribe_events";
27 event_type?: string;
28};
29export declare function subscribeEvents(eventType?: string): SubscribeEventMessage;
30export declare function unsubscribeEvents(subscription: number): {
31 type: string;
32 subscription: number;
33};
34export declare function ping(): {
35 type: string;
36};
37export declare function error(code: Error, message: string): {
38 type: string;
39 success: boolean;
40 error: {
41 code: Error;
42 message: string;
43 };
44};
45export {};