export = Parser; /** * @exports Parser * @class Parser * @classdesc * Holds all utility functions to parse both * websocket and http parameters. */ declare class Parser { /** * Parses the parameters from a http request. * For POST and PUT requests the body is read first and * then decoded using the querystring method. * Parameters for all other requests should be contained * in the query itself by way of querystring parameters * and as such are decoded directly via the same method. * @param {HttpRequest} request - the http request * @param {string} url - the query-string containing url * @returns the entailed parameters. */ static parseFullHttpParams(request: HttpRequest, url: string): Promise; /** * Parses the full parameters from a websocket request. * (Websocket parameters are mostly handled by the JSON format), * This method currently just makes sure empty-param-requests * are handled correctly. It can be extended in the future. * @param {WebsocketRequest} request - the websocket request * @returns the entailed parameters. */ static parseFullWsParams(request: WebsocketRequest): Promise; /** * Parse parameters from a json format. * * Example: '{"name": "trudy", "age": 5, "born": true}' * will translate into: * { * name: 'trudy', * age: 5, * born: true * } * @param {string} string - the json string * @param {function} reject - The rejector function called when parsing goes wrong. * @returns the entailed parameters. */ static parseJSONStringParams(string: string, reject: Function): any; /** * Parse parameters from a querystring format. * * Example: '?name=trudy&age=5&born=true' * will translate into: * { * name: 'trudy', * age: 5, * born: true * } * @param {string} string - the querystring * @returns the entailed parameters. */ static parseQueryStringParams(string: string): any; }