mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
51 lines
1.4 KiB
TypeScript
51 lines
1.4 KiB
TypeScript
// Type definitions for react-canvas-draw 1.1
|
|
// 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;
|
|
loadTimeOffset?: number;
|
|
lazyRadius?: number;
|
|
brushRadius?: number;
|
|
brushColor?: string;
|
|
catenaryColor?: string;
|
|
gridColor?: string;
|
|
backgroundColor?: string;
|
|
hideGrid?: boolean;
|
|
canvasWidth?: number | string;
|
|
canvasHeight?: number | string;
|
|
disabled?: boolean;
|
|
imgSrc?: string;
|
|
saveData?: string;
|
|
immediateLoading?: boolean;
|
|
hideInterface?: boolean;
|
|
className?: string;
|
|
style?: React.CSSProperties;
|
|
}
|
|
|
|
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;
|
|
}
|