Installation
npm install --save @types/screenshot-desktop
Summary
This package contains type definitions for screenshot-desktop (https://github.com/bencevans/screenshot-desktop).
Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/screenshot-desktop.
index.d.ts
/// <reference types="node" />
export = screenshotDesktop;
declare function screenshotDesktop(
options?: screenshotDesktop.ScreenshotOptionsWithoutFilename,
): Promise<NonSharedBuffer>;
declare function screenshotDesktop(
options?: screenshotDesktop.ScreenshotOptionsWithFilename,
): Promise<string>;
declare namespace screenshotDesktop {
interface ScreenshotOptions {
filename?: string;
format?: ImageFormat;
screen?: DisplayID;
linuxLibrary?: "scrot" | "imagemagick";
}
interface ScreenshotOptionsWithFilename extends ScreenshotOptions {
filename: string;
}
interface ScreenshotOptionsWithoutFilename extends ScreenshotOptions {
filename?: "";
}
interface Display {
id: number | string;
name: string;
}
type DisplayID = Display["id"];
type ImageFormat = "jpg" | "png";
function listDisplays(): Promise<Array<Display>>;
function all(): Promise<Array<NonSharedBuffer>>;
}
Additional Details
- Last updated: Wed, 30 Jul 2025 2250 GMT
- Dependencies: @types/node
Credits
These definitions were written by Usama Ahsan.