Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extract type for Options into a separate interface in axe.d.ts? #937

Closed
JoshuaKGoldberg opened this issue Jun 5, 2018 · 1 comment
Closed

Comments

@JoshuaKGoldberg
Copy link
Contributor

    /**
     * Runs a number of rules against the provided HTML page and returns the resulting issue list
     *
     * @param  {Object}   context  Optional The `Context` specification object @see Context
     * @param  {Array}    options  Optional Options passed into rules or checks, temporarily modifying them.
     * @param  {Function} callback Optional The function to invoke when analysis is complete.
     * @returns {any}  	  results  If the callback was not defined, aXe will return a Promise instead.
     */
    function run(context?: ElementContext, options?: {runOnly?: RunOnly, rules?: Object, iframes?: Boolean, elementRef?: Boolean, selectors?: Boolean}, callback?: (error: Error, results:AxeResults) => void): any

    /**
     * Starts analysis on the current document and its subframes
     *
     * @param  {Object}   context  The `Context` specification object @see Context
     * @param  {Array}    options  Options passed into rules or checks, temporarily modifyint them.
     * @param  {Function} callback The function to invoke when analysis is complete.
     * @returns {Object}  results  The aXe results object
     */
    function a11yCheck(context: ElementContext, options: {runOnly?: RunOnly, rules?: Object, iframes?: Boolean, elementRef?: Boolean, selectors?: Boolean}, callback: (results:AxeResults) => void): AxeResults

I'm writing types for axe-webdriverjs and it would be useful to include those {...}s directly. I can send a PR to extract them to:

interface RunOptions {
    runOnly?: RunOnly;
    rules?: Object;
    iframes?: Boolean;
    elementRef?: Boolean;
    selectors?: Boolean;
}
@JoshuaKGoldberg
Copy link
Contributor Author

Oh, fixed by #707. I'm looking at an old version. Never mind! 😊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant