1 | import { MessageConnection } from 'sourcegraph/module/jsonrpc2/connection';
|
2 | import { UpdateExtensionSettingsArgs } from './context';
|
3 |
|
4 | export declare type Source = 'Page' | 'Client';
|
5 |
|
6 | export interface ClientConnection {
|
7 |
|
8 | onSettings: (callback: (settings: string) => void) => void;
|
9 |
|
10 | editSetting: (edit: UpdateExtensionSettingsArgs) => Promise<void>;
|
11 |
|
12 | getSettings: () => Promise<string>;
|
13 |
|
14 | rawConnection: MessageConnection;
|
15 | }
|
16 |
|
17 | export interface PageConnection {
|
18 |
|
19 | onEditSetting: (callback: (edit: UpdateExtensionSettingsArgs) => Promise<void>) => void;
|
20 |
|
21 | onGetSettings: (callback: () => Promise<string>) => void;
|
22 |
|
23 | sendSettings: (settings: string) => void;
|
24 |
|
25 | rawConnection: MessageConnection;
|
26 | }
|
27 |
|
28 |
|
29 |
|
30 | export declare function connectAsClient(): Promise<PageConnection>;
|
31 |
|
32 |
|
33 |
|
34 | export declare function connectAsPage(): Promise<ClientConnection>;
|