Socket
Socket
Sign inDemoInstall

@types/react-canvas-draw

Package Overview
Dependencies
3
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @types/react-canvas-draw

TypeScript definitions for react-canvas-draw


Version published
Weekly downloads
7.3K
increased by2.5%
Maintainers
1
Install size
1.61 MB
Created
Weekly downloads
 

Readme

Source

Installation

npm install --save @types/react-canvas-draw

Summary

This package contains type definitions for react-canvas-draw (https://embiem.github.io/react-canvas-draw/).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-canvas-draw.

index.d.ts

import * as React from "react";

export interface CanvasDrawProps {
    onChange?: ((canvas: CanvasDraw) => void) | null | undefined;
    loadTimeOffset?: number | undefined;
    lazyRadius?: number | undefined;
    brushRadius?: number | undefined;
    brushColor?: string | undefined;
    catenaryColor?: string | undefined;
    gridColor?: string | undefined;
    backgroundColor?: string | undefined;
    hideGrid?: boolean | undefined;
    canvasWidth?: number | string | undefined;
    canvasHeight?: number | string | undefined;
    disabled?: boolean | undefined;
    imgSrc?: string | undefined;
    saveData?: string | undefined;
    immediateLoading?: boolean | undefined;
    hideInterface?: boolean | undefined;
    gridSizeX?: number | undefined;
    gridSizeY?: number | undefined;
    gridLineWidth?: number | undefined;
    hideGridX?: boolean | undefined;
    hideGridY?: boolean | undefined;
    enablePanAndZoom?: boolean | undefined;
    mouseZoomFactor?: number | undefined;
    zoomExtents?: { min: number; max: number } | undefined;
    clampLinesToDocument?: boolean | undefined;
    className?: string | undefined;
    style?: React.CSSProperties | undefined;
}

export default class CanvasDraw extends React.Component<CanvasDrawProps> {
    /**
     * Returns the drawing's save-data as a stringified object.
     */
    getSaveData(): string;

    /**
     * Loads a previously saved drawing using the saveData string, as well as an optional boolean
     * flag to load it immediately, instead of live-drawing it.
     */
    loadSaveData(saveData: string, immediate?: boolean): void;

    /**
     * Clears the canvas completely.
     */
    clear(): void;

    /**
     * Removes the latest change to the drawing. This includes everything drawn since the last MouseDown event.
     */
    undo(): void;
}

Additional Details

  • Last updated: Tue, 07 Nov 2023 09:09:39 GMT
  • Dependencies: @types/react

Credits

These definitions were written by Kamil Socha.

FAQs

Last updated on 07 Nov 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc