1.2.3 • Published 6 months ago

@types/react-canvas-draw v1.2.3

Weekly downloads
1,295
License
MIT
Repository
github
Last release
6 months ago

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

// Type definitions for react-canvas-draw 1.2
// Project: https://embiem.github.io/react-canvas-draw/
// Definitions by: Kamil Socha <https://github.com/ksocha>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped

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: Mon, 09 May 2022 22:01:34 GMT
  • Dependencies: @types/react
  • Global values: none

Credits

These definitions were written by Kamil Socha.

1.2.3

6 months ago

1.2.2

7 months ago

1.2.1

8 months ago

1.2.0

2 years ago

1.1.1

3 years ago

1.1.0

4 years ago