UNPKG

811 BTypeScriptView Raw
1import { AnyTxtNode, TxtNodeType } from "@textlint/ast-node-types";
2import type { TextlintRuleContext, TextlintRuleError, TextlintRuleReportHandler } from "@textlint/types";
3export interface wrapReportHandlerOptions {
4 /**
5 * Define ignore node's type.
6 * It the node.type is matched, report error that is related with the location of node.
7 * You also should use `report` function that is passed as wrapReportHandler 3rd argument.
8 */
9 ignoreNodeTypes: TxtNodeType[];
10}
11/**
12 *
13 * @param context
14 * @param options
15 * @param handler
16 */
17export declare function wrapReportHandler<T extends Readonly<TextlintRuleContext>, R extends TextlintRuleReportHandler>(context: T, options: wrapReportHandlerOptions, handler: (report: (node: AnyTxtNode, ruleError: TextlintRuleError) => void) => R): R;