• useDraw provides functionality for drawing on an html canvas

    Parameters

    • setItems: ((items) => void)
        • (items): void
        • Parameters

          • items: string[]

          Returns void

    Returns {
        canvasRef: RefObject<HTMLCanvasElement>;
        clear: ((clearBoard?) => void);
        onMouseDown: (() => void);
        promptUserRecogination: (() => Promise<undefined | string>);
        undoStroke: (() => void);
    }

    a reference to the html canvas, a function that should be called the user presses, and a function for clearning the canvas

    • canvasRef: RefObject<HTMLCanvasElement>
    • clear: ((clearBoard?) => void)
        • (clearBoard?): void
        • Parameters

          • clearBoard: boolean = true

          Returns void

    • onMouseDown: (() => void)
        • (): void
        • Returns void

    • promptUserRecogination: (() => Promise<undefined | string>)
        • (): Promise<undefined | string>
        • Returns Promise<undefined | string>

    • undoStroke: (() => void)
        • (): void
        • Returns void

Generated using TypeDoc