@augment-vir/test
Version:
A universal testing suite that works with Mocha style test runners _and_ Node.js's built-in test runner.
39 lines (38 loc) • 1.62 kB
TypeScript
import { type Coords } from '@augment-vir/common';
/**
* Checks if the current element is completely visible in its scroll view.
*
* @category Web : Elements
* @category Package : @augment-vir/web
* @package [`@augment-vir/web`](https://www.npmjs.com/package/@augment-vir/web)
*/
export declare function checkIfEntirelyInScrollView(element: Element): Promise<unknown>;
/**
* Check if the given element is visible in its scroll container to the degree of the given ratio.
*
* @category Web : Elements
* @category Package : @augment-vir/web
* @package [`@augment-vir/web`](https://www.npmjs.com/package/@augment-vir/web)
*/
export declare function checkIfInScrollView(element: Element,
/** A number from 0-1, representing 0% to 100%. */
ratio: number): Promise<unknown>;
/**
* Get the center of the current element. This is a relatively expensive operation as it uses
* [`.getBoundingClientRect()`](https://developer.mozilla.org/docs/Web/API/Element/getBoundingClientRect)
* so this should not be called excessively.
*
* @category Web : Elements
* @category Package : @augment-vir/web
* @package [`@augment-vir/web`](https://www.npmjs.com/package/@augment-vir/web)
*/
export declare function getCenterOfElement(element: Element): Coords;
/**
* Useful for debugging purposes, this sticks an absolutely positioned and brightly colored div at
* the given position.
*
* @category Web : Elements
* @category Package : @augment-vir/web
* @package [`@augment-vir/web`](https://www.npmjs.com/package/@augment-vir/web)
*/
export declare function appendPositionDebugDiv(position: Coords): HTMLDivElement;