@hyperbook/types 0.4.0 → 0.6.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.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/index.ts"],
4
- "sourcesContent": ["type ElementConfig = {\n version?: string;\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};\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 HyperbookPageFrontmatter = {\n name: string;\n lang?: Language;\n description?: string;\n keywords?: string[];\n index?: number;\n hide?: boolean;\n toc?: boolean;\n};\n\nexport type HyperbookSectionFrontmatter = HyperbookPageFrontmatter & {\n virtual?: boolean;\n expanded?: boolean;\n};\n\nexport type HyperbookPage = HyperbookPageFrontmatter & {\n isEmpty?: boolean;\n href?: string;\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 author?: {\n name?: string;\n url?: string;\n };\n font?: string;\n fonts?: {\n heading?: string;\n body?: string;\n code?: string;\n };\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?: string;\n links?: Link[];\n template?: string;\n elements?: {\n bookmarks?: false | ElementConfig;\n excalidraw?: ElementConfig & {\n autoZoom?: boolean;\n center?: boolean;\n aspectRation?: string;\n edit?: boolean;\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"],
4
+ "sourcesContent": ["type ElementConfig = {\n version?: string;\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};\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 HyperbookPageFrontmatter = {\n name: string;\n lang?: Language;\n description?: string;\n keywords?: string[];\n index?: number;\n hide?: boolean;\n toc?: boolean;\n};\n\nexport type HyperbookSectionFrontmatter = HyperbookPageFrontmatter & {\n virtual?: boolean;\n expanded?: boolean;\n};\n\nexport type HyperbookPage = HyperbookPageFrontmatter & {\n isEmpty?: boolean;\n href?: string;\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 author?: {\n name?: string;\n url?: string;\n };\n font?: string;\n fonts?: {\n heading?: string;\n body?: string;\n code?: string;\n };\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 template?: string;\n elements?: {\n bookmarks?: false | ElementConfig;\n excalidraw?: ElementConfig & {\n autoZoom?: boolean;\n center?: boolean;\n aspectRation?: string;\n edit?: boolean;\n };\n onlineide?: ElementConfig & {\n url?: string;\n height?: string | number;\n };\n sqlide?: ElementConfig & {\n url?: string;\n db?: string;\n height?: string | number;\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"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;AAAA;AAAA;",
6
6
  "names": []
7
7
  }
package/dist/index.d.ts CHANGED
@@ -1,31 +1,31 @@
1
- declare type ElementConfig = {
1
+ type ElementConfig = {
2
2
  version?: string;
3
3
  };
4
- export declare type LinkWithLinks = {
4
+ export type LinkWithLinks = {
5
5
  label: string;
6
6
  icon?: string;
7
7
  links: Link[];
8
8
  };
9
- export declare type LinkWithHref = {
9
+ export type LinkWithHref = {
10
10
  label: string;
11
11
  icon?: string;
12
12
  href: string;
13
13
  };
14
- export declare type Link = LinkWithHref | LinkWithLinks;
15
- export declare type Navigation = {
14
+ export type Link = LinkWithHref | LinkWithLinks;
15
+ export type Navigation = {
16
16
  next: HyperbookPage | null;
17
17
  previous: HyperbookPage | null;
18
18
  current: HyperbookPage | null;
19
19
  pages: HyperbookPage[];
20
20
  sections: HyperbookSection[];
21
21
  };
22
- export declare type Term = {
22
+ export type Term = {
23
23
  name: string;
24
24
  href: string;
25
25
  };
26
- export declare type Glossary = Record<string, Term[]>;
27
- export declare type Language = "de" | "en" | "fr" | "es" | "it" | "pt" | "nl";
28
- export declare type HyperbookPageFrontmatter = {
26
+ export type Glossary = Record<string, Term[]>;
27
+ export type Language = "de" | "en" | "fr" | "es" | "it" | "pt" | "nl";
28
+ export type HyperbookPageFrontmatter = {
29
29
  name: string;
30
30
  lang?: Language;
31
31
  description?: string;
@@ -34,24 +34,24 @@ export declare type HyperbookPageFrontmatter = {
34
34
  hide?: boolean;
35
35
  toc?: boolean;
36
36
  };
37
- export declare type HyperbookSectionFrontmatter = HyperbookPageFrontmatter & {
37
+ export type HyperbookSectionFrontmatter = HyperbookPageFrontmatter & {
38
38
  virtual?: boolean;
39
39
  expanded?: boolean;
40
40
  };
41
- export declare type HyperbookPage = HyperbookPageFrontmatter & {
41
+ export type HyperbookPage = HyperbookPageFrontmatter & {
42
42
  isEmpty?: boolean;
43
43
  href?: string;
44
44
  repo?: string;
45
45
  };
46
- export declare type HyperbookSection = HyperbookSectionFrontmatter & {
46
+ export type HyperbookSection = HyperbookSectionFrontmatter & {
47
47
  isEmpty?: boolean;
48
48
  href?: string;
49
49
  pages: HyperbookPage[];
50
50
  sections: HyperbookSection[];
51
51
  repo?: string;
52
52
  };
53
- export declare type HyperbookFrontmatter = HyperbookPageFrontmatter | HyperbookSectionFrontmatter;
54
- export declare type HyperbookJson = {
53
+ export type HyperbookFrontmatter = HyperbookPageFrontmatter | HyperbookSectionFrontmatter;
54
+ export type HyperbookJson = {
55
55
  name: string;
56
56
  description?: string;
57
57
  logo?: string;
@@ -83,7 +83,10 @@ export declare type HyperbookJson = {
83
83
  basePath?: string;
84
84
  license?: string;
85
85
  language?: Language;
86
- repo?: string;
86
+ repo?: string | {
87
+ url: string;
88
+ label: string;
89
+ };
87
90
  links?: Link[];
88
91
  template?: string;
89
92
  elements?: {
@@ -94,10 +97,19 @@ export declare type HyperbookJson = {
94
97
  aspectRation?: string;
95
98
  edit?: boolean;
96
99
  };
100
+ onlineide?: ElementConfig & {
101
+ url?: string;
102
+ height?: string | number;
103
+ };
104
+ sqlide?: ElementConfig & {
105
+ url?: string;
106
+ db?: string;
107
+ height?: string | number;
108
+ };
97
109
  };
98
110
  };
99
- export declare type LanguageString = Partial<Record<Language, string>>;
100
- export declare type HyperlibraryJson = {
111
+ export type LanguageString = Partial<Record<Language, string>>;
112
+ export type HyperlibraryJson = {
101
113
  name: string | LanguageString;
102
114
  library: {
103
115
  src: string;
@@ -107,7 +119,7 @@ export declare type HyperlibraryJson = {
107
119
  }[];
108
120
  basePath?: string;
109
121
  };
110
- export declare type Hyperproject = {
122
+ export type Hyperproject = {
111
123
  name: string | LanguageString;
112
124
  basePath?: string;
113
125
  icon?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hyperbook/types",
3
- "version": "0.4.0",
3
+ "version": "0.6.0",
4
4
  "author": "Mike Barkmin",
5
5
  "homepage": "https://github.com/openpatch/hyperbook#readme",
6
6
  "license": "MIT",