1 | import { ObjectType } from "./ObjectType";
|
2 | import { Token } from "../Token";
|
3 | /**
|
4 | * Service options passed to the @Service() decorator.
|
5 | * Allows to specify service id and/or factory used to create this service.
|
6 | */
|
7 | export interface ServiceOptions<T, K extends keyof T> {
|
8 | /**
|
9 | * Indicates if this service must be global and same instance must be used across all containers.
|
10 | */
|
11 | global?: boolean;
|
12 | /**
|
13 | * Indicates if instance of this class must be created on each its request.
|
14 | * Global option is ignored when this option is used.
|
15 | */
|
16 | transient?: boolean;
|
17 | /**
|
18 | * Allows to setup multiple instances the different classes under a single service id string or token.
|
19 | */
|
20 | multiple?: boolean;
|
21 | /**
|
22 | * Unique service id.
|
23 | */
|
24 | id?: string | Token<any>;
|
25 | /**
|
26 | * Factory used to produce this service.
|
27 | */
|
28 | factory?: [ObjectType<T>, K] | ((...params: any[]) => any);
|
29 | }
|
30 |
|
\ | No newline at end of file |