1
- // Type definitions for Angular JS 1.1.5+ (ui.router module)
2
- // Project: https://github.com/angular-ui/ui-router
3
- // Definitions by: Michel Salib <https://github.com/michelsalib>
4
- // Definitions: https://github.com/borisyankov/DefinitelyTyped
5
-
6
- // Support for AMD require and CommonJS
1
+ // Generated by typings
2
+ // Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/41f31600a1bff1adef3c76642183b20ec97aa81e/angular-ui-router/angular-ui-router.d.ts
7
3
declare module 'angular-ui-router' {
8
4
// Since angular-ui-router adds providers for a bunch of
9
5
// injectable dependencies, it doesn't really return any
@@ -26,14 +22,14 @@ declare module 'angular-ui-router' {
26
22
export type IType = angular . ui . IType ;
27
23
}
28
24
29
- declare module angular . ui {
25
+ declare namespace angular . ui {
30
26
31
27
interface IState {
32
28
name ?: string ;
33
29
/**
34
30
* String HTML content, or function that returns an HTML string
35
31
*/
36
- template ?: any | string | { ( ) : string } ;
32
+ template ?: string | { ( params : IStateParamsService ) : string } ;
37
33
/**
38
34
* String URL path to template file OR Function, returns URL path string
39
35
*/
@@ -98,6 +94,12 @@ declare module angular.ui {
98
94
cache ?: boolean ;
99
95
}
100
96
97
+ interface IUnfoundState {
98
+ to : string ,
99
+ toParams : { } ,
100
+ options : IStateOptions
101
+ }
102
+
101
103
interface IStateProvider extends angular . IServiceProvider {
102
104
state ( name :string , config :IState ) : IStateProvider ;
103
105
state ( config :IState ) : IStateProvider ;
@@ -221,9 +223,9 @@ declare module angular.ui {
221
223
*/
222
224
notify ?: boolean ;
223
225
/**
224
- * {boolean=false}, If true will force transition even if the state or params have not changed, aka a reload of the same state. It differs from reloadOnSearch because you'd use this when you want to force a reload when everything is the same, including search params.
226
+ * {boolean=false|string|IState }, If true will force transition even if the state or params have not changed, aka a reload of the same state. It differs from reloadOnSearch because you'd use this when you want to force a reload when everything is the same, including search params.
225
227
*/
226
- reload ?: boolean ;
228
+ reload ?: boolean | string | IState ;
227
229
}
228
230
229
231
interface IHrefOptions {
@@ -255,11 +257,15 @@ declare module angular.ui {
255
257
transitionTo ( state : string , params ?: { } , options ?: IStateOptions ) : angular . IPromise < any > ;
256
258
transitionTo ( state : IState , params ?: { } , options ?: IStateOptions ) : angular . IPromise < any > ;
257
259
includes ( state : string , params ?: { } ) : boolean ;
260
+ includes ( state : string , params ?: { } , options ?:any ) : boolean ;
258
261
is ( state :string , params ?: { } ) : boolean ;
259
262
is ( state : IState , params ?: { } ) : boolean ;
260
263
href ( state : IState , params ?: { } , options ?: IHrefOptions ) : string ;
261
264
href ( state : string , params ?: { } , options ?: IHrefOptions ) : string ;
262
- get ( state : string ) : IState ;
265
+ get ( state : string , context ?: string ) : IState ;
266
+ get ( state : IState , context ?: string ) : IState ;
267
+ get ( state : string , context ?: IState ) : IState ;
268
+ get ( state : IState , context ?: IState ) : IState ;
263
269
get ( ) : IState [ ] ;
264
270
/** A reference to the state's config object. However you passed it in. Useful for accessing custom data. */
265
271
current : IState ;
@@ -298,7 +304,10 @@ declare module angular.ui {
298
304
*
299
305
*/
300
306
sync ( ) : void ;
301
- listen ( ) : void ;
307
+ listen ( ) : Function ;
308
+ href ( urlMatcher : IUrlMatcher , params ?: IStateParamsService , options ?: IHrefOptions ) : string ;
309
+ update ( read ?: boolean ) : void ;
310
+ push ( urlMatcher : IUrlMatcher , params ?: IStateParamsService , options ?: IHrefOptions ) : void ;
302
311
}
303
312
304
313
interface IUiViewScrollProvider {
@@ -351,4 +360,4 @@ declare module angular.ui {
351
360
*/
352
361
pattern ?: RegExp ;
353
362
}
354
- }
363
+ }
0 commit comments