UNPKG

@textlint/kernel

Version:
52 lines 1.67 kB
import type { TextlintFilterRuleReporter, TextlintRuleReporter } from "@textlint/types"; /** * detect that ruleCreator has linter function * @param {*} ruleCreator * @returns {boolean} */ export declare function hasLinter(ruleCreator: unknown): boolean; /** * get linter function from ruleCreator * if not found, throw error * @param {((...args: any[]) => any)|Object|any} ruleCreator * @returns {(...args: any[]) => any} linter function * @throws */ export declare function getLinter(ruleCreator: unknown): TextlintRuleReporter; /** * detect that ruleCreator has fixer function * @param {*} ruleCreator * @returns {boolean} */ export declare function hasFixer(ruleCreator: unknown): boolean; /** * get fixer function from ruleCreator * if not found, throw error * @param {((...args: any[]) => any)|Object|any} ruleCreator * @returns {(...args: any[]) => any} fixer function * @throws */ export declare function getFixer(ruleCreator: unknown): TextlintRuleReporter; /** * RuleModule should has either linter or fixer. * @param {*} ruleCreator * @returns {boolean} **/ export declare function isRuleModule(ruleCreator: unknown): boolean; /** * Validate rule module. * if invalid throw error * @param {*} ruleModule * @param {string} [key] * @throws */ export declare function assertRuleShape(ruleModule: unknown, key?: string): void; /** * get linter function from ruleCreator * if not found, throw error * @param {*} ruleCreator * @returns {(...args: any[]) => any} linter function * @throws */ export declare function getFilter(ruleCreator: unknown): TextlintFilterRuleReporter; //# sourceMappingURL=rule-creator-helper.d.ts.map