# @types/cavy

> TypeScript definitions for cavy

Latest version **3.2.9** (published 2023-12-21) · MIT license · 0 weekly downloads

## Install

```sh
npm install @types/cavy
pnpm add @types/cavy
yarn add @types/cavy
bun add @types/cavy
```

## Health

**Score 45/100 (D)** — status: abandoned.

Positive: has types; no vulnerabilities; high maintenance score; popular repo; extremely popular.

Warnings: low downloads; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 3.2.9 |
| Published | 2023-12-21 |
| First published | 2019-03-01 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 6.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51438 |
| Maintainers | types |

## Links

- npm: https://www.npmjs.com/package/@types/cavy
- Repository: https://github.com/DefinitelyTyped/DefinitelyTyped
- Homepage: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/cavy
- npm.io page: https://npm.io/package/@types/cavy

## Dependencies (1)

- [@types/react](https://npm.io/package/@types/react.md) *

## Recent versions

- 3.2.9 (latest) — 2023-12-21
- 3.2.8 (ts4.5) — 2023-11-20
- 3.2.5 (ts4.3) — 2023-09-04
- 3.2.4 (ts3.8) — 2022-01-07
- 3.2.2 (ts3.7) — 2021-10-07
- 3.2.1 (ts3.6) — 2021-07-08
- 3.2.0 (ts3.0) — 2020-01-10
- 3.2.7 — 2023-11-07
- 3.2.6 — 2023-10-17
- 3.2.3 — 2022-01-07
- 3.1.1 — 2019-11-04
- 3.1.0 — 2019-10-18
- 2.2.0 — 2019-07-30
- 2.0.0 — 2019-05-13
- 0.6.0 — 2019-03-01

## README

# Installation
> `npm install --save @types/cavy`

# Summary
This package contains type definitions for cavy (https://github.com/pixielabs/cavy).

# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/cavy.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/cavy/index.d.ts)
````ts
import * as React from "react";

// Turn off automatic exporting by exporting {}.
export {};

type TestHookGeneratorWithRefCallback = (label: string, ref?: React.RefCallback<any>) => React.RefCallback<any>;

type TestHookGeneratorWithRefObject = (label: string, ref?: React.RefObject<any>) => React.RefObject<any>;

export type TestHookGenerator = TestHookGeneratorWithRefCallback & TestHookGeneratorWithRefObject;

export type WithTestHook<P extends {}> = P & { generateTestHook: TestHookGenerator };

export function hook<P extends {}>(WrappedComponent: React.ComponentClass<WithTestHook<P>>): React.ComponentClass<P>;

export function useCavy(): TestHookGenerator;

export function wrap<P extends {}>(
    WrappedComponent: React.ComponentClass<P> | React.FunctionComponent<P>,
): React.ComponentClass<P>;

export interface TesterProps {
    children: React.ReactElement;
    store: TestHookStore;
    specs: Array<(spec: TestScope) => void>;
    waitTime?: number | undefined;
    startDelay?: number | undefined;
    clearAsyncStorage?: boolean | undefined;
    reporter?: ((report: TestReport) => void) | undefined;

    // Deprecated
    sendReport?: boolean | undefined;
}

export class Tester extends React.Component<TesterProps> {
    reRender(): void;
    clearAsync(): Promise<void>;
}

export class TestHookStore {}

export class TestScope {
    component: Tester;
    findComponent(identifier: string): Promise<React.Component>;
    describe(label: string, fn: () => void): void;
    it(label: string, fn: () => void): void;
    beforeEach(fn: () => void): void;
    press(identifier: string): Promise<void>;
    fillIn(identifier: string, str: string): Promise<void>;
    focus(identifier: string): Promise<void>;
    pause(time: number): Promise<void>;
    exists(identifier: string): Promise<true>;
    notExists(identifier: string): Promise<true>;
    containsText(identifier: string, text: string): Promise<void>;
}

export interface TestResult {
    message: string;
    passed: boolean;
}

export interface TestReport {
    results: readonly TestResult[];
    errorCount: number;
    duration: number;
}

````

### Additional Details
 * Last updated: Thu, 21 Dec 2023 19:06:51 GMT
 * Dependencies: [@types/react](https://npmjs.com/package/@types/react)

# Credits
These definitions were written by [Tyler Hoffman](https://github.com/tyler-hoffman), and [Abigail McPhillips](https://github.com/AbigailMcP).

---
_Source: https://npm.io/package/@types/cavy · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
