@tinkoff/dippy
Advanced tools
Comparing version 0.11.2 to 0.11.3
import type { RecordProvide } from './Container.h'; | ||
import type { Provider, ProviderDeps, ProvideDepsIterator } from './Provider'; | ||
import type { BaseTokenInterface, MultiTokenInterface, OptionalTokenDependency } from './createToken/createToken'; | ||
import type { BaseTokenInterface, MultiTokenInterface, BaseOptionalTokenDependency, MultiOptionalTokenDependency, OptionalTokenDependency } from './createToken/createToken'; | ||
/** | ||
@@ -36,5 +36,7 @@ * Маркер, который указывает, что значение еще не создано. Для проверки по ссылке. | ||
}): T[]; | ||
get<T>(obj: BaseOptionalTokenDependency<T>): T | null; | ||
get<T>(obj: MultiOptionalTokenDependency<T>): T[] | null; | ||
get<T>(obj: OptionalTokenDependency<T>): T[] | T | null; | ||
get<T>(token: BaseTokenInterface<T>): T; | ||
get<T>(token: MultiTokenInterface<T>): T[]; | ||
get<T>(obj: OptionalTokenDependency<T>): T | null; | ||
get<T>(token: T): T; | ||
@@ -41,0 +43,0 @@ getOfDeps<T extends ProviderDeps>(deps: T): ProvideDepsIterator<T>; |
@@ -40,6 +40,5 @@ import type { ScopeVariants } from '../Provider'; | ||
*/ | ||
export declare function optional<Token extends MultiTokenInterface<any>>(token: Token): { | ||
export declare function optional<Token extends TokenInterface<any>>(token: Token): { | ||
token: Token; | ||
optional: true; | ||
multi: true; | ||
}; | ||
@@ -57,3 +56,11 @@ export type ExtractTokenType<Token extends TokenInterface<any>> = Token extends TokenInterface<infer Type> ? Type : unknown; | ||
}; | ||
export type BaseOptionalTokenDependency<Type> = { | ||
token: BaseTokenInterface<Type>; | ||
optional: boolean; | ||
}; | ||
export type MultiOptionalTokenDependency<Type> = { | ||
token: MultiTokenInterface<Type>; | ||
optional: boolean; | ||
}; | ||
export {}; | ||
//# sourceMappingURL=createToken.d.ts.map |
@@ -25,2 +25,5 @@ /** | ||
} | ||
/** | ||
* Helper function to declare a optional token dependency | ||
*/ | ||
function optional(token) { | ||
@@ -27,0 +30,0 @@ return { token, optional: true }; |
@@ -29,2 +29,5 @@ 'use strict'; | ||
} | ||
/** | ||
* Helper function to declare a optional token dependency | ||
*/ | ||
function optional(token) { | ||
@@ -31,0 +34,0 @@ return { token, optional: true }; |
{ | ||
"name": "@tinkoff/dippy", | ||
"version": "0.11.2", | ||
"version": "0.11.3", | ||
"initialVersion": "0.7.27", | ||
@@ -5,0 +5,0 @@ "description": "", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
78014
1654