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.

79 lines (78 loc) 3.69 kB
import { Injector } from '@angular/core'; import { HookParser } from '../../interfacesPublic'; import { SelectorHookParserConfigResolver } from '../../parsers/selector/selectorHookParserConfigResolver'; import { TagHookFinder } from '../../parsers/selector/text/tagHookFinder'; import { BindingsValueManager } from '../../parsers/selector/bindingsValueManager'; import { HookParserEntry } from './parserEntry'; import { AutoPlatformService } from '../platform/autoPlatformService'; import { Logger } from '../utils/logger'; import { ParseOptions } from '../settings/options'; import * as i0 from "@angular/core"; /** * A helper class for resolving HookParserEntries */ export declare class ParserEntryResolver { private injector; private parserResolver; private platformService; private tagHookFinder; private bindingsValueManager; private logger; constructor(injector: Injector, parserResolver: SelectorHookParserConfigResolver, platformService: AutoPlatformService, tagHookFinder: TagHookFinder, bindingsValueManager: BindingsValueManager, logger: Logger); /** * Takes a list of HookParserEntries and transforms them into a list of loaded HookParsers * * @param parserEntries - The list of HookParserEntries to process * @param injector - The injector to use for resolving parsers * @param blacklist - (optional) Which parsers to blacklist by name * @param whitelist - (optional) Which parsers to whitelist by name * @param options - The current ParseOptions */ resolve(parserEntries: HookParserEntry[], injector: Injector, blacklist: string[] | null, whitelist: string[] | null, options: ParseOptions): HookParser[]; /** * Figures out what kind of config type the HookParserEntry is and loads it appropriately. * * The potential types are: * - 1. a component class (shorthand for nr. 5) * - 2. a parser service * - 3. a parser class * - 4. a parser instance * - 5. an object literal to configure SelectorHookParser with * * @param parserEntry - The HookParserEntry to process * @param injector - The injector to use for resolving this parser * @param options - The current ParseOptions */ resolveEntry(parserEntry: HookParserEntry, injector: Injector, options: ParseOptions): HookParser | null; /** * Depending on the config, load either string or element SelectorHookParser * * @param config - The selectorHookParserConfig */ private createSelectorHookParser; /** * Makes sure that the parsers have all required functions * * @param parsers - The parsers in question * @param options - The current ParseOptions */ validateParserFunctions(parsers: HookParser[], options: ParseOptions): HookParser[]; /** * Makes sure that all parser names are unique * * @param parsers - The parsers in question * @param options - The current ParseOptions */ checkParserNames(parsers: HookParser[], options: ParseOptions): void; /** * A black/whitelist validation function for the benefit of the user. Outputs warnings in the console if something is off. * * @param parsers - The parsers in question * @param blacklist - The blacklist in question * @param whitelist - The whitelist in question * @param options - The current ParseOptions */ checkBlackAndWhitelist(parsers: HookParser[], blacklist: string[] | null, whitelist: string[] | null, options: ParseOptions): void; static ɵfac: i0.ɵɵFactoryDeclaration<ParserEntryResolver, never>; static ɵprov: i0.ɵɵInjectableDeclaration<ParserEntryResolver>; }