nxt-highlightjs 19.0.5 → 20.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.
@@ -1,27 +0,0 @@
1
- import { InputSignal, OutputEmitterRef, WritableSignal } from '@angular/core';
2
- import type { AutoHighlightResult, HighlightResult } from 'highlight.js';
3
- import { HighlightJS } from './highlight.service';
4
- import * as i0 from "@angular/core";
5
- export declare abstract class HighlightBase {
6
- protected readonly hljs: HighlightJS;
7
- private readonly nativeElement;
8
- private readonly sanitizer;
9
- /**
10
- * Code to highlight
11
- */
12
- abstract code: InputSignal<string | null | undefined>;
13
- /**
14
- * Highlighted result
15
- */
16
- abstract highlightResult: WritableSignal<HighlightResult | AutoHighlightResult | undefined>;
17
- /**
18
- * Stream that emits when code string is highlighted
19
- */
20
- abstract highlighted: OutputEmitterRef<HighlightResult | AutoHighlightResult | undefined>;
21
- constructor();
22
- protected abstract highlightElement(code: string): HighlightResult | AutoHighlightResult | undefined;
23
- private setTextContent;
24
- private setInnerHTML;
25
- static ɵfac: i0.ɵɵFactoryDeclaration<HighlightBase, never>;
26
- static ɵdir: i0.ɵɵDirectiveDeclaration<HighlightBase, never, never, {}, {}, never, never, true, never>;
27
- }
@@ -1,30 +0,0 @@
1
- import { InputSignal } from '@angular/core';
2
- import type { HighlightResult } from 'highlight.js';
3
- import { HighlightBase } from './highlight-base';
4
- import * as i0 from "@angular/core";
5
- export declare class HighlightDirective extends HighlightBase {
6
- /**
7
- * Code to highlight
8
- */
9
- code: InputSignal<string | null | undefined>;
10
- /**
11
- * Highlighted result
12
- */
13
- highlightResult: import("@angular/core").WritableSignal<HighlightResult | undefined>;
14
- /**
15
- * The language name highlight only one language
16
- */
17
- readonly language: InputSignal<string>;
18
- /**
19
- * An optional flag, when set to true it forces highlighting to finish even in case of detecting
20
- * illegal syntax for the language instead of throwing an exception
21
- */
22
- readonly ignoreIllegals: import("@angular/core").InputSignalWithTransform<boolean | undefined, unknown>;
23
- /**
24
- * Stream that emits when code string is highlighted
25
- */
26
- highlighted: import("@angular/core").OutputEmitterRef<HighlightResult>;
27
- highlightElement(code: string): HighlightResult | undefined;
28
- static ɵfac: i0.ɵɵFactoryDeclaration<HighlightDirective, never>;
29
- static ɵdir: i0.ɵɵDirectiveDeclaration<HighlightDirective, "[nxtHighlight]", never, { "code": { "alias": "nxtHighlight"; "required": false; "isSignal": true; }; "language": { "alias": "language"; "required": true; "isSignal": true; }; "ignoreIllegals": { "alias": "ignoreIllegals"; "required": false; "isSignal": true; }; }, { "highlighted": "highlighted"; }, never, never, true, never>;
30
- }
@@ -1,28 +0,0 @@
1
- import type { HLJSApi } from 'highlight.js';
2
- import * as i0 from "@angular/core";
3
- export declare class HighlightLoader {
4
- private readonly document;
5
- private readonly options;
6
- private readonly pendingTasks;
7
- readonly ready: Promise<HLJSApi>;
8
- private themeLinkElement?;
9
- constructor();
10
- /**
11
- * Lazy-Load highlight.js library
12
- */
13
- private loadLibrary;
14
- /**
15
- * Lazy-load highlight.js languages
16
- */
17
- private loadLanguages;
18
- /**
19
- * Reload theme styles
20
- */
21
- setTheme(path: string): void;
22
- /**
23
- * Load theme
24
- */
25
- private loadTheme;
26
- static ɵfac: i0.ɵɵFactoryDeclaration<HighlightLoader, never>;
27
- static ɵprov: i0.ɵɵInjectableDeclaration<HighlightLoader>;
28
- }
@@ -1,22 +0,0 @@
1
- import { InjectionToken } from '@angular/core';
2
- import type { HLJSApi, HLJSOptions, LanguageFn } from 'highlight.js';
3
- /**
4
- * Full documentation is available here https://highlightjs.readthedocs.io/en/latest/api.html
5
- */
6
- export interface LineNumbersOptions {
7
- startFrom?: number;
8
- singleLine?: boolean;
9
- }
10
- export interface HighlightJSOptions {
11
- highlightOptions?: Partial<HLJSOptions>;
12
- lineNumbersOptions?: LineNumbersOptions;
13
- languages?: Record<string, () => Promise<LanguageFn>>;
14
- coreLibraryLoader?: () => Promise<HLJSApi>;
15
- fullLibraryLoader?: () => Promise<HLJSApi>;
16
- lineNumbersLoader?: () => Promise<{
17
- activateLineNumbers: (document: Document) => (element: HTMLElement, options?: LineNumbersOptions) => void;
18
- }>;
19
- themePath?: string;
20
- }
21
- export declare const NXT_HIGHLIGHT_OPTIONS: InjectionToken<HighlightJSOptions>;
22
- export declare function provideHighlightOptions(options: HighlightJSOptions): import("@angular/core").EnvironmentProviders;
@@ -1,8 +0,0 @@
1
- import * as i0 from "@angular/core";
2
- import * as i1 from "./highlight";
3
- import * as i2 from "./highlight-auto";
4
- export declare class HighlightModule {
5
- static ɵfac: i0.ɵɵFactoryDeclaration<HighlightModule, never>;
6
- static ɵmod: i0.ɵɵNgModuleDeclaration<HighlightModule, never, [typeof i1.HighlightDirective, typeof i2.HighlightAutoDirective], [typeof i1.HighlightDirective, typeof i2.HighlightAutoDirective]>;
7
- static ɵinj: i0.ɵɵInjectorDeclaration<HighlightModule>;
8
- }
@@ -1,64 +0,0 @@
1
- import type { AutoHighlightResult, HLJSApi, HighlightOptions, HighlightResult, LanguageFn } from 'highlight.js';
2
- import { LineNumbersOptions } from './highlight.model';
3
- import * as i0 from "@angular/core";
4
- export declare class HighlightJS {
5
- private readonly loader;
6
- readonly hljs: import("@angular/core").Signal<HLJSApi | undefined>;
7
- constructor();
8
- /**
9
- * Core highlighting function. Accepts the code to highlight (string) and a list of options (object)
10
- */
11
- highlight(code: string, options: HighlightOptions): Promise<HighlightResult>;
12
- /**
13
- * Highlighting with language detection.
14
- */
15
- highlightAuto(value: string, languageSubset?: string[]): Promise<AutoHighlightResult>;
16
- /**
17
- * Applies highlighting to a DOM node containing code.
18
- * This function is the one to use to apply highlighting dynamically after page load or within initialization code of third-party JavaScript frameworks.
19
- * The function uses language detection by default but you can specify the language in the class attribute of the DOM node. See the scopes reference for all available language names and scopes.
20
- */
21
- highlightElement(element: HTMLElement): Promise<void>;
22
- /**
23
- * Applies highlighting to all elements on a page matching the configured cssSelector. The default cssSelector value is 'pre code',
24
- * which highlights all code blocks. This can be called before or after the page’s onload event has fired.
25
- */
26
- highlightAll(): Promise<void>;
27
- /**
28
- * Adds new language to the library under the specified name. Used mostly internally.
29
- * The function is passed the hljs object to be able to use common regular expressions defined within it.
30
- */
31
- registerLanguage(languageName: string, languageDefinition: LanguageFn): Promise<void>;
32
- /**
33
- * Removes a language and its aliases from the library. Used mostly internally
34
- */
35
- unregisterLanguage(languageName: string): Promise<void>;
36
- /**
37
- * Adds new language alias or aliases to the library for the specified language name defined under languageName key.
38
- */
39
- registerAliases(alias: string | string[], { languageName }: {
40
- languageName: string;
41
- }): Promise<void>;
42
- /**
43
- * @return The languages names list.
44
- */
45
- listLanguages(): Promise<string[]>;
46
- /**
47
- * Looks up a language by name or alias.
48
- */
49
- getLanguage(name: string): Promise<any>;
50
- /**
51
- * Enables safe mode. This is the default mode, providing the most reliable experience for production usage.
52
- */
53
- safeMode(): Promise<void>;
54
- /**
55
- * Enables debug/development mode.
56
- */
57
- debugMode(): Promise<void>;
58
- /**
59
- * Display line numbers
60
- */
61
- lineNumbersBlock(el: HTMLElement, options: LineNumbersOptions): Promise<void>;
62
- static ɵfac: i0.ɵɵFactoryDeclaration<HighlightJS, never>;
63
- static ɵprov: i0.ɵɵInjectableDeclaration<HighlightJS>;
64
- }
@@ -1,7 +0,0 @@
1
- export declare enum LoaderErrors {
2
- FULL_WITH_CORE_LIBRARY_IMPORTS = "The full library and the core library were imported, only one of them should be imported!",
3
- FULL_WITH_LANGUAGE_IMPORTS = "The highlighting languages were imported they are not needed!",
4
- CORE_WITHOUT_LANGUAGE_IMPORTS = "The highlighting languages were not imported!",
5
- LANGUAGE_WITHOUT_CORE_IMPORTS = "The core library was not imported!",
6
- NO_FULL_AND_NO_CORE_IMPORTS = "Highlight.js library was not imported!"
7
- }
@@ -1 +0,0 @@
1
- export declare function trustedHTMLFromStringBypass(html: string): string | import("trusted-types/lib").TrustedHTML;
@@ -1,6 +0,0 @@
1
- interface LineNumbersOptions {
2
- startFrom?: number;
3
- singleLine?: boolean;
4
- }
5
- export declare function activateLineNumbers(document: Document): (element: HTMLElement, options?: LineNumbersOptions) => void;
6
- export {};
@@ -1,12 +0,0 @@
1
- import * as i0 from "@angular/core";
2
- export declare class HighlightLineNumbersDirective {
3
- private readonly options;
4
- private readonly hljs;
5
- private readonly highlight;
6
- private readonly nativeElement;
7
- readonly startFrom: import("@angular/core").InputSignalWithTransform<number | undefined, unknown>;
8
- readonly singleLine: import("@angular/core").InputSignalWithTransform<boolean | undefined, unknown>;
9
- constructor();
10
- static ɵfac: i0.ɵɵFactoryDeclaration<HighlightLineNumbersDirective, never>;
11
- static ɵdir: i0.ɵɵDirectiveDeclaration<HighlightLineNumbersDirective, "[nxtHighlight][lineNumbers], [nxtHighlightAuto][lineNumbers]", never, { "startFrom": { "alias": "startFrom"; "required": false; "isSignal": true; }; "singleLine": { "alias": "singleLine"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
12
- }
@@ -1,2 +0,0 @@
1
- export * from './line-numbers';
2
- export * from './line-numbers-lib';
package/public-api.d.ts DELETED
@@ -1,7 +0,0 @@
1
- export * from './lib/highlight';
2
- export * from './lib/highlight-auto';
3
- export * from './lib/highlight-base';
4
- export * from './lib/highlight.loader';
5
- export * from './lib/highlight.model';
6
- export * from './lib/highlight.module';
7
- export * from './lib/highlight.service';