11declare module 'markdownlint-rule-helpers' {
2+ import type { RuleParams , RuleErrorCallback , MarkdownToken } from '@/content-linter/types'
3+ import type { LintError } from 'markdownlint'
4+
25 /**
36 * Adds an error to the linting results
4- * Using any because this third-party library doesn't provide TypeScript definitions
5- * onError is a callback function with dynamic signature from markdownlint
6- * fixInfo contains various fix information structures depending on the error type
77 */
88 export function addError (
9- onError : any ,
9+ onError : RuleErrorCallback ,
1010 lineNumber : number ,
1111 detail ?: string ,
1212 context ?: string | null ,
1313 range ?: [ number , number ] | number [ ] | string | null ,
14- fixInfo ?: any ,
14+ fixInfo ?: unknown ,
1515 ) : void
1616
1717 /**
1818 * Filters tokens by type and calls a handler for each matching token
19- * Using any because markdownlint-rule-helpers has no TypeScript definitions
20- * params contains markdownlint parsing parameters with varying structures
21- * token represents markdown tokens with different properties per token type
2219 */
23- export function filterTokens ( params : any , type : string , handler : ( token : any ) => void ) : void
20+ export function filterTokens (
21+ params : RuleParams ,
22+ type : string ,
23+ handler : ( token : MarkdownToken ) => void ,
24+ ) : void
2425
2526 /**
2627 * Truncates long strings with ellipsis for display
@@ -34,7 +35,6 @@ declare module 'markdownlint-rule-helpers' {
3435
3536 /**
3637 * Applies fixes to markdown content
37- * Using any[] because error objects from markdownlint have dynamic structures
3838 */
39- export function applyFixes ( content : string , errors : any [ ] ) : string
39+ export function applyFixes ( content : string , errors : LintError [ ] ) : string
4040}
0 commit comments