1 | import { ILogger } from '../common/logger';
|
2 | import { Event, Emitter } from '../common/event';
|
3 | import { DefaultFrontendApplicationContribution } from './frontend-application';
|
4 | import { StatusBar } from './status-bar/status-bar';
|
5 | import { WebSocketConnectionProvider } from './messaging/ws-connection-provider';
|
6 | import { Disposable, DisposableCollection } from '../common';
|
7 |
|
8 |
|
9 |
|
10 | export declare const ConnectionStatusService: unique symbol;
|
11 | export interface ConnectionStatusService {
|
12 | |
13 |
|
14 |
|
15 | readonly currentStatus: ConnectionStatus;
|
16 | |
17 |
|
18 |
|
19 | readonly onStatusChange: Event<ConnectionStatus>;
|
20 | }
|
21 |
|
22 |
|
23 |
|
24 | export declare enum ConnectionStatus {
|
25 | |
26 |
|
27 |
|
28 | ONLINE = 0,
|
29 | |
30 |
|
31 |
|
32 | OFFLINE = 1
|
33 | }
|
34 | export declare class ConnectionStatusOptions {
|
35 | static DEFAULT: ConnectionStatusOptions;
|
36 | |
37 |
|
38 |
|
39 | readonly offlineTimeout: number;
|
40 | }
|
41 | export declare const PingService: unique symbol;
|
42 | export interface PingService {
|
43 | ping(): Promise<void>;
|
44 | }
|
45 | export declare abstract class AbstractConnectionStatusService implements ConnectionStatusService, Disposable {
|
46 | protected readonly options: ConnectionStatusOptions;
|
47 | protected readonly statusChangeEmitter: Emitter<ConnectionStatus>;
|
48 | protected connectionStatus: ConnectionStatus;
|
49 | protected logger: ILogger;
|
50 | constructor(options?: ConnectionStatusOptions);
|
51 | get onStatusChange(): Event<ConnectionStatus>;
|
52 | get currentStatus(): ConnectionStatus;
|
53 | dispose(): void;
|
54 | protected updateStatus(success: boolean): void;
|
55 | protected fireStatusChange(status: ConnectionStatus): void;
|
56 | }
|
57 | export declare class FrontendConnectionStatusService extends AbstractConnectionStatusService {
|
58 | private scheduledPing;
|
59 | protected readonly wsConnectionProvider: WebSocketConnectionProvider;
|
60 | protected readonly pingService: PingService;
|
61 | protected init(): void;
|
62 | protected schedulePing(): void;
|
63 | protected performPingRequest(): Promise<void>;
|
64 | protected setTimeout(handler: (...args: any[]) => void, timeout: number): number;
|
65 | protected clearTimeout(handle?: number): void;
|
66 | }
|
67 | export declare class ApplicationConnectionStatusContribution extends DefaultFrontendApplicationContribution {
|
68 | protected readonly connectionStatusService: ConnectionStatusService;
|
69 | protected readonly statusBar: StatusBar;
|
70 | protected readonly logger: ILogger;
|
71 | protected readonly toDisposeOnOnline: DisposableCollection;
|
72 | constructor(connectionStatusService: ConnectionStatusService, statusBar: StatusBar, logger: ILogger);
|
73 | protected onStateChange(state: ConnectionStatus): void;
|
74 | private statusbarId;
|
75 | protected handleOnline(): void;
|
76 | protected handleOffline(): void;
|
77 | }
|
78 | //# sourceMappingURL=connection-status-service.d.ts.map |
\ | No newline at end of file |