import { n as TimelineRow, t as TimelineAction } from "./action-C-MnAPdg.cjs"; import * as React$1 from "react"; import React from "react"; //#region src/interface/effect.d.ts interface TimelineEffect { /** Effect id */ id: string; /** Effect name */ name?: string; } //#endregion //#region src/interface/timeline.d.ts type TimelineCursorPreviewRenderParams = { surface: "time-area"; time: number; } | { surface: "edit-row"; time: number; row: TimelineRow; }; interface EditData { /** * @description Timeline editing data */ editorData: TimelineRow[]; /** * @description Timeline action effects map */ effects: Record; /** * @description Single scale mark range (>0) * @default 1 */ scale?: number; /** * @description Minimum number of scales (>=1) * @default 20 */ minScaleCount?: number; /** * @description Maximum number of scales (>=minScaleCount) * @default Infinity */ maxScaleCount?: number; /** * @description Number of subdivision units per scale (>0 integer) * @default 10 */ scaleSplitCount?: number; /** * @description Display width of a single scale (>0, unit: px) * @default 160 */ scaleWidth?: number; /** * @description Distance from the left where the scale starts (>=0, unit: px) * @default 20 */ startLeft?: number; /** * @description Default height of each editing row (>0, unit: px) * @default 32 */ rowHeight?: number; /** * @description Default collapsed height for collapsible rows (>0, unit: px) * @default rowHeight */ collapsedRowHeight?: number; /** * @description Whether to enable grid snap * @default false */ gridSnap?: boolean; /** * @description Enable snap * @default false */ snap?: boolean; /** * @description Enable cursor snap to action endpoints when dragging * @default false */ cursorSnap?: boolean; /** * @description Whether to hide cursor * @default false */ hideCursor?: boolean; /** * @description Whether to show the timeline cursor preview while hovering the timeline surface * @default false */ showTimelineCursorPreview?: boolean; /** * @description Disable dragging in all action areas * @default false */ disableDrag?: boolean; /** * @description Custom action area rendering */ getActionRender?: (action: TimelineAction, row: TimelineRow) => React$1.ReactNode; /** * @description Client-controlled action preview to render before insertion */ actionPreview?: { rowId: string; action: TimelineAction; }; /** * @description Render custom content for an action preview */ getActionPreviewRender?: (params: { action: TimelineAction; row: TimelineRow; height: number; }) => React$1.ReactNode; /** * @description Render custom content inside the timeline cursor preview head */ getTimelineCursorPreviewHeadRender?: (params: TimelineCursorPreviewRenderParams) => React$1.ReactNode; /** * @description Render custom content inside rows with no actions */ getEmptyRowRender?: (params: { row: TimelineRow; height: number; }) => React$1.ReactNode; /** * @description Render decorative content over a collapsible row only while it is collapsed */ getCollapsedRowLabelRender?: (params: { row: TimelineRow; height: number; }) => React$1.ReactNode; /** * @description Custom scale rendering */ getScaleRender?: (scale: number) => React$1.ReactNode; /** * @description Start move callback */ onActionMoveStart?: (params: { action: TimelineAction; row: TimelineRow; }) => void; /** * @description Move callback (return false to prevent movement) */ onActionMoving?: (params: { action: TimelineAction; row: TimelineRow; start: number; end: number; }) => void | boolean; /** * @description Move end callback (return false to prevent onChange trigger) */ onActionMoveEnd?: (params: { action: TimelineAction; row: TimelineRow; start: number; end: number; }) => void; /** * @description Start resize callback */ onActionResizeStart?: (params: { action: TimelineAction; row: TimelineRow; dir: "right" | "left"; }) => void; /** * @description Resize callback (return false to prevent resize) */ onActionResizing?: (params: { action: TimelineAction; row: TimelineRow; start: number; end: number; dir: "right" | "left"; }) => void | boolean; /** * @description Resize end callback (return false to prevent onChange trigger) */ onActionResizeEnd?: (params: { action: TimelineAction; row: TimelineRow; start: number; end: number; dir: "right" | "left"; }) => void; /** * @description Click row callback */ onClickRow?: (e: React$1.MouseEvent, param: { row: TimelineRow; time: number; }) => void; /** * @description Pointer move row callback */ onPointerMoveRow?: (e: React$1.PointerEvent, param: { row: TimelineRow; time: number; }) => void; /** * @description Click action callback */ onClickAction?: (e: React$1.MouseEvent, param: { action: TimelineAction; row: TimelineRow; time: number; }) => void; /** * @description Click action callback (not executed when drag is triggered) */ onClickActionOnly?: (e: React$1.MouseEvent, param: { action: TimelineAction; row: TimelineRow; time: number; }) => void; /** * @description Double click row callback */ onDoubleClickRow?: (e: React$1.MouseEvent, param: { row: TimelineRow; time: number; }) => void; /** * @description Double click action callback */ onDoubleClickAction?: (e: React$1.MouseEvent, param: { action: TimelineAction; row: TimelineRow; time: number; }) => void; /** * @description Right click row callback */ onContextMenuRow?: (e: React$1.MouseEvent, param: { row: TimelineRow; time: number; }) => void; /** * @description Right click action callback */ onContextMenuAction?: (e: React$1.MouseEvent, param: { action: TimelineAction; row: TimelineRow; time: number; }) => void; /** * @description Get the list of action ids to show assist drag lines, calculated at move/resize start, defaults to all actions except the currently moving action */ getAssistDragLineActionIds?: (params: { action: TimelineAction; editorData: TimelineRow[]; row: TimelineRow; }) => string[]; /** * @description Cursor drag start event */ onCursorDragStart?: (time: number) => void; /** * @description Cursor drag end event */ onCursorDragEnd?: (time: number) => void; /** * @description Cursor drag event */ onCursorDrag?: (time: number) => void; /** * @description Click time area event, return false to prevent setting time */ onClickTimeArea?: (time: number, e: React$1.MouseEvent) => boolean | undefined; /** * @description Virtualization overscan count (unstable API, may change or be removed) * @default 5 */ unstable_rowActionsOverscan?: number; } type ScrollToTimeBlock = "start" | "center" | "end"; interface ScrollToTimeOptions { block?: ScrollToTimeBlock; offset?: number; /** * @description Only scroll if the time is not currently visible in the viewport * @default false */ onlyIfNotVisible?: boolean; behavior?: "instant" | "smooth" | "auto"; } interface TimelineState { readonly target: HTMLDivElement; time: number; getTime(): number; setTime(time: number): void; setScrollLeft: (val: number) => void; setScrollTop: (val: number) => void; scrollLeft: number; scrollTop: number; scrollToTime(time: number, options?: ScrollToTimeOptions): void; getTimePixelPosition(time?: number): number; } /** * Animation editor parameters * @export * @interface TimelineProp */ interface TimelineEditor extends EditData { /** * @description Editing area scroll callback (used to control synchronization with editing row scrolling) */ onScroll?: (params: EventTarget & HTMLDivElement) => void; /** * @description Called after a commit that moves actions: a change to scale, scaleWidth, startLeft or editorData. Gets * the committed state, so positions read from it match the DOM. A drag or resize in progress doesn't call it; use * onActionMoving / onActionResizing for those. */ onLayout?: (state: TimelineState) => void; /** * @description Whether to enable auto scroll when dragging * @default false */ autoScroll?: boolean; /** * @description Auto scroll speed (default 1) * @default 1 */ autoScrollSpeed?: number; /** * @description Auto scroll max speed (default 10) * @default 10 */ autoScrollMaxSpeed?: number; /** * @description Custom timeline style */ style?: React$1.CSSProperties; /** * @description Data change callback, triggered after action end changes data (return false to prevent automatic engine synchronization, used to reduce performance overhead) */ onChange?: (editorData: TimelineRow[]) => void | boolean; } //#endregion //#region src/components/timeline.d.ts declare function Timeline({ ref, ...props }: TimelineEditor & { ref?: React.RefObject; unstable_forceRemountEditorArea?: number; }): React.JSX.Element; //#endregion export { type EditData, Timeline, type TimelineAction, type TimelineCursorPreviewRenderParams, type TimelineEditor, type TimelineEffect, type TimelineRow, type TimelineState };