@hyperbook/types 0.23.0 → 0.23.2
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.d.ts +26 -0
- package/dist/index.js +6 -0
- package/dist/index.js.map +3 -3
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -161,10 +161,24 @@ export type HyperbookJson = {
|
|
|
161
161
|
onlineide?: ElementConfig & {
|
|
162
162
|
height?: string | number;
|
|
163
163
|
};
|
|
164
|
+
kirimoto?: ElementConfig & {
|
|
165
|
+
height?: string;
|
|
166
|
+
settings?: string;
|
|
167
|
+
};
|
|
164
168
|
sqlide?: ElementConfig & {
|
|
165
169
|
db?: string;
|
|
166
170
|
height?: string | number;
|
|
167
171
|
};
|
|
172
|
+
emoji?: ElementConfig & {
|
|
173
|
+
/**
|
|
174
|
+
* How emojis are rendered.
|
|
175
|
+
* - "native": Emojis are kept as text and drawn with the emoji font of
|
|
176
|
+
* the reader's operating system (default).
|
|
177
|
+
* - "twemoji": Emojis are replaced with Twemoji images, so they look the
|
|
178
|
+
* same on every platform.
|
|
179
|
+
*/
|
|
180
|
+
style?: "native" | "twemoji";
|
|
181
|
+
};
|
|
168
182
|
};
|
|
169
183
|
};
|
|
170
184
|
export type LanguageString = Partial<Record<Language, string>>;
|
|
@@ -199,5 +213,17 @@ export interface HyperbookContext {
|
|
|
199
213
|
versioned?: boolean;
|
|
200
214
|
}): string;
|
|
201
215
|
navigation: Navigation;
|
|
216
|
+
/**
|
|
217
|
+
* Collects absolute paths of files inlined into the page while it is being
|
|
218
|
+
* processed, so the dev server can rebuild exactly the pages that used them.
|
|
219
|
+
* Only set during a build that tracks dependencies.
|
|
220
|
+
*/
|
|
221
|
+
dependencies?: Set<string>;
|
|
202
222
|
}
|
|
223
|
+
/**
|
|
224
|
+
* Checks whether a path is an absolute URL and therefore must be passed
|
|
225
|
+
* through untouched by `makeUrl`, instead of being resolved against the
|
|
226
|
+
* hyperbook's base path.
|
|
227
|
+
*/
|
|
228
|
+
export declare const isExternalUrl: (path: string) => boolean;
|
|
203
229
|
export {};
|
package/dist/index.js
CHANGED
package/dist/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": [],
|
|
4
|
-
"sourcesContent": [],
|
|
5
|
-
"mappings": "",
|
|
3
|
+
"sources": ["../src/index.ts"],
|
|
4
|
+
"sourcesContent": ["type ElementConfig = {\n version?: string;\n};\n\nexport type Script =\n | string\n | {\n type?: \"module\" | \"plain/text\";\n src: string;\n crossorigin?: boolean;\n position: \"head\" | \"body\";\n versioned?: boolean;\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 glossary: HyperbookPage[];\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 Layout = \"default\" | \"wide\" | \"standalone\";\n\nexport type BreadcrumbConfig = {\n home?: string;\n separator?: string;\n};\n\nexport type PageNavigation = \"default\" | \"hidden\";\n\nexport type SectionNavigation =\n | \"default\"\n | \"hidden\"\n | \"virtual\"\n | \"page\"\n | \"expanded\";\n\nexport type HyperbookPageFrontmatter = {\n name: string;\n title?: string;\n permaid?: string;\n lang?: Language;\n qrcode?: boolean;\n description?: string;\n keywords?: string[];\n scripts?: string[];\n styles?: string[];\n index?: number;\n hide?: boolean;\n toc?: boolean;\n next?: string;\n prev?: string;\n layout?: Layout;\n breadcrumb?: boolean | BreadcrumbConfig;\n navigation?: PageNavigation;\n};\n\nexport type HyperbookSectionFrontmatter = Omit<\n HyperbookPageFrontmatter,\n \"navigation\"\n> & {\n virtual?: boolean;\n expanded?: boolean;\n navigation?: SectionNavigation;\n};\n\nexport type HyperbookPage = HyperbookPageFrontmatter & {\n isEmpty?: boolean;\n href?: string;\n path?: {\n directory: string;\n relative: string;\n absolute: string;\n href: string | null;\n permalink: string | null;\n };\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 allowDangerousHtml?: boolean;\n trailingSlash?: boolean;\n importExport?: boolean;\n search?: boolean;\n qrcode?: boolean;\n toc?: boolean;\n llms?: boolean;\n breadcrumb?: boolean | BreadcrumbConfig;\n author?: {\n name?: string;\n url?: string;\n };\n /**\n * Controls how the Hyperbook version is displayed.\n * - \"text\": Shows version below the \"Powered by Hyperbook\" label.\n * - \"tooltip\": Shows version on hover of the \"Powered by Hyperbook\" label.\n * - \"console\": Outputs version as ASCII art in the browser console (default).\n */\n version?: \"text\" | \"tooltip\" | \"console\";\n font?: string;\n fonts?: {\n heading?: string;\n body?: string;\n code?: string;\n };\n scripts?: string[];\n styles?: string[];\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?:\n | string\n | {\n url: string;\n label: string;\n };\n links?: Link[];\n cloud?: {\n url: string;\n id: string;\n };\n elements?: {\n bookmarks?: false | ElementConfig;\n code?: ElementConfig & {\n theme?:\n | {\n dark: string;\n light: string;\n }\n | string;\n bypassInline?: boolean;\n showLineNumbers?: boolean;\n };\n excalidraw?: ElementConfig & {\n autoZoom?: boolean;\n center?: boolean;\n aspectRatio?: string;\n edit?: boolean;\n };\n onlineide?: ElementConfig & {\n height?: string | number;\n };\n kirimoto?: ElementConfig & {\n height?: string;\n settings?: string;\n };\n sqlide?: ElementConfig & {\n db?: string;\n height?: string | number;\n };\n emoji?: ElementConfig & {\n /**\n * How emojis are rendered.\n * - \"native\": Emojis are kept as text and drawn with the emoji font of\n * the reader's operating system (default).\n * - \"twemoji\": Emojis are replaced with Twemoji images, so they look the\n * same on every platform.\n */\n style?: \"native\" | \"twemoji\";\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\nexport interface HyperbookContext {\n root: string;\n config: HyperbookJson;\n library?: HyperlibraryJson;\n project?: Hyperproject;\n version?: string;\n makeUrl(\n path: string | string[],\n base: \"public\" | \"book\" | \"archive\" | \"glossary\" | \"assets\",\n page?: HyperbookPage,\n options?: {\n versioned?: boolean;\n },\n ): string;\n navigation: Navigation;\n /**\n * Collects absolute paths of files inlined into the page while it is being\n * processed, so the dev server can rebuild exactly the pages that used them.\n * Only set during a build that tracks dependencies.\n */\n dependencies?: Set<string>;\n}\n\n/**\n * Matches a URI scheme at the start of a string, as defined by RFC 3986.\n * This covers `https://` and `data:` as well as schemes without an authority\n * like `mailto:`, `tel:` or `sms:`.\n */\nconst URL_SCHEME = /^[a-zA-Z][a-zA-Z0-9+.-]*:/;\n\n/**\n * Checks whether a path is an absolute URL and therefore must be passed\n * through untouched by `makeUrl`, instead of being resolved against the\n * hyperbook's base path.\n */\nexport const isExternalUrl = (path: string): boolean => URL_SCHEME.test(path);\n"],
|
|
5
|
+
"mappings": ";AA0QA,IAAM,aAAa;AAOZ,IAAM,gBAAgB,CAAC,SAA0B,WAAW,KAAK,IAAI;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|