UNPKG

1.72 kBTypeScriptView Raw
1/** @module services */
2/**
3 * Helper class that retrieves parameters from HTTP requests.
4 */
5export declare class HttpRequestDetector {
6 /**
7 * Detects the platform (using "user-agent") from which the given HTTP request was made.
8 *
9 * @param req an HTTP request to process.
10 * @returns the detected platform and version. Detectable platforms: "mobile", "iphone",
11 * "ipad", "macosx", "android", "webos", "mac", "windows". Otherwise - "unknown" will
12 * be returned.
13 */
14 static detectPlatform(req: any): string;
15 /**
16 * Detects the browser (using "user-agent") from which the given HTTP request was made.
17 *
18 * @param req an HTTP request to process.
19 * @returns the detected browser. Detectable browsers: "chrome", "msie", "firefox",
20 * "safari". Otherwise - "unknown" will be returned.
21 */
22 static detectBrowser(req: any): string;
23 /**
24 * Detects the IP address from which the given HTTP request was received.
25 *
26 * @param req an HTTP request to process.
27 * @returns the detected IP address (without a port). If no IP is detected -
28 * <code>null</code> will be returned.
29 */
30 static detectAddress(req: any): string;
31 /**
32 * Detects the host name of the request's destination server.
33 *
34 * @param req an HTTP request to process.
35 * @returns the destination server's host name.
36 */
37 static detectServerHost(req: any): string;
38 /**
39 * Detects the request's destination port number.
40 *
41 * @param req an HTTP request to process.
42 * @returns the detected port number or <code>80</code> (if none are detected).
43 */
44 static detectServerPort(req: any): any;
45}