ts-ioc-container 32.2.0 → 32.4.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/cjm/hooks/ExecutionContext.js +19 -0
- package/cjm/hooks/hook.js +29 -0
- package/cjm/index.js +5 -7
- package/esm/hooks/ExecutionContext.js +15 -0
- package/esm/hooks/hook.js +22 -0
- package/esm/index.js +2 -2
- package/package.json +2 -2
- package/typings/hooks/ExecutionContext.d.ts +11 -0
- package/typings/hooks/hook.d.ts +10 -0
- package/typings/index.d.ts +2 -2
- package/cjm/autorun.js +0 -45
- package/cjm/hook.js +0 -19
- package/esm/autorun.js +0 -37
- package/esm/hook.js +0 -13
- package/typings/autorun.d.ts +0 -17
- package/typings/hook.d.ts +0 -4
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ExecutionContext = void 0;
|
|
4
|
+
const MetadataInjector_1 = require("../injector/MetadataInjector");
|
|
5
|
+
class ExecutionContext {
|
|
6
|
+
constructor(instance, methodName, scope) {
|
|
7
|
+
this.instance = instance;
|
|
8
|
+
this.methodName = methodName;
|
|
9
|
+
this.scope = scope;
|
|
10
|
+
}
|
|
11
|
+
resolveArgs(...args) {
|
|
12
|
+
return (0, MetadataInjector_1.resolveArgs)(this.instance.constructor, this.methodName)(this.scope, ...args);
|
|
13
|
+
}
|
|
14
|
+
invokeMethod({ args = this.resolveArgs() }) {
|
|
15
|
+
// @ts-ignore
|
|
16
|
+
return this.instance[this.methodName](...args);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
exports.ExecutionContext = ExecutionContext;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.executeHooks = exports.hasHooks = exports.getHooks = exports.hook = void 0;
|
|
4
|
+
const ExecutionContext_1 = require("./ExecutionContext");
|
|
5
|
+
const createStore = () => new Map();
|
|
6
|
+
const hook = (key, ...fns) => (target, propertyKey) => {
|
|
7
|
+
const hooks = Reflect.hasMetadata(key, target.constructor)
|
|
8
|
+
? Reflect.getMetadata(key, target.constructor)
|
|
9
|
+
: createStore();
|
|
10
|
+
hooks.set(propertyKey, (hooks.get(propertyKey) ?? []).concat(fns));
|
|
11
|
+
Reflect.defineMetadata(key, hooks, target.constructor); // eslint-disable-line @typescript-eslint/ban-types
|
|
12
|
+
};
|
|
13
|
+
exports.hook = hook;
|
|
14
|
+
function getHooks(target, key) {
|
|
15
|
+
return Reflect.hasMetadata(key, target.constructor) ? Reflect.getMetadata(key, target.constructor) : new Map();
|
|
16
|
+
}
|
|
17
|
+
exports.getHooks = getHooks;
|
|
18
|
+
function hasHooks(target, key) {
|
|
19
|
+
return Reflect.hasMetadata(key, target.constructor);
|
|
20
|
+
}
|
|
21
|
+
exports.hasHooks = hasHooks;
|
|
22
|
+
const executeHooks = (target, key, { scope, createContext = (c) => c, }) => {
|
|
23
|
+
for (const [methodName, executions] of getHooks(target, key)) {
|
|
24
|
+
for (const execute of executions) {
|
|
25
|
+
execute(createContext(new ExecutionContext_1.ExecutionContext(target, methodName, scope)));
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
exports.executeHooks = executeHooks;
|
package/cjm/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getParameterMetadata = exports.getMethodMetadata = exports.setMethodMetadata = exports.setParameterMetadata = exports.getMetadata = exports.setMetadata = exports.
|
|
3
|
+
exports.getParameterMetadata = exports.getMethodMetadata = exports.setMethodMetadata = exports.setParameterMetadata = exports.getMetadata = exports.setMetadata = exports.byAliases = exports.byAlias = exports.IMemoKey = exports.by = exports.ExecutionContext = exports.executeHooks = exports.hasHooks = exports.hook = exports.getHooks = exports.ContainerDisposedError = exports.MethodNotImplementedError = exports.DependencyNotFoundError = exports.Registration = exports.register = exports.scope = exports.key = exports.decorate = exports.multiCache = exports.MultiCache = exports.SingletonProvider = exports.singleton = exports.Provider = exports.ProviderDecorator = exports.args = exports.argsFn = exports.alias = exports.visible = exports.provider = exports.ProxyInjector = exports.SimpleInjector = exports.getInjectFns = exports.resolveArgs = exports.inject = exports.MetadataInjector = exports.AutoMockedContainer = exports.EmptyContainer = exports.Container = exports.isDependencyKey = void 0;
|
|
4
4
|
// Containers
|
|
5
5
|
var IContainer_1 = require("./container/IContainer");
|
|
6
6
|
Object.defineProperty(exports, "isDependencyKey", { enumerable: true, get: function () { return IContainer_1.isDependencyKey; } });
|
|
@@ -52,20 +52,18 @@ Object.defineProperty(exports, "MethodNotImplementedError", { enumerable: true,
|
|
|
52
52
|
var ContainerDisposedError_1 = require("./errors/ContainerDisposedError");
|
|
53
53
|
Object.defineProperty(exports, "ContainerDisposedError", { enumerable: true, get: function () { return ContainerDisposedError_1.ContainerDisposedError; } });
|
|
54
54
|
// Others
|
|
55
|
-
var hook_1 = require("./hook");
|
|
55
|
+
var hook_1 = require("./hooks/hook");
|
|
56
56
|
Object.defineProperty(exports, "getHooks", { enumerable: true, get: function () { return hook_1.getHooks; } });
|
|
57
57
|
Object.defineProperty(exports, "hook", { enumerable: true, get: function () { return hook_1.hook; } });
|
|
58
58
|
Object.defineProperty(exports, "hasHooks", { enumerable: true, get: function () { return hook_1.hasHooks; } });
|
|
59
|
+
Object.defineProperty(exports, "executeHooks", { enumerable: true, get: function () { return hook_1.executeHooks; } });
|
|
60
|
+
var ExecutionContext_1 = require("./hooks/ExecutionContext");
|
|
61
|
+
Object.defineProperty(exports, "ExecutionContext", { enumerable: true, get: function () { return ExecutionContext_1.ExecutionContext; } });
|
|
59
62
|
var by_1 = require("./by");
|
|
60
63
|
Object.defineProperty(exports, "by", { enumerable: true, get: function () { return by_1.by; } });
|
|
61
64
|
Object.defineProperty(exports, "IMemoKey", { enumerable: true, get: function () { return by_1.IMemoKey; } });
|
|
62
65
|
Object.defineProperty(exports, "byAlias", { enumerable: true, get: function () { return by_1.byAlias; } });
|
|
63
66
|
Object.defineProperty(exports, "byAliases", { enumerable: true, get: function () { return by_1.byAliases; } });
|
|
64
|
-
var autorun_1 = require("./autorun");
|
|
65
|
-
Object.defineProperty(exports, "auto", { enumerable: true, get: function () { return autorun_1.auto; } });
|
|
66
|
-
Object.defineProperty(exports, "startAutorun", { enumerable: true, get: function () { return autorun_1.startAutorun; } });
|
|
67
|
-
Object.defineProperty(exports, "AutorunContext", { enumerable: true, get: function () { return autorun_1.AutorunContext; } });
|
|
68
|
-
Object.defineProperty(exports, "hasAutorunHooks", { enumerable: true, get: function () { return autorun_1.hasAutorunHooks; } });
|
|
69
67
|
var metadata_1 = require("./metadata");
|
|
70
68
|
Object.defineProperty(exports, "setMetadata", { enumerable: true, get: function () { return metadata_1.setMetadata; } });
|
|
71
69
|
Object.defineProperty(exports, "getMetadata", { enumerable: true, get: function () { return metadata_1.getMetadata; } });
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { resolveArgs } from '../injector/MetadataInjector';
|
|
2
|
+
export class ExecutionContext {
|
|
3
|
+
constructor(instance, methodName, scope) {
|
|
4
|
+
this.instance = instance;
|
|
5
|
+
this.methodName = methodName;
|
|
6
|
+
this.scope = scope;
|
|
7
|
+
}
|
|
8
|
+
resolveArgs(...args) {
|
|
9
|
+
return resolveArgs(this.instance.constructor, this.methodName)(this.scope, ...args);
|
|
10
|
+
}
|
|
11
|
+
invokeMethod({ args = this.resolveArgs() }) {
|
|
12
|
+
// @ts-ignore
|
|
13
|
+
return this.instance[this.methodName](...args);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ExecutionContext } from './ExecutionContext';
|
|
2
|
+
const createStore = () => new Map();
|
|
3
|
+
export const hook = (key, ...fns) => (target, propertyKey) => {
|
|
4
|
+
const hooks = Reflect.hasMetadata(key, target.constructor)
|
|
5
|
+
? Reflect.getMetadata(key, target.constructor)
|
|
6
|
+
: createStore();
|
|
7
|
+
hooks.set(propertyKey, (hooks.get(propertyKey) ?? []).concat(fns));
|
|
8
|
+
Reflect.defineMetadata(key, hooks, target.constructor); // eslint-disable-line @typescript-eslint/ban-types
|
|
9
|
+
};
|
|
10
|
+
export function getHooks(target, key) {
|
|
11
|
+
return Reflect.hasMetadata(key, target.constructor) ? Reflect.getMetadata(key, target.constructor) : new Map();
|
|
12
|
+
}
|
|
13
|
+
export function hasHooks(target, key) {
|
|
14
|
+
return Reflect.hasMetadata(key, target.constructor);
|
|
15
|
+
}
|
|
16
|
+
export const executeHooks = (target, key, { scope, createContext = (c) => c, }) => {
|
|
17
|
+
for (const [methodName, executions] of getHooks(target, key)) {
|
|
18
|
+
for (const execute of executions) {
|
|
19
|
+
execute(createContext(new ExecutionContext(target, methodName, scope)));
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
};
|
package/esm/index.js
CHANGED
|
@@ -20,7 +20,7 @@ export { DependencyNotFoundError } from './errors/DependencyNotFoundError';
|
|
|
20
20
|
export { MethodNotImplementedError } from './errors/MethodNotImplementedError';
|
|
21
21
|
export { ContainerDisposedError } from './errors/ContainerDisposedError';
|
|
22
22
|
// Others
|
|
23
|
-
export { getHooks, hook, hasHooks } from './hook';
|
|
23
|
+
export { getHooks, hook, hasHooks, executeHooks } from './hooks/hook';
|
|
24
|
+
export { ExecutionContext } from './hooks/ExecutionContext';
|
|
24
25
|
export { by, IMemoKey, byAlias, byAliases } from './by';
|
|
25
|
-
export { auto, startAutorun, AutorunContext, hasAutorunHooks } from './autorun';
|
|
26
26
|
export { setMetadata, getMetadata, setParameterMetadata, setMethodMetadata, getMethodMetadata, getParameterMetadata, } from './metadata';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ts-ioc-container",
|
|
3
|
-
"version": "32.
|
|
3
|
+
"version": "32.4.0",
|
|
4
4
|
"description": "Typescript IoC container",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public",
|
|
@@ -59,5 +59,5 @@
|
|
|
59
59
|
"ts-node": "^10.9.1",
|
|
60
60
|
"typescript": "5.4.3"
|
|
61
61
|
},
|
|
62
|
-
"gitHead": "
|
|
62
|
+
"gitHead": "590a34c13ebc93437a8a368f6e1e39db25600126"
|
|
63
63
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { IContainer } from '../container/IContainer';
|
|
2
|
+
export declare class ExecutionContext {
|
|
3
|
+
instance: object;
|
|
4
|
+
methodName: string;
|
|
5
|
+
scope: IContainer;
|
|
6
|
+
constructor(instance: object, methodName: string, scope: IContainer);
|
|
7
|
+
resolveArgs(...args: unknown[]): unknown[];
|
|
8
|
+
invokeMethod({ args }: {
|
|
9
|
+
args: unknown[];
|
|
10
|
+
}): unknown;
|
|
11
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { IContainer } from '../container/IContainer';
|
|
2
|
+
import { ExecutionContext } from './ExecutionContext';
|
|
3
|
+
export type Execution = <T extends ExecutionContext>(context: T) => void;
|
|
4
|
+
export declare const hook: (key: string | symbol, ...fns: Execution[]) => MethodDecorator;
|
|
5
|
+
export declare function getHooks(target: object, key: string | symbol): Map<string, Execution[]>;
|
|
6
|
+
export declare function hasHooks(target: object, key: string | symbol): boolean;
|
|
7
|
+
export declare const executeHooks: <Context extends ExecutionContext>(target: object, key: string | symbol, { scope, createContext, }: {
|
|
8
|
+
scope: IContainer;
|
|
9
|
+
createContext?: ((c: ExecutionContext) => Context) | undefined;
|
|
10
|
+
}) => void;
|
package/typings/index.d.ts
CHANGED
|
@@ -17,8 +17,8 @@ export { Registration } from './registration/Registration';
|
|
|
17
17
|
export { DependencyNotFoundError } from './errors/DependencyNotFoundError';
|
|
18
18
|
export { MethodNotImplementedError } from './errors/MethodNotImplementedError';
|
|
19
19
|
export { ContainerDisposedError } from './errors/ContainerDisposedError';
|
|
20
|
-
export { getHooks, hook, hasHooks } from './hook';
|
|
20
|
+
export { getHooks, hook, hasHooks, Execution, executeHooks } from './hooks/hook';
|
|
21
|
+
export { ExecutionContext } from './hooks/ExecutionContext';
|
|
21
22
|
export { by, InstancePredicate, IMemo, IMemoKey, byAlias, byAliases } from './by';
|
|
22
23
|
export { constructor } from './utils';
|
|
23
|
-
export { auto, startAutorun, AutorunContext, hasAutorunHooks } from './autorun';
|
|
24
24
|
export { setMetadata, getMetadata, setParameterMetadata, setMethodMetadata, getMethodMetadata, getParameterMetadata, } from './metadata';
|
package/cjm/autorun.js
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.startAutorun = exports.hasAutorunHooks = exports.getAutorunHooks = exports.auto = exports.AutorunContext = void 0;
|
|
4
|
-
const MetadataInjector_1 = require("./injector/MetadataInjector");
|
|
5
|
-
const METADATA_KEY = 'autorun';
|
|
6
|
-
class AutorunContext {
|
|
7
|
-
constructor(instance, methodName, scope) {
|
|
8
|
-
this.instance = instance;
|
|
9
|
-
this.methodName = methodName;
|
|
10
|
-
this.scope = scope;
|
|
11
|
-
}
|
|
12
|
-
resolveArgs(...args) {
|
|
13
|
-
return (0, MetadataInjector_1.resolveArgs)(this.instance.constructor, this.methodName)(this.scope, ...args);
|
|
14
|
-
}
|
|
15
|
-
invokeMethod({ args = this.resolveArgs() }) {
|
|
16
|
-
// @ts-ignore
|
|
17
|
-
return this.instance[this.methodName](...args);
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
exports.AutorunContext = AutorunContext;
|
|
21
|
-
const createStore = () => new Map();
|
|
22
|
-
const auto = (execute) => (target, propertyKey) => {
|
|
23
|
-
const hooks = Reflect.hasMetadata(METADATA_KEY, target.constructor)
|
|
24
|
-
? Reflect.getMetadata(METADATA_KEY, target.constructor)
|
|
25
|
-
: createStore();
|
|
26
|
-
hooks.set(propertyKey, execute);
|
|
27
|
-
Reflect.defineMetadata(METADATA_KEY, hooks, target.constructor);
|
|
28
|
-
};
|
|
29
|
-
exports.auto = auto;
|
|
30
|
-
const getAutorunHooks = (target) => {
|
|
31
|
-
return Reflect.hasMetadata(METADATA_KEY, target.constructor)
|
|
32
|
-
? Reflect.getMetadata(METADATA_KEY, target.constructor)
|
|
33
|
-
: new Map();
|
|
34
|
-
};
|
|
35
|
-
exports.getAutorunHooks = getAutorunHooks;
|
|
36
|
-
const hasAutorunHooks = (target) => {
|
|
37
|
-
return Reflect.hasMetadata(METADATA_KEY, target.constructor);
|
|
38
|
-
};
|
|
39
|
-
exports.hasAutorunHooks = hasAutorunHooks;
|
|
40
|
-
const startAutorun = (target, scope, createContext = (c) => c) => {
|
|
41
|
-
for (const [methodName, execute] of (0, exports.getAutorunHooks)(target)) {
|
|
42
|
-
execute(createContext(new AutorunContext(target, methodName, scope)));
|
|
43
|
-
}
|
|
44
|
-
};
|
|
45
|
-
exports.startAutorun = startAutorun;
|
package/cjm/hook.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.hasHooks = exports.getHooks = exports.hook = void 0;
|
|
4
|
-
const hook = (key, fn = () => []) => (target, propertyKey) => {
|
|
5
|
-
const hooks = Reflect.hasMetadata(key, target.constructor)
|
|
6
|
-
? Reflect.getMetadata(key, target.constructor)
|
|
7
|
-
: new Map();
|
|
8
|
-
hooks.set(propertyKey, fn);
|
|
9
|
-
Reflect.defineMetadata(key, hooks, target.constructor); // eslint-disable-line @typescript-eslint/ban-types
|
|
10
|
-
};
|
|
11
|
-
exports.hook = hook;
|
|
12
|
-
function getHooks(target, key) {
|
|
13
|
-
return Reflect.hasMetadata(key, target.constructor) ? Reflect.getMetadata(key, target.constructor) : new Map();
|
|
14
|
-
}
|
|
15
|
-
exports.getHooks = getHooks;
|
|
16
|
-
function hasHooks(target, key) {
|
|
17
|
-
return Reflect.hasMetadata(key, target.constructor);
|
|
18
|
-
}
|
|
19
|
-
exports.hasHooks = hasHooks;
|
package/esm/autorun.js
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { resolveArgs } from './injector/MetadataInjector';
|
|
2
|
-
const METADATA_KEY = 'autorun';
|
|
3
|
-
export class AutorunContext {
|
|
4
|
-
constructor(instance, methodName, scope) {
|
|
5
|
-
this.instance = instance;
|
|
6
|
-
this.methodName = methodName;
|
|
7
|
-
this.scope = scope;
|
|
8
|
-
}
|
|
9
|
-
resolveArgs(...args) {
|
|
10
|
-
return resolveArgs(this.instance.constructor, this.methodName)(this.scope, ...args);
|
|
11
|
-
}
|
|
12
|
-
invokeMethod({ args = this.resolveArgs() }) {
|
|
13
|
-
// @ts-ignore
|
|
14
|
-
return this.instance[this.methodName](...args);
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
const createStore = () => new Map();
|
|
18
|
-
export const auto = (execute) => (target, propertyKey) => {
|
|
19
|
-
const hooks = Reflect.hasMetadata(METADATA_KEY, target.constructor)
|
|
20
|
-
? Reflect.getMetadata(METADATA_KEY, target.constructor)
|
|
21
|
-
: createStore();
|
|
22
|
-
hooks.set(propertyKey, execute);
|
|
23
|
-
Reflect.defineMetadata(METADATA_KEY, hooks, target.constructor);
|
|
24
|
-
};
|
|
25
|
-
export const getAutorunHooks = (target) => {
|
|
26
|
-
return Reflect.hasMetadata(METADATA_KEY, target.constructor)
|
|
27
|
-
? Reflect.getMetadata(METADATA_KEY, target.constructor)
|
|
28
|
-
: new Map();
|
|
29
|
-
};
|
|
30
|
-
export const hasAutorunHooks = (target) => {
|
|
31
|
-
return Reflect.hasMetadata(METADATA_KEY, target.constructor);
|
|
32
|
-
};
|
|
33
|
-
export const startAutorun = (target, scope, createContext = (c) => c) => {
|
|
34
|
-
for (const [methodName, execute] of getAutorunHooks(target)) {
|
|
35
|
-
execute(createContext(new AutorunContext(target, methodName, scope)));
|
|
36
|
-
}
|
|
37
|
-
};
|
package/esm/hook.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export const hook = (key, fn = () => []) => (target, propertyKey) => {
|
|
2
|
-
const hooks = Reflect.hasMetadata(key, target.constructor)
|
|
3
|
-
? Reflect.getMetadata(key, target.constructor)
|
|
4
|
-
: new Map();
|
|
5
|
-
hooks.set(propertyKey, fn);
|
|
6
|
-
Reflect.defineMetadata(key, hooks, target.constructor); // eslint-disable-line @typescript-eslint/ban-types
|
|
7
|
-
};
|
|
8
|
-
export function getHooks(target, key) {
|
|
9
|
-
return Reflect.hasMetadata(key, target.constructor) ? Reflect.getMetadata(key, target.constructor) : new Map();
|
|
10
|
-
}
|
|
11
|
-
export function hasHooks(target, key) {
|
|
12
|
-
return Reflect.hasMetadata(key, target.constructor);
|
|
13
|
-
}
|
package/typings/autorun.d.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { IContainer } from './container/IContainer';
|
|
2
|
-
export declare class AutorunContext {
|
|
3
|
-
instance: object;
|
|
4
|
-
methodName: string;
|
|
5
|
-
scope: IContainer;
|
|
6
|
-
constructor(instance: object, methodName: string, scope: IContainer);
|
|
7
|
-
resolveArgs(...args: unknown[]): unknown[];
|
|
8
|
-
invokeMethod({ args }: {
|
|
9
|
-
args: unknown[];
|
|
10
|
-
}): unknown;
|
|
11
|
-
}
|
|
12
|
-
type AutorunHandler = <T extends AutorunContext>(context: T) => void;
|
|
13
|
-
export declare const auto: (execute: AutorunHandler) => MethodDecorator;
|
|
14
|
-
export declare const getAutorunHooks: (target: object) => Map<string, AutorunHandler>;
|
|
15
|
-
export declare const hasAutorunHooks: (target: object) => boolean;
|
|
16
|
-
export declare const startAutorun: <Context extends AutorunContext>(target: object, scope: IContainer, createContext?: (c: AutorunContext) => Context) => void;
|
|
17
|
-
export {};
|
package/typings/hook.d.ts
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { ArgsFn } from './provider/IProvider';
|
|
2
|
-
export declare const hook: (key: string | symbol, fn?: ArgsFn) => MethodDecorator;
|
|
3
|
-
export declare function getHooks(target: object, key: string | symbol): Map<string, ArgsFn>;
|
|
4
|
-
export declare function hasHooks(target: object, key: string | symbol): boolean;
|