UNPKG

@ynetlabo/htmlanalyzer

Version:

a tool for the npm package to easily analysis a html document.

23 lines (22 loc) 876 B
import { ArticleDoc, PostDoc } from "./AnalyzedDoc"; import { HTMLElement } from "node-html-parser"; export declare class AnalyzerOptions { selectQuery: string; titleSelector?: string; descriptionSelector?: string; dateSelector?: string; constructor(selectQuery: string); } export declare class HTMLAnalyzer { static getAnalyzedDocByUrl(targetUrl: string, options: AnalyzerOptions, postDocAdapter: Function): Promise<Array<PostDoc>>; static DlTagAdapter(elements: Array<HTMLElement>): Array<ArticleDoc>; static CustomBlockAdapter(elements: Array<HTMLElement>, options: AnalyzerOptions): Array<ArticleDoc>; private static guessDate; private static getHtmlDocByUrl; private static getParsedHtml; } export declare class DateRegexFormat { regex: string; dateFormat: string; constructor(regex: string, dateFormat: string); }