@tnotesjs/core 0.1.0 → 0.1.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.

Potentially problematic release.


This version of @tnotesjs/core might be problematic. Click here for more details.

@@ -1,2 +0,0 @@
1
-
2
- export { }
package/dist/index.d.ts DELETED
@@ -1,138 +0,0 @@
1
- /**
2
- * .vitepress/tnotes/types/config.ts
3
- *
4
- * 配置相关类型定义
5
- */
6
- /**
7
- * 知识库的 .tnotes.json 配置文件类型
8
- */
9
- interface TNotesConfig {
10
- id?: string;
11
- author: string;
12
- ignore_dirs: string[];
13
- repoName: string;
14
- keywords: string[];
15
- socialLinks: SocialLink[];
16
- menuItems: MenuItem[];
17
- sidebarShowNoteId: boolean;
18
- port?: number;
19
- packageManager?: 'pnpm' | 'npm' | 'yarn';
20
- root_item: RootItem;
21
- }
22
- /**
23
- * 图标配置
24
- */
25
- interface IconConfig {
26
- svg?: string;
27
- src?: string;
28
- }
29
- /**
30
- * 社交链接类型
31
- */
32
- interface SocialLink {
33
- ariaLabel?: string;
34
- icon: string | IconConfig;
35
- link: string;
36
- }
37
- /**
38
- * 菜单项类型
39
- */
40
- interface MenuItem {
41
- text: string;
42
- link: string;
43
- }
44
- /**
45
- * 根项目配置
46
- */
47
- interface RootItem {
48
- icon?: IconConfig;
49
- title: string;
50
- completed_notes_count: Record<string, number>;
51
- details: string;
52
- link: string;
53
- created_at: number;
54
- updated_at: number;
55
- days_since_birth: number;
56
- }
57
-
58
- /**
59
- * .vitepress/tnotes/types/note.ts
60
- *
61
- * 笔记相关类型定义
62
- */
63
- /**
64
- * 笔记的 .tnotes.json 配置类型
65
- */
66
- interface NoteConfig {
67
- id: string;
68
- bilibili: string[];
69
- tnotes: string[];
70
- yuque: string[];
71
- done: boolean;
72
- category?: string;
73
- enableDiscussions: boolean;
74
- description?: string;
75
- created_at: number;
76
- updated_at: number;
77
- }
78
- /**
79
- * 笔记信息
80
- */
81
- interface NoteInfo {
82
- index: string;
83
- path: string;
84
- dirName: string;
85
- readmePath: string;
86
- configPath: string;
87
- config?: NoteConfig;
88
- }
89
-
90
- /**
91
- * 配置管理器(单例模式)
92
- */
93
- declare class ConfigManager {
94
- private static instance;
95
- private config;
96
- private configPath;
97
- private rootPath;
98
- private constructor();
99
- /**
100
- * 使用指定的根路径初始化配置管理器
101
- *
102
- * 必须在 getInstance() 之前调用(如果需要指定 rootPath)。
103
- * 如果已经初始化,则忽略重复调用。
104
- */
105
- static init({ rootPath }: {
106
- rootPath: string;
107
- }): ConfigManager;
108
- /**
109
- * 获取单例实例
110
- */
111
- static getInstance(): ConfigManager;
112
- /**
113
- * 加载配置文件
114
- */
115
- loadConfig(configPath?: string): TNotesConfig;
116
- /**
117
- * 获取配置项
118
- */
119
- get<K extends keyof TNotesConfig>(key: K): TNotesConfig[K];
120
- /**
121
- * 获取所有配置
122
- */
123
- getAll(): TNotesConfig;
124
- /**
125
- * 获取项目根路径
126
- */
127
- getRootPath(): string;
128
- /**
129
- * @deprecated 使用 getRootPath() 替代
130
- */
131
- getDirname(): string;
132
- }
133
- /**
134
- * 获取配置管理器实例(便捷函数)
135
- */
136
- declare function getConfigManager(): ConfigManager;
137
-
138
- export { ConfigManager, type NoteConfig, type NoteInfo, type TNotesConfig, getConfigManager };