# @types/gaze

> TypeScript definitions for gaze

Latest version **1.1.6** (published 2025-08-15) · MIT license · 0 weekly downloads

## Install

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

## Health

**Score 55/100 (C)** — status: stable.

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

Warnings: low downloads; no esm support.

Negative: stale.

## Facts

| | |
|---|---|
| Version | 1.1.6 |
| Published | 2025-08-15 |
| First published | 2020-03-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 6.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51443 |
| Maintainers | types |

## Links

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

## Dependencies (1)

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

## Recent versions

- 1.1.6 (latest) — 2025-08-15
- 1.1.5 (ts4.5) — 2023-11-07
- 1.1.2 (ts3.8) — 2021-12-23
- 1.1.1 (ts3.6) — 2021-07-06
- 1.1.0 (ts3.1) — 2020-03-17
- 1.1.4 — 2023-10-18
- 1.1.3 — 2023-09-20

## README

# Installation
> `npm install --save @types/gaze`

# Summary
This package contains type definitions for gaze (https://github.com/shama/gaze).

# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/gaze.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/gaze/index.d.ts)
````ts
/// <reference types="node" />

import type { EventEmitter } from "node:events";

type Mode = "auto" | "watch" | "poll";

interface Options {
    /**
     * Interval to pass to fs.watchFile.
     */
    interval?: number | undefined;
    /**
     * Delay for events called in succession for the same file/event in milliseconds.
     */
    debounceDelay?: number | undefined;
    /**
     * Force the watch mode. Either 'auto' (default),
     * 'watch' (force native events), or 'poll' (force stat polling).
     */
    mode?: Mode | undefined;
    /**
     * The current working directory to base file patterns from. Default is `process.cwd()`.
     */
    cwd?: string | undefined;
}

declare namespace gaze {
    class Gaze extends EventEmitter {
        constructor(
            patterns: string | string[],
            options?: Options | null,
            callback?: (error: Error | null, watcher: Gaze) => void,
        );

        /**
         * Wrapper for EventEmitter.emit. `added`|`changed`|`renamed`|`deleted` events will also trigger the `all` event.
         */
        emit(event: string, ...args: any): boolean;

        /**
         * Unwatch all files and reset the watch instance.
         */
        close(): void;

        /**
         * Adds file(s) patterns to be watched.
         */
        add(patterns: string | string[]): void;

        /**
         * Removes a file or directory from being watched. Does not recurse directories.
         */
        remove(filepath: string): void;

        /**
         * Returns the currently watched files.
         */
        watched(): string[];

        /**
         * Returns the currently watched files with relative paths.
         */
        relative(dir: string, unixify: boolean): string[];
    }
}

declare function gaze(
    patterns: string | string[],
    options?: Options | null,
    callback?: (error: Error | null, watcher: gaze.Gaze) => void,
): void;
declare function gaze(
    patterns: string | string[],
    callback?: (error: Error | null, watcher: gaze.Gaze) => void,
): void;

export = gaze;

````

### Additional Details
 * Last updated: Fri, 15 Aug 2025 08:39:32 GMT
 * Dependencies: [@types/node](https://npmjs.com/package/@types/node)

# Credits
These definitions were written by [Kyle Hensel](https://github.com/k-yle).

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