UNPKG

@osaedasia/oresume

Version:

A user-friendly library for generating complete Single Page Applications (SPAs)

54 lines (53 loc) 2.23 kB
import { ParsedHtml } from "../../domain/models/ParsedHtml"; import { IPipelineContext } from "../../domain/definitions/interfaces/parser/IPipelineContext"; import { APatternService } from "./pattern/APatternService"; import { Pattern } from "../../domain/definitions/types/Pattern"; /** * Provides a context for parsing and processing HTML within a pipeline, * managing relevant state, detected patterns, and associated pattern services. * @implements {IPipelineContext} */ export declare class HtmlParsingContext implements IPipelineContext { /** * Holds the processed or converted HTML content. */ markedHtml: string; /** * An array of detected patterns. */ patterns: Pattern[]; /** * Tracks the number of patterns detected during the whole pipeline operation. */ patternFound: number; /** * Services for managing pattern-related logic. */ readonly patternServices: ReadonlySet<APatternService>; /** * Contains template strings and their respective interpolated values. */ readonly templateData: { strings: TemplateStringsArray; values: unknown[]; }; /** * Initializes the parsing context with pattern services, an empty HTML string, * an empty pattern list, and data for template interpolation. * @param {Set<APatternService>} patternServices A set of pattern service instances. * @param {TemplateStringsArray} strings Template string segments. * @param {...unknown[]} values Values to interpolate in the template. */ constructor(patternServices: Set<APatternService>, strings: TemplateStringsArray, ...values: unknown[]); /** * @returns {ParsedHtml} The resulting ParsedHtml containing the processed HTML. */ toParsedHtml(): ParsedHtml; /** * Finds and returns a pattern matching the specified index and type. * @param {number} index The index of the pattern to locate. * @param {APatternService} service The service specifying the pattern type to match. * @returns {Pattern | undefined} The matching pattern if found, otherwise undefined. */ findPattern(index: number, service: APatternService): Pattern | undefined; }