* Configures certain inject metadata. * * @param {InjectIndex} injectIndex Inject index. * @param {InjectOptions } injectOptions Inject options. * * @returns {InjectMetadata } Configured inject metadata.
(injectIndex: InjectIndex, injectOptions?: InjectOptions<TInjectType>)
| 1586 | * @returns {InjectMetadata<TObject, TInjectType>} Configured inject metadata. |
| 1587 | */ |
| 1588 | public configureInjectMetadata<TInjectType>(injectIndex: InjectIndex, injectOptions?: InjectOptions<TInjectType>): InjectMetadata<TObject, TInjectType> |
| 1589 | { |
| 1590 | let injectOptionsMap = this.typeOptions.injectOptionsMap; |
| 1591 | |
| 1592 | if (injectOptionsMap === undefined) |
| 1593 | { |
| 1594 | injectOptionsMap = new Map<InjectIndex, InjectOptions<any>>(); |
| 1595 | |
| 1596 | this.typeOptions.injectOptionsMap = injectOptionsMap; |
| 1597 | } |
| 1598 | |
| 1599 | let injectMetadata = this.currentInjectMetadataMap.get(injectIndex); |
| 1600 | |
| 1601 | if (injectMetadata === undefined) |
| 1602 | { |
| 1603 | injectOptions = injectOptions ?? {} as InjectOptions<TInjectType>; |
| 1604 | injectMetadata = new InjectMetadata(this.typeManager, this.currentTypeFnMap, this, injectIndex, injectOptions); |
| 1605 | |
| 1606 | this.currentInjectMetadataMap.set(injectIndex, injectMetadata); |
| 1607 | |
| 1608 | injectOptionsMap.set(injectIndex, injectOptions); |
| 1609 | |
| 1610 | this.currentTypeState = new UnresolvedTypeState<TObject>(this); |
| 1611 | |
| 1612 | return injectMetadata; |
| 1613 | } |
| 1614 | |
| 1615 | if (injectOptions !== undefined) |
| 1616 | { |
| 1617 | injectMetadata.configure(injectOptions); |
| 1618 | } |
| 1619 | |
| 1620 | this.currentTypeState = new UnresolvedTypeState<TObject>(this); |
| 1621 | |
| 1622 | return injectMetadata; |
| 1623 | } |
| 1624 | |
| 1625 | /** |
| 1626 | * Configures property metadata map. |