tessl install tessl/npm-types--react@19.1.0TypeScript definitions for React, the popular JavaScript library for building user interfaces
Agent Success
Agent success rate when using this tile
80%
Improvement
Agent success rate improvement when using this tile compared to baseline
1.48x
Baseline
Agent success rate without this tile
54%
Build a type-safe interactive canvas drawing tool that demonstrates advanced event handling patterns in React. The tool should support mouse drawing, keyboard shortcuts, touch gestures for mobile devices, and proper modifier key detection.
The canvas should support drawing with the mouse:
Implement keyboard shortcuts with proper modifier key detection:
Ctrl/Cmd + Z: Undo the last drawn strokeCtrl/Cmd + Shift + Z: Redo a previously undone strokeEscape: Clear the entire canvasC (without modifiers): Toggle color between black and redAdd touch event support for mobile devices:
@generates
import React from 'react';
/**
* A single drawing stroke on the canvas
*/
interface Stroke {
points: Array<{ x: number; y: number }>;
color: string;
}
/**
* Props for the CanvasDrawingTool component
*/
interface CanvasDrawingToolProps {
width?: number;
height?: number;
initialColor?: string;
}
/**
* Interactive canvas drawing tool with advanced event handling
*/
export function CanvasDrawingTool(props: CanvasDrawingToolProps): React.JSX.Element;Provides TypeScript type definitions for React, including comprehensive event types for mouse, keyboard, touch, and other DOM events.
@satisfied-by