dsh-calendar 0.2.0 → 0.2.1
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/lib/index.d.ts +2 -1
- package/lib/index.js +2 -1
- package/package.json +1 -1
package/lib/index.d.ts
CHANGED
|
@@ -9,6 +9,8 @@
|
|
|
9
9
|
*/
|
|
10
10
|
import { type CalendarConfig } from './config.js';
|
|
11
11
|
import { type CalendarToolDefinition } from './tools.js';
|
|
12
|
+
/** cordis 服务注入:apply 里要用 ctx.tools,必须显式声明注入,否则宿主会抛 cannot get property without inject。 */
|
|
13
|
+
export declare const inject: string[];
|
|
12
14
|
/** 插件所需的最小 ctx 面(社区插件不依赖宿主内部类型)。 */
|
|
13
15
|
export interface CalendarPluginContext {
|
|
14
16
|
tools: {
|
|
@@ -22,7 +24,6 @@ export interface CalendarPluginContext {
|
|
|
22
24
|
* @param config - 插件配置(可缺省)。
|
|
23
25
|
*/
|
|
24
26
|
export declare function apply(ctx: CalendarPluginContext, config?: CalendarConfig | null): void;
|
|
25
|
-
export default apply;
|
|
26
27
|
export * from './parameters.js';
|
|
27
28
|
export * from './config.js';
|
|
28
29
|
export * from './ical.js';
|
package/lib/index.js
CHANGED
|
@@ -9,6 +9,8 @@
|
|
|
9
9
|
*/
|
|
10
10
|
import { resolveConfig } from './config.js';
|
|
11
11
|
import { buildCalendarTools } from './tools.js';
|
|
12
|
+
/** cordis 服务注入:apply 里要用 ctx.tools,必须显式声明注入,否则宿主会抛 cannot get property without inject。 */
|
|
13
|
+
export const inject = ['tools'];
|
|
12
14
|
/**
|
|
13
15
|
* 插件入口:惰性解析配置并注册五个日历工具。
|
|
14
16
|
* @param ctx - 宿主上下文(至少含 tools.register)。
|
|
@@ -33,7 +35,6 @@ export function apply(ctx, config) {
|
|
|
33
35
|
});
|
|
34
36
|
}
|
|
35
37
|
}
|
|
36
|
-
export default apply;
|
|
37
38
|
export * from './parameters.js';
|
|
38
39
|
export * from './config.js';
|
|
39
40
|
export * from './ical.js';
|