Skip to content

Commit 6271a7b

Browse files
author
Anatoly Ostrovsky
committed
Test and type fixes
1 parent 2690982 commit 6271a7b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+248
-126
lines changed

@types/angular.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,14 +124,14 @@ export class Angular {
124124
* @param {string} name The name of the module to create or retrieve.
125125
* @param {Array.<string>} [requires] If specified then new module is being created. If
126126
* unspecified then the module is being retrieved for further configuration.
127-
* @param {Array<any>|Function} [configFn] Optional configuration function for the module that gets
127+
* @param {import("./interface.js").Injectable} [configFn] Optional configuration function for the module that gets
128128
* passed to {@link NgModule.config NgModule.config()}.
129129
* @returns {NgModule} A newly registered module.
130130
*/
131131
module(
132132
name: string,
133133
requires?: Array<string>,
134-
configFn?: Array<any> | Function,
134+
configFn?: import("./interface.js").Injectable,
135135
): NgModule;
136136
}
137137
/**

@types/core/di/ng-module.d.ts

Lines changed: 61 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,13 @@ export class NgModule {
2222
/**
2323
* @param {string} name - Name of the module
2424
* @param {Array<string>} requires - List of modules which the injector will load before the current module
25-
* @param {Function} [configFn]
25+
* @param {import("../../interface.js").Injectable} [configFn]
2626
*/
27-
constructor(name: string, requires: Array<string>, configFn?: Function);
27+
constructor(
28+
name: string,
29+
requires: Array<string>,
30+
configFn?: import("../../interface.js").Injectable,
31+
);
2832
/**
2933
* Name of the current module.
3034
* @type {string}
@@ -42,8 +46,8 @@ export class NgModule {
4246
invokeQueue: Array<Array<any>>;
4347
/** @type {!Array<Array<*>>} */
4448
configBlocks: Array<Array<any>>;
45-
/** @type {!Array.<Function>} */
46-
runBlocks: Array<Function>;
49+
/** @type {!Array.<import("../../interface.js").Injectable>} */
50+
runBlocks: Array<import("../../interface.js").Injectable>;
4751
/**
4852
* @param {string} name
4953
* @param {any} object
@@ -58,62 +62,94 @@ export class NgModule {
5862
constant(name: string, object: any): NgModule;
5963
/**
6064
*
61-
* @param {Function} configFn
65+
* @param {import("../../interface.js").Injectable} configFn
6266
* @returns {NgModule}
6367
*/
64-
config(configFn: Function): NgModule;
68+
config(configFn: import("../../interface.js").Injectable): NgModule;
6569
/**
66-
* @param {Function} block
70+
* @param {import("../../interface.js").Injectable} block
6771
* @returns {NgModule}
6872
*/
69-
run(block: Function): NgModule;
73+
run(block: import("../../interface.js").Injectable): NgModule;
7074
/**
7175
* @param {string} name
72-
* @param {*} options
76+
* @param {import("../../interface.js").Injectable} options
7377
* @returns {NgModule}
7478
*/
75-
component(name: string, options: any): NgModule;
79+
component(
80+
name: string,
81+
options: import("../../interface.js").Injectable,
82+
): NgModule;
7683
/**
7784
* @param {string} name
78-
* @param {*} providerFunction
85+
* @param {import("../../interface.js").Injectable} providerFunction
7986
* @returns {NgModule}
8087
*/
81-
factory(name: string, providerFunction: any): NgModule;
88+
factory(
89+
name: string,
90+
providerFunction: import("../../interface.js").Injectable,
91+
): NgModule;
8292
/**
8393
* @param {string} name
84-
* @param {*} serviceFunction
94+
* @param {import("../../interface.js").Injectable} serviceFunction
8595
* @returns {NgModule}
8696
*/
87-
service(name: string, serviceFunction: any): NgModule;
97+
service(
98+
name: string,
99+
serviceFunction: import("../../interface.js").Injectable,
100+
): NgModule;
88101
/**
89102
* @param {string} name
90-
* @param {*} providerType
103+
* @param {import("../../interface.js").Injectable} providerType
91104
* @returns {NgModule}
92105
*/
93-
provider(name: string, providerType: any): NgModule;
106+
provider(
107+
name: string,
108+
providerType: import("../../interface.js").Injectable,
109+
): NgModule;
94110
/**
95111
* @param {string} name
96-
* @param {*} decorFn
112+
* @param {import("../../interface.js").Injectable} decorFn
97113
* @returns {NgModule}
98114
*/
99-
decorator(name: string, decorFn: any): NgModule;
115+
decorator(
116+
name: string,
117+
decorFn: import("../../interface.js").Injectable,
118+
): NgModule;
100119
/**
101120
* @param {string} name
102-
* @param {*} directiveFactory
121+
* @param {import("../../interface.js").Injectable} directiveFactory
103122
* @returns {NgModule}
104123
*/
105-
directive(name: string, directiveFactory: any): NgModule;
124+
directive(
125+
name: string,
126+
directiveFactory: import("../../interface.js").Injectable,
127+
): NgModule;
106128
/**
107129
* @param {string} name
108-
* @param {*} animationFactory
130+
* @param {import("../../interface.js").Injectable} animationFactory
109131
* @returns {NgModule}
110132
*/
111-
animation(name: string, animationFactory: any): NgModule;
112-
filter(name: any, filterFn: any): this;
133+
animation(
134+
name: string,
135+
animationFactory: import("../../interface.js").Injectable,
136+
): NgModule;
113137
/**
114138
* @param {string} name
115-
* @param {*} ctlFn
139+
* @param {import("../../interface.js").Injectable} filterFn
140+
* @return {NgModule}
141+
*/
142+
filter(
143+
name: string,
144+
filterFn: import("../../interface.js").Injectable,
145+
): NgModule;
146+
/**
147+
* @param {string} name
148+
* @param {import("../../interface.js").Injectable} ctlFn
116149
* @returns {NgModule}
117150
*/
118-
controller(name: string, ctlFn: any): NgModule;
151+
controller(
152+
name: string,
153+
ctlFn: import("../../interface.js").Injectable,
154+
): NgModule;
119155
}

@types/interface.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,13 @@ export type ExpandoStore = {
3636
* ```
3737
*/
3838
export type AnnotatedFactory = [...string[], (...args: any[]) => any];
39+
export type InjectableFactory = (...args: any[]) => any;
3940
/**
4041
* A factory that can be either a standalone function or a dependency-annotated array.
4142
*
4243
* The array form is used to support minification-safe dependency injection.
4344
* See {@link AnnotatedFactory}.
4445
*/
45-
export type InjectableFactory = (...args: any[]) => any;
4646
export type Injectable = AnnotatedFactory | InjectableFactory;
4747
/**
4848
* An object that defines how a service is constructed.

@types/router/directives/state-directives.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,15 @@ export namespace $StateRefDynamicDirective {
2727
}
2828
/**
2929
* @param {*} $state
30-
* @param {import('../globals.js').Router} $router
30+
* @param {import('../router.js').Router} $router
3131
* @param {*} $interpolate
3232
* @param {*} $stateRegistry
3333
* @param {*} $transitions
3434
* @returns {import("../../interface.ts").Directive}
3535
*/
3636
export function $StateRefActiveDirective(
3737
$state: any,
38-
$router: import("../globals.js").Router,
38+
$router: import("../router.js").Router,
3939
$interpolate: any,
4040
$stateRegistry: any,
4141
$transitions: any,

@types/router/params/param-type.d.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ export class ParamType {
2525
/**
2626
* @param def A configuration object which contains the custom type definition. The object's
2727
* properties will override the default methods and/or pattern in `ParamType`'s public interface.
28-
* @returns a new ParamType object
2928
*/
3029
constructor(def: any);
3130
pattern: RegExp;
File renamed without changes.

@types/router/state/state-registry.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ export class StateRegistryProvider {
1010
/**
1111
* @param urlService
1212
* @param stateService
13-
* @param {import('../globals.js').Router} globals
13+
* @param {import('../router.js').Router} globals
1414
* @param viewService
1515
*/
1616
constructor(
1717
urlService: any,
1818
stateService: any,
19-
globals: import("../globals.js").Router,
19+
globals: import("../router.js").Router,
2020
viewService: any,
2121
);
2222
states: {};

@types/router/state/state-service.d.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ export class StateProvider {
77
static $inject: string[];
88
/**
99
*
10-
* @param {import('../globals.js').Router} globals
10+
* @param {import('../router.js').Router} globals
1111
* @param {*} transitionService
1212
*/
13-
constructor(globals: import("../globals.js").Router, transitionService: any);
13+
constructor(globals: import("../router.js").Router, transitionService: any);
1414
/**
1515
* The latest successful state parameters
1616
*
@@ -31,7 +31,7 @@ export class StateProvider {
3131
get $current(): import("./state-object.js").StateObject;
3232
stateRegistry: any;
3333
urlService: any;
34-
globals: import("../globals.js").Router;
34+
globals: import("../router.js").Router;
3535
transitionService: any;
3636
invalidCallbacks: any[];
3737
_defaultErrorHandler: ($error$: any) => never;

@types/router/transition/transition-service.d.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,18 @@ export namespace defaultTransOpts {
2323
export class TransitionProvider {
2424
static $inject: string[];
2525
/**
26-
* @param {import('../globals.js').Router} globals
26+
* @param {import('../router.js').Router} globals
2727
* @param viewService
2828
*/
29-
constructor(globals: import("../globals.js").Router, viewService: any);
29+
constructor(globals: import("../router.js").Router, viewService: any);
3030
_transitionCount: number;
3131
/** The transition hook types, such as `onEnter`, `onStart`, etc */
3232
_eventTypes: any[];
3333
/** @internal The registered transition hooks */
3434
_registeredHooks: {};
3535
/** The paths on a criteria object */
3636
_criteriaPaths: {};
37-
globals: import("../globals.js").Router;
37+
globals: import("../router.js").Router;
3838
$view: any;
3939
_deregisterHookFns: {};
4040
_pluginapi: any;

@types/router/transition/transition.d.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,18 @@ export class Transition implements IHookRegistry {
1818
* encapsulates the "from state".
1919
* @param {import('../state/target-state.js').TargetState} targetState The target state and parameters being transitioned to (also, the transition options)
2020
* @param {import('../transition/transition-service.js').TransitionProvider} transitionService The [[TransitionService]] instance
21-
* @param {import('../globals.js').Router} globals
21+
* @param {import('../router.js').Router} globals
2222
*/
2323
constructor(
2424
fromPath: Array<import("../path/path-node.js").PathNode>,
2525
targetState: import("../state/target-state.js").TargetState,
2626
transitionService: import("../transition/transition-service.js").TransitionProvider,
27-
globals: import("../globals.js").Router,
27+
globals: import("../router.js").Router,
2828
);
2929
/**
30-
* @type {import('../globals.js').Router}
30+
* @type {import('../router.js').Router}
3131
*/
32-
globals: import("../globals.js").Router;
32+
globals: import("../router.js").Router;
3333
transitionService: import("../transition/transition-service.js").TransitionProvider;
3434
_deferred: any;
3535
/**

0 commit comments

Comments
 (0)