@angular-wave/angular.ts 0.0.20 → 0.0.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (128) hide show
  1. package/Makefile +1 -1
  2. package/README.md +3 -3
  3. package/TODO.md +14 -0
  4. package/dist/angular-ts.esm.js +1 -1
  5. package/dist/angular-ts.umd.js +1 -1
  6. package/index.html +2 -1
  7. package/package.json +1 -1
  8. package/src/animations/animate-css-driver.js +2 -2
  9. package/src/animations/animate-css.js +15 -6
  10. package/src/animations/animate-js.js +1 -1
  11. package/src/animations/animate-queue.js +1 -1
  12. package/src/animations/shared.js +0 -14
  13. package/src/core/compile.js +6 -3
  14. package/src/core/q.js +9 -9
  15. package/src/core/sanitize-uri.js +1 -1
  16. package/src/core/sce.js +1 -1
  17. package/src/directive/if.js +0 -79
  18. package/src/directive/if.md +80 -0
  19. package/src/directive/include.js +0 -82
  20. package/src/directive/include.md +86 -0
  21. package/src/directive/repeat.js +0 -1
  22. package/src/loader.js +0 -1
  23. package/src/public.js +0 -2
  24. package/src/router/common/trace.js +1 -1
  25. package/src/router/directives/stateDirectives.js +16 -14
  26. package/src/router/directives/viewDirective.js +2 -2
  27. package/src/router/hooks/resolve.js +3 -4
  28. package/src/router/hooks/views.js +3 -2
  29. package/src/router/state/stateService.js +1 -2
  30. package/src/router/transition/interface.js +14 -14
  31. package/src/router/transition/rejectFactory.js +29 -20
  32. package/src/router/transition/transitionHook.js +5 -5
  33. package/src/router/url/urlMatcher.js +1 -2
  34. package/src/router/url/urlRule.js +1 -1
  35. package/src/router/url/urlRules.js +1 -1
  36. package/src/shared/common.js +0 -1
  37. package/test/module-test.html +44 -12
  38. package/test/router/services.spec.js +71 -0
  39. package/test/router/state-directives.spec.js +1208 -0
  40. package/types/angular.d.ts +132 -124
  41. package/types/index.d.ts +2350 -2187
  42. package/types/jqlite.d.ts +463 -418
  43. package/types/router/core/common/common.d.ts +70 -24
  44. package/types/router/core/common/coreservices.d.ts +30 -32
  45. package/types/router/core/common/glob.d.ts +9 -9
  46. package/types/router/core/common/hof.d.ts +12 -4
  47. package/types/router/core/common/index.d.ts +8 -8
  48. package/types/router/core/common/predicates.d.ts +1 -1
  49. package/types/router/core/common/queue.d.ts +13 -13
  50. package/types/router/core/common/safeConsole.d.ts +3 -3
  51. package/types/router/core/common/strings.d.ts +4 -2
  52. package/types/router/core/common/trace.d.ts +94 -82
  53. package/types/router/core/globals.d.ts +37 -37
  54. package/types/router/core/hooks/coreResolvables.d.ts +5 -3
  55. package/types/router/core/hooks/ignoredTransition.d.ts +4 -2
  56. package/types/router/core/hooks/invalidTransition.d.ts +4 -2
  57. package/types/router/core/hooks/lazyLoad.d.ts +10 -5
  58. package/types/router/core/hooks/onEnterExitRetain.d.ts +10 -4
  59. package/types/router/core/hooks/redirectTo.d.ts +4 -2
  60. package/types/router/core/hooks/resolve.d.ts +10 -4
  61. package/types/router/core/hooks/updateGlobals.d.ts +4 -2
  62. package/types/router/core/hooks/url.d.ts +4 -2
  63. package/types/router/core/hooks/views.d.ts +7 -3
  64. package/types/router/core/index.d.ts +11 -12
  65. package/types/router/core/interface.d.ts +83 -81
  66. package/types/router/core/params/index.d.ts +5 -5
  67. package/types/router/core/params/interface.d.ts +439 -439
  68. package/types/router/core/params/param.d.ts +72 -60
  69. package/types/router/core/params/paramType.d.ts +40 -40
  70. package/types/router/core/params/paramTypes.d.ts +169 -165
  71. package/types/router/core/params/stateParams.d.ts +13 -13
  72. package/types/router/core/path/index.d.ts +2 -2
  73. package/types/router/core/path/pathNode.d.ts +49 -49
  74. package/types/router/core/path/pathUtils.d.ts +100 -74
  75. package/types/router/core/resolve/index.d.ts +3 -3
  76. package/types/router/core/resolve/interface.d.ts +137 -137
  77. package/types/router/core/resolve/resolvable.d.ts +60 -54
  78. package/types/router/core/resolve/resolveContext.d.ts +84 -79
  79. package/types/router/core/router.d.ts +95 -86
  80. package/types/router/core/state/index.d.ts +8 -8
  81. package/types/router/core/state/interface.d.ts +667 -643
  82. package/types/router/core/state/stateBuilder.d.ts +41 -38
  83. package/types/router/core/state/stateMatcher.d.ts +11 -9
  84. package/types/router/core/state/stateObject.d.ts +154 -139
  85. package/types/router/core/state/stateQueueManager.d.ts +26 -21
  86. package/types/router/core/state/stateRegistry.d.ts +124 -121
  87. package/types/router/core/state/stateService.d.ts +380 -343
  88. package/types/router/core/state/targetState.d.ts +74 -69
  89. package/types/router/core/transition/hookBuilder.d.ts +34 -30
  90. package/types/router/core/transition/hookRegistry.d.ts +96 -74
  91. package/types/router/core/transition/index.d.ts +8 -8
  92. package/types/router/core/transition/interface.d.ts +652 -609
  93. package/types/router/core/transition/rejectFactory.d.ts +97 -97
  94. package/types/router/core/transition/transition.d.ts +565 -517
  95. package/types/router/core/transition/transitionEventType.d.ts +20 -11
  96. package/types/router/core/transition/transitionHook.d.ts +90 -82
  97. package/types/router/core/transition/transitionService.d.ts +228 -161
  98. package/types/router/core/url/index.d.ts +8 -8
  99. package/types/router/core/url/interface.d.ts +100 -87
  100. package/types/router/core/url/urlConfig.d.ts +130 -126
  101. package/types/router/core/url/urlMatcher.d.ts +132 -127
  102. package/types/router/core/url/urlMatcherFactory.d.ts +46 -42
  103. package/types/router/core/url/urlRouter.d.ts +91 -75
  104. package/types/router/core/url/urlRule.d.ts +123 -100
  105. package/types/router/core/url/urlRules.d.ts +240 -232
  106. package/types/router/core/url/urlService.d.ts +201 -201
  107. package/types/router/core/view/index.d.ts +2 -2
  108. package/types/router/core/view/interface.d.ts +26 -26
  109. package/types/router/core/view/view.d.ts +152 -143
  110. package/types/router/directives/viewDirective.d.ts +12 -11
  111. package/types/router/index.d.ts +11 -12
  112. package/types/router/interface.d.ts +361 -351
  113. package/types/router/legacy/resolveService.d.ts +44 -40
  114. package/types/router/legacy/stateEvents.d.ts +1 -1
  115. package/types/router/locationServices.d.ts +45 -37
  116. package/types/router/services.d.ts +9 -9
  117. package/types/router/stateFilters.d.ts +3 -3
  118. package/types/router/stateProvider.d.ts +240 -235
  119. package/types/router/statebuilders/onEnterExitRetain.d.ts +4 -2
  120. package/types/router/statebuilders/views.d.ts +35 -22
  121. package/types/router/templateFactory.d.ts +99 -79
  122. package/types/router/viewScroll.d.ts +7 -7
  123. package/src/directive/a.js +0 -37
  124. package/test/directive/a.spec.js +0 -192
  125. package/types/router/angular.d.ts +0 -1
  126. package/types/router/core/vanilla.d.ts +0 -1
  127. package/types/router/directives/stateDirectives.d.ts +0 -3
  128. package/types/router/injectables.d.ts +0 -1
@@ -1,65 +1,77 @@
1
- import { RawParams } from '../params/interface';
2
- import { ParamType } from './paramType';
3
- import { StateDeclaration } from '../state';
4
- import { UrlConfig } from '../url';
1
+ import { RawParams } from "../params/interface";
2
+ import { ParamType } from "./paramType";
3
+ import { StateDeclaration } from "../state";
4
+ import { UrlConfig } from "../url";
5
5
  declare enum DefType {
6
- PATH = 0,
7
- SEARCH = 1,
8
- CONFIG = 2
6
+ PATH = 0,
7
+ SEARCH = 1,
8
+ CONFIG = 2,
9
9
  }
10
10
  export { DefType };
11
11
  export declare class Param {
12
- id: string;
13
- type: ParamType;
14
- location: DefType;
15
- isOptional: boolean;
16
- dynamic: boolean;
17
- raw: boolean;
18
- squash: boolean | string;
19
- replace: [{
20
- to: any;
21
- from: any;
22
- }];
23
- inherit: boolean;
24
- array: boolean;
25
- config: any;
26
- /** Cache the default value if it is a static value */
27
- _defaultValueCache: {
28
- defaultValue: any;
29
- };
30
- static values(params: Param[], values?: RawParams): RawParams;
31
- /**
32
- * Finds [[Param]] objects which have different param values
33
- *
34
- * Filters a list of [[Param]] objects to only those whose parameter values differ in two param value objects
35
- *
36
- * @param params: The list of Param objects to filter
37
- * @param values1: The first set of parameter values
38
- * @param values2: the second set of parameter values
39
- *
40
- * @returns any Param objects whose values were different between values1 and values2
41
- */
42
- static changed(params: Param[], values1?: RawParams, values2?: RawParams): Param[];
43
- /**
44
- * Checks if two param value objects are equal (for a set of [[Param]] objects)
45
- *
46
- * @param params The list of [[Param]] objects to check
47
- * @param values1 The first set of param values
48
- * @param values2 The second set of param values
49
- *
50
- * @returns true if the param values in values1 and values2 are equal
51
- */
52
- static equals(params: Param[], values1?: {}, values2?: {}): boolean;
53
- /** Returns true if a the parameter values are valid, according to the Param definitions */
54
- static validates(params: Param[], values?: RawParams): boolean;
55
- constructor(id: string, type: ParamType, location: DefType, urlConfig: UrlConfig, state: StateDeclaration);
56
- isDefaultValue(value: any): boolean;
57
- /**
58
- * [Internal] Gets the decoded representation of a value if the value is defined, otherwise, returns the
59
- * default value, which may be the result of an injectable function.
60
- */
61
- value(value?: any): any;
62
- isSearch(): boolean;
63
- validates(value: any): boolean;
64
- toString(): string;
12
+ id: string;
13
+ type: ParamType;
14
+ location: DefType;
15
+ isOptional: boolean;
16
+ dynamic: boolean;
17
+ raw: boolean;
18
+ squash: boolean | string;
19
+ replace: [
20
+ {
21
+ to: any;
22
+ from: any;
23
+ },
24
+ ];
25
+ inherit: boolean;
26
+ array: boolean;
27
+ config: any;
28
+ /** Cache the default value if it is a static value */
29
+ _defaultValueCache: {
30
+ defaultValue: any;
31
+ };
32
+ static values(params: Param[], values?: RawParams): RawParams;
33
+ /**
34
+ * Finds [[Param]] objects which have different param values
35
+ *
36
+ * Filters a list of [[Param]] objects to only those whose parameter values differ in two param value objects
37
+ *
38
+ * @param params: The list of Param objects to filter
39
+ * @param values1: The first set of parameter values
40
+ * @param values2: the second set of parameter values
41
+ *
42
+ * @returns any Param objects whose values were different between values1 and values2
43
+ */
44
+ static changed(
45
+ params: Param[],
46
+ values1?: RawParams,
47
+ values2?: RawParams,
48
+ ): Param[];
49
+ /**
50
+ * Checks if two param value objects are equal (for a set of [[Param]] objects)
51
+ *
52
+ * @param params The list of [[Param]] objects to check
53
+ * @param values1 The first set of param values
54
+ * @param values2 The second set of param values
55
+ *
56
+ * @returns true if the param values in values1 and values2 are equal
57
+ */
58
+ static equals(params: Param[], values1?: {}, values2?: {}): boolean;
59
+ /** Returns true if a the parameter values are valid, according to the Param definitions */
60
+ static validates(params: Param[], values?: RawParams): boolean;
61
+ constructor(
62
+ id: string,
63
+ type: ParamType,
64
+ location: DefType,
65
+ urlConfig: UrlConfig,
66
+ state: StateDeclaration,
67
+ );
68
+ isDefaultValue(value: any): boolean;
69
+ /**
70
+ * [Internal] Gets the decoded representation of a value if the value is defined, otherwise, returns the
71
+ * default value, which may be the result of an injectable function.
72
+ */
73
+ value(value?: any): any;
74
+ isSearch(): boolean;
75
+ validates(value: any): boolean;
76
+ toString(): string;
65
77
  }
@@ -1,4 +1,4 @@
1
- import { ParamTypeDefinition } from './interface';
1
+ import { ParamTypeDefinition } from "./interface";
2
2
  /**
3
3
  * An internal class which implements [[ParamTypeDefinition]].
4
4
  *
@@ -23,43 +23,43 @@ import { ParamTypeDefinition } from './interface';
23
23
  * ```
24
24
  */
25
25
  export declare class ParamType implements ParamTypeDefinition {
26
- /** @inheritdoc */
27
- pattern: RegExp;
28
- /** The name/id of the parameter type */
29
- name: string;
30
- /** @inheritdoc */
31
- raw: boolean;
32
- /** @inheritdoc */
33
- dynamic: boolean;
34
- /** @inheritdoc */
35
- inherit: boolean;
36
- /**
37
- * @param def A configuration object which contains the custom type definition. The object's
38
- * properties will override the default methods and/or pattern in `ParamType`'s public interface.
39
- * @returns a new ParamType object
40
- */
41
- constructor(def: ParamTypeDefinition);
42
- /** @inheritdoc */
43
- is(val: any, key?: string): boolean;
44
- /** @inheritdoc */
45
- encode(val: any, key?: string): string | string[];
46
- /** @inheritdoc */
47
- decode(val: string, key?: string): any;
48
- /** @inheritdoc */
49
- equals(a: any, b: any): boolean;
50
- $subPattern(): string;
51
- toString(): string;
52
- /** Given an encoded string, or a decoded object, returns a decoded object */
53
- $normalize(val: any): any;
54
- /**
55
- * Wraps an existing custom ParamType as an array of ParamType, depending on 'mode'.
56
- * e.g.:
57
- * - urlmatcher pattern "/path?{queryParam[]:int}"
58
- * - url: "/path?queryParam=1&queryParam=2
59
- * - $stateParams.queryParam will be [1, 2]
60
- * if `mode` is "auto", then
61
- * - url: "/path?queryParam=1 will create $stateParams.queryParam: 1
62
- * - url: "/path?queryParam=1&queryParam=2 will create $stateParams.queryParam: [1, 2]
63
- */
64
- $asArray(mode: boolean | 'auto', isSearch: boolean): any;
26
+ /** @inheritdoc */
27
+ pattern: RegExp;
28
+ /** The name/id of the parameter type */
29
+ name: string;
30
+ /** @inheritdoc */
31
+ raw: boolean;
32
+ /** @inheritdoc */
33
+ dynamic: boolean;
34
+ /** @inheritdoc */
35
+ inherit: boolean;
36
+ /**
37
+ * @param def A configuration object which contains the custom type definition. The object's
38
+ * properties will override the default methods and/or pattern in `ParamType`'s public interface.
39
+ * @returns a new ParamType object
40
+ */
41
+ constructor(def: ParamTypeDefinition);
42
+ /** @inheritdoc */
43
+ is(val: any, key?: string): boolean;
44
+ /** @inheritdoc */
45
+ encode(val: any, key?: string): string | string[];
46
+ /** @inheritdoc */
47
+ decode(val: string, key?: string): any;
48
+ /** @inheritdoc */
49
+ equals(a: any, b: any): boolean;
50
+ $subPattern(): string;
51
+ toString(): string;
52
+ /** Given an encoded string, or a decoded object, returns a decoded object */
53
+ $normalize(val: any): any;
54
+ /**
55
+ * Wraps an existing custom ParamType as an array of ParamType, depending on 'mode'.
56
+ * e.g.:
57
+ * - urlmatcher pattern "/path?{queryParam[]:int}"
58
+ * - url: "/path?queryParam=1&queryParam=2
59
+ * - $stateParams.queryParam will be [1, 2]
60
+ * if `mode` is "auto", then
61
+ * - url: "/path?queryParam=1 will create $stateParams.queryParam: 1
62
+ * - url: "/path?queryParam=1&queryParam=2 will create $stateParams.queryParam: [1, 2]
63
+ */
64
+ $asArray(mode: boolean | "auto", isSearch: boolean): any;
65
65
  }
@@ -1,4 +1,4 @@
1
- import { ParamTypeDefinition } from './interface';
1
+ import { ParamTypeDefinition } from "./interface";
2
2
  /**
3
3
  * A registry for parameter types.
4
4
  *
@@ -23,168 +23,172 @@ import { ParamTypeDefinition } from './interface';
23
23
  * ```
24
24
  */
25
25
  export declare class ParamTypes {
26
- /**
27
- * Built-in parameter type: `string`
28
- *
29
- * This parameter type coerces values to strings.
30
- * It matches anything (`new RegExp(".*")`) in the URL
31
- */
32
- static string: ParamTypeDefinition;
33
- /**
34
- * Built-in parameter type: `path`
35
- *
36
- * This parameter type is the default type for path parameters.
37
- * A path parameter is any parameter declared in the path portion of a url
38
- *
39
- * - `/foo/:param1/:param2`: two path parameters
40
- *
41
- * This parameter type behaves exactly like the [[string]] type with one exception.
42
- * When matching parameter values in the URL, the `path` type does not match forward slashes `/`.
43
- *
44
- * #### Angular 1 note:
45
- * In ng1, this type is overridden with one that pre-encodes slashes as `~2F` instead of `%2F`.
46
- * For more details about this angular 1 behavior, see: https://github.com/angular-ui/ui-router/issues/2598
47
- */
48
- static path: ParamTypeDefinition;
49
- /**
50
- * Built-in parameter type: `query`
51
- *
52
- * This parameter type is the default type for query/search parameters.
53
- * It behaves the same as the [[string]] parameter type.
54
- *
55
- * A query parameter is any parameter declared in the query/search portion of a url
56
- *
57
- * - `/bar?param2`: a query parameter
58
- */
59
- static query: ParamTypeDefinition;
60
- /**
61
- * Built-in parameter type: `hash`
62
- *
63
- * This parameter type is used for the `#` parameter (the hash)
64
- * It behaves the same as the [[string]] parameter type.
65
- */
66
- static hash: ParamTypeDefinition;
67
- /**
68
- * Built-in parameter type: `int`
69
- *
70
- * This parameter type serializes javascript integers (`number`s which represent an integer) to the URL.
71
- *
72
- * #### Example:
73
- * ```js
74
- * .state({
75
- * name: 'user',
76
- * url: '/user/{id:int}'
77
- * });
78
- * ```
79
- * ```js
80
- * $state.go('user', { id: 1298547 });
81
- * ```
82
- *
83
- * The URL will serialize to: `/user/1298547`.
84
- *
85
- * When the parameter value is read, it will be the `number` `1298547`, not the string `"1298547"`.
86
- */
87
- static int: ParamTypeDefinition;
88
- /**
89
- * Built-in parameter type: `bool`
90
- *
91
- * This parameter type serializes `true`/`false` as `1`/`0`
92
- *
93
- * #### Example:
94
- * ```js
95
- * .state({
96
- * name: 'inbox',
97
- * url: '/inbox?{unread:bool}'
98
- * });
99
- * ```
100
- * ```js
101
- * $state.go('inbox', { unread: true });
102
- * ```
103
- *
104
- * The URL will serialize to: `/inbox?unread=1`.
105
- *
106
- * Conversely, if the url is `/inbox?unread=0`, the value of the `unread` parameter will be a `false`.
107
- */
108
- static bool: ParamTypeDefinition;
109
- /**
110
- * Built-in parameter type: `date`
111
- *
112
- * This parameter type can be used to serialize Javascript dates as parameter values.
113
- *
114
- * #### Example:
115
- * ```js
116
- * .state({
117
- * name: 'search',
118
- * url: '/search?{start:date}'
119
- * });
120
- * ```
121
- * ```js
122
- * $state.go('search', { start: new Date(2000, 0, 1) });
123
- * ```
124
- *
125
- * The URL will serialize to: `/search?start=2000-01-01`.
126
- *
127
- * Conversely, if the url is `/search?start=2016-12-25`, the value of the `start` parameter will be a `Date` object where:
128
- *
129
- * - `date.getFullYear() === 2016`
130
- * - `date.getMonth() === 11` (month is 0-based)
131
- * - `date.getDate() === 25`
132
- */
133
- static date: ParamTypeDefinition;
134
- /**
135
- * Built-in parameter type: `json`
136
- *
137
- * This parameter type can be used to serialize javascript objects into the URL using JSON serialization.
138
- *
139
- * #### Example:
140
- * This example serializes an plain javascript object to the URL
141
- * ```js
142
- * .state({
143
- * name: 'map',
144
- * url: '/map/{coords:json}'
145
- * });
146
- * ```
147
- * ```js
148
- * $state.go('map', { coords: { x: 10399.2, y: 49071 });
149
- * ```
150
- *
151
- * The URL will serialize to: `/map/%7B%22x%22%3A10399.2%2C%22y%22%3A49071%7D`
152
- */
153
- static json: ParamTypeDefinition;
154
- /**
155
- * Built-in parameter type: `any`
156
- *
157
- * This parameter type is used by default for url-less parameters (parameters that do not appear in the URL).
158
- * This type does not encode or decode.
159
- * It is compared using a deep `equals` comparison.
160
- *
161
- * #### Example:
162
- * This example defines a non-url parameter on a [[StateDeclaration]].
163
- * ```js
164
- * .state({
165
- * name: 'new',
166
- * url: '/new',
167
- * params: {
168
- * inrepyto: null
169
- * }
170
- * });
171
- * ```
172
- * ```js
173
- * $state.go('new', { inreplyto: currentMessage });
174
- * ```
175
- */
176
- static any: ParamTypeDefinition;
177
- types: any;
178
- enqueue: boolean;
179
- typeQueue: any[];
180
- private defaultTypes;
181
- constructor();
182
- dispose(): void;
183
- /**
184
- * Registers a parameter type
185
- *
186
- * End users should call [[UrlMatcherFactory.type]], which delegates to this method.
187
- */
188
- type(name: string, definition?: ParamTypeDefinition, definitionFn?: () => ParamTypeDefinition): any;
189
- _flushTypeQueue(): void;
26
+ /**
27
+ * Built-in parameter type: `string`
28
+ *
29
+ * This parameter type coerces values to strings.
30
+ * It matches anything (`new RegExp(".*")`) in the URL
31
+ */
32
+ static string: ParamTypeDefinition;
33
+ /**
34
+ * Built-in parameter type: `path`
35
+ *
36
+ * This parameter type is the default type for path parameters.
37
+ * A path parameter is any parameter declared in the path portion of a url
38
+ *
39
+ * - `/foo/:param1/:param2`: two path parameters
40
+ *
41
+ * This parameter type behaves exactly like the [[string]] type with one exception.
42
+ * When matching parameter values in the URL, the `path` type does not match forward slashes `/`.
43
+ *
44
+ * #### Angular 1 note:
45
+ * In ng1, this type is overridden with one that pre-encodes slashes as `~2F` instead of `%2F`.
46
+ * For more details about this angular 1 behavior, see: https://github.com/angular-ui/ui-router/issues/2598
47
+ */
48
+ static path: ParamTypeDefinition;
49
+ /**
50
+ * Built-in parameter type: `query`
51
+ *
52
+ * This parameter type is the default type for query/search parameters.
53
+ * It behaves the same as the [[string]] parameter type.
54
+ *
55
+ * A query parameter is any parameter declared in the query/search portion of a url
56
+ *
57
+ * - `/bar?param2`: a query parameter
58
+ */
59
+ static query: ParamTypeDefinition;
60
+ /**
61
+ * Built-in parameter type: `hash`
62
+ *
63
+ * This parameter type is used for the `#` parameter (the hash)
64
+ * It behaves the same as the [[string]] parameter type.
65
+ */
66
+ static hash: ParamTypeDefinition;
67
+ /**
68
+ * Built-in parameter type: `int`
69
+ *
70
+ * This parameter type serializes javascript integers (`number`s which represent an integer) to the URL.
71
+ *
72
+ * #### Example:
73
+ * ```js
74
+ * .state({
75
+ * name: 'user',
76
+ * url: '/user/{id:int}'
77
+ * });
78
+ * ```
79
+ * ```js
80
+ * $state.go('user', { id: 1298547 });
81
+ * ```
82
+ *
83
+ * The URL will serialize to: `/user/1298547`.
84
+ *
85
+ * When the parameter value is read, it will be the `number` `1298547`, not the string `"1298547"`.
86
+ */
87
+ static int: ParamTypeDefinition;
88
+ /**
89
+ * Built-in parameter type: `bool`
90
+ *
91
+ * This parameter type serializes `true`/`false` as `1`/`0`
92
+ *
93
+ * #### Example:
94
+ * ```js
95
+ * .state({
96
+ * name: 'inbox',
97
+ * url: '/inbox?{unread:bool}'
98
+ * });
99
+ * ```
100
+ * ```js
101
+ * $state.go('inbox', { unread: true });
102
+ * ```
103
+ *
104
+ * The URL will serialize to: `/inbox?unread=1`.
105
+ *
106
+ * Conversely, if the url is `/inbox?unread=0`, the value of the `unread` parameter will be a `false`.
107
+ */
108
+ static bool: ParamTypeDefinition;
109
+ /**
110
+ * Built-in parameter type: `date`
111
+ *
112
+ * This parameter type can be used to serialize Javascript dates as parameter values.
113
+ *
114
+ * #### Example:
115
+ * ```js
116
+ * .state({
117
+ * name: 'search',
118
+ * url: '/search?{start:date}'
119
+ * });
120
+ * ```
121
+ * ```js
122
+ * $state.go('search', { start: new Date(2000, 0, 1) });
123
+ * ```
124
+ *
125
+ * The URL will serialize to: `/search?start=2000-01-01`.
126
+ *
127
+ * Conversely, if the url is `/search?start=2016-12-25`, the value of the `start` parameter will be a `Date` object where:
128
+ *
129
+ * - `date.getFullYear() === 2016`
130
+ * - `date.getMonth() === 11` (month is 0-based)
131
+ * - `date.getDate() === 25`
132
+ */
133
+ static date: ParamTypeDefinition;
134
+ /**
135
+ * Built-in parameter type: `json`
136
+ *
137
+ * This parameter type can be used to serialize javascript objects into the URL using JSON serialization.
138
+ *
139
+ * #### Example:
140
+ * This example serializes an plain javascript object to the URL
141
+ * ```js
142
+ * .state({
143
+ * name: 'map',
144
+ * url: '/map/{coords:json}'
145
+ * });
146
+ * ```
147
+ * ```js
148
+ * $state.go('map', { coords: { x: 10399.2, y: 49071 });
149
+ * ```
150
+ *
151
+ * The URL will serialize to: `/map/%7B%22x%22%3A10399.2%2C%22y%22%3A49071%7D`
152
+ */
153
+ static json: ParamTypeDefinition;
154
+ /**
155
+ * Built-in parameter type: `any`
156
+ *
157
+ * This parameter type is used by default for url-less parameters (parameters that do not appear in the URL).
158
+ * This type does not encode or decode.
159
+ * It is compared using a deep `equals` comparison.
160
+ *
161
+ * #### Example:
162
+ * This example defines a non-url parameter on a [[StateDeclaration]].
163
+ * ```js
164
+ * .state({
165
+ * name: 'new',
166
+ * url: '/new',
167
+ * params: {
168
+ * inrepyto: null
169
+ * }
170
+ * });
171
+ * ```
172
+ * ```js
173
+ * $state.go('new', { inreplyto: currentMessage });
174
+ * ```
175
+ */
176
+ static any: ParamTypeDefinition;
177
+ types: any;
178
+ enqueue: boolean;
179
+ typeQueue: any[];
180
+ private defaultTypes;
181
+ constructor();
182
+ dispose(): void;
183
+ /**
184
+ * Registers a parameter type
185
+ *
186
+ * End users should call [[UrlMatcherFactory.type]], which delegates to this method.
187
+ */
188
+ type(
189
+ name: string,
190
+ definition?: ParamTypeDefinition,
191
+ definitionFn?: () => ParamTypeDefinition,
192
+ ): any;
193
+ _flushTypeQueue(): void;
190
194
  }
@@ -1,15 +1,15 @@
1
- import { Obj } from '../common/common';
2
- import { StateObject } from '../state/stateObject';
1
+ import { Obj } from "../common/common";
2
+ import { StateObject } from "../state/stateObject";
3
3
  export declare class StateParams {
4
- [key: string]: any;
5
- constructor(params?: Obj);
6
- /**
7
- * Merges a set of parameters with all parameters inherited between the common parents of the
8
- * current state and a given destination state.
9
- *
10
- * @param {Object} newParams The set of parameters which will be composited with inherited params.
11
- * @param {Object} $current Internal definition of object representing the current state.
12
- * @param {Object} $to Internal definition of object representing state to transition to.
13
- */
14
- $inherit(newParams: Obj, $current: StateObject, $to: StateObject): any;
4
+ [key: string]: any;
5
+ constructor(params?: Obj);
6
+ /**
7
+ * Merges a set of parameters with all parameters inherited between the common parents of the
8
+ * current state and a given destination state.
9
+ *
10
+ * @param {Object} newParams The set of parameters which will be composited with inherited params.
11
+ * @param {Object} $current Internal definition of object representing the current state.
12
+ * @param {Object} $to Internal definition of object representing state to transition to.
13
+ */
14
+ $inherit(newParams: Obj, $current: StateObject, $to: StateObject): any;
15
15
  }
@@ -1,2 +1,2 @@
1
- export * from './pathNode';
2
- export * from './pathUtils';
1
+ export * from "./pathNode";
2
+ export * from "./pathUtils";