@cyca/react-timeline-editor 0.2.4-alpha.0 → 0.2.4-alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -56,6 +56,11 @@ export declare interface EditData {
56
56
  * @default false
57
57
  */
58
58
  snap?: boolean;
59
+ /**
60
+ * @description Enable cursor snap to action endpoints when dragging
61
+ * @default false
62
+ */
63
+ cursorSnap?: boolean;
59
64
  /**
60
65
  * @description Whether to hide cursor
61
66
  * @default false
@@ -105,7 +110,7 @@ export declare interface EditData {
105
110
  onActionResizeStart?: (params: {
106
111
  action: TimelineAction;
107
112
  row: TimelineRow;
108
- dir: 'right' | 'left';
113
+ dir: "right" | "left";
109
114
  }) => void;
110
115
  /**
111
116
  * @description Resize callback (return false to prevent resize)
@@ -115,7 +120,7 @@ export declare interface EditData {
115
120
  row: TimelineRow;
116
121
  start: number;
117
122
  end: number;
118
- dir: 'right' | 'left';
123
+ dir: "right" | "left";
119
124
  }) => void | boolean;
120
125
  /**
121
126
  * @description Resize end callback (return false to prevent onChange trigger)
@@ -125,7 +130,7 @@ export declare interface EditData {
125
130
  row: TimelineRow;
126
131
  start: number;
127
132
  end: number;
128
- dir: 'right' | 'left';
133
+ dir: "right" | "left";
129
134
  }) => void;
130
135
  /**
131
136
  * @description Click row callback
@@ -204,21 +209,22 @@ export declare interface EditData {
204
209
  * @description Click time area event, return false to prevent setting time
205
210
  */
206
211
  onClickTimeArea?: (time: number, e: React_2.MouseEvent<HTMLDivElement, MouseEvent>) => boolean | undefined;
212
+ /**
213
+ * @description Virtualization overscan count (unstable API, may change or be removed)
214
+ * @default 5
215
+ */
216
+ unstable_rowActionsOverscan?: number;
207
217
  }
208
218
 
209
- export declare interface EffectSourceParam {
210
- /** Current time */
211
- time: number;
212
- /** Whether it is currently playing */
213
- isPlaying: boolean;
214
- /** Action */
215
- action: TimelineAction;
216
- /** Action effect */
217
- effect: TimelineEffect;
219
+ declare type ScrollToTimeBlock = "start" | "center" | "end";
220
+
221
+ declare interface ScrollToTimeOptions {
222
+ block?: ScrollToTimeBlock;
223
+ offset?: number;
218
224
  }
219
225
 
220
226
  export declare function Timeline({ ref, ...props }: TimelineEditor & {
221
- ref?: default_2.RefObject<TimelineState>;
227
+ ref?: default_2.RefObject<TimelineState | null>;
222
228
  }): JSX.Element;
223
229
 
224
230
  /**
@@ -268,11 +274,6 @@ export declare interface TimelineEditor extends EditData {
268
274
  * @description Custom timeline style
269
275
  */
270
276
  style?: React_2.CSSProperties;
271
- /**
272
- * @description Whether to auto re-render (update tick when data changes or cursor time changes)
273
- * @default true
274
- */
275
- autoReRender?: boolean;
276
277
  /**
277
278
  * @description Data change callback, triggered after action end changes data (return false to prevent automatic engine synchronization, used to reduce performance overhead)
278
279
  */
@@ -284,26 +285,6 @@ export declare interface TimelineEffect {
284
285
  id: string;
285
286
  /** Effect name */
286
287
  name?: string;
287
- /** Effect execution code */
288
- source?: TimeLineEffectSource;
289
- }
290
-
291
- /**
292
- * Effect execution callback
293
- * @export
294
- * @interface TimeLineEffectSource
295
- */
296
- export declare interface TimeLineEffectSource {
297
- /** Callback when playback starts in the current action time region */
298
- start?: (param: EffectSourceParam) => void;
299
- /** Callback executed when time enters the action */
300
- enter?: (param: EffectSourceParam) => void;
301
- /** Callback when action updates */
302
- update?: (param: EffectSourceParam) => void;
303
- /** Callback executed when time leaves the action */
304
- leave?: (param: EffectSourceParam) => void;
305
- /** Callback when playback stops in the current action time region */
306
- stop?: (param: EffectSourceParam) => void;
307
288
  }
308
289
 
309
290
  /**
@@ -325,16 +306,15 @@ export declare interface TimelineRow {
325
306
  }
326
307
 
327
308
  export declare interface TimelineState {
328
- /** DOM node */
329
- target: HTMLElement;
330
- /** Set current playback time */
331
- set time(time: number);
332
- /** Get current playback time */
333
- get time(): number;
334
- /** Set scroll left */
309
+ readonly target: HTMLDivElement;
310
+ time: number;
311
+ getTime(): number;
312
+ setTime(time: number): void;
335
313
  setScrollLeft: (val: number) => void;
336
- /** Set scroll top */
337
314
  setScrollTop: (val: number) => void;
315
+ scrollLeft: number;
316
+ scrollTop: number;
317
+ scrollToTime(time: number, options?: ScrollToTimeOptions): void;
338
318
  }
339
319
 
340
320
  export { }