@hyperbook/types 0.3.0 → 0.4.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/index.cjs.js.map +1 -1
- package/dist/index.d.ts +50 -1
- package/package.json +1 -1
package/dist/index.cjs.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/index.ts"],
|
|
4
|
-
"sourcesContent": ["type ElementConfig = {\n version?: string;\n};\n\nexport type LinkWithLinks = {\n label: string;\n icon?: string;\n links: Link[];\n};\n\nexport type LinkWithHref = {\n label: string;\n icon?: string;\n href: string;\n};\n\nexport type Link = LinkWithHref | LinkWithLinks;\n\nexport type Language = \"de\" | \"en\" | \"fr\" | \"es\" | \"it\" | \"pt\" | \"nl\";\n\nexport type HyperbookJson = {\n name: string;\n description?: string;\n logo?: string;\n author?: {\n name?: string;\n url?: string;\n };\n font?: string;\n fonts?: {\n heading?: string;\n body?: string;\n code?: string;\n };\n colors?: {\n /**\n * @format color-hex\n */\n brand?: string;\n /**\n * @format color-hex\n */\n brandDark?: string;\n /**\n * @format color-hex\n */\n brandText?: string;\n inverted?: boolean;\n };\n basePath?: string;\n license?: string;\n language?: Language;\n repo?: string;\n links?: Link[];\n template?: string;\n elements?: {\n bookmarks?: false | ElementConfig;\n excalidraw?: ElementConfig & {\n autoZoom?: boolean;\n center?: boolean;\n aspectRation?: string;\n edit?: boolean;\n };\n };\n};\n\nexport type LanguageString = Record<Language, string
|
|
4
|
+
"sourcesContent": ["type ElementConfig = {\n version?: string;\n};\n\nexport type LinkWithLinks = {\n label: string;\n icon?: string;\n links: Link[];\n};\n\nexport type LinkWithHref = {\n label: string;\n icon?: string;\n href: string;\n};\n\nexport type Link = LinkWithHref | LinkWithLinks;\n\nexport type Navigation = {\n next: HyperbookPage | null;\n previous: HyperbookPage | null;\n current: HyperbookPage | null;\n pages: HyperbookPage[];\n sections: HyperbookSection[];\n};\n\nexport type Term = {\n name: string;\n href: string;\n};\n\nexport type Glossary = Record<string, Term[]>;\n\nexport type Language = \"de\" | \"en\" | \"fr\" | \"es\" | \"it\" | \"pt\" | \"nl\";\n\nexport type HyperbookPageFrontmatter = {\n name: string;\n lang?: Language;\n description?: string;\n keywords?: string[];\n index?: number;\n hide?: boolean;\n toc?: boolean;\n};\n\nexport type HyperbookSectionFrontmatter = HyperbookPageFrontmatter & {\n virtual?: boolean;\n expanded?: boolean;\n};\n\nexport type HyperbookPage = HyperbookPageFrontmatter & {\n isEmpty?: boolean;\n href?: string;\n repo?: string;\n};\n\nexport type HyperbookSection = HyperbookSectionFrontmatter & {\n isEmpty?: boolean;\n href?: string;\n pages: HyperbookPage[];\n sections: HyperbookSection[];\n repo?: string;\n};\n\nexport type HyperbookFrontmatter =\n | HyperbookPageFrontmatter\n | HyperbookSectionFrontmatter;\n\nexport type HyperbookJson = {\n name: string;\n description?: string;\n logo?: string;\n author?: {\n name?: string;\n url?: string;\n };\n font?: string;\n fonts?: {\n heading?: string;\n body?: string;\n code?: string;\n };\n colors?: {\n /**\n * @format color-hex\n */\n brand?: string;\n /**\n * @format color-hex\n */\n brandDark?: string;\n /**\n * @format color-hex\n */\n brandText?: string;\n inverted?: boolean;\n };\n basePath?: string;\n license?: string;\n language?: Language;\n repo?: string;\n links?: Link[];\n template?: string;\n elements?: {\n bookmarks?: false | ElementConfig;\n excalidraw?: ElementConfig & {\n autoZoom?: boolean;\n center?: boolean;\n aspectRation?: string;\n edit?: boolean;\n };\n };\n};\n\nexport type LanguageString = Partial<Record<Language, string>>;\n\nexport type HyperlibraryJson = {\n name: string | LanguageString;\n library: {\n src: string;\n basePath: string;\n icon?: string;\n name?: string | LanguageString;\n }[];\n basePath?: string;\n};\n\nexport type Hyperproject = {\n name: string | LanguageString;\n basePath?: string;\n icon?: string;\n src: string;\n} & ({ type: \"book\" } | { type: \"library\"; projects: Hyperproject[] });\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;AAAA;AAAA;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -12,7 +12,45 @@ export declare type LinkWithHref = {
|
|
|
12
12
|
href: string;
|
|
13
13
|
};
|
|
14
14
|
export declare type Link = LinkWithHref | LinkWithLinks;
|
|
15
|
+
export declare type Navigation = {
|
|
16
|
+
next: HyperbookPage | null;
|
|
17
|
+
previous: HyperbookPage | null;
|
|
18
|
+
current: HyperbookPage | null;
|
|
19
|
+
pages: HyperbookPage[];
|
|
20
|
+
sections: HyperbookSection[];
|
|
21
|
+
};
|
|
22
|
+
export declare type Term = {
|
|
23
|
+
name: string;
|
|
24
|
+
href: string;
|
|
25
|
+
};
|
|
26
|
+
export declare type Glossary = Record<string, Term[]>;
|
|
15
27
|
export declare type Language = "de" | "en" | "fr" | "es" | "it" | "pt" | "nl";
|
|
28
|
+
export declare type HyperbookPageFrontmatter = {
|
|
29
|
+
name: string;
|
|
30
|
+
lang?: Language;
|
|
31
|
+
description?: string;
|
|
32
|
+
keywords?: string[];
|
|
33
|
+
index?: number;
|
|
34
|
+
hide?: boolean;
|
|
35
|
+
toc?: boolean;
|
|
36
|
+
};
|
|
37
|
+
export declare type HyperbookSectionFrontmatter = HyperbookPageFrontmatter & {
|
|
38
|
+
virtual?: boolean;
|
|
39
|
+
expanded?: boolean;
|
|
40
|
+
};
|
|
41
|
+
export declare type HyperbookPage = HyperbookPageFrontmatter & {
|
|
42
|
+
isEmpty?: boolean;
|
|
43
|
+
href?: string;
|
|
44
|
+
repo?: string;
|
|
45
|
+
};
|
|
46
|
+
export declare type HyperbookSection = HyperbookSectionFrontmatter & {
|
|
47
|
+
isEmpty?: boolean;
|
|
48
|
+
href?: string;
|
|
49
|
+
pages: HyperbookPage[];
|
|
50
|
+
sections: HyperbookSection[];
|
|
51
|
+
repo?: string;
|
|
52
|
+
};
|
|
53
|
+
export declare type HyperbookFrontmatter = HyperbookPageFrontmatter | HyperbookSectionFrontmatter;
|
|
16
54
|
export declare type HyperbookJson = {
|
|
17
55
|
name: string;
|
|
18
56
|
description?: string;
|
|
@@ -58,7 +96,7 @@ export declare type HyperbookJson = {
|
|
|
58
96
|
};
|
|
59
97
|
};
|
|
60
98
|
};
|
|
61
|
-
export declare type LanguageString = Record<Language, string
|
|
99
|
+
export declare type LanguageString = Partial<Record<Language, string>>;
|
|
62
100
|
export declare type HyperlibraryJson = {
|
|
63
101
|
name: string | LanguageString;
|
|
64
102
|
library: {
|
|
@@ -69,4 +107,15 @@ export declare type HyperlibraryJson = {
|
|
|
69
107
|
}[];
|
|
70
108
|
basePath?: string;
|
|
71
109
|
};
|
|
110
|
+
export declare type Hyperproject = {
|
|
111
|
+
name: string | LanguageString;
|
|
112
|
+
basePath?: string;
|
|
113
|
+
icon?: string;
|
|
114
|
+
src: string;
|
|
115
|
+
} & ({
|
|
116
|
+
type: "book";
|
|
117
|
+
} | {
|
|
118
|
+
type: "library";
|
|
119
|
+
projects: Hyperproject[];
|
|
120
|
+
});
|
|
72
121
|
export {};
|