@types/window-size
TypeScript icon, indicating that this package has built-in type declarations

1.1.4 • Public • Published

Installation

npm install --save @types/window-size

Summary

This package contains type definitions for window-size (https://github.com/jonschlinkert/window-size).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/window-size.

index.d.ts

/// <reference types="node" />

declare module "window-size" {
    import { WriteStream } from "fs";

    const windowSize: windowSize.Size & {
        /** Get terminal window's size with available channels. */
        get(options?: windowSize.WindowSizeOptions): windowSize.Size;
        /** Get terminal window's size with `process.env.COLUMNS` and `process.env.ROWS`. */
        env(): windowSize.Size;
        /** Get terminal window's size with `tty` module */
        tty(options: windowSize.TtySizeOptions): windowSize.Size;
        tput(): windowSize.Size;
        win(): windowSize.Size;
    };
    export = windowSize;
    namespace windowSize {
        export interface Size {
            width: number;
            height: number;
            type: string;
        }

        /** Options of inner function `streamSize`. */
        type StreamSizeOptions = Record<string, WriteStream>;

        /** Options of function `windowSize.tty`. */
        interface TtySizeOptions {
            tty?: {
                getWindowSize?: (out: WriteStream) => [number, number];
            };
        }

        /** Options of function `windowSize.get` */
        type WindowSizeOptions = StreamSizeOptions & TtySizeOptions;
    }
}

Additional Details

  • Last updated: Tue, 07 Nov 2023 15:11:36 GMT
  • Dependencies: @types/node

Credits

These definitions were written by Juer Whang.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/window-size

Weekly Downloads

12,720

Version

1.1.4

License

MIT

Unpacked Size

5.1 kB

Total Files

5

Last publish

Collaborators

  • types