@kaokei/di 3.0.9 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +49 -3
- package/dist/binding.d.cts +41 -17
- package/dist/binding.d.ts +41 -17
- package/dist/cachemap.d.cts +23 -8
- package/dist/cachemap.d.ts +23 -8
- package/dist/constants.d.cts +19 -6
- package/dist/constants.d.ts +19 -6
- package/dist/container.d.cts +11 -7
- package/dist/container.d.ts +11 -7
- package/dist/decorator.d.cts +30 -13
- package/dist/decorator.d.ts +30 -13
- package/dist/errors/BaseError.d.cts +1 -0
- package/dist/errors/BaseError.d.ts +1 -0
- package/dist/errors/ContainerNotFoundError.d.cts +5 -0
- package/dist/errors/ContainerNotFoundError.d.ts +5 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +10 -3
- package/dist/index.d.ts +10 -3
- package/dist/index.js +320 -232
- package/dist/interfaces.d.cts +1 -1
- package/dist/interfaces.d.ts +1 -1
- package/dist/token.d.cts +1 -1
- package/dist/token.d.ts +1 -1
- package/package.json +7 -2
- package/dist/lazyinject.d.cts +0 -4
- package/dist/lazyinject.d.ts +0 -4
package/dist/interfaces.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Token, LazyToken } from './token';
|
|
2
2
|
import { Container } from './container';
|
|
3
3
|
import { Binding } from './binding';
|
|
4
|
-
export type Newable<TInstance = unknown
|
|
4
|
+
export type Newable<TInstance = unknown> = new () => TInstance;
|
|
5
5
|
export type InjectFunction<R extends (...args: any) => any> = (token: GenericToken) => ReturnType<R>;
|
|
6
6
|
export type CommonToken<T = unknown> = Token<T> | Newable<T>;
|
|
7
7
|
export type TokenType<T> = T extends CommonToken<infer U> ? U : never;
|
package/dist/interfaces.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Token, LazyToken } from './token';
|
|
2
2
|
import { Container } from './container';
|
|
3
3
|
import { Binding } from './binding';
|
|
4
|
-
export type Newable<TInstance = unknown
|
|
4
|
+
export type Newable<TInstance = unknown> = new () => TInstance;
|
|
5
5
|
export type InjectFunction<R extends (...args: any) => any> = (token: GenericToken) => ReturnType<R>;
|
|
6
6
|
export type CommonToken<T = unknown> = Token<T> | Newable<T>;
|
|
7
7
|
export type TokenType<T> = T extends CommonToken<infer U> ? U : never;
|
package/dist/token.d.cts
CHANGED
package/dist/token.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kaokei/di",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Tiny di library depends on typescript decorator.",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -44,7 +44,10 @@
|
|
|
44
44
|
"postpublish": "git push origin --follow-tags",
|
|
45
45
|
"prepublishOnly": "npm run clean && npm run build",
|
|
46
46
|
"release": "standard-version -r",
|
|
47
|
-
"release:first": "standard-version --first-release"
|
|
47
|
+
"release:first": "standard-version --first-release",
|
|
48
|
+
"docs:dev": "vitepress dev docs",
|
|
49
|
+
"docs:build": "vitepress build docs",
|
|
50
|
+
"docs:preview": "vitepress preview docs"
|
|
48
51
|
},
|
|
49
52
|
"devDependencies": {
|
|
50
53
|
"@types/fs-extra": "^11.0.4",
|
|
@@ -52,6 +55,7 @@
|
|
|
52
55
|
"@vitejs/plugin-vue": "^5.2.1",
|
|
53
56
|
"@vitest/coverage-v8": "^3.1.1",
|
|
54
57
|
"@vue/test-utils": "^2.4.6",
|
|
58
|
+
"fast-check": "^4.6.0",
|
|
55
59
|
"fs-extra": "^11.3.0",
|
|
56
60
|
"inversify": "^6.2.2",
|
|
57
61
|
"jsdom": "^25.0.1",
|
|
@@ -60,6 +64,7 @@
|
|
|
60
64
|
"typescript": "~5.6.3",
|
|
61
65
|
"vite": "^5.4.14",
|
|
62
66
|
"vite-plugin-dts": "^4.5.0",
|
|
67
|
+
"vitepress": "^1.6.3",
|
|
63
68
|
"vitest": "^3.1.1",
|
|
64
69
|
"vue": "^3.5.13",
|
|
65
70
|
"vue-router": "^4.5.0",
|
package/dist/lazyinject.d.cts
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { GenericToken } from './interfaces';
|
|
2
|
-
import { Container } from './container';
|
|
3
|
-
export declare function LazyInject<T>(token: GenericToken<T>, container?: Container): (proto: any, key: string) => void;
|
|
4
|
-
export declare function createLazyInject(container: Container): <T>(token: GenericToken<T>) => (proto: any, key: string) => void;
|
package/dist/lazyinject.d.ts
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { GenericToken } from './interfaces';
|
|
2
|
-
import { Container } from './container';
|
|
3
|
-
export declare function LazyInject<T>(token: GenericToken<T>, container?: Container): (proto: any, key: string) => void;
|
|
4
|
-
export declare function createLazyInject(container: Container): <T>(token: GenericToken<T>) => (proto: any, key: string) => void;
|