@hyperbook/types 0.20.0 → 0.22.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 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
- yarn add @hyperbook/types
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, 'navigation'> & {
62
+ export type HyperbookSectionFrontmatter = Omit<HyperbookPageFrontmatter, "navigation"> & {
56
63
  virtual?: boolean;
57
64
  expanded?: boolean;
58
65
  navigation?: SectionNavigation;
@@ -124,6 +131,10 @@ export type HyperbookJson = {
124
131
  label: string;
125
132
  };
126
133
  links?: Link[];
134
+ cloud?: {
135
+ url: string;
136
+ id: string;
137
+ };
127
138
  elements?: {
128
139
  bookmarks?: false | ElementConfig;
129
140
  code?: ElementConfig & {
@@ -141,11 +152,9 @@ export type HyperbookJson = {
141
152
  edit?: boolean;
142
153
  };
143
154
  onlineide?: ElementConfig & {
144
- url?: string;
145
155
  height?: string | number;
146
156
  };
147
157
  sqlide?: ElementConfig & {
148
- url?: string;
149
158
  db?: string;
150
159
  height?: string | number;
151
160
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hyperbook/types",
3
- "version": "0.20.0",
3
+ "version": "0.22.0",
4
4
  "author": "Mike Barkmin",
5
5
  "homepage": "https://github.com/openpatch/hyperbook#readme",
6
6
  "license": "MIT",