accessibility-checker
Version:
An automated testing tools for accessibility testing using Puppeteer, Selenium, or Zombie
80 lines (76 loc) • 3.31 kB
TypeScript
/******************************************************************************
Copyright:: 2023- IBM, Inc
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*****************************************************************************/
import { IAbstractAPI } from "../api-ext/IAbstractAPI.js";
import { IConfigInternal } from "../config/IConfig.js";
import { CompressedReport, IBaselineReport, IEngineReport } from "../engine/IReport.js";
import { Guideline } from "../engine/IGuideline.js";
export interface IReporterStored {
startScan: number;
url: string;
pageTitle: string;
label: string;
scanProfile: string;
engineReport: IBaselineReport;
}
export type GenSummReturn = {
summaryPath: string;
summary: string | Buffer | ((filename?: string) => Promise<void>);
} | void;
export interface IReporter {
name(): string;
generateReport(config: IConfigInternal, rulesets: Guideline[], reportData: IReporterStored): {
reportPath: string;
report: string;
} | void;
generateSummary(config: IConfigInternal, rulesets: Guideline[], endReport: number, summaryData: CompressedReport[]): Promise<GenSummReturn>;
}
/**
* This interface is responsible for aChecker reporters which will be used to: collect scan results
* generate the results to a particular format per file, and generate a final summary
*/
export declare class ReporterManager {
private static config;
private static rulesets;
private static absAPI;
private static reporters;
private static reports;
private static nlsData;
private static usedLabels;
private static returnReporter;
private static scanID;
private static toolID;
private static compressReport;
static uncompressReport(report: CompressedReport): IReporterStored;
static initialize(config: IConfigInternal, absAPI: IAbstractAPI, rulesets: Guideline[]): void;
static setConfig(config: IConfigInternal): void;
/**
* This function is responsible for printing the scan results to string with the intent of that going to the console.
*
* @param {Object} results - Provide the results from the scan.
*
* @return {String} resultsString - String representation of the results/violations.
*
* PUBLIC API
*
* @memberOf this
*/
static stringifyResults(reportP: IBaselineReport): string;
private static getHelpUrl;
static addEngineReport(scanProfile: string, startScan: number, url: string, pageTitle: string, label: string, engineReport: IEngineReport): IBaselineReport;
static generateSummaries(endReport?: number): Promise<void>;
private static valueToLevel;
private static filterReport;
private static addCounts;
private static isLabelUnique;
private static verifyLabel;
}