kecare-tools 1.0.0-beta.1 → 1.0.0-beta.13
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/index.ts +29 -13
- package/package.json +1 -1
package/index.ts
CHANGED
|
@@ -1,30 +1,46 @@
|
|
|
1
|
-
|
|
2
1
|
export type Article = {
|
|
3
2
|
id: string;
|
|
4
3
|
title: string;
|
|
5
|
-
desc
|
|
4
|
+
desc?: string;
|
|
6
5
|
coverSrc: string;
|
|
7
6
|
contentHtml: string;
|
|
8
7
|
createdAt: string;
|
|
9
|
-
author
|
|
8
|
+
author?: string;
|
|
10
9
|
to: string;
|
|
10
|
+
menu?: string | null;
|
|
11
|
+
menudata?: NavItem[] | null;
|
|
12
|
+
headings: Heading[];
|
|
13
|
+
};
|
|
14
|
+
export type HeadingH1 = {
|
|
15
|
+
depth: 1;
|
|
16
|
+
text: string;
|
|
17
|
+
id: string;
|
|
18
|
+
children: HeadingH2[];
|
|
11
19
|
};
|
|
12
20
|
|
|
13
|
-
export type
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
totalPages: number;
|
|
20
|
-
totalArticles: number;
|
|
21
|
-
listTitle?: string;
|
|
21
|
+
export type HeadingH2 = {
|
|
22
|
+
depth: 2;
|
|
23
|
+
text: string;
|
|
24
|
+
id: string;
|
|
25
|
+
};
|
|
26
|
+
export type Heading = HeadingH1 | HeadingH2;
|
|
22
27
|
|
|
23
|
-
}) => Promise<{
|
|
28
|
+
export type ArticleListGenerator = (params: { projectPath: string; article: Article; totalArticles: number; articles: Article[]; NavItems: NavItem[] }) => Promise<{
|
|
24
29
|
path: string;
|
|
25
30
|
template: string;
|
|
26
31
|
}>;
|
|
27
32
|
|
|
33
|
+
export type PagesListGenerator = (params: { projectPath: string; page: number; cards: []; isIndex: number; pageSize: number; totalPages: number; totalArticles: number; listTitle: number }) => Promise<{
|
|
34
|
+
path: string;
|
|
35
|
+
template: string;
|
|
36
|
+
}>;
|
|
37
|
+
|
|
38
|
+
export type NavItem = { text: string; link: string; level: number; desc?: string; icon?: string } | { text: string; items: NavItem[]; level: number };
|
|
39
|
+
|
|
28
40
|
export function defineArticleListGenerator<Generator extends ArticleListGenerator>(yourGenerator: Generator) {
|
|
29
41
|
return yourGenerator;
|
|
30
42
|
}
|
|
43
|
+
|
|
44
|
+
export function PagesListGenerator<Generator extends PagesListGenerator>(yourGenerator: Generator) {
|
|
45
|
+
return yourGenerator;
|
|
46
|
+
}
|