mirror of
https://github.com/idrawjs/idraw
synced 2026-05-24 10:08:34 +00:00
feat: update types/plugin
This commit is contained in:
parent
469be6c867
commit
fef6826bf5
1 changed files with 34 additions and 3 deletions
|
|
@ -1,7 +1,38 @@
|
|||
import { TypeData } from './data';
|
||||
import { TypeElemDesc, TypeElement } from './element';
|
||||
import { TypeContext } from './context';
|
||||
import { TypePoint, TypePointCursor } from './board';
|
||||
|
||||
|
||||
export interface TypePlugin {
|
||||
drawTopContext?(ctx: TypeContext): void;
|
||||
drawTopDisplayContext?(ctx2d: CanvasRenderingContext2D): void;
|
||||
drawBottomDisplayContext?(ctx2d: CanvasRenderingContext2D): void;
|
||||
onHover?: (detail: {
|
||||
point: TypePoint,
|
||||
selectedElement: TypeElement<keyof TypeElemDesc> | null,
|
||||
data: TypeData,
|
||||
helperCtx:TypeContext,
|
||||
}) => void | { cursor?: TypePointCursor };
|
||||
onClick?: (detail: {
|
||||
point: TypePoint,
|
||||
selectedElement: TypeElement<keyof TypeElemDesc> | null,
|
||||
data: TypeData,
|
||||
helperCtx:TypeContext
|
||||
}) => void;
|
||||
onMoveStart?: (detail: {
|
||||
point: TypePoint,
|
||||
selectedElement: TypeElement<keyof TypeElemDesc> | null,
|
||||
data: TypeData,
|
||||
helperCtx:TypeContext
|
||||
}) => void;
|
||||
onMove?: (detail: {
|
||||
point: TypePoint,
|
||||
selectedElement: TypeElement<keyof TypeElemDesc> | null,
|
||||
data: TypeData,
|
||||
helperCtx:TypeContext
|
||||
}) => void;
|
||||
onMoveEnd?: (detail: {
|
||||
point: TypePoint,
|
||||
selectedElement?: TypeElement<keyof TypeElemDesc> | null,
|
||||
data: TypeData,
|
||||
helperCtx:TypeContext
|
||||
}) => void;
|
||||
}
|
||||
Loading…
Reference in a new issue