UNPKG

622 BTypeScriptView Raw
1import { MsPattern } from '../interfaces';
2/**
3 * Transforms the Pattern to Route.
4 * 1. If Pattern is a `string`, it will be returned as it is.
5 * 2. If Pattern is a `number`, it will be converted to `string`.
6 * 3. If Pattern is a `JSON` object, it will be transformed to Route. For that end,
7 * the function will sort properties of `JSON` Object and creates `route` string
8 * according to the following template:
9 * <key1>:<value1>/<key2>:<value2>/.../<keyN>:<valueN>
10 *
11 * @param {MsPattern} pattern - client pattern
12 * @returns string
13 */
14export declare function transformPatternToRoute(pattern: MsPattern): string;