Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 17 additions & 6 deletions src/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,15 @@ export interface EditOptions {
slug: string;
/** Optional style information */
style?: string | null;
/** The mouse event that triggered the edit */
e?: MouseEvent;
/** The coordinates of the edit, and the bounding rectangle of the element being edited */
position?: {
x: number;
y: number;
left: number;
width: number;
top: number;
height: number;
};
}

/**
Expand All @@ -215,16 +222,20 @@ export interface AddArrayItemOptions extends ArrayOptions {
index: number | null;
/** The value to insert */
value: any;
/** The mouse event that triggered the addition */
e?: MouseEvent;
/** The index to clone from if value isnt provided */
sourceIndex?: number;
}

/**
* Options for moving an array item in the v2 API
*/
export interface MoveArrayItemOptions extends ArrayOptions {
export interface MoveArrayItemOptions {
/** the identifier of the array field to move from */
fromSlug: string;
/** the identifier of the array field to move to, defaults to fromSlug if not provided */
toSlug?: string;
/** The current index of the item */
index: number;
fromIndex: number;
/** The target index for the item */
toIndex: number;
}
Expand Down