UNPKG

1.34 kBTypeScriptView Raw
1import URI from '../common/uri';
2/**
3 * An endpoint provides URLs for http and ws, based on configuration and defaults.
4 */
5export declare class Endpoint {
6 protected readonly options: Endpoint.Options;
7 protected readonly location: Endpoint.Location;
8 static readonly PROTO_HTTPS: string;
9 static readonly PROTO_HTTP: string;
10 static readonly PROTO_WS: string;
11 static readonly PROTO_WSS: string;
12 static readonly PROTO_FILE: string;
13 constructor(options?: Endpoint.Options, location?: Endpoint.Location);
14 getWebSocketUrl(): URI;
15 getRestUrl(): URI;
16 protected get pathname(): string;
17 get host(): string;
18 get origin(): string;
19 protected get port(): string;
20 protected getSearchParam(name: string, defaultValue: string): string;
21 protected get wsScheme(): string;
22 /**
23 * The HTTP/HTTPS scheme of the endpoint, or the user defined one.
24 * See: `Endpoint.Options.httpScheme`.
25 */
26 get httpScheme(): string;
27 protected get path(): string;
28}
29export declare namespace Endpoint {
30 class Options {
31 host?: string;
32 wsScheme?: string;
33 httpScheme?: string;
34 path?: string;
35 }
36 class Location {
37 host: string;
38 pathname: string;
39 search: string;
40 protocol: string;
41 }
42}
43//# sourceMappingURL=endpoint.d.ts.map
\No newline at end of file