@hyperbook/types 0.8.1 → 0.9.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.
Files changed (2) hide show
  1. package/dist/index.d.ts +21 -1
  2. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -18,6 +18,7 @@ export type Navigation = {
18
18
  current: HyperbookPage | null;
19
19
  pages: HyperbookPage[];
20
20
  sections: HyperbookSection[];
21
+ glossary: HyperbookPage[];
21
22
  };
22
23
  export type Term = {
23
24
  name: string;
@@ -30,6 +31,8 @@ export type HyperbookPageFrontmatter = {
30
31
  lang?: Language;
31
32
  description?: string;
32
33
  keywords?: string[];
34
+ scripts?: string[];
35
+ styles?: string[];
33
36
  index?: number;
34
37
  hide?: boolean;
35
38
  toc?: boolean;
@@ -55,9 +58,9 @@ export type HyperbookSection = HyperbookSectionFrontmatter & {
55
58
  export type HyperbookFrontmatter = HyperbookPageFrontmatter | HyperbookSectionFrontmatter;
56
59
  export type HyperbookJson = {
57
60
  name: string;
58
- trailingSlash?: boolean;
59
61
  description?: string;
60
62
  logo?: string;
63
+ allowDangerousHtml?: boolean;
61
64
  author?: {
62
65
  name?: string;
63
66
  url?: string;
@@ -68,6 +71,8 @@ export type HyperbookJson = {
68
71
  body?: string;
69
72
  code?: string;
70
73
  };
74
+ scripts?: string[];
75
+ styles?: string[];
71
76
  colors?: {
72
77
  /**
73
78
  * @format color-hex
@@ -93,6 +98,13 @@ export type HyperbookJson = {
93
98
  links?: Link[];
94
99
  elements?: {
95
100
  bookmarks?: false | ElementConfig;
101
+ code?: ElementConfig & {
102
+ theme?: {
103
+ dark: string;
104
+ light: string;
105
+ } | string;
106
+ showLineNumbers?: boolean;
107
+ };
96
108
  excalidraw?: ElementConfig & {
97
109
  autoZoom?: boolean;
98
110
  center?: boolean;
@@ -132,4 +144,12 @@ export type Hyperproject = {
132
144
  type: "library";
133
145
  projects: Hyperproject[];
134
146
  });
147
+ export interface HyperbookContext {
148
+ root: string;
149
+ config: HyperbookJson;
150
+ library?: HyperlibraryJson;
151
+ project?: Hyperproject;
152
+ makeUrl(path: string | string[], base: "public" | "book" | "archive" | "glossary" | "assets"): string;
153
+ navigation: Navigation;
154
+ }
135
155
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hyperbook/types",
3
- "version": "0.8.1",
3
+ "version": "0.9.0",
4
4
  "author": "Mike Barkmin",
5
5
  "homepage": "https://github.com/openpatch/hyperbook#readme",
6
6
  "license": "MIT",