@ng-doc/app 22.0.0-beta.1 → 22.0.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 +20 -29
- package/fesm2022/ng-doc-app-classes-content-anchor-controller.mjs +363 -0
- package/fesm2022/ng-doc-app-classes-content-anchor-controller.mjs.map +1 -0
- package/fesm2022/ng-doc-app-classes-content-controller.mjs +299 -0
- package/fesm2022/ng-doc-app-classes-content-controller.mjs.map +1 -0
- package/fesm2022/ng-doc-app-classes-default-search-engine.mjs +51 -35
- package/fesm2022/ng-doc-app-classes-default-search-engine.mjs.map +1 -1
- package/fesm2022/ng-doc-app-classes-root-page.mjs.map +1 -1
- package/fesm2022/ng-doc-app-classes-search-engine.mjs.map +1 -1
- package/fesm2022/ng-doc-app-classes.mjs +2 -0
- package/fesm2022/ng-doc-app-classes.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-api-list.mjs +178 -68
- package/fesm2022/ng-doc-app-components-api-list.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-breadcrumb.mjs +13 -10
- package/fesm2022/ng-doc-app-components-breadcrumb.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-code.mjs +152 -25
- package/fesm2022/ng-doc-app-components-code.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-command-palette.mjs +498 -0
- package/fesm2022/ng-doc-app-components-command-palette.mjs.map +1 -0
- package/fesm2022/ng-doc-app-components-copy-button.mjs +38 -21
- package/fesm2022/ng-doc-app-components-copy-button.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-demo-displayer.mjs +36 -29
- package/fesm2022/ng-doc-app-components-demo-displayer.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-demo-pane.mjs +39 -36
- package/fesm2022/ng-doc-app-components-demo-pane.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-demo.mjs +129 -44
- package/fesm2022/ng-doc-app-components-demo.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-fullscreen-button.mjs +12 -9
- package/fesm2022/ng-doc-app-components-fullscreen-button.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-fullscreen-toggle.mjs +79 -0
- package/fesm2022/ng-doc-app-components-fullscreen-toggle.mjs.map +1 -0
- package/fesm2022/ng-doc-app-components-heading-anchor.mjs +54 -21
- package/fesm2022/ng-doc-app-components-heading-anchor.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-image-viewer.mjs +187 -91
- package/fesm2022/ng-doc-app-components-image-viewer.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-kind-icon.mjs +42 -25
- package/fesm2022/ng-doc-app-components-kind-icon.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-link.mjs +12 -9
- package/fesm2022/ng-doc-app-components-link.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-members.mjs +30 -0
- package/fesm2022/ng-doc-app-components-members.mjs.map +1 -0
- package/fesm2022/ng-doc-app-components-mermaid-viewer.mjs +69 -24
- package/fesm2022/ng-doc-app-components-mermaid-viewer.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-navbar.mjs +39 -49
- package/fesm2022/ng-doc-app-components-navbar.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-page-header.mjs +73 -10
- package/fesm2022/ng-doc-app-components-page-header.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-page-link.mjs +123 -31
- package/fesm2022/ng-doc-app-components-page-link.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-page-navigation.mjs +17 -19
- package/fesm2022/ng-doc-app-components-page-navigation.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-page-wrapper.mjs +56 -35
- package/fesm2022/ng-doc-app-components-page-wrapper.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-page.mjs +168 -24
- package/fesm2022/ng-doc-app-components-page.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-playground.mjs +392 -263
- package/fesm2022/ng-doc-app-components-playground.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-root.mjs +48 -31
- package/fesm2022/ng-doc-app-components-root.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-search-result.mjs +22 -21
- package/fesm2022/ng-doc-app-components-search-result.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-search.mjs +64 -33
- package/fesm2022/ng-doc-app-components-search.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-sidebar.mjs +90 -63
- package/fesm2022/ng-doc-app-components-sidebar.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-tabs.mjs +18 -12
- package/fesm2022/ng-doc-app-components-tabs.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-theme-toggle.mjs +33 -21
- package/fesm2022/ng-doc-app-components-theme-toggle.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-toc.mjs +268 -90
- package/fesm2022/ng-doc-app-components-toc.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components.mjs +3 -1
- package/fesm2022/ng-doc-app-components.mjs.map +1 -1
- package/fesm2022/ng-doc-app-defaults-default-processors.mjs +2 -1
- package/fesm2022/ng-doc-app-defaults-default-processors.mjs.map +1 -1
- package/fesm2022/ng-doc-app-directives-code-highlighter.mjs +14 -7
- package/fesm2022/ng-doc-app-directives-code-highlighter.mjs.map +1 -1
- package/fesm2022/ng-doc-app-directives-members-filter.mjs +276 -0
- package/fesm2022/ng-doc-app-directives-members-filter.mjs.map +1 -0
- package/fesm2022/ng-doc-app-directives-route-active.mjs +34 -30
- package/fesm2022/ng-doc-app-directives-route-active.mjs.map +1 -1
- package/fesm2022/ng-doc-app-directives.mjs +1 -0
- package/fesm2022/ng-doc-app-directives.mjs.map +1 -1
- package/fesm2022/ng-doc-app-helpers.mjs +285 -1
- package/fesm2022/ng-doc-app-helpers.mjs.map +1 -1
- package/fesm2022/ng-doc-app-pipes-decode-uri-component.mjs +6 -4
- package/fesm2022/ng-doc-app-pipes-decode-uri-component.mjs.map +1 -1
- package/fesm2022/ng-doc-app-pipes-extract-value.mjs +6 -4
- package/fesm2022/ng-doc-app-pipes-extract-value.mjs.map +1 -1
- package/fesm2022/ng-doc-app-pipes-filter-by-text.mjs +7 -4
- package/fesm2022/ng-doc-app-pipes-filter-by-text.mjs.map +1 -1
- package/fesm2022/ng-doc-app-pipes-sanitize-html.mjs +8 -5
- package/fesm2022/ng-doc-app-pipes-sanitize-html.mjs.map +1 -1
- package/fesm2022/ng-doc-app-processors-page-processor.mjs +86 -23
- package/fesm2022/ng-doc-app-processors-page-processor.mjs.map +1 -1
- package/fesm2022/ng-doc-app-processors-processors-tooltip.mjs +26 -25
- package/fesm2022/ng-doc-app-processors-processors-tooltip.mjs.map +1 -1
- package/fesm2022/ng-doc-app-processors-processors.mjs +12 -1
- package/fesm2022/ng-doc-app-processors-processors.mjs.map +1 -1
- package/fesm2022/ng-doc-app-providers-ng-doc-app.mjs +31 -2
- package/fesm2022/ng-doc-app-providers-ng-doc-app.mjs.map +1 -1
- package/fesm2022/ng-doc-app-services-content-scroll-intent.mjs +122 -0
- package/fesm2022/ng-doc-app-services-content-scroll-intent.mjs.map +1 -0
- package/fesm2022/ng-doc-app-services-content-state.mjs +57 -0
- package/fesm2022/ng-doc-app-services-content-state.mjs.map +1 -0
- package/fesm2022/ng-doc-app-services-fullscreen-route.mjs +74 -0
- package/fesm2022/ng-doc-app-services-fullscreen-route.mjs.map +1 -0
- package/fesm2022/ng-doc-app-services-highlighter.mjs +83 -14
- package/fesm2022/ng-doc-app-services-highlighter.mjs.map +1 -1
- package/fesm2022/ng-doc-app-services-route-preloader.mjs +360 -0
- package/fesm2022/ng-doc-app-services-route-preloader.mjs.map +1 -0
- package/fesm2022/ng-doc-app-services-shortcuts.mjs +214 -0
- package/fesm2022/ng-doc-app-services-shortcuts.mjs.map +1 -0
- package/fesm2022/ng-doc-app-services-sidebar.mjs +59 -25
- package/fesm2022/ng-doc-app-services-sidebar.mjs.map +1 -1
- package/fesm2022/ng-doc-app-services-store.mjs +8 -8
- package/fesm2022/ng-doc-app-services-store.mjs.map +1 -1
- package/fesm2022/ng-doc-app-services-theme.mjs +32 -12
- package/fesm2022/ng-doc-app-services-theme.mjs.map +1 -1
- package/fesm2022/ng-doc-app-services.mjs +143 -0
- package/fesm2022/ng-doc-app-services.mjs.map +1 -1
- package/fesm2022/ng-doc-app-tokens.mjs +7 -28
- package/fesm2022/ng-doc-app-tokens.mjs.map +1 -1
- package/fesm2022/ng-doc-app-type-controls-boolean-control.mjs +18 -9
- package/fesm2022/ng-doc-app-type-controls-boolean-control.mjs.map +1 -1
- package/fesm2022/ng-doc-app-type-controls-number-control.mjs +12 -9
- package/fesm2022/ng-doc-app-type-controls-number-control.mjs.map +1 -1
- package/fesm2022/ng-doc-app-type-controls-string-control.mjs +12 -9
- package/fesm2022/ng-doc-app-type-controls-string-control.mjs.map +1 -1
- package/fesm2022/ng-doc-app-type-controls-type-alias-control.mjs +22 -16
- package/fesm2022/ng-doc-app-type-controls-type-alias-control.mjs.map +1 -1
- package/package.json +74 -32
- package/styles/global.css +1129 -205
- package/styles/main.css +1129 -205
- package/styles/themes/dark.css +78 -56
- package/types/ng-doc-app-classes-content-anchor-controller.d.ts +54 -0
- package/types/ng-doc-app-classes-content-controller.d.ts +94 -0
- package/types/ng-doc-app-classes-default-search-engine.d.ts +9 -1
- package/types/ng-doc-app-classes-root-page.d.ts +6 -1
- package/types/ng-doc-app-classes-search-engine.d.ts +5 -0
- package/types/ng-doc-app-classes.d.ts +2 -0
- package/types/ng-doc-app-components-api-list.d.ts +69 -20
- package/types/ng-doc-app-components-breadcrumb.d.ts +8 -3
- package/types/ng-doc-app-components-code.d.ts +46 -12
- package/types/ng-doc-app-components-command-palette.d.ts +147 -0
- package/types/ng-doc-app-components-copy-button.d.ts +18 -6
- package/types/ng-doc-app-components-demo-displayer.d.ts +23 -10
- package/types/ng-doc-app-components-demo-pane.d.ts +19 -15
- package/types/ng-doc-app-components-demo.d.ts +62 -15
- package/types/ng-doc-app-components-fullscreen-button.d.ts +4 -2
- package/types/ng-doc-app-components-fullscreen-toggle.d.ts +24 -0
- package/types/ng-doc-app-components-heading-anchor.d.ts +26 -7
- package/types/ng-doc-app-components-image-viewer.d.ts +71 -7
- package/types/ng-doc-app-components-kind-icon.d.ts +28 -7
- package/types/ng-doc-app-components-link.d.ts +6 -2
- package/types/ng-doc-app-components-members.d.ts +13 -0
- package/types/ng-doc-app-components-mermaid-viewer.d.ts +21 -6
- package/types/ng-doc-app-components-navbar.d.ts +25 -15
- package/types/ng-doc-app-components-page-header.d.ts +28 -4
- package/types/ng-doc-app-components-page-link.d.ts +34 -15
- package/types/ng-doc-app-components-page-navigation.d.ts +10 -5
- package/types/ng-doc-app-components-page-wrapper.d.ts +35 -11
- package/types/ng-doc-app-components-page.d.ts +57 -6
- package/types/ng-doc-app-components-playground.d.ts +146 -78
- package/types/ng-doc-app-components-root.d.ts +28 -7
- package/types/ng-doc-app-components-search-result.d.ts +14 -6
- package/types/ng-doc-app-components-search.d.ts +19 -7
- package/types/ng-doc-app-components-tabs.d.ts +13 -4
- package/types/ng-doc-app-components-theme-toggle.d.ts +18 -5
- package/types/ng-doc-app-components-toc.d.ts +76 -29
- package/types/ng-doc-app-components.d.ts +3 -1
- package/types/ng-doc-app-directives-code-highlighter.d.ts +8 -4
- package/types/ng-doc-app-directives-members-filter.d.ts +61 -0
- package/types/ng-doc-app-directives-route-active.d.ts +21 -7
- package/types/ng-doc-app-directives.d.ts +1 -0
- package/types/ng-doc-app-helpers.d.ts +124 -3
- package/types/ng-doc-app-interfaces.d.ts +48 -28
- package/types/ng-doc-app-pipes-decode-uri-component.d.ts +3 -0
- package/types/ng-doc-app-pipes-extract-value.d.ts +3 -0
- package/types/ng-doc-app-pipes-filter-by-text.d.ts +4 -0
- package/types/ng-doc-app-pipes-sanitize-html.d.ts +4 -2
- package/types/ng-doc-app-processors-page-processor.d.ts +39 -10
- package/types/ng-doc-app-processors-processors-tooltip.d.ts +11 -10
- package/types/ng-doc-app-processors-processors.d.ts +5 -1
- package/types/ng-doc-app-providers-ng-doc-app.d.ts +17 -0
- package/types/ng-doc-app-providers-playground-demo.d.ts +1 -1
- package/types/ng-doc-app-providers-type-control.d.ts +2 -2
- package/types/ng-doc-app-services-content-scroll-intent.d.ts +52 -0
- package/types/ng-doc-app-services-content-state.d.ts +40 -0
- package/types/ng-doc-app-services-fullscreen-route.d.ts +35 -0
- package/types/ng-doc-app-services-highlighter.d.ts +40 -5
- package/types/ng-doc-app-services-route-preloader.d.ts +109 -0
- package/types/ng-doc-app-services-shortcuts.d.ts +96 -0
- package/types/ng-doc-app-services-sidebar.d.ts +24 -4
- package/types/ng-doc-app-services-store.d.ts +24 -1
- package/types/ng-doc-app-services-theme.d.ts +19 -3
- package/types/ng-doc-app-services.d.ts +77 -0
- package/types/ng-doc-app-tokens.d.ts +10 -30
- package/types/ng-doc-app-type-controls-boolean-control.d.ts +11 -6
- package/types/ng-doc-app-type-controls-number-control.d.ts +5 -3
- package/types/ng-doc-app-type-controls-string-control.d.ts +5 -3
- package/types/ng-doc-app-type-controls-type-alias-control.d.ts +13 -6
- package/fesm2022/ng-doc-app-components-search-dialog.mjs +0 -78
- package/fesm2022/ng-doc-app-components-search-dialog.mjs.map +0 -1
- package/types/ng-doc-app-components-search-dialog.d.ts +0 -28
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { NgDocBaseEntity, JSDocMetadata, NgDocPageIndex } from '@ng-doc/core/interfaces';
|
|
2
|
-
import { Type, Injector } from '@angular/core';
|
|
2
|
+
import { Type, Injector, Signal } from '@angular/core';
|
|
3
3
|
import { InputType } from '@ng-doc/core';
|
|
4
4
|
import { Constructor } from '@ng-doc/core/types/constructor';
|
|
5
5
|
import { ControlValueAccessor } from '@angular/forms';
|
|
@@ -32,6 +32,12 @@ interface NgDocContext {
|
|
|
32
32
|
* List of navigation items
|
|
33
33
|
*/
|
|
34
34
|
navigation: NgDocNavigation[];
|
|
35
|
+
/**
|
|
36
|
+
* The segments of the site's API lists (`assets/ng-doc/<segment>/api-list.json`, an empty string
|
|
37
|
+
* for the root list). The new engine generates it, so the search palette requests only these
|
|
38
|
+
* lists; without it, the palette finds them in the router configuration.
|
|
39
|
+
*/
|
|
40
|
+
apiLists?: string[];
|
|
35
41
|
}
|
|
36
42
|
|
|
37
43
|
interface NgDocDemoAssets {
|
|
@@ -85,6 +91,11 @@ interface NgDocTocItem {
|
|
|
85
91
|
level: number;
|
|
86
92
|
}
|
|
87
93
|
|
|
94
|
+
/**
|
|
95
|
+
* A field of a page skeleton component. The page sets it through the setInput method of the
|
|
96
|
+
* component reference, so the component may declare it as a plain property or as a signal input.
|
|
97
|
+
*/
|
|
98
|
+
type NgDocPageSkeletonField<T> = T | Signal<T | undefined>;
|
|
88
99
|
/**
|
|
89
100
|
* Interface for page navigation implementation
|
|
90
101
|
*/
|
|
@@ -92,11 +103,11 @@ interface NgDocPageNavigation {
|
|
|
92
103
|
/**
|
|
93
104
|
* Previous page
|
|
94
105
|
*/
|
|
95
|
-
prevPage?: NgDocNavigation
|
|
106
|
+
prevPage?: NgDocPageSkeletonField<NgDocNavigation | undefined>;
|
|
96
107
|
/**
|
|
97
108
|
* Next page
|
|
98
109
|
*/
|
|
99
|
-
nextPage?: NgDocNavigation
|
|
110
|
+
nextPage?: NgDocPageSkeletonField<NgDocNavigation | undefined>;
|
|
100
111
|
}
|
|
101
112
|
/**
|
|
102
113
|
* Interface for page breadcrumb implementation
|
|
@@ -105,7 +116,7 @@ interface NgDocPageBreadcrumbs {
|
|
|
105
116
|
/**
|
|
106
117
|
* Breadcrumb items
|
|
107
118
|
*/
|
|
108
|
-
breadcrumbs: string[]
|
|
119
|
+
breadcrumbs: NgDocPageSkeletonField<string[]>;
|
|
109
120
|
}
|
|
110
121
|
/**
|
|
111
122
|
* Interface for page table of content implementation
|
|
@@ -114,7 +125,18 @@ interface NgDocPageToc {
|
|
|
114
125
|
/**
|
|
115
126
|
* Table of content items.
|
|
116
127
|
*/
|
|
117
|
-
tableOfContent: NgDocTocItem[]
|
|
128
|
+
tableOfContent: NgDocPageSkeletonField<NgDocTocItem[]>;
|
|
129
|
+
/**
|
|
130
|
+
* URL where the reader can edit the page source. The page sets it only on components that
|
|
131
|
+
* declare this input.
|
|
132
|
+
*/
|
|
133
|
+
editSourceFileUrl?: NgDocPageSkeletonField<string | undefined>;
|
|
134
|
+
/**
|
|
135
|
+
* The symbol details of an API page (kind, decorators, heritage, scope) as an element to show
|
|
136
|
+
* in the rail. The page sets it only on components that declare this input, and moves the
|
|
137
|
+
* element out of the content; other components leave it hidden in the content.
|
|
138
|
+
*/
|
|
139
|
+
details?: NgDocPageSkeletonField<Element | undefined>;
|
|
118
140
|
}
|
|
119
141
|
/**
|
|
120
142
|
* Page skeleton that should be used to create different parts of the page.
|
|
@@ -137,29 +159,40 @@ interface NgDocPageSkeleton {
|
|
|
137
159
|
}
|
|
138
160
|
|
|
139
161
|
/**
|
|
140
|
-
*
|
|
162
|
+
* A field of a type control that the playground sets: a plain field, or a signal input
|
|
163
|
+
* (`input()`) of the same name. The playground sets inputs with the `setInput()` method of the
|
|
164
|
+
* component reference and assigns plain fields.
|
|
165
|
+
*/
|
|
166
|
+
type NgDocTypeControlField<T> = T | Signal<T | undefined>;
|
|
167
|
+
/**
|
|
168
|
+
* Interface describing Type Control.
|
|
169
|
+
*
|
|
170
|
+
* A type control is a `ControlValueAccessor`. The playground sets the fields below before the
|
|
171
|
+
* control renders; declare them as plain fields or as signal inputs (`name = input<string>()`).
|
|
172
|
+
* A field declared as an input (a signal input or an `@Input()`) is set as an input, so the
|
|
173
|
+
* control's `ngOnChanges` reports it; a plain field is assigned and is not reported.
|
|
141
174
|
*/
|
|
142
175
|
interface NgDocTypeControl<T = unknown> extends ControlValueAccessor {
|
|
143
176
|
/**
|
|
144
177
|
* The name of the input for which it is created
|
|
145
178
|
*/
|
|
146
|
-
name?: string
|
|
179
|
+
name?: NgDocTypeControlField<string>;
|
|
147
180
|
/**
|
|
148
181
|
* The description of the input (based on the comment)
|
|
149
182
|
*/
|
|
150
|
-
description?: string
|
|
183
|
+
description?: NgDocTypeControlField<string>;
|
|
151
184
|
/**
|
|
152
185
|
* The default value of the input
|
|
153
186
|
*/
|
|
154
|
-
default?: T
|
|
187
|
+
default?: NgDocTypeControlField<T>;
|
|
155
188
|
/**
|
|
156
189
|
* The list of possible values, it usually works only for Type Aliases which has several values
|
|
157
190
|
*/
|
|
158
|
-
options?: string[]
|
|
191
|
+
options?: NgDocTypeControlField<string[]>;
|
|
159
192
|
/**
|
|
160
193
|
* Determines if the property is manually added by the user using `controls` property in playground config
|
|
161
194
|
*/
|
|
162
|
-
isManual?: boolean
|
|
195
|
+
isManual?: NgDocTypeControlField<boolean>;
|
|
163
196
|
}
|
|
164
197
|
|
|
165
198
|
/**
|
|
@@ -172,8 +205,9 @@ interface NgDocTypeControlProviderOptions {
|
|
|
172
205
|
*/
|
|
173
206
|
hideLabel?: boolean;
|
|
174
207
|
/**
|
|
175
|
-
* You can use this to change the order of the type control
|
|
176
|
-
*
|
|
208
|
+
* You can use this to change the order of the type control.
|
|
209
|
+
* Controls are sorted by ascending order, and controls without an order come last.
|
|
210
|
+
* NgDoc's own controls use 10 (type aliases), 20 (`string`), 30 (`number`) and 40 (`boolean`)
|
|
177
211
|
*/
|
|
178
212
|
order?: number;
|
|
179
213
|
}
|
|
@@ -204,18 +238,4 @@ interface NgDocTab {
|
|
|
204
238
|
active?: boolean;
|
|
205
239
|
}
|
|
206
240
|
|
|
207
|
-
|
|
208
|
-
* Interface describing a custom theme for the application
|
|
209
|
-
*/
|
|
210
|
-
interface NgDocTheme {
|
|
211
|
-
/**
|
|
212
|
-
* Theme ID that you can use to set theme (e.g. `CustomTheme`)
|
|
213
|
-
*/
|
|
214
|
-
id: string;
|
|
215
|
-
/**
|
|
216
|
-
* Path that will be used to load theme dynamically (e.g. `/assets/themes/custom.css`)
|
|
217
|
-
*/
|
|
218
|
-
path: string;
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
export type { NgDocContext, NgDocDemoAsset, NgDocDemoAssets, NgDocNavigation, NgDocPageBreadcrumbs, NgDocPageNavigation, NgDocPageProcessor, NgDocPageSkeleton, NgDocPageToc, NgDocProcessorOptions, NgDocProvidedTypeControl, NgDocSearchResult, NgDocTab, NgDocTheme, NgDocTocItem, NgDocTypeControl, NgDocTypeControlProviderOptions };
|
|
241
|
+
export type { NgDocContext, NgDocDemoAsset, NgDocDemoAssets, NgDocNavigation, NgDocPageBreadcrumbs, NgDocPageNavigation, NgDocPageProcessor, NgDocPageSkeleton, NgDocPageSkeletonField, NgDocPageToc, NgDocProcessorOptions, NgDocProvidedTypeControl, NgDocSearchResult, NgDocTab, NgDocTocItem, NgDocTypeControl, NgDocTypeControlField, NgDocTypeControlProviderOptions };
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { PipeTransform } from '@angular/core';
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* Decodes a URI component, and returns the value unchanged when it is not a valid encoding.
|
|
6
|
+
*/
|
|
4
7
|
declare class NgDocDecodeUriComponentPipe implements PipeTransform {
|
|
5
8
|
transform(value: string): string;
|
|
6
9
|
static ɵfac: i0.ɵɵFactoryDeclaration<NgDocDecodeUriComponentPipe, never>;
|
|
@@ -2,6 +2,9 @@ import * as i0 from '@angular/core';
|
|
|
2
2
|
import { PipeTransform } from '@angular/core';
|
|
3
3
|
import { NgDocExtractedValue } from '@ng-doc/core/types/extracted-value';
|
|
4
4
|
|
|
5
|
+
/**
|
|
6
|
+
* Parses the string form of a value (for example a default value of a playground property).
|
|
7
|
+
*/
|
|
5
8
|
declare class NgDocExtractValuePipe implements PipeTransform {
|
|
6
9
|
transform(value: string): NgDocExtractedValue;
|
|
7
10
|
static ɵfac: i0.ɵɵFactoryDeclaration<NgDocExtractValuePipe, never>;
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { PipeTransform } from '@angular/core';
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* Keeps the items that match a search term. By default an item matches when its string form
|
|
6
|
+
* equals the term.
|
|
7
|
+
*/
|
|
4
8
|
declare class NgDocFilterByTextPipe<T> implements PipeTransform {
|
|
5
9
|
transform(items: readonly T[], searchTerm: string, matcher?: (item: T, searchTerm: string) => boolean): readonly T[];
|
|
6
10
|
static ɵfac: i0.ɵɵFactoryDeclaration<NgDocFilterByTextPipe<any>, never>;
|
|
@@ -2,10 +2,12 @@ import * as i0 from '@angular/core';
|
|
|
2
2
|
import { PipeTransform } from '@angular/core';
|
|
3
3
|
import { SafeHtml } from '@angular/platform-browser';
|
|
4
4
|
|
|
5
|
+
/**
|
|
6
|
+
* Marks HTML as trusted, so it can be bound to `innerHTML` without sanitization. Use it only for
|
|
7
|
+
* HTML that NgDoc generated.
|
|
8
|
+
*/
|
|
5
9
|
declare class NgDocSanitizeHtmlPipe implements PipeTransform {
|
|
6
10
|
private readonly sanitizer;
|
|
7
|
-
/** Inserted by Angular inject() migration for backwards compatibility */
|
|
8
|
-
constructor(...args: unknown[]);
|
|
9
11
|
transform(value: string): SafeHtml;
|
|
10
12
|
static ɵfac: i0.ɵɵFactoryDeclaration<NgDocSanitizeHtmlPipe, never>;
|
|
11
13
|
static ɵpipe: i0.ɵɵPipeDeclaration<NgDocSanitizeHtmlPipe, "ngDocSanitizeHtml", true>;
|
|
@@ -1,15 +1,38 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import {
|
|
1
|
+
import * as _angular_core from '@angular/core';
|
|
2
|
+
import { OutputRef, ElementRef, ViewContainerRef, ApplicationRef, Injector, Renderer2, ErrorHandler } from '@angular/core';
|
|
3
3
|
import { SafeHtml } from '@angular/platform-browser';
|
|
4
|
+
import { NgDocContentRenderFailure } from '@ng-doc/app/classes/content-controller';
|
|
4
5
|
import { NgDocPageProcessor } from '@ng-doc/app/interfaces';
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
|
-
*
|
|
8
|
-
*
|
|
8
|
+
* Renders HTML into its host element and replaces the nodes that the page processors
|
|
9
|
+
* (`NG_DOC_PAGE_PROCESSOR`, `NG_DOC_PAGE_CUSTOM_PROCESSOR`) select with Angular components.
|
|
10
|
+
*
|
|
11
|
+
* Each change of the HTML or of `contentVersion` destroys the components of the previous pass
|
|
12
|
+
* and schedules a new pass for the next microtask, after the HTML is in the DOM. A pass that a
|
|
13
|
+
* newer change superseded, or that ends after the component is destroyed, emits nothing.
|
|
9
14
|
*/
|
|
10
|
-
declare class NgDocPageProcessorComponent
|
|
11
|
-
|
|
12
|
-
|
|
15
|
+
declare class NgDocPageProcessorComponent {
|
|
16
|
+
/** The HTML to render and process. */
|
|
17
|
+
readonly html: _angular_core.InputSignal<SafeHtml>;
|
|
18
|
+
/** Version of the HTML. A new version processes the HTML again, even when it is unchanged. */
|
|
19
|
+
readonly contentVersion: _angular_core.InputSignal<number>;
|
|
20
|
+
/**
|
|
21
|
+
* Emits the version of a pass after its components are created and before they render, in the
|
|
22
|
+
* same task, so that a listener can reveal the content they will measure.
|
|
23
|
+
* @internal
|
|
24
|
+
*/
|
|
25
|
+
readonly beforeRender: _angular_core.OutputEmitterRef<number>;
|
|
26
|
+
/** Emits after a pass has created its components and rendered them. */
|
|
27
|
+
readonly afterRender: _angular_core.OutputEmitterRef<void>;
|
|
28
|
+
/** Emits the version of each pass that completed. */
|
|
29
|
+
readonly contentProcessed: _angular_core.OutputEmitterRef<number>;
|
|
30
|
+
private readonly processingErrors;
|
|
31
|
+
/**
|
|
32
|
+
* Emits the version and the error of a pass that a processor failed. Without a listener, the
|
|
33
|
+
* error goes to the `ErrorHandler` instead.
|
|
34
|
+
*/
|
|
35
|
+
readonly processingError: OutputRef<NgDocContentRenderFailure>;
|
|
13
36
|
processors: Array<NgDocPageProcessor<unknown>>;
|
|
14
37
|
customProcessors: Array<NgDocPageProcessor<unknown>>;
|
|
15
38
|
protected readonly elementRef: ElementRef<HTMLElement>;
|
|
@@ -17,10 +40,16 @@ declare class NgDocPageProcessorComponent implements OnChanges {
|
|
|
17
40
|
protected readonly applicationRef: ApplicationRef;
|
|
18
41
|
protected readonly injector: Injector;
|
|
19
42
|
protected readonly renderer: Renderer2;
|
|
20
|
-
|
|
43
|
+
protected readonly errorHandler: ErrorHandler;
|
|
44
|
+
private readonly sanitizer;
|
|
45
|
+
private scheduledVersion;
|
|
46
|
+
private scheduledHtml?;
|
|
47
|
+
private destroyed;
|
|
48
|
+
constructor();
|
|
49
|
+
private schedule;
|
|
21
50
|
private process;
|
|
22
|
-
static ɵfac:
|
|
23
|
-
static ɵcmp:
|
|
51
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<NgDocPageProcessorComponent, never>;
|
|
52
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<NgDocPageProcessorComponent, "[ngDocPageProcessor]", never, { "html": { "alias": "ngDocPageProcessor"; "required": false; "isSignal": true; }; "contentVersion": { "alias": "contentVersion"; "required": false; "isSignal": true; }; }, { "beforeRender": "beforeRender"; "afterRender": "afterRender"; "contentProcessed": "contentProcessed"; "processingError": "processingError"; }, never, ["*"], true, never>;
|
|
24
53
|
}
|
|
25
54
|
|
|
26
55
|
export { NgDocPageProcessorComponent };
|
|
@@ -1,17 +1,18 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import { AfterViewInit } from '@angular/core';
|
|
1
|
+
import * as _angular_core from '@angular/core';
|
|
3
2
|
import { NgDocPageProcessor } from '@ng-doc/app/interfaces';
|
|
4
3
|
|
|
5
|
-
declare class NgDocTooltipWrapperComponent
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
private contentProjection?;
|
|
4
|
+
declare class NgDocTooltipWrapperComponent {
|
|
5
|
+
readonly content: _angular_core.InputSignal<string | undefined>;
|
|
6
|
+
protected readonly tooltipElement: _angular_core.WritableSignal<HTMLElement | null>;
|
|
7
|
+
private readonly contentProjection;
|
|
10
8
|
constructor();
|
|
11
|
-
|
|
12
|
-
static
|
|
13
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<NgDocTooltipWrapperComponent, "ng-doc-tooltip-wrapper", never, { "content": { "alias": "content"; "required": false; }; }, {}, never, ["*"], true, never>;
|
|
9
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<NgDocTooltipWrapperComponent, never>;
|
|
10
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<NgDocTooltipWrapperComponent, "ng-doc-tooltip-wrapper", never, { "content": { "alias": "content"; "required": false; "isSignal": true; }; }, {}, never, ["*"], true, never>;
|
|
14
11
|
}
|
|
12
|
+
/**
|
|
13
|
+
* Wraps an element with an `ngDocTooltip` attribute in a component that shows the attribute's
|
|
14
|
+
* value as a tooltip.
|
|
15
|
+
*/
|
|
15
16
|
declare const tooltipProcessor: NgDocPageProcessor<NgDocTooltipWrapperComponent>;
|
|
16
17
|
|
|
17
18
|
export { tooltipProcessor };
|
|
@@ -5,6 +5,7 @@ import { NgDocDemoComponent } from '@ng-doc/app/components/demo';
|
|
|
5
5
|
import { NgDocDemoPaneComponent } from '@ng-doc/app/components/demo-pane';
|
|
6
6
|
import { NgDocHeadingAnchorComponent } from '@ng-doc/app/components/heading-anchor';
|
|
7
7
|
import { NgDocImageViewerComponent } from '@ng-doc/app/components/image-viewer';
|
|
8
|
+
import { NgDocMembersComponent } from '@ng-doc/app/components/members';
|
|
8
9
|
import { NgDocMermaidViewerComponent } from '@ng-doc/app/components/mermaid-viewer';
|
|
9
10
|
import { NgDocPlaygroundComponent } from '@ng-doc/app/components/playground';
|
|
10
11
|
import { NgDocTabsComponent } from '@ng-doc/app/components/tabs';
|
|
@@ -25,10 +26,13 @@ declare const iconProcessor: NgDocPageProcessor<NgDocIconComponent>;
|
|
|
25
26
|
|
|
26
27
|
declare const imageProcessor: NgDocPageProcessor<NgDocImageViewerComponent>;
|
|
27
28
|
|
|
29
|
+
/** Adds the member filter to the members table of an API page (`<ng-doc-members>`). */
|
|
30
|
+
declare const membersProcessor: NgDocPageProcessor<NgDocMembersComponent>;
|
|
31
|
+
|
|
28
32
|
declare const mermaidProcessor: NgDocPageProcessor<NgDocMermaidViewerComponent>;
|
|
29
33
|
|
|
30
34
|
declare const playgroundProcessor: NgDocPageProcessor<NgDocPlaygroundComponent>;
|
|
31
35
|
|
|
32
36
|
declare const tabsProcessor: NgDocPageProcessor<NgDocTabsComponent>;
|
|
33
37
|
|
|
34
|
-
export { blockquoteProcessor, codeProcessor, demoPaneProcessor, demoProcessor, headingAnchorProcessor, iconProcessor, imageProcessor, mermaidProcessor, playgroundProcessor, tabsProcessor };
|
|
38
|
+
export { blockquoteProcessor, codeProcessor, demoPaneProcessor, demoProcessor, headingAnchorProcessor, iconProcessor, imageProcessor, membersProcessor, mermaidProcessor, playgroundProcessor, tabsProcessor };
|
|
@@ -1,11 +1,22 @@
|
|
|
1
1
|
import { EnvironmentProviders, Provider } from '@angular/core';
|
|
2
2
|
import { NgDocHighlighterConfig } from '@ng-doc/app/services/highlighter';
|
|
3
|
+
import { NgDocContentScrollPositionRestoration } from '@ng-doc/app/tokens';
|
|
3
4
|
import { NgDocUiConfig } from '@ng-doc/ui-kit';
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* NgDoc application config.
|
|
7
8
|
*/
|
|
8
9
|
interface NgDocApplicationConfig {
|
|
10
|
+
/**
|
|
11
|
+
* Replays a router anchor scroll once asynchronous NgDoc content has been processed.
|
|
12
|
+
* Enable this beside Angular router anchor scrolling.
|
|
13
|
+
*/
|
|
14
|
+
contentAnchorScrolling?: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Replays a saved router position after asynchronous NgDoc content is processed.
|
|
17
|
+
* Select the same intent as Angular router scroll position restoration.
|
|
18
|
+
*/
|
|
19
|
+
contentScrollPositionRestoration?: NgDocContentScrollPositionRestoration;
|
|
9
20
|
/**
|
|
10
21
|
* UI Kit configuration.
|
|
11
22
|
*/
|
|
@@ -14,6 +25,12 @@ interface NgDocApplicationConfig {
|
|
|
14
25
|
* Shiki theme.
|
|
15
26
|
*/
|
|
16
27
|
shiki?: NgDocHighlighterConfig;
|
|
28
|
+
/**
|
|
29
|
+
* Whether single-key shortcuts (slash, the square brackets, F, L and T) are on for readers who
|
|
30
|
+
* have not turned them on or off themselves. Readers can always change it with the switch in
|
|
31
|
+
* the search palette. Command+K (Control+K) opens the search either way. Defaults to true.
|
|
32
|
+
*/
|
|
33
|
+
shortcuts?: boolean;
|
|
17
34
|
}
|
|
18
35
|
/**
|
|
19
36
|
* Provides the NgDoc application configuration.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { NgDocTypeControl, NgDocTypeControlProviderOptions
|
|
1
|
+
import { InjectionToken, Provider } from '@angular/core';
|
|
2
|
+
import { NgDocProvidedTypeControl, NgDocTypeControl, NgDocTypeControlProviderOptions } from '@ng-doc/app/interfaces';
|
|
3
3
|
import { Constructor } from '@ng-doc/core/types';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { Signal } from '@angular/core';
|
|
3
|
+
|
|
4
|
+
/** The fragment of the application's first navigation, kept until a page replays or drops it. */
|
|
5
|
+
interface NgDocInitialContentScrollIntent {
|
|
6
|
+
/** The decoded fragment of the navigation. */
|
|
7
|
+
readonly anchor: string;
|
|
8
|
+
/** Id of the navigation that produced the fragment. */
|
|
9
|
+
readonly navigationId: number;
|
|
10
|
+
/** The URL after redirects. */
|
|
11
|
+
readonly url: string;
|
|
12
|
+
}
|
|
13
|
+
/** Captures the public initial-navigation facts that are unavailable after component activation. */
|
|
14
|
+
declare class NgDocContentScrollIntent {
|
|
15
|
+
private readonly browser;
|
|
16
|
+
private readonly router;
|
|
17
|
+
private candidate?;
|
|
18
|
+
private intent?;
|
|
19
|
+
private readonly listeners;
|
|
20
|
+
private started;
|
|
21
|
+
private successful;
|
|
22
|
+
private subscription?;
|
|
23
|
+
private readonly intentState;
|
|
24
|
+
/**
|
|
25
|
+
* The pending initial intent as a signal, the same value `subscribe()` listeners receive.
|
|
26
|
+
*/
|
|
27
|
+
readonly currentIntent: Signal<NgDocInitialContentScrollIntent | undefined>;
|
|
28
|
+
constructor();
|
|
29
|
+
/** Starts following router events. Does nothing on the server or when already started. */
|
|
30
|
+
start(): void;
|
|
31
|
+
/**
|
|
32
|
+
* Calls the listener with every change of the intent, and at once with the pending one.
|
|
33
|
+
* @param listener - Receives the intent, or `undefined` once it is consumed or cancelled.
|
|
34
|
+
* @returns A function that removes the listener.
|
|
35
|
+
*/
|
|
36
|
+
subscribe(listener: (intent: NgDocInitialContentScrollIntent | undefined) => void): () => void;
|
|
37
|
+
/**
|
|
38
|
+
* Consumes the current fallback after its page has either replayed or explicitly yielded it.
|
|
39
|
+
* @param navigationId - The navigation of the intent to consume.
|
|
40
|
+
*/
|
|
41
|
+
settle(navigationId: number): void;
|
|
42
|
+
private navigationStarted;
|
|
43
|
+
private navigationEnded;
|
|
44
|
+
private scrolled;
|
|
45
|
+
private publish;
|
|
46
|
+
private destroy;
|
|
47
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NgDocContentScrollIntent, never>;
|
|
48
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export { NgDocContentScrollIntent };
|
|
52
|
+
export type { NgDocInitialContentScrollIntent };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { Signal } from '@angular/core';
|
|
3
|
+
|
|
4
|
+
/** A content source that failed to load or to render. */
|
|
5
|
+
interface NgDocContentFailure {
|
|
6
|
+
/** Id of the content source that failed. */
|
|
7
|
+
readonly contentId: string;
|
|
8
|
+
/** The error it failed with. */
|
|
9
|
+
readonly error: unknown;
|
|
10
|
+
}
|
|
11
|
+
/** Request-local content failures observed by the SSR readiness boundary. */
|
|
12
|
+
declare class NgDocContentState {
|
|
13
|
+
private readonly failures;
|
|
14
|
+
private readonly failureState;
|
|
15
|
+
/**
|
|
16
|
+
* The failure `currentFailure()` returns, as a signal. It changes with every
|
|
17
|
+
* `report()` and `clear()` call.
|
|
18
|
+
*/
|
|
19
|
+
readonly failure: Signal<NgDocContentFailure | undefined>;
|
|
20
|
+
/**
|
|
21
|
+
* Records the failure of one content owner, replacing its previous failure.
|
|
22
|
+
* @param owner - The object that owns the content source.
|
|
23
|
+
* @param failure - The failure.
|
|
24
|
+
*/
|
|
25
|
+
report(owner: object, failure: NgDocContentFailure): void;
|
|
26
|
+
/**
|
|
27
|
+
* Forgets the failure of one content owner.
|
|
28
|
+
* @param owner - The object that owns the content source.
|
|
29
|
+
*/
|
|
30
|
+
clear(owner: object): void;
|
|
31
|
+
/** Returns the oldest failure that is still recorded, if any. */
|
|
32
|
+
currentFailure(): NgDocContentFailure | undefined;
|
|
33
|
+
/** Throws the error of `currentFailure()`, if there is one. */
|
|
34
|
+
throwIfFailed(): void;
|
|
35
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NgDocContentState, never>;
|
|
36
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export { NgDocContentState };
|
|
40
|
+
export type { NgDocContentFailure };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { Signal } from '@angular/core';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Tells whether a page shows one of its fullscreen routes: a child route of the page (see
|
|
6
|
+
* `route.children` of `NgDocPage`), which `ng-doc-page` shows on its own, on the canvas of demos,
|
|
7
|
+
* instead of the page. Pages with `disableFullscreenRoutes` never report one.
|
|
8
|
+
*
|
|
9
|
+
* While one is shown, `ng-doc-root` hides the navbar, the sidebar and the footer, and
|
|
10
|
+
* `ng-doc-page-wrapper` hides the breadcrumbs, the page header, the page links and the table of
|
|
11
|
+
* contents, so the route opens as a standalone page without changes to the application's template.
|
|
12
|
+
*/
|
|
13
|
+
declare class NgDocFullscreenRouteService {
|
|
14
|
+
private readonly pages;
|
|
15
|
+
/**
|
|
16
|
+
* Whether the server rendered a fullscreen route, until the first navigation in the browser
|
|
17
|
+
* settles. `ng-doc-root` renders before its page does, and it must render the server's markup
|
|
18
|
+
* (and hide the same chrome) until the page tells again.
|
|
19
|
+
*/
|
|
20
|
+
private readonly serverRendered;
|
|
21
|
+
/** Whether a page shows one of its fullscreen routes. */
|
|
22
|
+
readonly active: Signal<boolean>;
|
|
23
|
+
constructor();
|
|
24
|
+
/**
|
|
25
|
+
* Records whether a page shows one of its fullscreen routes.
|
|
26
|
+
* @param page - The page.
|
|
27
|
+
* @param shown - Whether the page shows a fullscreen route.
|
|
28
|
+
* @internal
|
|
29
|
+
*/
|
|
30
|
+
set(page: object, shown: boolean): void;
|
|
31
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NgDocFullscreenRouteService, never>;
|
|
32
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export { NgDocFullscreenRouteService };
|
|
@@ -1,27 +1,62 @@
|
|
|
1
1
|
import * as _ng_doc_app_tokens from '@ng-doc/app/tokens';
|
|
2
|
-
import { ThemeInput } from 'shiki';
|
|
3
2
|
import * as i0 from '@angular/core';
|
|
3
|
+
import { OnDestroy, Signal } from '@angular/core';
|
|
4
|
+
import { ThemeInput } from 'shiki';
|
|
4
5
|
|
|
6
|
+
/** Shiki configuration of the code highlighter. */
|
|
5
7
|
interface NgDocHighlighterConfig {
|
|
6
8
|
/**
|
|
7
9
|
* Themes sources.
|
|
8
10
|
*/
|
|
9
11
|
themes?: ThemeInput[];
|
|
10
12
|
/**
|
|
11
|
-
*
|
|
13
|
+
* Has no effect, and is reported in development mode.
|
|
14
|
+
*
|
|
15
|
+
* The theme names come from `shiki.themes` in `ng-doc.config.ts`: NgDoc highlights code blocks
|
|
16
|
+
* with them when it builds the site, and passes them to the application (`NG_DOC_SHIKI_THEME`),
|
|
17
|
+
* so the code that the browser highlights matches the code blocks.
|
|
18
|
+
* @deprecated Set the theme names in `shiki.themes` of `ng-doc.config.ts` instead, and load
|
|
19
|
+
* other themes with `themes`. This field will be removed in a future major release.
|
|
12
20
|
*/
|
|
13
21
|
theme?: {
|
|
14
22
|
light: string;
|
|
15
23
|
dark: string;
|
|
16
24
|
};
|
|
17
25
|
}
|
|
18
|
-
|
|
19
|
-
|
|
26
|
+
/**
|
|
27
|
+
* Highlights code with Shiki. `provideNgDocApp` initializes it before the application renders.
|
|
28
|
+
*/
|
|
29
|
+
declare class NgDocHighlighterService implements OnDestroy {
|
|
30
|
+
private static defaultInitialization?;
|
|
31
|
+
private highlighter?;
|
|
32
|
+
private initialization?;
|
|
33
|
+
private ownsHighlighter;
|
|
34
|
+
private destroyed;
|
|
35
|
+
private readonly readyState;
|
|
20
36
|
protected readonly theme: _ng_doc_app_tokens.NgDocShikiTheme;
|
|
37
|
+
/**
|
|
38
|
+
* Whether `highlight()` can highlight: `true` once `initialize()` has finished, and
|
|
39
|
+
* `false` again after the service is destroyed.
|
|
40
|
+
*/
|
|
41
|
+
readonly ready: Signal<boolean>;
|
|
42
|
+
/**
|
|
43
|
+
* Loads Shiki with the built-in themes (`github-light`, `ayu-dark` and NgDoc's `css-variables`)
|
|
44
|
+
* and the given ones. Concurrent and repeated calls share one initialization; a failed one can
|
|
45
|
+
* be retried.
|
|
46
|
+
* @param config - Custom Shiki themes to load.
|
|
47
|
+
*/
|
|
21
48
|
initialize(config?: NgDocHighlighterConfig): Promise<void>;
|
|
49
|
+
/** Disposes the highlighter this service created for custom themes. */
|
|
50
|
+
ngOnDestroy(): void;
|
|
51
|
+
private static create;
|
|
52
|
+
/**
|
|
53
|
+
* Returns the code as highlighted HTML, or an empty string before `initialize()` has
|
|
54
|
+
* finished. It reads `ready()`, so a `computed` over it updates once Shiki is loaded.
|
|
55
|
+
* @param code - Angular HTML to highlight.
|
|
56
|
+
*/
|
|
22
57
|
highlight(code: string): string;
|
|
23
58
|
static ɵfac: i0.ɵɵFactoryDeclaration<NgDocHighlighterService, never>;
|
|
24
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<
|
|
59
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
25
60
|
}
|
|
26
61
|
|
|
27
62
|
export { NgDocHighlighterService };
|