11// Type definitions for axe-core
22// Project: https://github.com/dequelabs/axe-core
3- // Definitions by: Marcy Sutton <https://github.com/marcysutton>
43
54declare namespace axe {
65 type ImpactValue = 'minor' | 'moderate' | 'serious' | 'critical' | null ;
@@ -333,6 +332,14 @@ declare namespace axe {
333332 xpath : string [ ] ;
334333 ancestry : UnlabelledFrameSelector ;
335334 }
335+ interface DqElement extends SerialDqElement {
336+ element : Element ;
337+ toJSON ( ) : SerialDqElement ;
338+ mergeSpecs (
339+ childSpec : SerialDqElement ,
340+ parentSpec : SerialDqElement
341+ ) : SerialDqElement ;
342+ }
336343 interface PartialRuleResult {
337344 id : string ;
338345 result : 'inapplicable' ;
@@ -351,16 +358,21 @@ declare namespace axe {
351358 frameContext : FrameContextObject ;
352359 }
353360
361+ interface RawCheckResult extends Omit < CheckResult , 'relatedNodes' > {
362+ relatedNodes ?: Array < SerialDqElement | DqElement > ;
363+ }
364+
354365 interface RawNodeResult < T extends 'passed' | 'failed' | 'incomplete' > {
355- any : CheckResult [ ] ;
356- all : CheckResult [ ] ;
357- none : CheckResult [ ] ;
366+ node : SerialDqElement | DqElement ;
367+ any : RawCheckResult [ ] ;
368+ all : RawCheckResult [ ] ;
369+ none : RawCheckResult [ ] ;
358370 impact : ImpactValue | null ;
359371 result : T ;
360372 }
361373
362374 interface RawResult extends Omit < Result , 'nodes' > {
363- inapplicable : [ ] ;
375+ inapplicable : Array < never > ;
364376 passes : RawNodeResult < 'passed' > [ ] ;
365377 incomplete : RawNodeResult < 'incomplete' > [ ] ;
366378 violations : RawNodeResult < 'failed' > [ ] ;
@@ -383,6 +395,7 @@ declare namespace axe {
383395 attr ( attr : string ) : string | null ;
384396 hasAttr ( attr : string ) : boolean ;
385397 props : { [ key : string ] : unknown } ;
398+ boundingClientRect : DOMRect ;
386399 }
387400
388401 interface Utils {
@@ -396,7 +409,7 @@ declare namespace axe {
396409 DqElement : new (
397410 elm : Element ,
398411 options ?: { absolutePaths ?: boolean }
399- ) => SerialDqElement ;
412+ ) => DqElement ;
400413 uuid : (
401414 options ?: { random ?: Uint8Array | Array < number > } ,
402415 buf ?: Uint8Array | Array < number > ,
0 commit comments