import type { Rule } from 'eslint' ; import type { RuleContext } from './eslint' ; import type { AST as VAST } from 'vue-eslint-parser' ; import type { TokenStore } from './types' ; import type { VElement } from 'vue-eslint-parser/ast' ; export interface TemplateListener { [ key ] : ( ( node : never ) => void ) | undefined ; } export interface RuleListener { onCodePathStart ? ( codePath , node ) : void ; onCodePathEnd ? ( codePath , node ) : void ; onCodePathSegmentStart ? ( segment , node ) : void ; onCodePathSegmentEnd ? ( segment , node ) : void ; onCodePathSegmentLoop ? ( fromSegment , toSegment , node ) : void ; [ key ] : ( ( node : never ) => void ) | ( ( codePath : Rule . CodePath , node : never ) => void ) | ( ( segment : Rule . CodePathSegment , node : never ) => void ) | ( ( fromSegment : Rule . CodePathSegment , toSegment : Rule . CodePathSegment , node : never ) => void ) | undefined ; } export interface VueParserServices { getTemplateBodyTokenStore : ( ) => TokenStore ; defineTemplateBodyVisitor ? : ( templateBodyVisitor : TemplateListener , scriptVisitor ? : RuleListener ) => RuleListener ; defineCustomBlocksVisitor ? : ( context : RuleContext , parser : { parseForESLint : ( code : string , options : any ) => any ; } , rule : { target : string | string [ ] | ( ( lang : string | null , customBlock : VAST . VElement ) => boolean ) ; create : CustomBlockVisitorFactory ; } , scriptVisitor ? : RuleListener ) => RuleListener ; getDocumentFragment ? : ( ) => VAST . VDocumentFragment | null ; } export type CustomBlockVisitorFactory = ( context : RuleContext & { parserServices : RuleContext [ 'parserServices' ] & { customBlock : VElement ; } ; } ) => RuleListener | null ;