import type { Parser } from '@mewjs/htmlparser2'; import type { HTMLElement, HTMLDocument } from '@mewjs/dom/lib'; import type defaultConfig from '../default/config'; import type Reporter from '../reporter'; export { Node, Element, Document } from 'domhandler/lib/node'; export { ElementType } from 'domelementtype'; export { HTMLDocument } from '@mewjs/dom/lib'; export declare type ConfigurationValue = string | boolean | number | ConfigObject; interface ConfigObject { [key: string]: ConfigurationValue; } export declare type Configuration = typeof defaultConfig; export declare type Target = 'document' | 'parser'; export declare interface ASTNode { index: number; content: string; } export declare interface ASTTarget { [key: string]: ASTNode[]; } export declare interface Config { index: number; content: string | boolean | number | Record; } export declare interface Configs { [key: string]: Config[]; } export declare type getConfigValue = (indexOrParser?: number | string | Parser | HTMLElement, ruleName?: string) => ConfigurationValue; export declare type Linter = (getConfig: getConfigValue, parser: T, reporter: Reporter, code?: string) => void; export declare type Formatter = (getConfig: getConfigValue, document: HTMLDocument, options: object) => void; export interface RuleOptions { target: Target; name: string; desc: string; lint?: Linter | Linter; format?: Formatter; } export interface FormatterRule extends RuleOptions { format: Formatter; } export interface ParserRule extends RuleOptions { lint: Linter; } export interface DocumentRule extends RuleOptions { lint: Linter; } export declare interface InlineConfigRules { [key: string]: string; } export declare interface InlineConfigs { rules: Configs; reporter: Configs; } export declare type RuleType = Parser | HTMLDocument; export declare class Rule implements RuleOptions { target: Target; name: string; desc: string; lint: null; format: null; constructor(options: T); static create(options: T): Rule; } export interface RuleHelper { indent: (content: string) => string; trim: (content: string) => string; }