@hyperbook/types 0.19.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 +18 -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;
|
|
@@ -27,6 +34,12 @@ export type Term = {
|
|
|
27
34
|
export type Glossary = Record<string, Term[]>;
|
|
28
35
|
export type Language = "de" | "en" | "fr" | "es" | "it" | "pt" | "nl";
|
|
29
36
|
export type Layout = "default" | "wide" | "standalone";
|
|
37
|
+
export type BreadcrumbConfig = {
|
|
38
|
+
home?: string;
|
|
39
|
+
separator?: string;
|
|
40
|
+
};
|
|
41
|
+
export type PageNavigation = "default" | "hidden";
|
|
42
|
+
export type SectionNavigation = "default" | "hidden" | "virtual" | "page" | "expanded";
|
|
30
43
|
export type HyperbookPageFrontmatter = {
|
|
31
44
|
name: string;
|
|
32
45
|
title?: string;
|
|
@@ -43,10 +56,13 @@ export type HyperbookPageFrontmatter = {
|
|
|
43
56
|
next?: string;
|
|
44
57
|
prev?: string;
|
|
45
58
|
layout?: Layout;
|
|
59
|
+
breadcrumb?: boolean | BreadcrumbConfig;
|
|
60
|
+
navigation?: PageNavigation;
|
|
46
61
|
};
|
|
47
|
-
export type HyperbookSectionFrontmatter = HyperbookPageFrontmatter & {
|
|
62
|
+
export type HyperbookSectionFrontmatter = Omit<HyperbookPageFrontmatter, "navigation"> & {
|
|
48
63
|
virtual?: boolean;
|
|
49
64
|
expanded?: boolean;
|
|
65
|
+
navigation?: SectionNavigation;
|
|
50
66
|
};
|
|
51
67
|
export type HyperbookPage = HyperbookPageFrontmatter & {
|
|
52
68
|
isEmpty?: boolean;
|
|
@@ -79,6 +95,7 @@ export type HyperbookJson = {
|
|
|
79
95
|
qrcode?: boolean;
|
|
80
96
|
toc?: boolean;
|
|
81
97
|
llms?: boolean;
|
|
98
|
+
breadcrumb?: boolean | BreadcrumbConfig;
|
|
82
99
|
author?: {
|
|
83
100
|
name?: string;
|
|
84
101
|
url?: string;
|
|
@@ -131,11 +148,9 @@ export type HyperbookJson = {
|
|
|
131
148
|
edit?: boolean;
|
|
132
149
|
};
|
|
133
150
|
onlineide?: ElementConfig & {
|
|
134
|
-
url?: string;
|
|
135
151
|
height?: string | number;
|
|
136
152
|
};
|
|
137
153
|
sqlide?: ElementConfig & {
|
|
138
|
-
url?: string;
|
|
139
154
|
db?: string;
|
|
140
155
|
height?: string | number;
|
|
141
156
|
};
|