1.1.3 • Published 7 months ago

@types/ccapture.js v1.1.3

Weekly downloads
26
License
MIT
Repository
github
Last release
7 months ago

Installation

npm install --save @types/ccapture.js

Summary

This package contains type definitions for ccapture.js (https://github.com/spite/ccapture.js#readme).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/ccapture.js.

index.d.ts

// Type definitions for ccapture.js 1.1
// Project: https://github.com/spite/ccapture.js#readme
// Definitions by: Sam Alexander <https://github.com/samalexander>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped

declare class CCapture {
    constructor(settings: CCapture.Settings);

    start(): void;

    capture(canvas: HTMLElement): void;

    stop(): void;

    save(cb?: (blob: Blob) => void): void;
}

declare namespace CCapture {
    interface Settings {
        /**
         * Target framerate for the capture
         */
        framerate?: number | undefined;
        /**
         * Super-sampling of frames to create a motion-blurred frame (0 or 1 make no effect)
         */
        motionBlurFrames?: number | undefined;
        format: "webm" | "gif" | "png" | "jpg" | "ffmpegserver";
        /**
         * Quality for webm/jpg
         */
        quality?: number | undefined;
        /**
         * Name of the files to be exported. if no name is provided, a GUID will be generated
         */
        name?: string | undefined;
        /**
         * Dumps info on the console
         */
        verbose?: boolean | undefined;
        /**
         * Adds a widget with capturing info
         */
        display?: boolean | undefined;
        /**
         * Automatically stops and downloads when reaching that time (seconds).
         * Very convenient for long captures: set it and forget it (remember autoSaveTime!)
         */
        timeLimit?: number | undefined;
        /**
         * It will automatically download the captured data every n seconds (only available for webm/png/jpg)
         */
        autoSaveTime?: number | undefined;
        /**
         * Skip to that mark (seconds)
         */
        startTime?: number | undefined;
        /**
         * Path to the gif worker script
         */
        workersPath?: string | undefined;
    }
}

Additional Details

  • Last updated: Thu, 08 Jul 2021 09:07:11 GMT
  • Dependencies: none
  • Global values: CCapture

Credits

These definitions were written by Sam Alexander.