1 | import { UrlMatcher } from './urlMatcher';
|
2 | import { RawParams } from '../params';
|
3 | import { UIRouter } from '../router';
|
4 | import { UrlRuleFactory } from './urlRule';
|
5 | import { MatchResult, UrlParts, UrlRule, UrlRuleHandlerFn } from './interface';
|
6 | import { TargetState, TargetStateDef } from '../state';
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 | export declare class UrlRouter {
|
16 | private router;
|
17 |
|
18 | urlRuleFactory: UrlRuleFactory;
|
19 | private location;
|
20 |
|
21 | constructor( router: UIRouter);
|
22 | /** Internal API. */
|
23 | update(read?: boolean): void;
|
24 | /**
|
25 | * Internal API.
|
26 | *
|
27 | * Pushes a new location to the browser history.
|
28 | *
|
29 | * @internal
|
30 | * @param urlMatcher
|
31 | * @param params
|
32 | * @param options
|
33 | */
|
34 | push(urlMatcher: UrlMatcher, params?: RawParams, options?: {
|
35 | replace?: string | boolean;
|
36 | }): void;
|
37 | /**
|
38 | * Builds and returns a URL with interpolated parameters
|
39 | *
|
40 | * #### Example:
|
41 | * ```js
|
42 | * matcher = $umf.compile("/about/:person");
|
43 | * params = { person: "bob" };
|
44 | * $bob = $urlRouter.href(matcher, params);
|
45 | *
|
46 | * ```
|
47 | *
|
48 | * @param urlMatcher The [[UrlMatcher]] object which is used as the template of the URL to generate.
|
49 | * @param params An object of parameter values to fill the matcher's required parameters.
|
50 | * @param options Options object. The options are:
|
51 | *
|
52 | * - **`absolute`** - {boolean=false}, If true will generate an absolute url, e.g. "http://www.example.com/fullurl".
|
53 | *
|
54 | * @returns Returns the fully compiled URL, or `null` if `params` fail validation against `urlMatcher`
|
55 | */
|
56 | href(urlMatcher: UrlMatcher, params?: any, options?: {
|
57 | absolute: boolean;
|
58 | }): string;
|
59 | /** @deprecated use [[UrlService.sync]]*/
|
60 | sync: (evt?: any) => void;
|
61 | /** @deprecated use [[UrlService.listen]]*/
|
62 | listen: (enabled?: boolean) => Function;
|
63 | /** @deprecated use [[UrlService.deferIntercept]]*/
|
64 | deferIntercept: (defer?: boolean) => void;
|
65 | /** @deprecated use [[UrlService.interceptDeferred]]*/
|
66 | interceptDeferred: boolean;
|
67 | /** @deprecated use [[UrlService.match]]*/
|
68 | match: (urlParts: UrlParts) => MatchResult;
|
69 | /** @deprecated use [[UrlRules.initial]]*/
|
70 | initial: (handler: string | UrlRuleHandlerFn | TargetState | TargetStateDef) => void;
|
71 | /** @deprecated use [[UrlRules.otherwise]]*/
|
72 | otherwise: (handler: string | UrlRuleHandlerFn | TargetState | TargetStateDef) => void;
|
73 | /** @deprecated use [[UrlRules.removeRule]]*/
|
74 | removeRule: (rule: UrlRule) => void;
|
75 | /** @deprecated use [[UrlRules.rule]]*/
|
76 | rule: (rule: UrlRule) => Function;
|
77 | /** @deprecated use [[UrlRules.rules]]*/
|
78 | rules: () => UrlRule[];
|
79 | /** @deprecated use [[UrlRules.sort]]*/
|
80 | sort: (compareFn?: (a: UrlRule, b: UrlRule) => number) => void;
|
81 | /** @deprecated use [[UrlRules.when]]*/
|
82 | when: (matcher: RegExp | UrlMatcher | string, handler: string | UrlRuleHandlerFn, options?: {
|
83 | priority: number;
|
84 | }) => UrlRule;
|
85 | }
|
86 |
|
\ | No newline at end of file |