UNPKG

1.09 kBTypeScriptView Raw
1import { Models } from './models';
2/** check if string is a valid pattern */
3export declare function isValid(pattern: string): boolean;
4export declare function check(url: string, pattern: string): boolean;
5export declare function getModels(pattern: string): string[];
6export declare function getRestPramsNames(pattern: string): string[];
7export declare function containsModels(url: string, models: string[]): boolean;
8export declare function stars(n: number): string;
9export declare function getRestParams(url: string, pattern: string): Object;
10export declare const regexisPath: RegExp;
11export declare function interpolateParamsToUrl(params: Object, url: string): string;
12/**
13 * Get query params from url, like 'ex' in /api/books?ex=value
14*/
15export declare function decodeUrl(url: string): Object;
16/**
17 * Create query params string for url
18 *
19 * @export
20 * @param {UrlParams[]} params
21 * @returns {string}
22 */
23export declare function getParamsUrl(params: Models.UrlParams[], doNotSerialize?: boolean): string;
24export declare function prepareUrlOldWay(params?: TemplateStringsArray): string;