@mathstack/app-kit 0.0.1-beta.0 → 0.0.1-beta.1

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.
@@ -0,0 +1,387 @@
1
+ import * as rxjs from 'rxjs';
2
+ import { Observable } from 'rxjs';
3
+ import * as i0 from '@angular/core';
4
+ import { DestroyRef, EventEmitter, OnInit, AfterViewInit, ElementRef, TemplateRef, OnChanges, SimpleChanges, NgZone } from '@angular/core';
5
+ import { SafeHtml } from '@angular/platform-browser';
6
+ import { BundledLanguage } from 'shiki/langs';
7
+ import { BundledTheme } from 'shiki/themes';
8
+ import { HighlighterGeneric } from 'shiki/types.mjs';
9
+ import { unified } from 'unified';
10
+ import { Root } from 'hast';
11
+
12
+ declare enum AdkAssetResponse {
13
+ ArrayBuffer = "arraybuffer",
14
+ Blob = "blob",
15
+ Json = "json",
16
+ Text = "text"
17
+ }
18
+ declare class AdkAssetsService {
19
+ private assets;
20
+ private assetsPath;
21
+ private resource;
22
+ setAssetsPath(path: string): void;
23
+ /**
24
+ * Loads an asset from the assets folder.
25
+ *
26
+ * @param assetName The path to the asset from assets/. Should not include leading slash.
27
+ * @returns An observable that emits the asset data.
28
+ */
29
+ getAsset(assetName: string, responseType: AdkAssetResponse): Observable<unknown>;
30
+ private fetchAsset;
31
+ /**
32
+ * Loads multiple assets concurrently.
33
+ *
34
+ * @param assetNames An array of asset names to load.
35
+ * @returns An observable that emits an array of asset data.
36
+ */
37
+ getAssets(assetNames: string[], responseType: AdkAssetResponse): Observable<unknown[]>;
38
+ parseCsv<T>(str: string): T[];
39
+ parseYaml<T>(str: string): T;
40
+ static ɵfac: i0.ɵɵFactoryDeclaration<AdkAssetsService, never>;
41
+ static ɵprov: i0.ɵɵInjectableDeclaration<AdkAssetsService>;
42
+ }
43
+
44
+ declare const defaultHighlighterLangs: string[];
45
+ declare enum ShikiTheme {
46
+ Andromeeda = "andromeeda",
47
+ AuroraX = "aurora-x",
48
+ AyuDark = "ayu-dark",
49
+ CatppuccinFrappe = "catppuccin-frappe",
50
+ CatppuccinLatte = "catppuccin-latte",
51
+ CatppuccinMacchiato = "catppuccin-macchiato",
52
+ CatppuccinMocha = "catppuccin-mocha",
53
+ DarkPlus = "dark-plus",
54
+ DraculaTheme = "dracula",
55
+ DraculaThemeSoft = "dracula-soft",
56
+ EverforestDark = "everforest-dark",
57
+ EverforestLight = "everforest-light",
58
+ GitHubDark = "github-dark",
59
+ GitHubDarkDefault = "github-dark-default",
60
+ GitHubDarkDimmed = "github-dark-dimmed",
61
+ GitHubDarkHighContrast = "github-dark-high-contrast",
62
+ GitHubLight = "github-light",
63
+ GitHubLightDefault = "github-light-default",
64
+ GitHubLightHighContrast = "github-light-high-contrast",
65
+ Houston = "houston",
66
+ LaserWave = "laserwave",
67
+ LightPlus = "light-plus",
68
+ MaterialTheme = "material-theme",
69
+ MaterialThemeDarker = "material-theme-darker",
70
+ MaterialThemeLighter = "material-theme-lighter",
71
+ MaterialThemeOcean = "material-theme-ocean",
72
+ MaterialThemePalenight = "material-theme-palenight",
73
+ MinDark = "min-dark",
74
+ MinLight = "min-light",
75
+ Monokai = "monokai",
76
+ NightOwl = "night-owl",
77
+ Nord = "nord",
78
+ OneDarkPro = "one-dark-pro",
79
+ OneLight = "one-light",
80
+ Plastic = "plastic",
81
+ Poimandres = "poimandres",
82
+ Red = "red",
83
+ RosePine = "rose-pine",
84
+ RosePineDawn = "rose-pine-dawn",
85
+ RosePineMoon = "rose-pine-moon",
86
+ SlackDark = "slack-dark",
87
+ SlackOchin = "slack-ochin",
88
+ SnazzyLight = "snazzy-light",
89
+ SolarizedDark = "solarized-dark",
90
+ SolarizedLight = "solarized-light",
91
+ Synthwave84 = "synthwave-84",
92
+ TokyoNight = "tokyo-night",
93
+ Vesper = "vesper",
94
+ VitesseBlack = "vitesse-black",
95
+ VitesseDark = "vitesse-dark",
96
+ VitesseLight = "vitesse-light"
97
+ }
98
+ declare class AdkShikiHighlighter {
99
+ private highlighterPromise;
100
+ /**
101
+ * Initialize the highlighter. This should only be called one in an application.
102
+ *
103
+ * @param themes an array of any Shiki themes you may want to use anywhere in the app. You can control which theme for your particular parsing by passing the theme name to the actual parsing function.
104
+ *
105
+ * @returns void
106
+ */
107
+ initialize(themes: ShikiTheme[], langs?: string[]): Promise<void>;
108
+ getHighlighter(): Promise<HighlighterGeneric<BundledLanguage, BundledTheme>>;
109
+ remarkHighlight(options: AdkShikiHighlighterOptions): (tree: Root) => void;
110
+ rehypeHighlight(options: AdkShikiHighlighterOptions): (tree: Root) => void;
111
+ getLanguage(node: any): string;
112
+ static ɵfac: i0.ɵɵFactoryDeclaration<AdkShikiHighlighter, never>;
113
+ static ɵprov: i0.ɵɵInjectableDeclaration<AdkShikiHighlighter>;
114
+ }
115
+
116
+ interface AdkParsedContentSection<Content = string> {
117
+ type: string;
118
+ content: Content;
119
+ html?: SafeHtml;
120
+ headers: {
121
+ id: string;
122
+ text: string;
123
+ level: number;
124
+ }[];
125
+ }
126
+ interface AdkMarkdownParsingOptions {
127
+ highlighter?: AdkShikiHighlighterOptions;
128
+ gfm?: boolean;
129
+ headingIds?: boolean;
130
+ headingFragmentLinks?: AdkHeadingFragmentLinkOptions;
131
+ }
132
+ interface AdkShikiHighlighterOptions {
133
+ highlighter?: HighlighterGeneric<BundledLanguage, BundledTheme>;
134
+ theme?: ShikiTheme;
135
+ type?: 'html' | 'markdown';
136
+ ignoreUnknownLanguage?: boolean;
137
+ }
138
+ interface AdkHeadingFragmentLinkOptions {
139
+ createLinks?: boolean;
140
+ behavior?: 'append' | 'prepend' | 'wrap' | 'before' | 'after';
141
+ }
142
+ declare class AdkMarkdownParser {
143
+ parser: typeof unified;
144
+ private sanitizer;
145
+ private shikiHighlighter;
146
+ constructor();
147
+ parse(markdown: string, options?: AdkMarkdownParsingOptions): Observable<AdkParsedContentSection[]>;
148
+ private getSections;
149
+ private parseSection;
150
+ getHeaders(markdown: string): {
151
+ id: string;
152
+ text: string;
153
+ level: number;
154
+ }[];
155
+ parseComponent(content: string): {
156
+ name: string;
157
+ pathTo: string;
158
+ };
159
+ static ɵfac: i0.ɵɵFactoryDeclaration<AdkMarkdownParser, never>;
160
+ static ɵprov: i0.ɵɵInjectableDeclaration<AdkMarkdownParser>;
161
+ }
162
+
163
+ declare function deepMerge<T>(target: T, source: Partial<T>): T;
164
+
165
+ /**
166
+ * Safely assigns properties from a source object to a target object.
167
+ *
168
+ * Copies all own, enumerable properties from `source` to `target`,
169
+ * except when the target already has a property of the same name that is a function.
170
+ *
171
+ * Logs a warning for each skipped property if `logConflicts` is true.
172
+ *
173
+ * @template TTarget The type of the target object.
174
+ * @template TSource The type of the source object.
175
+ * @param target The object to assign properties to.
176
+ * @param source The object providing properties to assign.
177
+ * @param logConflicts If true, logs when a method/property on the target prevents assignment. Default is false.
178
+ *
179
+ * @example
180
+ * safeAssign(this, { log: 'hello' }, true);
181
+ */
182
+ declare function safeAssign<TTarget extends object, TSource extends object>(target: TTarget, source: TSource, logConflicts?: boolean): void;
183
+
184
+ declare class AdkActiveHeadingTracker {
185
+ private activeHeadingId;
186
+ activeHeadingId$: rxjs.Observable<string>;
187
+ private ngZone;
188
+ initScrollListener(contentEl: HTMLElement, destroyRef: DestroyRef): void;
189
+ private findActiveHeading;
190
+ setActiveHeading(heading: HTMLHeadingElement): void;
191
+ scrollToTop(): void;
192
+ static ɵfac: i0.ɵɵFactoryDeclaration<AdkActiveHeadingTracker, never>;
193
+ static ɵprov: i0.ɵɵInjectableDeclaration<AdkActiveHeadingTracker>;
194
+ }
195
+
196
+ interface AdkNestedObject {
197
+ [key: string]: string | AdkNestedObject;
198
+ }
199
+ interface AdkDocumentationNavigationSiblings {
200
+ previous: string | undefined;
201
+ next: string | undefined;
202
+ }
203
+ declare class AdkDocumentationConfigParser {
204
+ basePath: string;
205
+ /**
206
+ * This method takes a path from the application and a configuration object, and returns a path to a file that will be fetched.
207
+ *
208
+ * This assumes that the pathFromApp matches a path through the keys of the Nested Object.
209
+ *
210
+ * If the path is 'viz/content/items/bars', the config object might look like this:
211
+ * viz: {
212
+ * content: {
213
+ * items: {
214
+ * bars: 'bars.md'
215
+ * }
216
+ * }
217
+ * }
218
+ *
219
+ * @param pathFromApp a string representing the path from the application, for example 'viz/content/items/bars'
220
+ * @param config a nested object representing the configuration
221
+ * @returns a string representing the file path
222
+ */
223
+ getPathToFile(pathFromApp: string, config: AdkNestedObject, basePath: string): string;
224
+ /**
225
+ *
226
+ * @param pathParts a string array of path parts, for example ['viz', 'content', 'items', 'bars]
227
+ * @param config a nested object representing the configuration
228
+ * @returns a string representing the file name
229
+ */
230
+ private getFileNameFromPath;
231
+ findPreviousAndNextByPath(obj: AdkNestedObject, targetPath: string): AdkDocumentationNavigationSiblings;
232
+ flattenObjectWithPath(obj: AdkNestedObject, prefix?: string): string[];
233
+ static ɵfac: i0.ɵɵFactoryDeclaration<AdkDocumentationConfigParser, never>;
234
+ static ɵprov: i0.ɵɵInjectableDeclaration<AdkDocumentationConfigParser>;
235
+ }
236
+
237
+ interface AdkDocsConfig {
238
+ title: string;
239
+ items: AdkFilesConfig;
240
+ }
241
+ interface AdkFilesConfig {
242
+ [key: string]: AdkFilesItem;
243
+ }
244
+ type AdkFilesItem = string | null | AdkFilesConfig;
245
+ interface AdkParsedMarkdownFile<Content = string> {
246
+ sections: AdkParsedContentSection<Content>[];
247
+ headings: AdkHtmlHeader[];
248
+ }
249
+ interface AdkParsedDocumentation<Content = string> extends AdkParsedMarkdownFile<Content> {
250
+ siblings: AdkDocumentationNavigationSiblings;
251
+ }
252
+ interface AdkHtmlHeader {
253
+ id: string;
254
+ level: number;
255
+ text: string;
256
+ }
257
+ interface AdkDocumentationContentOptions {
258
+ fileConfig: AdkNestedObject;
259
+ basePath: string;
260
+ parsingOptions?: AdkMarkdownParsingOptions;
261
+ }
262
+ declare class AdkDocumentationContentService {
263
+ private files;
264
+ private assetsService;
265
+ private docsConfigParser;
266
+ private markdownParser;
267
+ /**
268
+ * This service requires the consuming app to provide the AdkDocumentationDisplayService, the AdkAssetsService, and the AdkDocumentationConfigParser at the level at which this service is configured.
269
+ *
270
+ * OPTIONAL: If the consuming app wants to use a different assets directory, they can pass it in here.
271
+ */
272
+ initialize(assetsDirectory?: string): void;
273
+ /**
274
+ * Assumes that the content path matches
275
+ */
276
+ getContentForCurrentContentPath(contentPath$: Observable<string>, options: AdkDocumentationContentOptions): Observable<AdkParsedDocumentation>;
277
+ private getParsedMarkdownFile;
278
+ static ɵfac: i0.ɵɵFactoryDeclaration<AdkDocumentationContentService, never>;
279
+ static ɵprov: i0.ɵɵInjectableDeclaration<AdkDocumentationContentService>;
280
+ }
281
+
282
+ declare class AdkDocumentIndexComponent {
283
+ headings: AdkHtmlHeader[];
284
+ activeHeading: EventEmitter<{
285
+ heading: AdkHtmlHeader;
286
+ event: KeyboardEvent | PointerEvent | MouseEvent | Event;
287
+ }>;
288
+ activeHeadingTracker: AdkActiveHeadingTracker;
289
+ setActiveHeading(event: KeyboardEvent | PointerEvent | MouseEvent | Event, heading: AdkHtmlHeader): void;
290
+ scrollToTop(): void;
291
+ static ɵfac: i0.ɵɵFactoryDeclaration<AdkDocumentIndexComponent, never>;
292
+ static ɵcmp: i0.ɵɵComponentDeclaration<AdkDocumentIndexComponent, "hsi-adk-document-index", never, { "headings": { "alias": "headings"; "required": false; }; }, { "activeHeading": "activeHeading"; }, never, never, true, never>;
293
+ }
294
+
295
+ declare class AdkDocumentationDisplayComponent implements OnInit, AfterViewInit {
296
+ /**
297
+ * Observable that emits the current content path
298
+ */
299
+ contentPath$: Observable<string>;
300
+ fileConfig: AdkNestedObject;
301
+ highlightTheme: ShikiTheme;
302
+ pathFromAssetsToFile: string;
303
+ showPrevNextNavigation: boolean;
304
+ nextDoc: EventEmitter<string>;
305
+ file: ElementRef<HTMLDivElement>;
306
+ content$: Observable<AdkParsedDocumentation>;
307
+ escapedContentTemplateRef: TemplateRef<unknown>;
308
+ private content;
309
+ private activeHeading;
310
+ private destroyRef;
311
+ private zone;
312
+ private document;
313
+ ngOnInit(): void;
314
+ ngAfterViewInit(): void;
315
+ setContent(): void;
316
+ scrollToHeading(update: {
317
+ heading: AdkHtmlHeader;
318
+ event: KeyboardEvent | PointerEvent | MouseEvent | Event;
319
+ }): void;
320
+ scrollToItemById(item: HTMLHeadingElement, needsChangeDetection?: boolean): void;
321
+ scrollToItem(top: number): void;
322
+ navigateToDoc(sibling: string): void;
323
+ static ɵfac: i0.ɵɵFactoryDeclaration<AdkDocumentationDisplayComponent, never>;
324
+ static ɵcmp: i0.ɵɵComponentDeclaration<AdkDocumentationDisplayComponent, "hsi-adk-documentation-display", never, { "contentPath$": { "alias": "contentPath$"; "required": false; }; "fileConfig": { "alias": "fileConfig"; "required": false; }; "highlightTheme": { "alias": "highlightTheme"; "required": false; }; "pathFromAssetsToFile": { "alias": "pathFromAssetsToFile"; "required": false; }; "showPrevNextNavigation": { "alias": "showPrevNextNavigation"; "required": false; }; }, { "nextDoc": "nextDoc"; }, ["escapedContentTemplateRef"], never, true, never>;
325
+ }
326
+
327
+ declare class NavigationSiblingsComponent implements OnChanges {
328
+ siblings: AdkDocumentationNavigationSiblings;
329
+ nextDoc: EventEmitter<string>;
330
+ previous: string;
331
+ next: string;
332
+ private titleCase;
333
+ ngOnChanges(): void;
334
+ setDisplayNames(): void;
335
+ getDisplayName(path: string): string;
336
+ navigateToDoc(sibling: string): void;
337
+ static ɵfac: i0.ɵɵFactoryDeclaration<NavigationSiblingsComponent, never>;
338
+ static ɵcmp: i0.ɵɵComponentDeclaration<NavigationSiblingsComponent, "hsi-adk-navigation-siblings", never, { "siblings": { "alias": "siblings"; "required": false; }; }, { "nextDoc": "nextDoc"; }, never, never, true, never>;
339
+ }
340
+
341
+ /**
342
+ * A utility class for detecting changes to objects in Angular's ngOnChanges lifecycle hook.
343
+ */
344
+ declare class NgOnChangesUtilities {
345
+ /**
346
+ * Checks if an input object has changed since the first change.
347
+ * @param changes - The SimpleChanges object containing the changes.
348
+ * @param inputName - The name of the input property to check.
349
+ * @param property - Optional specific property to check within the input object.
350
+ * @returns True if the input object has changed since the first change, otherwise false.
351
+ */
352
+ static inputObjectChangedNotFirstTime(changes: SimpleChanges, inputName: string, property?: string): boolean;
353
+ /**
354
+ * Checks if an input object has changed.
355
+ * @param changes - The SimpleChanges object containing the changes.
356
+ * @param inputName - The name of the input property to check.
357
+ * @param property - Optional specific property to check within the input object.
358
+ * @returns True if the input object has changed, otherwise false.
359
+ */
360
+ static inputObjectChanged(changes: SimpleChanges, inputName: string, property?: string): boolean;
361
+ }
362
+
363
+ /**
364
+ *
365
+ * @param zone: NgZone
366
+ * @returns (source: Observable<T>) => Observable<void>
367
+ *
368
+ * A custom RxJS operator that runs an Angular change detection cycle after the source observable emits, and waits until the change detection cycle is complete before emitting the next value.
369
+ *
370
+ * Note that this is not intended to be used frequently. It is a workaround for cases where you need to ensure that Angular has completed change detection before continuing with the next operation, for example when you need to access a DOM element that is being created through multiple levels of content projection.
371
+ *
372
+ * @example
373
+ * ```ts
374
+ * this.myObservable.pipe(
375
+ * runNgChangeDetectionThen(this.zone),
376
+ * subscribe(() => {
377
+ * console.log('a change detection cycle has completed');
378
+ * })
379
+ * );
380
+ * ```
381
+ */
382
+ declare function runNgChangeDetectionThen<T>(zone: NgZone): (source: Observable<T>) => Observable<void>;
383
+
384
+ declare const STYLES_PATH = "./lib/styles/_index.scss";
385
+
386
+ export { AdkActiveHeadingTracker, AdkAssetResponse, AdkAssetsService, AdkDocumentIndexComponent, AdkDocumentationConfigParser, AdkDocumentationContentService, AdkDocumentationDisplayComponent, AdkMarkdownParser, AdkShikiHighlighter, NavigationSiblingsComponent, NgOnChangesUtilities, STYLES_PATH, ShikiTheme, deepMerge, defaultHighlighterLangs, runNgChangeDetectionThen, safeAssign };
387
+ export type { AdkDocsConfig, AdkDocumentationContentOptions, AdkDocumentationNavigationSiblings, AdkFilesConfig, AdkFilesItem, AdkHeadingFragmentLinkOptions, AdkHtmlHeader, AdkMarkdownParsingOptions, AdkNestedObject, AdkParsedContentSection, AdkParsedDocumentation, AdkParsedMarkdownFile, AdkShikiHighlighterOptions };
package/index.d.ts DELETED
@@ -1,5 +0,0 @@
1
- /**
2
- * Generated bundle index. Do not edit.
3
- */
4
- /// <amd-module name="@mathstack/app-kit" />
5
- export * from './public-api';
@@ -1,11 +0,0 @@
1
- import { HttpClient } from '@angular/common/http';
2
- import { Observable } from 'rxjs';
3
- import { AdkAssetResponse } from './assets-service';
4
- import * as i0 from "@angular/core";
5
- export declare class AdkAssetsResource {
6
- private http;
7
- constructor(http: HttpClient);
8
- getAsset(path: string, responseType: AdkAssetResponse): Observable<unknown>;
9
- static ɵfac: i0.ɵɵFactoryDeclaration<AdkAssetsResource, never>;
10
- static ɵprov: i0.ɵɵInjectableDeclaration<AdkAssetsResource>;
11
- }
@@ -1,35 +0,0 @@
1
- import { Observable } from 'rxjs';
2
- import { AdkAssetsResource } from './assets-resource';
3
- import * as i0 from "@angular/core";
4
- export declare enum AdkAssetResponse {
5
- ArrayBuffer = "arraybuffer",
6
- Blob = "blob",
7
- Json = "json",
8
- Text = "text"
9
- }
10
- export declare class AdkAssetsService {
11
- private resource;
12
- private assets;
13
- private assetsPath;
14
- constructor(resource: AdkAssetsResource);
15
- setAssetsPath(path: string): void;
16
- /**
17
- * Loads an asset from the assets folder.
18
- *
19
- * @param assetName The path to the asset from assets/. Should not include leading slash.
20
- * @returns An observable that emits the asset data.
21
- */
22
- getAsset(assetName: string, responseType: AdkAssetResponse): Observable<unknown>;
23
- private fetchAsset;
24
- /**
25
- * Loads multiple assets concurrently.
26
- *
27
- * @param assetNames An array of asset names to load.
28
- * @returns An observable that emits an array of asset data.
29
- */
30
- getAssets(assetNames: string[], responseType: AdkAssetResponse): Observable<unknown[]>;
31
- parseCsv<T>(str: string): T[];
32
- parseYaml<T>(str: string): T;
33
- static ɵfac: i0.ɵɵFactoryDeclaration<AdkAssetsService, never>;
34
- static ɵprov: i0.ɵɵInjectableDeclaration<AdkAssetsService>;
35
- }
@@ -1 +0,0 @@
1
- export * from './assets-service';
@@ -1,2 +0,0 @@
1
- export * from './markdown-parser';
2
- export * from './shiki-highlighter';
@@ -1,54 +0,0 @@
1
- import { DomSanitizer, SafeHtml } from '@angular/platform-browser';
2
- import { Observable } from 'rxjs';
3
- import { BundledLanguage } from 'shiki/langs';
4
- import { BundledTheme } from 'shiki/themes';
5
- import { HighlighterGeneric } from 'shiki/types.mjs';
6
- import { unified } from 'unified';
7
- import { AdkShikiHighlighter, ShikiTheme } from './shiki-highlighter';
8
- import * as i0 from "@angular/core";
9
- export interface AdkParsedContentSection<Content = string> {
10
- type: string;
11
- content: Content;
12
- html?: SafeHtml;
13
- headers: {
14
- id: string;
15
- text: string;
16
- level: number;
17
- }[];
18
- }
19
- export interface AdkMarkdownParsingOptions {
20
- highlighter?: AdkShikiHighlighterOptions;
21
- gfm?: boolean;
22
- headingIds?: boolean;
23
- headingFragmentLinks?: AdkHeadingFragmentLinkOptions;
24
- }
25
- export interface AdkShikiHighlighterOptions {
26
- highlighter?: HighlighterGeneric<BundledLanguage, BundledTheme>;
27
- theme?: ShikiTheme;
28
- type?: 'html' | 'markdown';
29
- ignoreUnknownLanguage?: boolean;
30
- }
31
- export interface AdkHeadingFragmentLinkOptions {
32
- createLinks?: boolean;
33
- behavior?: 'append' | 'prepend' | 'wrap' | 'before' | 'after';
34
- }
35
- export declare class AdkMarkdownParser {
36
- private sanitizer;
37
- private shikiHighlighter;
38
- parser: typeof unified;
39
- constructor(sanitizer: DomSanitizer, shikiHighlighter: AdkShikiHighlighter);
40
- parse(markdown: string, options?: AdkMarkdownParsingOptions): Observable<AdkParsedContentSection[]>;
41
- private getSections;
42
- private parseSection;
43
- getHeaders(markdown: string): {
44
- id: string;
45
- text: string;
46
- level: number;
47
- }[];
48
- parseComponent(content: string): {
49
- name: string;
50
- pathTo: string;
51
- };
52
- static ɵfac: i0.ɵɵFactoryDeclaration<AdkMarkdownParser, never>;
53
- static ɵprov: i0.ɵɵInjectableDeclaration<AdkMarkdownParser>;
54
- }
@@ -1,77 +0,0 @@
1
- import { Root } from 'hast';
2
- import { BundledLanguage } from 'shiki/langs';
3
- import { BundledTheme } from 'shiki/themes';
4
- import { HighlighterGeneric } from 'shiki/types.mjs';
5
- import { AdkShikiHighlighterOptions } from './markdown-parser';
6
- import * as i0 from "@angular/core";
7
- export declare const defaultHighlighterLangs: string[];
8
- export declare enum ShikiTheme {
9
- Andromeeda = "andromeeda",
10
- AuroraX = "aurora-x",
11
- AyuDark = "ayu-dark",
12
- CatppuccinFrappe = "catppuccin-frappe",
13
- CatppuccinLatte = "catppuccin-latte",
14
- CatppuccinMacchiato = "catppuccin-macchiato",
15
- CatppuccinMocha = "catppuccin-mocha",
16
- DarkPlus = "dark-plus",
17
- DraculaTheme = "dracula",
18
- DraculaThemeSoft = "dracula-soft",
19
- EverforestDark = "everforest-dark",
20
- EverforestLight = "everforest-light",
21
- GitHubDark = "github-dark",
22
- GitHubDarkDefault = "github-dark-default",
23
- GitHubDarkDimmed = "github-dark-dimmed",
24
- GitHubDarkHighContrast = "github-dark-high-contrast",
25
- GitHubLight = "github-light",
26
- GitHubLightDefault = "github-light-default",
27
- GitHubLightHighContrast = "github-light-high-contrast",
28
- Houston = "houston",
29
- LaserWave = "laserwave",
30
- LightPlus = "light-plus",
31
- MaterialTheme = "material-theme",
32
- MaterialThemeDarker = "material-theme-darker",
33
- MaterialThemeLighter = "material-theme-lighter",
34
- MaterialThemeOcean = "material-theme-ocean",
35
- MaterialThemePalenight = "material-theme-palenight",
36
- MinDark = "min-dark",
37
- MinLight = "min-light",
38
- Monokai = "monokai",
39
- NightOwl = "night-owl",
40
- Nord = "nord",
41
- OneDarkPro = "one-dark-pro",
42
- OneLight = "one-light",
43
- Plastic = "plastic",
44
- Poimandres = "poimandres",
45
- Red = "red",
46
- RosePine = "rose-pine",
47
- RosePineDawn = "rose-pine-dawn",
48
- RosePineMoon = "rose-pine-moon",
49
- SlackDark = "slack-dark",
50
- SlackOchin = "slack-ochin",
51
- SnazzyLight = "snazzy-light",
52
- SolarizedDark = "solarized-dark",
53
- SolarizedLight = "solarized-light",
54
- Synthwave84 = "synthwave-84",
55
- TokyoNight = "tokyo-night",
56
- Vesper = "vesper",
57
- VitesseBlack = "vitesse-black",
58
- VitesseDark = "vitesse-dark",
59
- VitesseLight = "vitesse-light"
60
- }
61
- export declare class AdkShikiHighlighter {
62
- private highlighterPromise;
63
- /**
64
- * Initialize the highlighter. This should only be called one in an application.
65
- *
66
- * @param themes an array of any Shiki themes you may want to use anywhere in the app. You can control which theme for your particular parsing by passing the theme name to the actual parsing function.
67
- *
68
- * @returns void
69
- */
70
- initialize(themes: ShikiTheme[], langs?: string[]): Promise<void>;
71
- getHighlighter(): Promise<HighlighterGeneric<BundledLanguage, BundledTheme>>;
72
- remarkHighlight(options: AdkShikiHighlighterOptions): (tree: Root) => void;
73
- rehypeHighlight(options: AdkShikiHighlighterOptions): (tree: Root) => void;
74
- getLanguage(node: any): string;
75
- static ɵfac: i0.ɵɵFactoryDeclaration<AdkShikiHighlighter, never>;
76
- static ɵprov: i0.ɵɵInjectableDeclaration<AdkShikiHighlighter>;
77
- }
@@ -1 +0,0 @@
1
- export declare function deepMerge<T>(target: T, source: Partial<T>): T;
@@ -1,2 +0,0 @@
1
- export * from './deep-merge';
2
- export * from './safe-assign';
@@ -1,18 +0,0 @@
1
- /**
2
- * Safely assigns properties from a source object to a target object.
3
- *
4
- * Copies all own, enumerable properties from `source` to `target`,
5
- * except when the target already has a property of the same name that is a function.
6
- *
7
- * Logs a warning for each skipped property if `logConflicts` is true.
8
- *
9
- * @template TTarget The type of the target object.
10
- * @template TSource The type of the source object.
11
- * @param target The object to assign properties to.
12
- * @param source The object providing properties to assign.
13
- * @param logConflicts If true, logs when a method/property on the target prevents assignment. Default is false.
14
- *
15
- * @example
16
- * safeAssign(this, { log: 'hello' }, true);
17
- */
18
- export declare function safeAssign<TTarget extends object, TSource extends object>(target: TTarget, source: TSource, logConflicts?: boolean): void;
@@ -1,14 +0,0 @@
1
- import { DestroyRef, NgZone } from '@angular/core';
2
- import * as i0 from "@angular/core";
3
- export declare class AdkActiveHeadingTracker {
4
- private ngZone;
5
- private activeHeadingId;
6
- activeHeadingId$: import("rxjs").Observable<string>;
7
- constructor(ngZone: NgZone);
8
- initScrollListener(contentEl: HTMLElement, destroyRef: DestroyRef): void;
9
- private findActiveHeading;
10
- setActiveHeading(heading: HTMLHeadingElement): void;
11
- scrollToTop(): void;
12
- static ɵfac: i0.ɵɵFactoryDeclaration<AdkActiveHeadingTracker, never>;
13
- static ɵprov: i0.ɵɵInjectableDeclaration<AdkActiveHeadingTracker>;
14
- }
@@ -1,17 +0,0 @@
1
- import { EventEmitter } from '@angular/core';
2
- import { AdkActiveHeadingTracker } from '../active-heading-tracker';
3
- import { AdkHtmlHeader } from '../documentation-content-service';
4
- import * as i0 from "@angular/core";
5
- export declare class AdkDocumentIndexComponent {
6
- activeHeadingTracker: AdkActiveHeadingTracker;
7
- headings: AdkHtmlHeader[];
8
- activeHeading: EventEmitter<{
9
- heading: AdkHtmlHeader;
10
- event: KeyboardEvent | PointerEvent | MouseEvent | Event;
11
- }>;
12
- constructor(activeHeadingTracker: AdkActiveHeadingTracker);
13
- setActiveHeading(event: KeyboardEvent | PointerEvent | MouseEvent | Event, heading: AdkHtmlHeader): void;
14
- scrollToTop(): void;
15
- static ɵfac: i0.ɵɵFactoryDeclaration<AdkDocumentIndexComponent, never>;
16
- static ɵcmp: i0.ɵɵComponentDeclaration<AdkDocumentIndexComponent, "hsi-adk-document-index", never, { "headings": { "alias": "headings"; "required": false; }; }, { "activeHeading": "activeHeading"; }, never, never, true, never>;
17
- }