koatty 3.11.9 → 3.13.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/.rollup.config.js +28 -6
- package/CHANGELOG.md +1877 -184
- package/README.md +122 -139
- package/dist/README.md +122 -139
- package/dist/index.d.ts +56 -26
- package/dist/index.js +466 -749
- package/dist/index.mjs +406 -707
- package/dist/package.json +15 -16
- package/package.json +15 -16
package/dist/index.d.ts
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
/*!
|
2
2
|
* @Author: richen
|
3
|
-
* @Date: 2025-
|
3
|
+
* @Date: 2025-04-19 23:06:57
|
4
4
|
* @License: BSD (3-Clause)
|
5
5
|
* @Copyright (c) - <richenlin(at)gmail.com>
|
6
6
|
* @HomePage: https://koatty.org/
|
@@ -13,58 +13,88 @@ import { KoattyApplication } from 'koatty_core';
|
|
13
13
|
import { Logger as Logger_2 } from 'koatty_logger';
|
14
14
|
|
15
15
|
/**
|
16
|
-
*
|
17
|
-
*
|
16
|
+
* Bind event hook to target class.
|
17
|
+
*
|
18
|
+
* @param eventName - The application event name to bind
|
19
|
+
* @param eventFunc - The event hook function to be executed
|
20
|
+
* @param target - The target class to bind the event hook
|
21
|
+
* @returns {*}
|
22
|
+
* @throws Error if the decorated class does not inherit from Koatty.
|
23
|
+
* @example
|
24
|
+
* ```typescript
|
18
25
|
* export function TestDecorator(): ClassDecorator {
|
19
|
-
*
|
20
|
-
*
|
26
|
+
* return (target: Function) => {
|
27
|
+
* BindEventHook(AppEvent.appBoot, (app: KoattyApplication) => {
|
21
28
|
* // todo
|
22
29
|
* return Promise.resolve();
|
23
30
|
* }, target)
|
24
31
|
* }
|
25
32
|
* }
|
26
|
-
* @param {AppEvent} eventName
|
27
|
-
* @param {EventHookFunc} eventFunc
|
28
|
-
* @param {any} target
|
29
|
-
* @return {*}
|
30
33
|
*/
|
31
34
|
export declare function BindEventHook(eventName: AppEvent, eventFunc: EventHookFunc, target: any): void;
|
32
35
|
|
33
36
|
/**
|
34
|
-
* Bootstrap application
|
37
|
+
* Bootstrap decorator for Koatty application class.
|
38
|
+
*
|
39
|
+
* @param bootFunc Optional function to execute during bootstrap process
|
40
|
+
* @returns ClassDecorator
|
41
|
+
* @throws Error if target class does not inherit from Koatty
|
35
42
|
*
|
36
|
-
* @
|
37
|
-
*
|
38
|
-
* @
|
43
|
+
* @example
|
44
|
+
* ```ts
|
45
|
+
* @Bootstrap()
|
46
|
+
* export class App extends Koatty {
|
47
|
+
* // ...
|
48
|
+
* }
|
49
|
+
* ```
|
39
50
|
*/
|
40
51
|
export declare function Bootstrap(bootFunc?: Function): ClassDecorator;
|
41
52
|
|
42
53
|
/**
|
43
|
-
*
|
54
|
+
* Component scan decorator for Koatty application.
|
55
|
+
* Scans the specified path(s) for components and registers them in the IOC container.
|
44
56
|
*
|
45
|
-
* @
|
46
|
-
* @
|
47
|
-
* @
|
57
|
+
* @param {string | string[]} [scanPath] - The path or array of paths to scan for components
|
58
|
+
* @returns {ClassDecorator} A class decorator that enables component scanning
|
59
|
+
* @throws {Error} If the decorated class does not inherit from Koatty
|
60
|
+
* @example
|
61
|
+
* ```typescript
|
62
|
+
* @ComponentScan()
|
63
|
+
* export class App extends Koatty {
|
64
|
+
* // ...
|
65
|
+
* }
|
66
|
+
* ```
|
48
67
|
*/
|
49
68
|
export declare function ComponentScan(scanPath?: string | string[]): ClassDecorator;
|
50
69
|
|
51
70
|
export { Config }
|
52
71
|
|
53
72
|
/**
|
54
|
-
*
|
73
|
+
* Configuration scan decorator, used to scan and load configuration files.
|
55
74
|
*
|
56
|
-
* @
|
57
|
-
* @
|
58
|
-
* @
|
75
|
+
* @param scanPath - The path or array of paths to scan for configuration files. If not provided, defaults to empty string.
|
76
|
+
* @returns A class decorator function that registers configuration scan metadata.
|
77
|
+
* @throws Error if the decorated class does not inherit from Koatty.
|
78
|
+
* @example
|
79
|
+
* ```typescript
|
80
|
+
* @ConfigurationScan()
|
81
|
+
* export class App extends Koatty {
|
82
|
+
* // ...
|
83
|
+
* }
|
59
84
|
*/
|
60
85
|
export declare function ConfigurationScan(scanPath?: string | string[]): ClassDecorator;
|
61
86
|
|
62
87
|
/**
|
63
|
-
*
|
64
|
-
*
|
65
|
-
* @
|
66
|
-
* @
|
67
|
-
* @
|
88
|
+
* Decorator function for bootstrapping a Koatty application.
|
89
|
+
*
|
90
|
+
* @param bootFunc Optional function to be executed during bootstrap process
|
91
|
+
* @returns A decorator function that validates and executes the bootstrap process
|
92
|
+
* @throws Error if the target class does not inherit from Koatty
|
93
|
+
*
|
94
|
+
* @example
|
95
|
+
* ```typescript
|
96
|
+
* app = await ExecBootStrap()(App);
|
97
|
+
* ```
|
68
98
|
*/
|
69
99
|
export declare function ExecBootStrap(bootFunc?: Function): (target: any) => Promise<KoattyApplication>;
|
70
100
|
|