UNPKG

ngx-dynamic-hooks

Version:

Automatically insert live Angular components into a dynamic string of content (based on their selector or any pattern of your choice) and render the result in the DOM.

54 lines (53 loc) 2.56 kB
import { SavedBindings } from '../../../interfaces'; import { HookParser, HookValue, HookComponentData, HookBindings } from '../../../interfacesPublic'; import { BindingsValueManager } from '../bindingsValueManager'; import { SelectorHookParserConfig } from '../selectorHookParserConfig'; import { SelectorHookParserConfigResolver } from '../selectorHookParserConfigResolver'; import { AutoPlatformService } from '../../../services/platform/autoPlatformService'; import { ParseOptions } from '../../../services/settings/options'; /** * An element parser to load components with their bindings like in Angular templates. */ export declare class ElementSelectorHookParser implements HookParser { private configResolver; private platformService; private bindingsValueManager; name: string | undefined; config: SelectorHookParserConfig; savedBindings: { [key: number]: SavedBindings; }; constructor(config: SelectorHookParserConfig, configResolver: SelectorHookParserConfigResolver, platformService: AutoPlatformService, bindingsValueManager: BindingsValueManager); findHookElements(contentElement: any, context: any, options: ParseOptions): any[]; loadComponent(hookId: number, hookValue: HookValue, context: any, childNodes: any[], options: ParseOptions): HookComponentData; getBindings(hookId: number, hookValue: HookValue, context: any, options: ParseOptions): HookBindings; /** * Always removes angular-typical template attrs like []-input and ()-outputs from anchors * * @param anchorElement - The element to strub */ scrubAngularBindingAttrs(anchorElement: any): void; /** * Returns RichBindingData for Angular-style inputs & output attrs from an element * * @param element - The element to inspect */ createBindings(element: any): SavedBindings; /** * Returns Angular-style inputs or output attrs from an element * * @param element - The element to inspect * @param type - Whether to return the inputs or outputs * @param blacklist - A list of inputs/outputs to blacklist * @param whitelist - A list of inputs/outputs to whitelist */ collectRawBindings(element: any, type: 'inputs' | 'outputs', blacklist: string[] | null, whitelist: string[] | null): { [key: string]: any; }; /** * Transforms a RichBindingData object into a normal bindings object * * @param richBindingsObject - The object containing the RichBindingData */ private getValuesFromSavedBindings; }