mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
feat: add onChange
, onPointerDown
, onPointerUp
api subs (#7154)
This commit is contained in:
parent
9eb89f9960
commit
e7cc2337ea
4 changed files with 173 additions and 0 deletions
23
src/types.ts
23
src/types.ts
|
@ -607,6 +607,8 @@ export type PointerDownState = Readonly<{
|
|||
};
|
||||
}>;
|
||||
|
||||
type UnsubscribeCallback = () => void;
|
||||
|
||||
export type ExcalidrawImperativeAPI = {
|
||||
updateScene: InstanceType<typeof App>["updateScene"];
|
||||
updateLibrary: InstanceType<typeof Library>["updateLibrary"];
|
||||
|
@ -637,6 +639,27 @@ export type ExcalidrawImperativeAPI = {
|
|||
* used in conjunction with view mode (props.viewModeEnabled).
|
||||
*/
|
||||
updateFrameRendering: InstanceType<typeof App>["updateFrameRendering"];
|
||||
onChange: (
|
||||
callback: (
|
||||
elements: readonly ExcalidrawElement[],
|
||||
appState: AppState,
|
||||
files: BinaryFiles,
|
||||
) => void,
|
||||
) => UnsubscribeCallback;
|
||||
onPointerDown: (
|
||||
callback: (
|
||||
activeTool: AppState["activeTool"],
|
||||
pointerDownState: PointerDownState,
|
||||
event: React.PointerEvent<HTMLElement>,
|
||||
) => void,
|
||||
) => UnsubscribeCallback;
|
||||
onPointerUp: (
|
||||
callback: (
|
||||
activeTool: AppState["activeTool"],
|
||||
pointerDownState: PointerDownState,
|
||||
event: PointerEvent,
|
||||
) => void,
|
||||
) => UnsubscribeCallback;
|
||||
};
|
||||
|
||||
export type Device = Readonly<{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue