Skip to content

Commit b880be9

Browse files
Christian SiebmannsChristian Siebmanns
authored andcommitted
Add stronger types
1 parent c0a95c6 commit b880be9

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

projects/testing-library/src/lib/models.ts

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Type, DebugElement } from '@angular/core';
1+
import { Type, DebugElement, ModuleWithProviders, EnvironmentProviders, TypeProvider } from '@angular/core';
22
import { ComponentFixture, TestBed } from '@angular/core/testing';
33
import { Routes } from '@angular/router';
44
import { BoundFunction, Queries, queries, Config as dtlConfig, PrettyDOMOptions } from '@testing-library/dom';
@@ -65,6 +65,12 @@ export interface RenderResult<ComponentType, WrapperType = ComponentType> extend
6565
) => Promise<void>;
6666
}
6767

68+
export interface ProviderInterface {
69+
provide: any;
70+
useValue: any;
71+
multi?: boolean;
72+
}
73+
6874
export interface RenderComponentOptions<ComponentType, Q extends Queries = typeof queries> {
6975
/**
7076
* @description
@@ -128,7 +134,7 @@ export interface RenderComponentOptions<ComponentType, Q extends Queries = typeo
128134
* ]
129135
* })
130136
*/
131-
providers?: any[];
137+
providers?: Array<ProviderInterface | TypeProvider | EnvironmentProviders>;
132138
/**
133139
* @description
134140
* A collection of imports needed to render the component, for example, shared modules.
@@ -147,7 +153,7 @@ export interface RenderComponentOptions<ComponentType, Q extends Queries = typeo
147153
* ]
148154
* })
149155
*/
150-
imports?: any[];
156+
imports?: Array<Type<any> | ModuleWithProviders<unknown> | any[]>;
151157
/**
152158
* @description
153159
* A collection of schemas needed to render the component.
@@ -231,7 +237,7 @@ export interface RenderComponentOptions<ComponentType, Q extends Queries = typeo
231237
* ]
232238
* })
233239
*/
234-
componentProviders?: any[];
240+
componentProviders?: Array<ProviderInterface | TypeProvider | EnvironmentProviders>;
235241
/**
236242
* @description
237243
* Collection of child component specified providers to override with

0 commit comments

Comments
 (0)