@tnotesjs/core 0.5.0 → 0.6.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/dist/chunk-3R7QSABB.cjs +502 -0
- package/dist/chunk-CZXRQPFJ.js +11 -0
- package/dist/{chunk-XCWFZLER.js → chunk-DUTS75WQ.js} +27 -493
- package/dist/chunk-HXED7KVT.cjs +11 -0
- package/dist/chunk-IHFUHB4J.cjs +176 -0
- package/dist/chunk-MZIXIY2Y.cjs +216 -0
- package/dist/chunk-TJ4527KA.cjs +5264 -0
- package/dist/chunk-U6IBLREL.js +502 -0
- package/dist/chunk-UNFSW5C2.js +176 -0
- package/dist/cli/index.cjs +936 -0
- package/dist/cli/index.d.cts +2 -0
- package/dist/cli/index.d.ts +2 -0
- package/dist/cli/index.js +9 -6
- package/dist/index.cjs +8 -0
- package/dist/index.d.cts +56 -0
- package/dist/index.d.ts +56 -0
- package/dist/markdown/index.cjs +82 -0
- package/dist/markdown/index.d.cts +36 -0
- package/dist/markdown/index.d.ts +36 -0
- package/dist/markdown/index.js +82 -0
- package/dist/note-oGm44Rw8.d.cts +84 -0
- package/dist/note-oGm44Rw8.d.ts +84 -0
- package/dist/types-CpsEy8lA.d.cts +221 -0
- package/dist/types-CwBWwNVv.d.ts +221 -0
- package/dist/vitepress/config/index.cjs +1669 -0
- package/dist/vitepress/config/index.d.cts +12 -0
- package/dist/vitepress/config/index.d.ts +12 -0
- package/dist/vitepress/config/index.js +10 -4
- package/dist/workspace/index.cjs +1207 -0
- package/dist/workspace/index.d.cts +14 -0
- package/dist/workspace/index.d.ts +14 -0
- package/dist/workspace/index.js +1207 -0
- package/package.json +14 -1
- package/vitepress/components/Settings/Settings.vue +3 -3
- package/vitepress/components/SidebarCard/SidebarCard.vue +3 -3
- package/vitepress/plugins/localSearchReindexLogic.ts +11 -3
package/dist/cli/index.js
CHANGED
|
@@ -22,10 +22,8 @@ import {
|
|
|
22
22
|
TocService,
|
|
23
23
|
UpdateNoteConfigCommand,
|
|
24
24
|
VitepressService,
|
|
25
|
-
buildFolderTocLine,
|
|
26
25
|
buildInitContext,
|
|
27
26
|
buildManualSteps,
|
|
28
|
-
buildTocLine,
|
|
29
27
|
createLogger,
|
|
30
28
|
defaultDisplayName,
|
|
31
29
|
getInitializedConfigPath,
|
|
@@ -35,18 +33,23 @@ import {
|
|
|
35
33
|
migrateReadmeToToc,
|
|
36
34
|
parseArgs,
|
|
37
35
|
parseReadmeCompletedNotes,
|
|
38
|
-
parseTocCompletedNotes,
|
|
39
|
-
processTocEmptyLines,
|
|
40
|
-
resolveNoteFromIndex,
|
|
41
36
|
runCommand,
|
|
42
37
|
validatePort,
|
|
43
38
|
validateTopic
|
|
44
|
-
} from "../chunk-
|
|
39
|
+
} from "../chunk-DUTS75WQ.js";
|
|
45
40
|
import {
|
|
46
41
|
ConfigManager,
|
|
47
42
|
getConfigManager,
|
|
48
43
|
stripDeprecatedRootItemFields
|
|
49
44
|
} from "../chunk-UJG3UU5X.js";
|
|
45
|
+
import {
|
|
46
|
+
buildFolderTocLine,
|
|
47
|
+
buildTocLine,
|
|
48
|
+
parseTocCompletedNotes,
|
|
49
|
+
processTocEmptyLines,
|
|
50
|
+
resolveNoteFromIndex
|
|
51
|
+
} from "../chunk-U6IBLREL.js";
|
|
52
|
+
import "../chunk-CZXRQPFJ.js";
|
|
50
53
|
|
|
51
54
|
// commands/update/UpdateCommand.ts
|
|
52
55
|
import { existsSync, readFileSync, writeFileSync } from "fs";
|
package/dist/index.cjs
ADDED
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { T as TNotesConfig } from './note-oGm44Rw8.cjs';
|
|
2
|
+
export { N as NoteConfig, a as NoteInfo } from './note-oGm44Rw8.cjs';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* 配置管理器(单例模式)
|
|
6
|
+
*/
|
|
7
|
+
declare class ConfigManager {
|
|
8
|
+
private static instance;
|
|
9
|
+
private config;
|
|
10
|
+
private configPath;
|
|
11
|
+
private rootPath;
|
|
12
|
+
private constructor();
|
|
13
|
+
/**
|
|
14
|
+
* 使用指定的根路径初始化配置管理器
|
|
15
|
+
*
|
|
16
|
+
* 必须在 getInstance() 之前调用(如果需要指定 rootPath)。
|
|
17
|
+
* 如果已经初始化,则忽略重复调用。
|
|
18
|
+
*/
|
|
19
|
+
static init({ rootPath }: {
|
|
20
|
+
rootPath: string;
|
|
21
|
+
}): ConfigManager;
|
|
22
|
+
/**
|
|
23
|
+
* 获取单例实例
|
|
24
|
+
*/
|
|
25
|
+
static getInstance(): ConfigManager;
|
|
26
|
+
/**
|
|
27
|
+
* 加载配置文件
|
|
28
|
+
*/
|
|
29
|
+
loadConfig(configPath?: string): TNotesConfig;
|
|
30
|
+
/**
|
|
31
|
+
* 清除内存中的配置缓存,下次 get/getAll 时重新从磁盘加载
|
|
32
|
+
*/
|
|
33
|
+
clearCache(): void;
|
|
34
|
+
/**
|
|
35
|
+
* 获取配置项
|
|
36
|
+
*/
|
|
37
|
+
get<K extends keyof TNotesConfig>(key: K): TNotesConfig[K];
|
|
38
|
+
/**
|
|
39
|
+
* 获取所有配置
|
|
40
|
+
*/
|
|
41
|
+
getAll(): TNotesConfig;
|
|
42
|
+
/**
|
|
43
|
+
* 获取项目根路径
|
|
44
|
+
*/
|
|
45
|
+
getRootPath(): string;
|
|
46
|
+
/**
|
|
47
|
+
* @deprecated 使用 getRootPath() 替代
|
|
48
|
+
*/
|
|
49
|
+
getDirname(): string;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* 获取配置管理器实例(便捷函数)
|
|
53
|
+
*/
|
|
54
|
+
declare function getConfigManager(): ConfigManager;
|
|
55
|
+
|
|
56
|
+
export { ConfigManager, TNotesConfig, getConfigManager };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { T as TNotesConfig } from './note-oGm44Rw8.js';
|
|
2
|
+
export { N as NoteConfig, a as NoteInfo } from './note-oGm44Rw8.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* 配置管理器(单例模式)
|
|
6
|
+
*/
|
|
7
|
+
declare class ConfigManager {
|
|
8
|
+
private static instance;
|
|
9
|
+
private config;
|
|
10
|
+
private configPath;
|
|
11
|
+
private rootPath;
|
|
12
|
+
private constructor();
|
|
13
|
+
/**
|
|
14
|
+
* 使用指定的根路径初始化配置管理器
|
|
15
|
+
*
|
|
16
|
+
* 必须在 getInstance() 之前调用(如果需要指定 rootPath)。
|
|
17
|
+
* 如果已经初始化,则忽略重复调用。
|
|
18
|
+
*/
|
|
19
|
+
static init({ rootPath }: {
|
|
20
|
+
rootPath: string;
|
|
21
|
+
}): ConfigManager;
|
|
22
|
+
/**
|
|
23
|
+
* 获取单例实例
|
|
24
|
+
*/
|
|
25
|
+
static getInstance(): ConfigManager;
|
|
26
|
+
/**
|
|
27
|
+
* 加载配置文件
|
|
28
|
+
*/
|
|
29
|
+
loadConfig(configPath?: string): TNotesConfig;
|
|
30
|
+
/**
|
|
31
|
+
* 清除内存中的配置缓存,下次 get/getAll 时重新从磁盘加载
|
|
32
|
+
*/
|
|
33
|
+
clearCache(): void;
|
|
34
|
+
/**
|
|
35
|
+
* 获取配置项
|
|
36
|
+
*/
|
|
37
|
+
get<K extends keyof TNotesConfig>(key: K): TNotesConfig[K];
|
|
38
|
+
/**
|
|
39
|
+
* 获取所有配置
|
|
40
|
+
*/
|
|
41
|
+
getAll(): TNotesConfig;
|
|
42
|
+
/**
|
|
43
|
+
* 获取项目根路径
|
|
44
|
+
*/
|
|
45
|
+
getRootPath(): string;
|
|
46
|
+
/**
|
|
47
|
+
* @deprecated 使用 getRootPath() 替代
|
|
48
|
+
*/
|
|
49
|
+
getDirname(): string;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* 获取配置管理器实例(便捷函数)
|
|
53
|
+
*/
|
|
54
|
+
declare function getConfigManager(): ConfigManager;
|
|
55
|
+
|
|
56
|
+
export { ConfigManager, TNotesConfig, getConfigManager };
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
var _chunkIHFUHB4Jcjs = require('../chunk-IHFUHB4J.cjs');
|
|
6
|
+
require('../chunk-HXED7KVT.cjs');
|
|
7
|
+
|
|
8
|
+
// markdown/components.ts
|
|
9
|
+
var TNOTES_COMPONENTS = [
|
|
10
|
+
{
|
|
11
|
+
name: "BilibiliOutsidePlayer",
|
|
12
|
+
aliases: ["B"],
|
|
13
|
+
kind: "block-component",
|
|
14
|
+
editable: "visual"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
name: "EnWordList",
|
|
18
|
+
aliases: ["E"],
|
|
19
|
+
kind: "block-component",
|
|
20
|
+
editable: "visual"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
name: "Footprints",
|
|
24
|
+
aliases: ["F"],
|
|
25
|
+
kind: "block-component",
|
|
26
|
+
editable: "visual"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
name: "NotesTable",
|
|
30
|
+
aliases: ["N"],
|
|
31
|
+
kind: "block-component",
|
|
32
|
+
editable: "visual"
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
name: "Tooltip",
|
|
36
|
+
kind: "inline-component",
|
|
37
|
+
editable: "visual"
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
name: "MindmapPreview",
|
|
41
|
+
kind: "block-component",
|
|
42
|
+
editable: "visual"
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
name: "Mermaid",
|
|
46
|
+
kind: "block-component",
|
|
47
|
+
editable: "visual"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
name: "Discussions",
|
|
51
|
+
kind: "block-component",
|
|
52
|
+
editable: "placeholder"
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
name: "SidebarCard",
|
|
56
|
+
kind: "block-component",
|
|
57
|
+
editable: "placeholder"
|
|
58
|
+
},
|
|
59
|
+
{ name: "swiper", kind: "container", editable: "visual" },
|
|
60
|
+
{ name: "code-group", kind: "container", editable: "visual" },
|
|
61
|
+
{ name: "details", kind: "container", editable: "visual" },
|
|
62
|
+
{ name: "info", kind: "container", editable: "visual" },
|
|
63
|
+
{ name: "tip", kind: "container", editable: "visual" },
|
|
64
|
+
{ name: "warning", kind: "container", editable: "visual" },
|
|
65
|
+
{ name: "danger", kind: "container", editable: "visual" },
|
|
66
|
+
{ name: "mermaid", kind: "fenced-language", editable: "visual" },
|
|
67
|
+
{ name: "mindmap", kind: "fenced-language", editable: "visual" },
|
|
68
|
+
{ name: "markmap", kind: "fenced-language", editable: "visual" }
|
|
69
|
+
];
|
|
70
|
+
function findTNotesComponent(name) {
|
|
71
|
+
const normalized = name.toLowerCase();
|
|
72
|
+
return TNOTES_COMPONENTS.find(
|
|
73
|
+
(component) => component.name.toLowerCase() === normalized || _optionalChain([component, 'access', _ => _.aliases, 'optionalAccess', _2 => _2.some, 'call', _3 => _3((alias) => alias.toLowerCase() === normalized)])
|
|
74
|
+
);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
exports.NOTE_TOC_END_TAG = _chunkIHFUHB4Jcjs.NOTE_TOC_END_TAG; exports.NOTE_TOC_START_TAG = _chunkIHFUHB4Jcjs.NOTE_TOC_START_TAG; exports.TNOTES_COMPONENTS = TNOTES_COMPONENTS; exports.findTNotesComponent = findTNotesComponent; exports.formatTNotesNote = _chunkIHFUHB4Jcjs.formatTNotesNote;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { m as WorkspaceNoteConfig } from '../types-CpsEy8lA.cjs';
|
|
2
|
+
import '../note-oGm44Rw8.cjs';
|
|
3
|
+
|
|
4
|
+
declare const NOTE_TOC_START_TAG = "<!-- region:toc -->";
|
|
5
|
+
declare const NOTE_TOC_END_TAG = "<!-- endregion:toc -->";
|
|
6
|
+
interface FormatTNotesNoteInput {
|
|
7
|
+
content: string;
|
|
8
|
+
noteIndex: string;
|
|
9
|
+
title: string;
|
|
10
|
+
repoOwner: string;
|
|
11
|
+
repoName: string;
|
|
12
|
+
noteConfig: WorkspaceNoteConfig;
|
|
13
|
+
prettier?: boolean;
|
|
14
|
+
}
|
|
15
|
+
interface FormatTNotesNoteResult {
|
|
16
|
+
content: string;
|
|
17
|
+
generatedTitle: string;
|
|
18
|
+
generatedToc: string[];
|
|
19
|
+
}
|
|
20
|
+
declare function formatTNotesNote(input: FormatTNotesNoteInput): Promise<FormatTNotesNoteResult>;
|
|
21
|
+
|
|
22
|
+
type TNotesComponentKind = 'block-component' | 'inline-component' | 'container' | 'fenced-language';
|
|
23
|
+
interface TNotesComponentDescriptor {
|
|
24
|
+
name: string;
|
|
25
|
+
aliases?: string[];
|
|
26
|
+
kind: TNotesComponentKind;
|
|
27
|
+
editable: 'visual' | 'source-only' | 'placeholder';
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Runtime-neutral registry shared by Desk and other TNotes clients. It does not
|
|
31
|
+
* import Vue or VitePress and is therefore safe in Node/Electron workers.
|
|
32
|
+
*/
|
|
33
|
+
declare const TNOTES_COMPONENTS: readonly TNotesComponentDescriptor[];
|
|
34
|
+
declare function findTNotesComponent(name: string): TNotesComponentDescriptor | undefined;
|
|
35
|
+
|
|
36
|
+
export { type FormatTNotesNoteInput, type FormatTNotesNoteResult, NOTE_TOC_END_TAG, NOTE_TOC_START_TAG, TNOTES_COMPONENTS, type TNotesComponentDescriptor, type TNotesComponentKind, findTNotesComponent, formatTNotesNote };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { m as WorkspaceNoteConfig } from '../types-CwBWwNVv.js';
|
|
2
|
+
import '../note-oGm44Rw8.js';
|
|
3
|
+
|
|
4
|
+
declare const NOTE_TOC_START_TAG = "<!-- region:toc -->";
|
|
5
|
+
declare const NOTE_TOC_END_TAG = "<!-- endregion:toc -->";
|
|
6
|
+
interface FormatTNotesNoteInput {
|
|
7
|
+
content: string;
|
|
8
|
+
noteIndex: string;
|
|
9
|
+
title: string;
|
|
10
|
+
repoOwner: string;
|
|
11
|
+
repoName: string;
|
|
12
|
+
noteConfig: WorkspaceNoteConfig;
|
|
13
|
+
prettier?: boolean;
|
|
14
|
+
}
|
|
15
|
+
interface FormatTNotesNoteResult {
|
|
16
|
+
content: string;
|
|
17
|
+
generatedTitle: string;
|
|
18
|
+
generatedToc: string[];
|
|
19
|
+
}
|
|
20
|
+
declare function formatTNotesNote(input: FormatTNotesNoteInput): Promise<FormatTNotesNoteResult>;
|
|
21
|
+
|
|
22
|
+
type TNotesComponentKind = 'block-component' | 'inline-component' | 'container' | 'fenced-language';
|
|
23
|
+
interface TNotesComponentDescriptor {
|
|
24
|
+
name: string;
|
|
25
|
+
aliases?: string[];
|
|
26
|
+
kind: TNotesComponentKind;
|
|
27
|
+
editable: 'visual' | 'source-only' | 'placeholder';
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Runtime-neutral registry shared by Desk and other TNotes clients. It does not
|
|
31
|
+
* import Vue or VitePress and is therefore safe in Node/Electron workers.
|
|
32
|
+
*/
|
|
33
|
+
declare const TNOTES_COMPONENTS: readonly TNotesComponentDescriptor[];
|
|
34
|
+
declare function findTNotesComponent(name: string): TNotesComponentDescriptor | undefined;
|
|
35
|
+
|
|
36
|
+
export { type FormatTNotesNoteInput, type FormatTNotesNoteResult, NOTE_TOC_END_TAG, NOTE_TOC_START_TAG, TNOTES_COMPONENTS, type TNotesComponentDescriptor, type TNotesComponentKind, findTNotesComponent, formatTNotesNote };
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import {
|
|
2
|
+
NOTE_TOC_END_TAG,
|
|
3
|
+
NOTE_TOC_START_TAG,
|
|
4
|
+
formatTNotesNote
|
|
5
|
+
} from "../chunk-UNFSW5C2.js";
|
|
6
|
+
import "../chunk-CZXRQPFJ.js";
|
|
7
|
+
|
|
8
|
+
// markdown/components.ts
|
|
9
|
+
var TNOTES_COMPONENTS = [
|
|
10
|
+
{
|
|
11
|
+
name: "BilibiliOutsidePlayer",
|
|
12
|
+
aliases: ["B"],
|
|
13
|
+
kind: "block-component",
|
|
14
|
+
editable: "visual"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
name: "EnWordList",
|
|
18
|
+
aliases: ["E"],
|
|
19
|
+
kind: "block-component",
|
|
20
|
+
editable: "visual"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
name: "Footprints",
|
|
24
|
+
aliases: ["F"],
|
|
25
|
+
kind: "block-component",
|
|
26
|
+
editable: "visual"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
name: "NotesTable",
|
|
30
|
+
aliases: ["N"],
|
|
31
|
+
kind: "block-component",
|
|
32
|
+
editable: "visual"
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
name: "Tooltip",
|
|
36
|
+
kind: "inline-component",
|
|
37
|
+
editable: "visual"
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
name: "MindmapPreview",
|
|
41
|
+
kind: "block-component",
|
|
42
|
+
editable: "visual"
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
name: "Mermaid",
|
|
46
|
+
kind: "block-component",
|
|
47
|
+
editable: "visual"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
name: "Discussions",
|
|
51
|
+
kind: "block-component",
|
|
52
|
+
editable: "placeholder"
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
name: "SidebarCard",
|
|
56
|
+
kind: "block-component",
|
|
57
|
+
editable: "placeholder"
|
|
58
|
+
},
|
|
59
|
+
{ name: "swiper", kind: "container", editable: "visual" },
|
|
60
|
+
{ name: "code-group", kind: "container", editable: "visual" },
|
|
61
|
+
{ name: "details", kind: "container", editable: "visual" },
|
|
62
|
+
{ name: "info", kind: "container", editable: "visual" },
|
|
63
|
+
{ name: "tip", kind: "container", editable: "visual" },
|
|
64
|
+
{ name: "warning", kind: "container", editable: "visual" },
|
|
65
|
+
{ name: "danger", kind: "container", editable: "visual" },
|
|
66
|
+
{ name: "mermaid", kind: "fenced-language", editable: "visual" },
|
|
67
|
+
{ name: "mindmap", kind: "fenced-language", editable: "visual" },
|
|
68
|
+
{ name: "markmap", kind: "fenced-language", editable: "visual" }
|
|
69
|
+
];
|
|
70
|
+
function findTNotesComponent(name) {
|
|
71
|
+
const normalized = name.toLowerCase();
|
|
72
|
+
return TNOTES_COMPONENTS.find(
|
|
73
|
+
(component) => component.name.toLowerCase() === normalized || component.aliases?.some((alias) => alias.toLowerCase() === normalized)
|
|
74
|
+
);
|
|
75
|
+
}
|
|
76
|
+
export {
|
|
77
|
+
NOTE_TOC_END_TAG,
|
|
78
|
+
NOTE_TOC_START_TAG,
|
|
79
|
+
TNOTES_COMPONENTS,
|
|
80
|
+
findTNotesComponent,
|
|
81
|
+
formatTNotesNote
|
|
82
|
+
};
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 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
|
+
icon: string | IconConfig;
|
|
34
|
+
link: string;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* 菜单项类型
|
|
38
|
+
*/
|
|
39
|
+
interface MenuItem {
|
|
40
|
+
text: string;
|
|
41
|
+
link: string;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* 根项目配置
|
|
45
|
+
*/
|
|
46
|
+
interface RootItem {
|
|
47
|
+
icon?: IconConfig;
|
|
48
|
+
title: string;
|
|
49
|
+
completed_notes_count: Record<string, number>;
|
|
50
|
+
details: string;
|
|
51
|
+
link: string;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* types/note.ts
|
|
56
|
+
*
|
|
57
|
+
* 笔记相关类型定义
|
|
58
|
+
*/
|
|
59
|
+
/**
|
|
60
|
+
* 笔记的 .tnotes.json 配置类型
|
|
61
|
+
*/
|
|
62
|
+
interface NoteConfig {
|
|
63
|
+
id: string;
|
|
64
|
+
bilibili: string[];
|
|
65
|
+
tnotes: string[];
|
|
66
|
+
yuque: string[];
|
|
67
|
+
done: boolean;
|
|
68
|
+
category?: string;
|
|
69
|
+
enableDiscussions: boolean;
|
|
70
|
+
description?: string;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* 笔记信息
|
|
74
|
+
*/
|
|
75
|
+
interface NoteInfo {
|
|
76
|
+
index: string;
|
|
77
|
+
path: string;
|
|
78
|
+
dirName: string;
|
|
79
|
+
readmePath: string;
|
|
80
|
+
configPath: string;
|
|
81
|
+
config?: NoteConfig;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export type { NoteConfig as N, TNotesConfig as T, NoteInfo as a };
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 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
|
+
icon: string | IconConfig;
|
|
34
|
+
link: string;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* 菜单项类型
|
|
38
|
+
*/
|
|
39
|
+
interface MenuItem {
|
|
40
|
+
text: string;
|
|
41
|
+
link: string;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* 根项目配置
|
|
45
|
+
*/
|
|
46
|
+
interface RootItem {
|
|
47
|
+
icon?: IconConfig;
|
|
48
|
+
title: string;
|
|
49
|
+
completed_notes_count: Record<string, number>;
|
|
50
|
+
details: string;
|
|
51
|
+
link: string;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* types/note.ts
|
|
56
|
+
*
|
|
57
|
+
* 笔记相关类型定义
|
|
58
|
+
*/
|
|
59
|
+
/**
|
|
60
|
+
* 笔记的 .tnotes.json 配置类型
|
|
61
|
+
*/
|
|
62
|
+
interface NoteConfig {
|
|
63
|
+
id: string;
|
|
64
|
+
bilibili: string[];
|
|
65
|
+
tnotes: string[];
|
|
66
|
+
yuque: string[];
|
|
67
|
+
done: boolean;
|
|
68
|
+
category?: string;
|
|
69
|
+
enableDiscussions: boolean;
|
|
70
|
+
description?: string;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* 笔记信息
|
|
74
|
+
*/
|
|
75
|
+
interface NoteInfo {
|
|
76
|
+
index: string;
|
|
77
|
+
path: string;
|
|
78
|
+
dirName: string;
|
|
79
|
+
readmePath: string;
|
|
80
|
+
configPath: string;
|
|
81
|
+
config?: NoteConfig;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export type { NoteConfig as N, TNotesConfig as T, NoteInfo as a };
|