/** * @packageDocumentation * Shared rule creation helpers for eslint-plugin-remark. */ import type { TSESLint } from "@typescript-eslint/utils"; import type { Except, UnknownArray } from "type-fest"; import type { RemarkConfigReference } from "./remark-config-references.js"; /** Small helper for rule context typing in local helpers. */ export type GenericRuleContext> = Readonly>; /** CSS/JS-agnostic listener map used by this plugin's rules. */ export type GenericRuleListener = Readonly void>>; /** Plugin-specific metadata extensions for `meta.docs`. */ export type RemarkRuleDocs = Readonly<{ configs: readonly RemarkConfigReference[] | RemarkConfigReference; description: string; frozen?: boolean; recommended: boolean; requiresTypeChecking: boolean; url: string; }>; /** * Rule definition shape accepted by `createTypedRule`, including typed * `create(context, options)` access with merged default options. */ export type RuleDefinitionWithDocs> = Except, "create" | "meta"> & { create: (context: GenericRuleContext, options: Options) => TSESLint.RuleListener; meta: RuleModuleWithDocs["meta"]; }; /** Rule module contract used by registry and plugin wiring. */ export type RuleModuleWithDocs> = TSESLint.RuleModule & { meta: TSESLint.RuleMetaData & { deprecated: boolean; docs: RemarkRuleDocs; languages: string[]; }; name: string; }; /** Identity-preserving rule creator with canonical docs URL enforcement. */ export declare const createTypedRule: >(ruleDefinition: Readonly>) => RuleModuleWithDocs; /** Convert a generic string-keyed listener map into an ESLint rule listener. */ export declare const toRuleListener: (listener: GenericRuleListener) => TSESLint.RuleListener; //# sourceMappingURL=typed-rule.d.ts.map