nxt-highlightjs 19.0.5
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 +64 -0
- package/extras/code-file-location.d.ts +12 -0
- package/extras/code-from-url.d.ts +10 -0
- package/extras/code-loader.d.ts +22 -0
- package/extras/gist.d.ts +20 -0
- package/extras/gist.model.d.ts +95 -0
- package/extras/highlight-extras.module.d.ts +8 -0
- package/extras/index.d.ts +5 -0
- package/extras/public_api.d.ts +5 -0
- package/fesm2022/nxt-highlightjs-extras.mjs +203 -0
- package/fesm2022/nxt-highlightjs-extras.mjs.map +1 -0
- package/fesm2022/nxt-highlightjs-line-numbers.mjs +311 -0
- package/fesm2022/nxt-highlightjs-line-numbers.mjs.map +1 -0
- package/fesm2022/nxt-highlightjs.mjs +389 -0
- package/fesm2022/nxt-highlightjs.mjs.map +1 -0
- package/index.d.ts +5 -0
- package/lib/highlight-auto.d.ts +27 -0
- package/lib/highlight-base.d.ts +27 -0
- package/lib/highlight.d.ts +30 -0
- package/lib/highlight.loader.d.ts +28 -0
- package/lib/highlight.model.d.ts +22 -0
- package/lib/highlight.module.d.ts +8 -0
- package/lib/highlight.service.d.ts +64 -0
- package/lib/loader-errors.d.ts +7 -0
- package/lib/trusted-types.d.ts +1 -0
- package/line-numbers/index.d.ts +5 -0
- package/line-numbers/line-numbers-lib.d.ts +6 -0
- package/line-numbers/line-numbers.d.ts +12 -0
- package/line-numbers/public_api.d.ts +2 -0
- package/package.json +52 -0
- package/public-api.d.ts +7 -0
|
@@ -0,0 +1,64 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function trustedHTMLFromStringBypass(html: string): string | import("trusted-types/lib").TrustedHTML;
|
|
@@ -0,0 +1,12 @@
|
|
|
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
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "nxt-highlightjs",
|
|
3
|
+
"description": "Angular code highlighting directives with optional line numbers and support for SSR",
|
|
4
|
+
"bugs": "https://github.com/Liquid-JS/nxt-components/issues",
|
|
5
|
+
"version": "19.0.5",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"type": "module",
|
|
8
|
+
"repository": "https://github.com/Liquid-JS/nxt-components.git",
|
|
9
|
+
"homepage": "https://github.com/Liquid-JS/nxt-components/tree/master/packages/highlightjs",
|
|
10
|
+
"keywords": [
|
|
11
|
+
"nxt-highlightjs",
|
|
12
|
+
"ng-highlightjs",
|
|
13
|
+
"angular",
|
|
14
|
+
"highlight",
|
|
15
|
+
"highlightjs",
|
|
16
|
+
"prism",
|
|
17
|
+
"syntax",
|
|
18
|
+
"code",
|
|
19
|
+
"gist"
|
|
20
|
+
],
|
|
21
|
+
"peerDependencies": {
|
|
22
|
+
"@angular/cdk": "^19.0.0",
|
|
23
|
+
"@angular/common": "^19.0.0",
|
|
24
|
+
"@angular/core": "^19.0.0",
|
|
25
|
+
"@angular/platform-browser": "^19.0.0",
|
|
26
|
+
"highlight.js": ">=11.11.0",
|
|
27
|
+
"rxjs": "^7.8.1"
|
|
28
|
+
},
|
|
29
|
+
"dependencies": {
|
|
30
|
+
"tslib": "^2.8.1"
|
|
31
|
+
},
|
|
32
|
+
"module": "fesm2022/nxt-highlightjs.mjs",
|
|
33
|
+
"typings": "index.d.ts",
|
|
34
|
+
"exports": {
|
|
35
|
+
"./package.json": {
|
|
36
|
+
"default": "./package.json"
|
|
37
|
+
},
|
|
38
|
+
".": {
|
|
39
|
+
"types": "./index.d.ts",
|
|
40
|
+
"default": "./fesm2022/nxt-highlightjs.mjs"
|
|
41
|
+
},
|
|
42
|
+
"./extras": {
|
|
43
|
+
"types": "./extras/index.d.ts",
|
|
44
|
+
"default": "./fesm2022/nxt-highlightjs-extras.mjs"
|
|
45
|
+
},
|
|
46
|
+
"./line-numbers": {
|
|
47
|
+
"types": "./line-numbers/index.d.ts",
|
|
48
|
+
"default": "./fesm2022/nxt-highlightjs-line-numbers.mjs"
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
"sideEffects": false
|
|
52
|
+
}
|
package/public-api.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
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';
|