@ng-doc/utils 17.6.15 → 18.0.0-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.
- package/html/helpers/index.d.ts +2 -3
- package/html/helpers/is-code-block.d.ts +7 -0
- package/html/helpers/is-element.d.ts +2 -2
- package/html/helpers/is-heading.d.ts +6 -0
- package/html/plugins/add-heading-anchors.plugin.d.ts +6 -0
- package/html/plugins/keywords.plugin.d.ts +7 -3
- package/html/plugins/mark-elements.plugin.d.ts +1 -1
- package/html/plugins/mermaid.plugin.d.ts +6 -0
- package/html/plugins/slugger.plugin.d.ts +2 -2
- package/html/plugins/table-wrapper.d.ts +4 -0
- package/html/post-process-html.d.ts +13 -0
- package/html/process-html.d.ts +18 -0
- package/html/replace-keywords.d.ts +12 -0
- package/html/stringify-entities.d.ts +5 -0
- package/index.d.ts +4 -2
- package/index.esm.js +259 -15283
- package/package.json +15 -11
- package/html/helpers/is-text.d.ts +0 -6
- package/html/helpers/line-break.d.ts +0 -5
- package/html/helpers/text-element.d.ts +0 -6
- package/html/html-post-processor.d.ts +0 -13
- package/html/html-processor.d.ts +0 -13
- package/html/plugins/autolink-headings.plugin.d.ts +0 -6
- package/html/plugins/code-block-lines.plugin.d.ts +0 -5
- package/html/plugins/mark-code-blocks.plugin.d.ts +0 -8
package/html/helpers/index.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
export * from './attr-value';
|
|
2
2
|
export * from './has-class';
|
|
3
3
|
export * from './has-link-ancestor';
|
|
4
|
+
export * from './is-code-block';
|
|
4
5
|
export * from './is-code-node';
|
|
5
6
|
export * from './is-element';
|
|
6
|
-
export * from './is-
|
|
7
|
-
export * from './line-break';
|
|
8
|
-
export * from './text-element';
|
|
7
|
+
export * from './is-heading';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Content, Element } from 'hast';
|
|
2
2
|
/**
|
|
3
3
|
*
|
|
4
4
|
* @param node
|
|
5
5
|
*/
|
|
6
|
-
export declare function isElement(node?:
|
|
6
|
+
export declare function isElement(node?: Content): node is Element;
|
|
@@ -1,10 +1,14 @@
|
|
|
1
|
-
import { NgDocKeyword } from '@ng-doc/core
|
|
1
|
+
import { NgDocKeyword } from '@ng-doc/core';
|
|
2
2
|
import { Element } from 'hast';
|
|
3
|
-
import { NgDocHtmlPostProcessorConfig } from '../html-post-processor';
|
|
4
3
|
export type AddKeyword = (keyword: string) => void;
|
|
5
4
|
export type GetKeyword = (keyword: string) => NgDocKeyword | undefined;
|
|
5
|
+
interface Config {
|
|
6
|
+
addUsedKeyword?: AddKeyword;
|
|
7
|
+
getKeyword?: GetKeyword;
|
|
8
|
+
}
|
|
6
9
|
/**
|
|
7
10
|
*
|
|
8
11
|
* @param config
|
|
9
12
|
*/
|
|
10
|
-
export default function keywordsPlugin(config:
|
|
13
|
+
export default function keywordsPlugin(config: Config): (tree: Element) => undefined;
|
|
14
|
+
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { NgDocHeading, NgDocPageAnchor } from '@ng-doc/core';
|
|
2
2
|
import { Root } from 'hast';
|
|
3
3
|
/**
|
|
4
4
|
*
|
|
@@ -6,4 +6,4 @@ import { Root } from 'hast';
|
|
|
6
6
|
* @param addAnchor
|
|
7
7
|
* @param headings
|
|
8
8
|
*/
|
|
9
|
-
export default function sluggerPlugin(addAnchor
|
|
9
|
+
export default function sluggerPlugin(addAnchor?: (anchor: NgDocPageAnchor) => void, headings?: NgDocHeading[]): (tree: Root) => void;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface PostProcessHtmlOutput {
|
|
2
|
+
content: string;
|
|
3
|
+
usedKeywords: string[];
|
|
4
|
+
error?: unknown;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
*
|
|
8
|
+
* @param html
|
|
9
|
+
* @param config
|
|
10
|
+
* @param config.addUsedKeyword
|
|
11
|
+
* @param addUsedKeyword
|
|
12
|
+
*/
|
|
13
|
+
export declare function postProcessHtml(html: string): Promise<PostProcessHtmlOutput>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { NgDocHeading, NgDocPageAnchor } from '@ng-doc/core';
|
|
2
|
+
export interface NgDocHtmlProcessorConfig {
|
|
3
|
+
lightTheme?: string;
|
|
4
|
+
darkTheme?: string;
|
|
5
|
+
headings?: NgDocHeading[];
|
|
6
|
+
route?: string;
|
|
7
|
+
}
|
|
8
|
+
export interface NgDocHtmlProcessorOutput {
|
|
9
|
+
content: string;
|
|
10
|
+
anchors: NgDocPageAnchor[];
|
|
11
|
+
error?: unknown;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
*
|
|
15
|
+
* @param html
|
|
16
|
+
* @param config
|
|
17
|
+
*/
|
|
18
|
+
export declare function processHtml(html: string, config: NgDocHtmlProcessorConfig): Promise<NgDocHtmlProcessorOutput>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { GetKeyword } from './plugins/keywords.plugin';
|
|
2
|
+
export interface ReplaceKeywordsConfig {
|
|
3
|
+
getKeyword: GetKeyword;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
*
|
|
7
|
+
* @param html
|
|
8
|
+
* @param config
|
|
9
|
+
* @param config.getKeyword
|
|
10
|
+
* @param getKeyword
|
|
11
|
+
*/
|
|
12
|
+
export declare function replaceKeywords(html: string, { getKeyword }: ReplaceKeywordsConfig): Promise<string>;
|
package/index.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
-
export * from './html/
|
|
2
|
-
export * from './html/html
|
|
1
|
+
export * from './html/post-process-html';
|
|
2
|
+
export * from './html/process-html';
|
|
3
3
|
export * from './html/remove-not-indexable-content';
|
|
4
|
+
export * from './html/replace-keywords';
|
|
5
|
+
export * from './html/stringify-entities';
|