1 | export interface Endpoint {
|
2 | type: 'messenger' | 'discord';
|
3 | id: string;
|
4 | readonly?: boolean;
|
5 | }
|
6 | export default class Connection {
|
7 | name: string;
|
8 | endpoints: Endpoint[];
|
9 | disabled: boolean;
|
10 | constructor(name: string, endpoints?: Endpoint[]);
|
11 | static isThread(endpoint: Endpoint): boolean;
|
12 | static isChannel(endpoint: Endpoint): boolean;
|
13 | addThread(id: string): this;
|
14 | addChannel(id: string): this;
|
15 | addEndpoint({ id, type, readonly }: {
|
16 | id: string;
|
17 | type: 'discord' | 'messenger';
|
18 | readonly?: boolean;
|
19 | }): Promise<void>;
|
20 | has(id: string): boolean;
|
21 | getWritableEndpoints(): Endpoint[];
|
22 | getThreads(): Endpoint[];
|
23 | getWritableThreads(): Endpoint[];
|
24 | getOtherWritableThreads(id: string): Endpoint[];
|
25 | getChannels(): Endpoint[];
|
26 | getWritableChannels(): Endpoint[];
|
27 | getOtherWritableChannels(id: string): Endpoint[];
|
28 | checkChannelRenames(name: string): Promise<this>;
|
29 | hasEndpoint(id: string): boolean;
|
30 | markEndpointAsReadonly(id: string, readonly: boolean): this;
|
31 | removeEndpoint(id: string): this;
|
32 | getPrintable(): string;
|
33 | rename(newName: string): this;
|
34 | delete(): Promise<void>;
|
35 | disable(): this;
|
36 | enable(): this;
|
37 | save(): Promise<this>;
|
38 | toYAMLObject(): {
|
39 | [x: string]: Endpoint[];
|
40 | };
|
41 | toObject(): {
|
42 | name: string;
|
43 | endpoints: Endpoint[];
|
44 | disabled: boolean;
|
45 | };
|
46 | readonly cleanEndpoints: Endpoint[];
|
47 | }
|