@ng-doc/app
Version:
<!-- PROJECT LOGO --> <br /> <div align="center"> <a href="https://github.com/ng-doc/ng-doc"> <img src="https://ng-doc.com/assets/images/ng-doc.svg?raw=true" alt="Logo" height="150px"> </a>
28 lines (27 loc) • 990 B
TypeScript
import { Injector, Type } from '@angular/core';
import { NgDocProcessorOptions } from './processor-options';
/**
* Interface to create a processor that will be used to replace html nodes with an Angular component.
*/
export interface NgDocPageProcessor<T = unknown> {
/**
* Target component to replace html nodes with.
*/
component: Type<T>;
/**
* Selector to find html nodes to replace.
*/
selector: string;
/**
* Extract options for Angular component from html node.
* @param element - Html node to extract options from.
* @param root - Root html node.
*/
extractOptions: (element: Element, root: HTMLElement) => NgDocProcessorOptions<T>;
/**
* Can be used to find a node to replace instead of the node that was found by selector.
* @param element - Html node to replace.
* @param injector - Injector to get dependencies.
*/
nodeToReplace?: (element: Element, injector: Injector) => Element;
}