UNPKG

825 BTypeScriptView Raw
1/**
2 * We encode using encodeURIComponent but we want to
3 * preserver certain characters which are commonly used
4 * (sub delimiters and ':')
5 *
6 * https://www.ietf.org/rfc/rfc3986.txt
7 *
8 * reserved = gen-delims / sub-delims
9 *
10 * gen-delims = ":" / "/" / "?" / "#" / "[" / "]" / "@"
11 *
12 * sub-delims = "!" / "$" / "&" / "'" / "(" / ")"
13 / "*" / "+" / "," / ";" / "="
14 */
15export declare type URLParamsEncodingType = 'default' | 'uri' | 'uriComponent' | 'none' | 'legacy';
16export declare const encodeURIComponentExcludingSubDelims: (segment: string) => string;
17export declare const encodeParam: (param: string | number | boolean, encoding: URLParamsEncodingType, isSpatParam: boolean) => string;
18export declare const decodeParam: (param: string, encoding: URLParamsEncodingType) => string;