From 45b6c2916956e9afb526a320a32b117805cb8b64 Mon Sep 17 00:00:00 2001 From: Jean-Yves Moyen Date: Wed, 21 Jul 2021 11:17:55 +0200 Subject: [PATCH 1/6] Copy implementation of R70 --- packages/alfa-rules/src/rules.ts | 1 + packages/alfa-rules/src/sia-r70/rule.ts | 137 ++++++++++++++++++ .../alfa-rules/test/sia-r70/rule.spec.tsx | 107 ++++++++++++++ packages/alfa-rules/tsconfig.json | 2 + 4 files changed, 247 insertions(+) create mode 100644 packages/alfa-rules/src/sia-r70/rule.ts create mode 100644 packages/alfa-rules/test/sia-r70/rule.spec.tsx diff --git a/packages/alfa-rules/src/rules.ts b/packages/alfa-rules/src/rules.ts index e2a7de2cfa..a0f6b9702b 100644 --- a/packages/alfa-rules/src/rules.ts +++ b/packages/alfa-rules/src/rules.ts @@ -63,6 +63,7 @@ export { default as R66 } from "./sia-r66/rule"; export { default as R67 } from "./sia-r67/rule"; export { default as R68 } from "./sia-r68/rule"; export { default as R69 } from "./sia-r69/rule"; +export { default as R70 } from "./sia-r70/rule"; export { default as R71 } from "./sia-r71/rule"; export { default as R72 } from "./sia-r72/rule"; export { default as R73 } from "./sia-r73/rule"; diff --git a/packages/alfa-rules/src/sia-r70/rule.ts b/packages/alfa-rules/src/sia-r70/rule.ts new file mode 100644 index 0000000000..d56f22be07 --- /dev/null +++ b/packages/alfa-rules/src/sia-r70/rule.ts @@ -0,0 +1,137 @@ +import { Rule, Diagnostic } from "@siteimprove/alfa-act"; +import { Document, Element, Namespace } from "@siteimprove/alfa-dom"; +import { Predicate } from "@siteimprove/alfa-predicate"; +import { Err, Ok } from "@siteimprove/alfa-result"; +import { Page } from "@siteimprove/alfa-web"; +import { List } from "@siteimprove/alfa-list"; +import { Iterable } from "@siteimprove/alfa-iterable"; +import { Array } from "@siteimprove/alfa-array"; + +import { expectation } from "../common/expectation"; +import { hasChild, isRendered, isDocumentElement } from "../common/predicate"; + +const { isElement, hasName, hasNamespace } = Element; +const { and, test } = Predicate; + +const isDeprecated = hasName( + "acronym", + "applet", + "basefont", + "bgsound", + "big", + "blink", + "center", + "content", + "dir", + "font", + "frame", + "frameset", + "hgroup", + "image", + "keygen", + "marquee", + "menuitem", + "nobr", + "noembed", + "noframes", + "plaintext", + "rb", + "rtc", + "shadow", + "spacer", + "strike", + "tt", + "xmp" +); + +export default Rule.Atomic.of({ + uri: "https://alfa.siteimprove.com/rules/sia-r70", + evaluate({ device, document }) { + return { + applicability() { + return test(hasChild(isDocumentElement), document) ? [document] : []; + }, + + expectations(target) { + const deprecatedElements = target + .descendants({ flattened: true, nested: true }) + .filter(isElement) + .filter( + and(hasNamespace(Namespace.HTML), isDeprecated, isRendered(device)) + ); + + return { + 1: expectation( + deprecatedElements.isEmpty(), + () => Outcomes.HasNoDeprecatedElement, + () => Outcomes.HasDeprecatedElements(deprecatedElements) + ), + }; + }, + }; + }, +}); + +export namespace Outcomes { + export const HasNoDeprecatedElement = Ok.of( + Diagnostic.of(`The document doesn't contain any deprecated element`) + ); + + export const HasDeprecatedElements = (errors: Iterable) => + Err.of( + DeprecatedElements.of( + `The document contains deprecated elements: `, + errors + ) + ); +} + +class DeprecatedElements extends Diagnostic implements Iterable { + public static of( + message: string, + errors: Iterable = [] + ): DeprecatedElements { + return new DeprecatedElements(message, Array.from(errors)); + } + + private _errors: ReadonlyArray; + private constructor(message: string, errors: Array) { + super(message); + this._errors = errors; + } + + public get errors(): ReadonlyArray { + return this._errors; + } + public equals(value: DeprecatedElements): boolean; + public equals(value: unknown): value is this; + public equals(value: unknown): boolean { + return ( + value instanceof DeprecatedElements && + value._message === this._message && + Array.equals(value._errors, this._errors) + ); + } + + public *[Symbol.iterator](): Iterator { + yield* this._errors; + } + public toJSON(): DeprecatedElements.JSON { + return { + ...super.toJSON(), + errors: this._errors.map((element) => element.path()), + }; + } +} + +namespace DeprecatedElements { + export interface JSON extends Diagnostic.JSON { + errors: Array; + } + + export function isDeprecatedElements( + value: unknown + ): value is DeprecatedElements { + return value instanceof DeprecatedElements; + } +} diff --git a/packages/alfa-rules/test/sia-r70/rule.spec.tsx b/packages/alfa-rules/test/sia-r70/rule.spec.tsx new file mode 100644 index 0000000000..f4b85098cc --- /dev/null +++ b/packages/alfa-rules/test/sia-r70/rule.spec.tsx @@ -0,0 +1,107 @@ +import { h } from "@siteimprove/alfa-dom"; +import { test } from "@siteimprove/alfa-test"; + +import R70, { Outcomes } from "../../src/sia-r70/rule"; + +import { evaluate } from "../common/evaluate"; +import { passed, failed, inapplicable } from "../common/outcome"; + +test("evaluate() passes a page with no deprecated / obsolete elements ", async (t) => { + const target = ( + +

Lorem ipsum.

+ + ); + + const document = h.document([target]); + + t.deepEqual(await evaluate(R70, { document }), [ + passed(R70, document, { + 1: Outcomes.HasNoDeprecatedElement, + }), + ]); +}); + +test("evaluate() passes a page with a deprecated but not rendered element", async (t) => { + const target = ( + +

+ Lorem +

+ + ); + + const document = h.document([target]); + + t.deepEqual(await evaluate(R70, { document }), [ + passed(R70, document, { + 1: Outcomes.HasNoDeprecatedElement, + }), + ]); +}); + +test("evaluate() fails a page with deprecated and rendered element", async (t) => { + const blink = not; + const target = ( + +

Schrödinger's cat is {blink} dead.

+ + ); + + const document = h.document([target]); + + t.deepEqual(await evaluate(R70, { document }), [ + failed(R70, document, { + 1: Outcomes.HasDeprecatedElements([blink]), + }), + ]); +}); + +test("evaluate() fails a page with deprecated visible element", async (t) => { + const blink = ; + const target = ( + +

Schrödinger's cat is {blink} dead.

+ + ); + + const document = h.document([target]); + + t.deepEqual(await evaluate(R70, { document }), [ + failed(R70, document, { + 1: Outcomes.HasDeprecatedElements([blink]), + }), + ]); +}); + +test("evaluate() fails a page with two deprecated elements in the accessibility tree", async (t) => { + const menuitem1 = Foo; + const menuitem2 = Bar; + const target = ( + +
    + {menuitem1} + {menuitem2} +
+ + ); + + const document = h.document([target]); + + t.deepEqual(await evaluate(R70, { document }), [ + failed(R70, document, { + 1: Outcomes.HasDeprecatedElements([menuitem1, menuitem2]), + }), + ]); +}); + +test("evaluate() is inapplicable to non-HTML documents", async (t) => { + const document = h.document([ + + This is a circle + + , + ]); + + t.deepEqual(await evaluate(R70, { document }), [inapplicable(R70)]); +}); diff --git a/packages/alfa-rules/tsconfig.json b/packages/alfa-rules/tsconfig.json index 448d2d2a94..25a12f720f 100644 --- a/packages/alfa-rules/tsconfig.json +++ b/packages/alfa-rules/tsconfig.json @@ -131,6 +131,7 @@ "src/sia-r67/rule.ts", "src/sia-r68/rule.ts", "src/sia-r69/rule.ts", + "src/sia-r70/rule.ts", "src/sia-r7/rule.ts", "src/sia-r71/rule.ts", "src/sia-r72/rule.ts", @@ -205,6 +206,7 @@ "test/sia-r67/rule.spec.tsx", "test/sia-r68/rule.spec.tsx", "test/sia-r69/rule.spec.tsx", + "test/sia-r70/rule.spec.tsx", "test/sia-r71/rule.spec.tsx", "test/sia-r72/rule.spec.tsx", "test/sia-r73/rule.spec.tsx", From 5154cd432edca82a2ac1d4c3f27d5b840835a289 Mon Sep 17 00:00:00 2001 From: Jean-Yves Moyen Date: Wed, 21 Jul 2021 12:23:39 +0200 Subject: [PATCH 2/6] Update documentation --- docs/review/api/alfa-rules.api.md | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/docs/review/api/alfa-rules.api.md b/docs/review/api/alfa-rules.api.md index b1d7ade697..185bbbdc57 100644 --- a/docs/review/api/alfa-rules.api.md +++ b/docs/review/api/alfa-rules.api.md @@ -208,7 +208,7 @@ const _default_64: Rule.Atomic; const _default_65: Rule.Atomic; // @public (undocumented) -const _default_66: Rule.Atomic; +const _default_66: Rule.Atomic; // @public (undocumented) const _default_67: Rule.Atomic; @@ -232,16 +232,16 @@ const _default_71: Rule.Atomic; const _default_72: Rule.Atomic; // @public (undocumented) -const _default_73: Rule.Atomic, Question>; +const _default_73: Rule.Atomic; // @public (undocumented) -const _default_74: Rule.Atomic; +const _default_74: Rule.Atomic, Question>; // @public (undocumented) -const _default_75: Rule.Atomic; +const _default_75: Rule.Atomic; // @public (undocumented) -const _default_76: Rule.Atomic; +const _default_76: Rule.Atomic; // @public (undocumented) const _default_77: Rule.Atomic; @@ -250,13 +250,13 @@ const _default_77: Rule.Atomic; const _default_78: Rule.Atomic; // @public (undocumented) -const _default_79: Rule.Atomic; +const _default_79: Rule.Atomic; // @public (undocumented) const _default_8: Rule.Atomic; // @public (undocumented) -const _default_80: Rule.Atomic; +const _default_80: Rule.Atomic; // @public (undocumented) const _default_81: Rule.Atomic; @@ -276,6 +276,9 @@ const _default_85: Rule.Atomic; // @public (undocumented) const _default_86: Rule.Atomic; +// @public (undocumented) +const _default_87: Rule.Atomic; + // @public (undocumented) const _default_9: Rule.Atomic; From f5c35da15e9a46c6a1af2f65a4ab130436b3934e Mon Sep 17 00:00:00 2001 From: elenamongelli <52746406+elenamongelli@users.noreply.github.com> Date: Mon, 23 Aug 2021 10:46:09 +0200 Subject: [PATCH 3/6] Comments implemented --- packages/alfa-rules/src/sia-r70/rule.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/packages/alfa-rules/src/sia-r70/rule.ts b/packages/alfa-rules/src/sia-r70/rule.ts index d56f22be07..4ae91524f1 100644 --- a/packages/alfa-rules/src/sia-r70/rule.ts +++ b/packages/alfa-rules/src/sia-r70/rule.ts @@ -1,11 +1,10 @@ import { Rule, Diagnostic } from "@siteimprove/alfa-act"; +import { Array } from "@siteimprove/alfa-array"; import { Document, Element, Namespace } from "@siteimprove/alfa-dom"; +import { Iterable } from "@siteimprove/alfa-iterable"; import { Predicate } from "@siteimprove/alfa-predicate"; import { Err, Ok } from "@siteimprove/alfa-result"; import { Page } from "@siteimprove/alfa-web"; -import { List } from "@siteimprove/alfa-list"; -import { Iterable } from "@siteimprove/alfa-iterable"; -import { Array } from "@siteimprove/alfa-array"; import { expectation } from "../common/expectation"; import { hasChild, isRendered, isDocumentElement } from "../common/predicate"; @@ -74,7 +73,7 @@ export default Rule.Atomic.of({ export namespace Outcomes { export const HasNoDeprecatedElement = Ok.of( - Diagnostic.of(`The document doesn't contain any deprecated element`) + Diagnostic.of(`The document doesn't contain any deprecated elements`) ); export const HasDeprecatedElements = (errors: Iterable) => @@ -95,6 +94,7 @@ class DeprecatedElements extends Diagnostic implements Iterable { } private _errors: ReadonlyArray; + private constructor(message: string, errors: Array) { super(message); this._errors = errors; @@ -103,8 +103,11 @@ class DeprecatedElements extends Diagnostic implements Iterable { public get errors(): ReadonlyArray { return this._errors; } + public equals(value: DeprecatedElements): boolean; + public equals(value: unknown): value is this; + public equals(value: unknown): boolean { return ( value instanceof DeprecatedElements && @@ -116,6 +119,7 @@ class DeprecatedElements extends Diagnostic implements Iterable { public *[Symbol.iterator](): Iterator { yield* this._errors; } + public toJSON(): DeprecatedElements.JSON { return { ...super.toJSON(), From a2297f265b3a74c7fe8eae1b535d59d4568162f5 Mon Sep 17 00:00:00 2001 From: elenamongelli <52746406+elenamongelli@users.noreply.github.com> Date: Mon, 23 Aug 2021 13:02:11 +0200 Subject: [PATCH 4/6] Update alfa-rules.api.md --- docs/review/api/alfa-rules.api.md | 198 +++++++++++++----------------- 1 file changed, 87 insertions(+), 111 deletions(-) diff --git a/docs/review/api/alfa-rules.api.md b/docs/review/api/alfa-rules.api.md index 7598f7c821..dce340aa5f 100644 --- a/docs/review/api/alfa-rules.api.md +++ b/docs/review/api/alfa-rules.api.md @@ -3,24 +3,25 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts -import * as act from "@siteimprove/alfa-act"; -import { Array as Array_2 } from "@siteimprove/alfa-array"; -import { Attribute } from "@siteimprove/alfa-dom"; -import { Document } from "@siteimprove/alfa-dom"; -import * as earl from "@siteimprove/alfa-earl"; -import { Element } from "@siteimprove/alfa-dom"; -import { Equatable } from "@siteimprove/alfa-equatable"; -import * as json from "@siteimprove/alfa-json"; -import { Node } from "@siteimprove/alfa-dom"; -import { Option } from "@siteimprove/alfa-option"; -import { Page } from "@siteimprove/alfa-web"; -import { Record as Record_2 } from "@siteimprove/alfa-record"; -import { RGB } from "@siteimprove/alfa-css"; -import { Rule } from "@siteimprove/alfa-act"; -import * as sarif from "@siteimprove/alfa-sarif"; -import { Sequence } from "@siteimprove/alfa-sequence"; -import { Tag } from "@siteimprove/alfa-act"; -import { Text } from "@siteimprove/alfa-dom"; + +import * as act from '@siteimprove/alfa-act'; +import { Array as Array_2 } from '@siteimprove/alfa-array'; +import { Attribute } from '@siteimprove/alfa-dom'; +import { Document } from '@siteimprove/alfa-dom'; +import * as earl from '@siteimprove/alfa-earl'; +import { Element } from '@siteimprove/alfa-dom'; +import { Equatable } from '@siteimprove/alfa-equatable'; +import * as json from '@siteimprove/alfa-json'; +import { Node } from '@siteimprove/alfa-dom'; +import { Option } from '@siteimprove/alfa-option'; +import { Page } from '@siteimprove/alfa-web'; +import { Record as Record_2 } from '@siteimprove/alfa-record'; +import { RGB } from '@siteimprove/alfa-css'; +import { Rule } from '@siteimprove/alfa-act'; +import * as sarif from '@siteimprove/alfa-sarif'; +import { Sequence } from '@siteimprove/alfa-sequence'; +import { Tag } from '@siteimprove/alfa-act'; +import { Text } from '@siteimprove/alfa-dom'; // @public (undocumented) const _default: Rule.Atomic; @@ -209,7 +210,7 @@ const _default_64: Rule.Atomic; const _default_65: Rule.Atomic; // @public (undocumented) -const _default_66: Rule.Atomic; +const _default_66: Rule.Atomic; // @public (undocumented) const _default_67: Rule.Atomic; @@ -233,16 +234,16 @@ const _default_71: Rule.Atomic; const _default_72: Rule.Atomic; // @public (undocumented) -const _default_73: Rule.Atomic, Question, Group>; +const _default_73: Rule.Atomic; // @public (undocumented) -const _default_74: Rule.Atomic; +const _default_74: Rule.Atomic, Question, Group>; // @public (undocumented) -const _default_75: Rule.Atomic; +const _default_75: Rule.Atomic; // @public (undocumented) -const _default_76: Rule.Atomic; +const _default_76: Rule.Atomic; // @public (undocumented) const _default_77: Rule.Atomic; @@ -257,7 +258,7 @@ const _default_79: Rule.Atomic; const _default_8: Rule.Atomic; // @public (undocumented) -const _default_80: Rule.Atomic; +const _default_80: Rule.Atomic; // @public (undocumented) const _default_81: Rule.Atomic; @@ -276,6 +277,7 @@ const _default_85: Rule.Atomic; // @public (undocumented) const _default_86: Rule.Atomic; + // @public (undocumented) const _default_87: Rule.Atomic; @@ -285,98 +287,71 @@ const _default_9: Rule.Atomic; // Warning: (ae-forgotten-export) The symbol "Rule" needs to be exported by the entry point index.d.ts // // @public (undocumented) -type Flattened = Sequence< - act.Rule< - act.Rule.Input, - act.Rule.Target, - act.Rule.Question, - act.Rule.Subject - > ->; +type Flattened = Sequence, act.Rule.Target, act.Rule.Question, act.Rule.Subject>>; // @public const Flattened: Flattened; export default Flattened; // @public (undocumented) -export class Group - implements - Iterable, - Equatable, - json.Serializable>, - earl.Serializable, - sarif.Serializable -{ - // (undocumented) - [Symbol.iterator](): Iterator; - // (undocumented) - equals(value: unknown): value is this; - // (undocumented) - static of(members: Iterable): Group; - // (undocumented) - get size(): number; - // (undocumented) - toEARL(): Group.EARL; - // (undocumented) - toJSON(): Group.JSON; - // (undocumented) - toSARIF(): sarif.Location; +export class Group implements Iterable, Equatable, json.Serializable>, earl.Serializable, sarif.Serializable { + // (undocumented) + [Symbol.iterator](): Iterator; + // (undocumented) + equals(value: unknown): value is this; + // (undocumented) + static of(members: Iterable): Group; + // (undocumented) + get size(): number; + // (undocumented) + toEARL(): Group.EARL; + // (undocumented) + toJSON(): Group.JSON; + // (undocumented) + toSARIF(): sarif.Location; } // @public (undocumented) export namespace Group { - // (undocumented) - export interface EARL extends earl.EARL { // (undocumented) - "@context": { - ptr: "http://www.w3.org/2009/pointers#"; - }; + export interface EARL extends earl.EARL { + // (undocumented) + "@context": { + ptr: "http://www.w3.org/2009/pointers#"; + }; + // (undocumented) + "@type": ["ptr:Pointer", "ptr:PointersGroup", "ptr:RelatedPointers"]; + // (undocumented) + "ptr:groupPointer": { + "@list": Array_2; + }; + } // (undocumented) - "@type": ["ptr:Pointer", "ptr:PointersGroup", "ptr:RelatedPointers"]; + export function isGroup(value: unknown): value is Group; // (undocumented) - "ptr:groupPointer": { - "@list": Array_2; - }; - } - // (undocumented) - export function isGroup( - value: unknown - ): value is Group; - // (undocumented) - export type JSON = Array_2>; + export type JSON = Array_2>; } // @public (undocumented) export interface Question { - // (undocumented) - "color[]": Iterable; - // (undocumented) - "node[]": Iterable; - // (undocumented) - boolean: boolean; - // (undocumented) - color: Option; - // (undocumented) - node: Option; + // (undocumented) + "color[]": Iterable; + // (undocumented) + "node[]": Iterable; + // (undocumented) + boolean: boolean; + // (undocumented) + color: Option; + // (undocumented) + node: Option; } // @public (undocumented) export namespace Question { - // (undocumented) - export function of( - type: Q, - uri: string, - message: string, - subject: S - ): act.Question; - // (undocumented) - export function of( - type: Q, - uri: string, - message: string, - subject: S, - context: C - ): act.Question; + // (undocumented) + export function of(type: Q, uri: string, message: string, subject: S): act.Question; + // (undocumented) + export function of(type: Q, uri: string, message: string, subject: S, context: C): act.Question; } // @public (undocumented) @@ -389,28 +364,29 @@ export const Rules: Record_2; // @public (undocumented) export class Scope extends Tag<"scope"> { - // (undocumented) - equals(value: Scope): boolean; - // (undocumented) - equals(value: unknown): value is this; - // (undocumented) - static of(scope: S): Scope; - // (undocumented) - toJSON(): Scope.JSON; - // (undocumented) - get type(): "scope"; + // (undocumented) + equals(value: Scope): boolean; + // (undocumented) + equals(value: unknown): value is this; + // (undocumented) + static of(scope: S): Scope; + // (undocumented) + toJSON(): Scope.JSON; + // (undocumented) + get type(): "scope"; } // @public (undocumented) export namespace Scope { - // (undocumented) - export interface JSON extends Tag.JSON<"scope"> { // (undocumented) - scope: S; - } - const Page: Scope<"page">; - const Component: Scope<"component">; + export interface JSON extends Tag.JSON<"scope"> { + // (undocumented) + scope: S; + } + const Page: Scope<"page">; + const Component: Scope<"component">; } // (No @packageDocumentation comment for this package) + ``` From d680222bdd89d81f56ddac217d52d873cde70796 Mon Sep 17 00:00:00 2001 From: elenamongelli <52746406+elenamongelli@users.noreply.github.com> Date: Mon, 23 Aug 2021 13:13:46 +0200 Subject: [PATCH 5/6] Update rule.ts --- packages/alfa-rules/src/sia-r70/rule.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/packages/alfa-rules/src/sia-r70/rule.ts b/packages/alfa-rules/src/sia-r70/rule.ts index 4ae91524f1..5631e71d9c 100644 --- a/packages/alfa-rules/src/sia-r70/rule.ts +++ b/packages/alfa-rules/src/sia-r70/rule.ts @@ -78,10 +78,7 @@ export namespace Outcomes { export const HasDeprecatedElements = (errors: Iterable) => Err.of( - DeprecatedElements.of( - `The document contains deprecated elements: `, - errors - ) + DeprecatedElements.of(`The document contains deprecated elements`, errors) ); } From 033ed664dd89ea99e09765970a2024c767ec7fa0 Mon Sep 17 00:00:00 2001 From: elenamongelli <52746406+elenamongelli@users.noreply.github.com> Date: Tue, 24 Aug 2021 13:34:16 +0200 Subject: [PATCH 6/6] Update alfa-rules.api.md --- docs/review/api/alfa-rules.api.md | 202 +++++++++++++----------------- 1 file changed, 90 insertions(+), 112 deletions(-) diff --git a/docs/review/api/alfa-rules.api.md b/docs/review/api/alfa-rules.api.md index 5edbc4cb2a..0a844a0db8 100644 --- a/docs/review/api/alfa-rules.api.md +++ b/docs/review/api/alfa-rules.api.md @@ -3,24 +3,25 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts -import * as act from "@siteimprove/alfa-act"; -import { Array as Array_2 } from "@siteimprove/alfa-array"; -import { Attribute } from "@siteimprove/alfa-dom"; -import { Document } from "@siteimprove/alfa-dom"; -import * as earl from "@siteimprove/alfa-earl"; -import { Element } from "@siteimprove/alfa-dom"; -import { Equatable } from "@siteimprove/alfa-equatable"; -import * as json from "@siteimprove/alfa-json"; -import { Node } from "@siteimprove/alfa-dom"; -import { Option } from "@siteimprove/alfa-option"; -import { Page } from "@siteimprove/alfa-web"; -import { Record as Record_2 } from "@siteimprove/alfa-record"; -import { RGB } from "@siteimprove/alfa-css"; -import { Rule } from "@siteimprove/alfa-act"; -import * as sarif from "@siteimprove/alfa-sarif"; -import { Sequence } from "@siteimprove/alfa-sequence"; -import { Tag } from "@siteimprove/alfa-act"; -import { Text } from "@siteimprove/alfa-dom"; + +import * as act from '@siteimprove/alfa-act'; +import { Array as Array_2 } from '@siteimprove/alfa-array'; +import { Attribute } from '@siteimprove/alfa-dom'; +import { Document } from '@siteimprove/alfa-dom'; +import * as earl from '@siteimprove/alfa-earl'; +import { Element } from '@siteimprove/alfa-dom'; +import { Equatable } from '@siteimprove/alfa-equatable'; +import * as json from '@siteimprove/alfa-json'; +import { Node } from '@siteimprove/alfa-dom'; +import { Option } from '@siteimprove/alfa-option'; +import { Page } from '@siteimprove/alfa-web'; +import { Record as Record_2 } from '@siteimprove/alfa-record'; +import { RGB } from '@siteimprove/alfa-css'; +import { Rule } from '@siteimprove/alfa-act'; +import * as sarif from '@siteimprove/alfa-sarif'; +import { Sequence } from '@siteimprove/alfa-sequence'; +import { Tag } from '@siteimprove/alfa-act'; +import { Text } from '@siteimprove/alfa-dom'; // @public (undocumented) const _default: Rule.Atomic; @@ -212,7 +213,7 @@ const _default_65: Rule.Atomic; const _default_66: Rule.Atomic; // @public (undocumented) -const _default_67: Rule.Atomic; +const _default_67: Rule.Atomic; // @public (undocumented) const _default_68: Rule.Atomic; @@ -236,16 +237,16 @@ const _default_72: Rule.Atomic; const _default_73: Rule.Atomic; // @public (undocumented) -const _default_74: Rule.Atomic, Question, Group>; +const _default_74: Rule.Atomic; // @public (undocumented) -const _default_75: Rule.Atomic; +const _default_75: Rule.Atomic, Question, Group>; // @public (undocumented) -const _default_76: Rule.Atomic; +const _default_76: Rule.Atomic; // @public (undocumented) -const _default_77: Rule.Atomic; +const _default_77: Rule.Atomic; // @public (undocumented) const _default_78: Rule.Atomic; @@ -257,10 +258,10 @@ const _default_79: Rule.Atomic; const _default_8: Rule.Atomic; // @public (undocumented) -const _default_80: Rule.Atomic; +const _default_80: Rule.Atomic; // @public (undocumented) -const _default_81: Rule.Atomic; +const _default_81: Rule.Atomic; // @public (undocumented) const _default_82: Rule.Atomic; @@ -280,104 +281,80 @@ const _default_86: Rule.Atomic; // @public (undocumented) const _default_87: Rule.Atomic; +// @public (undocumented) +const _default_88: Rule.Atomic; + // @public (undocumented) const _default_9: Rule.Atomic; // Warning: (ae-forgotten-export) The symbol "Rule" needs to be exported by the entry point index.d.ts // // @public (undocumented) -type Flattened = Sequence< - act.Rule< - act.Rule.Input, - act.Rule.Target, - act.Rule.Question, - act.Rule.Subject - > ->; +type Flattened = Sequence, act.Rule.Target, act.Rule.Question, act.Rule.Subject>>; // @public const Flattened: Flattened; export default Flattened; // @public (undocumented) -export class Group - implements - Iterable, - Equatable, - json.Serializable>, - earl.Serializable, - sarif.Serializable -{ - // (undocumented) - [Symbol.iterator](): Iterator; - // (undocumented) - equals(value: unknown): value is this; - // (undocumented) - static of(members: Iterable): Group; - // (undocumented) - get size(): number; - // (undocumented) - toEARL(): Group.EARL; - // (undocumented) - toJSON(): Group.JSON; - // (undocumented) - toSARIF(): sarif.Location; +export class Group implements Iterable, Equatable, json.Serializable>, earl.Serializable, sarif.Serializable { + // (undocumented) + [Symbol.iterator](): Iterator; + // (undocumented) + equals(value: unknown): value is this; + // (undocumented) + static of(members: Iterable): Group; + // (undocumented) + get size(): number; + // (undocumented) + toEARL(): Group.EARL; + // (undocumented) + toJSON(): Group.JSON; + // (undocumented) + toSARIF(): sarif.Location; } // @public (undocumented) export namespace Group { - // (undocumented) - export interface EARL extends earl.EARL { // (undocumented) - "@context": { - ptr: "http://www.w3.org/2009/pointers#"; - }; + export interface EARL extends earl.EARL { + // (undocumented) + "@context": { + ptr: "http://www.w3.org/2009/pointers#"; + }; + // (undocumented) + "@type": ["ptr:Pointer", "ptr:PointersGroup", "ptr:RelatedPointers"]; + // (undocumented) + "ptr:groupPointer": { + "@list": Array_2; + }; + } // (undocumented) - "@type": ["ptr:Pointer", "ptr:PointersGroup", "ptr:RelatedPointers"]; + export function isGroup(value: unknown): value is Group; // (undocumented) - "ptr:groupPointer": { - "@list": Array_2; - }; - } - // (undocumented) - export function isGroup( - value: unknown - ): value is Group; - // (undocumented) - export type JSON = Array_2>; + export type JSON = Array_2>; } // @public (undocumented) export interface Question { - // (undocumented) - "color[]": Iterable; - // (undocumented) - "node[]": Iterable; - // (undocumented) - boolean: boolean; - // (undocumented) - color: Option; - // (undocumented) - node: Option; + // (undocumented) + "color[]": Iterable; + // (undocumented) + "node[]": Iterable; + // (undocumented) + boolean: boolean; + // (undocumented) + color: Option; + // (undocumented) + node: Option; } // @public (undocumented) export namespace Question { - // (undocumented) - export function of( - type: Q, - uri: string, - message: string, - subject: S - ): act.Question; - // (undocumented) - export function of( - type: Q, - uri: string, - message: string, - subject: S, - context: C - ): act.Question; + // (undocumented) + export function of(type: Q, uri: string, message: string, subject: S): act.Question; + // (undocumented) + export function of(type: Q, uri: string, message: string, subject: S, context: C): act.Question; } // @public (undocumented) @@ -390,28 +367,29 @@ export const Rules: Record_2; // @public (undocumented) export class Scope extends Tag<"scope"> { - // (undocumented) - equals(value: Scope): boolean; - // (undocumented) - equals(value: unknown): value is this; - // (undocumented) - static of(scope: S): Scope; - // (undocumented) - toJSON(): Scope.JSON; - // (undocumented) - get type(): "scope"; + // (undocumented) + equals(value: Scope): boolean; + // (undocumented) + equals(value: unknown): value is this; + // (undocumented) + static of(scope: S): Scope; + // (undocumented) + toJSON(): Scope.JSON; + // (undocumented) + get type(): "scope"; } // @public (undocumented) export namespace Scope { - // (undocumented) - export interface JSON extends Tag.JSON<"scope"> { // (undocumented) - scope: S; - } - const Page: Scope<"page">; - const Component: Scope<"component">; + export interface JSON extends Tag.JSON<"scope"> { + // (undocumented) + scope: S; + } + const Page: Scope<"page">; + const Component: Scope<"component">; } // (No @packageDocumentation comment for this package) + ```