Comparing version 4.1.1 to 4.1.2
# Changelog | ||
## 4.1.2 | ||
- Fix typescript definitions via . Thanks [PR60](https://github.com/guidesmiths/systemic/pull/60). Thanks [teunmooij](https://github.com/teunmooij). | ||
- Remove unused dev deps | ||
## 4.1.1 | ||
@@ -4,0 +9,0 @@ |
@@ -27,3 +27,3 @@ type RequiredKeys<T> = { | ||
* Systemic component that can be added to the systemic system. | ||
* @templace TComponent The type of the component that will be exposed by the systemic system | ||
* @template TComponent The type of the component that will be exposed by the systemic system | ||
* @template TDependencies The type of the dependencies this component depends on | ||
@@ -44,2 +44,21 @@ */ | ||
/** | ||
* Systemic component that can be added to the systemic system. | ||
* @template TComponent The type of the component that will be exposed by the systemic system | ||
* @template TDependencies The type of the dependencies this component depends on | ||
*/ | ||
export type CallbackComponent<TComponent, TDependencies extends Record<string, unknown> = {}> = { | ||
/** | ||
* Starts this component | ||
* @param {TDependencies} dependencies The dependencies of this component | ||
* @param callback Callback receives the component after it has been built | ||
*/ | ||
start: (dependencies: TDependencies, callback: (err: any, component: TComponent) => void) => void; | ||
/** | ||
* Stops this component | ||
* @param callback Callback is called when the component has been stopped | ||
*/ | ||
stop?: (callback: (err?: any) => void) => void; | ||
}; | ||
type SimpleDependsOnOption<TSystemic> = keyof TSystemic; | ||
@@ -97,3 +116,3 @@ type MappingDependsOnOption<TDependencyKeys, TSystemic> = TDependencyKeys extends keyof TSystemic | ||
name: S extends keyof T ? never : S, // We don't allow duplicate names | ||
component?: Component<TComponent, TDependencies> | TComponent, | ||
component?: Component<TComponent, TDependencies> | CallbackComponent<TComponent, TDependencies> | TComponent, | ||
options?: { scoped?: boolean } | ||
@@ -115,3 +134,3 @@ ) => SystemicBuild< | ||
name: S, | ||
component: Component<TComponent, TDependencies> | TComponent, | ||
component: Component<TComponent, TDependencies> | CallbackComponent<TComponent, TDependencies> | TComponent, | ||
options?: { scoped?: boolean } | ||
@@ -129,3 +148,3 @@ ) => SystemicBuild< | ||
configure: <TComponent, TDependencies extends Record<string, unknown> = {}>( | ||
component: Component<TComponent, TDependencies> | TComponent | ||
component: Component<TComponent, TDependencies> | CallbackComponent<TComponent, TDependencies> | TComponent | ||
) => SystemicBuild<T & { config: TComponent }, TDependencies>; | ||
@@ -132,0 +151,0 @@ |
{ | ||
"name": "systemic", | ||
"version": "4.1.1", | ||
"version": "4.1.2", | ||
"description": "A minimal dependency injection library for node", | ||
@@ -35,3 +35,2 @@ "main": "index.js", | ||
"eslint-plugin-import": "^2.26.0", | ||
"eslint-plugin-prettier": "^4.0.0", | ||
"husky": "^7.0.4", | ||
@@ -38,0 +37,0 @@ "lint-staged": "^12.3.5", |
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
44212
9
644