@hyperbook/types 0.20.0 → 0.21.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/README.md +21 -1
- package/dist/index.d.ts +8 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,9 +1,29 @@
|
|
|
1
1
|
# @hyperbook/types
|
|
2
2
|
|
|
3
|
+
TypeScript type definitions for Hyperbook. This package provides all the core types used across the Hyperbook ecosystem, including:
|
|
4
|
+
|
|
5
|
+
- Configuration types for `hyperbook.json` and `hyperlibrary.json`
|
|
6
|
+
- Page and section navigation types
|
|
7
|
+
- Language and layout definitions
|
|
8
|
+
- Element and directive configuration types
|
|
9
|
+
- Glossary and frontmatter types
|
|
10
|
+
|
|
3
11
|
## Installation
|
|
4
12
|
|
|
5
13
|
```sh
|
|
6
|
-
|
|
14
|
+
pnpm add @hyperbook/types
|
|
7
15
|
# or
|
|
8
16
|
npm i @hyperbook/types
|
|
9
17
|
```
|
|
18
|
+
|
|
19
|
+
## Usage
|
|
20
|
+
|
|
21
|
+
```typescript
|
|
22
|
+
import type { HyperbookJson, Language, Navigation } from "@hyperbook/types";
|
|
23
|
+
|
|
24
|
+
const config: HyperbookJson = {
|
|
25
|
+
name: "My Documentation",
|
|
26
|
+
language: "en",
|
|
27
|
+
// ...
|
|
28
|
+
};
|
|
29
|
+
```
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
type ElementConfig = {
|
|
2
2
|
version?: string;
|
|
3
3
|
};
|
|
4
|
+
export type Script = string | {
|
|
5
|
+
type?: "module" | "plain/text";
|
|
6
|
+
src: string;
|
|
7
|
+
crossorigin?: boolean;
|
|
8
|
+
position: "head" | "body";
|
|
9
|
+
versioned?: boolean;
|
|
10
|
+
};
|
|
4
11
|
export type LinkWithLinks = {
|
|
5
12
|
label: string;
|
|
6
13
|
icon?: string;
|
|
@@ -52,7 +59,7 @@ export type HyperbookPageFrontmatter = {
|
|
|
52
59
|
breadcrumb?: boolean | BreadcrumbConfig;
|
|
53
60
|
navigation?: PageNavigation;
|
|
54
61
|
};
|
|
55
|
-
export type HyperbookSectionFrontmatter = Omit<HyperbookPageFrontmatter,
|
|
62
|
+
export type HyperbookSectionFrontmatter = Omit<HyperbookPageFrontmatter, "navigation"> & {
|
|
56
63
|
virtual?: boolean;
|
|
57
64
|
expanded?: boolean;
|
|
58
65
|
navigation?: SectionNavigation;
|
|
@@ -141,11 +148,9 @@ export type HyperbookJson = {
|
|
|
141
148
|
edit?: boolean;
|
|
142
149
|
};
|
|
143
150
|
onlineide?: ElementConfig & {
|
|
144
|
-
url?: string;
|
|
145
151
|
height?: string | number;
|
|
146
152
|
};
|
|
147
153
|
sqlide?: ElementConfig & {
|
|
148
|
-
url?: string;
|
|
149
154
|
db?: string;
|
|
150
155
|
height?: string | number;
|
|
151
156
|
};
|