npm.io
4.1.4 • Published 2 years ago

@types/happo-cypress

Licence
MIT
Version
4.1.4
Deps
1
Size
5 kB
Vulns
0
Weekly
0
Stars
51.4K

Installation

npm install --save @types/happo-cypress

Summary

This package contains type definitions for happo-cypress (https://github.com/happo/happo-cypress#readme).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/happo-cypress.

index.d.ts

/// <reference types="cypress" />

export interface HappoScreenshotTarget {
    name: string;
    browser: string;
    viewport: string;
}

export interface HappoScreenshotOptions {
    component?: string | undefined;
    variant?: string | undefined;
    targets?: ReadonlyArray<string | HappoScreenshotTarget> | undefined;
    responsiveInlinedCanvases?: boolean | undefined;
    transformDOM?: HappoTransformDOMOptions | undefined;
    includeAllElements?: boolean | undefined;
}

export interface HappoTransformDOMOptions {
    selector: string;
    transform: (element: Element, document: Document) => Element;
}

export interface HappoHideDynamicElementsOptions {
    matchers?: readonly RegExp[] | undefined;
    defaultMatchers?: readonly RegExp[] | undefined;
    selectors?: readonly string[] | undefined;
    defaultSelectors?: readonly string[] | undefined;
    replace?: boolean | undefined;
}

declare global {
    namespace Cypress {
        interface Chainable {
            happoScreenshot(options?: HappoScreenshotOptions): void;
            happoHideDynamicElements(options?: HappoHideDynamicElementsOptions): void;
        }
    }
}

Additional Details

  • Last updated: Mon, 20 Nov 2023 2324 GMT
  • Dependencies: cypress

Credits

These definitions were written by Alexander Polyankin, and Mario Beltrán Alarcón.