awesome-timeline-react 0.1.14 → 0.2.0
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/LICENSE +21 -21
- package/README.md +184 -96
- package/dist/_tsup-dts-rollup.d.mts +738 -329
- package/dist/_tsup-dts-rollup.d.ts +738 -329
- package/dist/index.css +44 -125
- package/dist/index.css.map +1 -1
- package/dist/index.d.mts +19 -0
- package/dist/index.d.ts +19 -0
- package/dist/index.js +1775 -1643
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1792 -1662
- package/dist/index.mjs.map +1 -1
- package/package.json +66 -62
- package/dist/src/index.d.mts +0 -1
- package/dist/src/index.d.ts +0 -1
|
@@ -1,329 +1,738 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
declare type
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
export declare const
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
};
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
export declare const
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
export declare const
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
declare
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
export declare
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
}
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
}
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
1
|
+
import { default as React_2 } from 'react';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Layout animation configuration. `false` disables all animations;
|
|
5
|
+
* an object tunes the durations (0 disables that animation).
|
|
6
|
+
*/
|
|
7
|
+
export declare type AnimationConfig = boolean | {
|
|
8
|
+
/** event stacking / row height tween, ms (default 200) */
|
|
9
|
+
layoutMs?: number;
|
|
10
|
+
/** resize-handle fade, ms (default 120) */
|
|
11
|
+
fadeMs?: number;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Assigns a vertical lane (stacking order) to each window-visible event of a
|
|
16
|
+
* single row. Faithful extraction of the algorithm previously inlined in
|
|
17
|
+
* use-produce-content.tsx — including its quirks:
|
|
18
|
+
*
|
|
19
|
+
* - Events outside [windowStart, windowEnd] are skipped and do not influence
|
|
20
|
+
* lane assignment at all.
|
|
21
|
+
* - The occupancy scan for an event only covers lanes 0..eventOrder (the lane
|
|
22
|
+
* of the previously placed event), not every tracked lane.
|
|
23
|
+
* - Touching events (prev.endTime === next.startTime) do not overlap.
|
|
24
|
+
*
|
|
25
|
+
* `rowEvents` must already be filtered to one row and sorted with
|
|
26
|
+
* helpers/sort-events (startTime asc, endTime asc).
|
|
27
|
+
*/
|
|
28
|
+
export declare const assignLanes: (rowEvents: EventType[], windowStart: number, windowEnd: number) => LaneResult;
|
|
29
|
+
|
|
30
|
+
/** Eligibility: same expression as the legacy Event component's render guard. */
|
|
31
|
+
export declare const canResizeEvent: (event: EventType, eventsResize: boolean) => boolean;
|
|
32
|
+
|
|
33
|
+
declare type CanvasBoardProps = {
|
|
34
|
+
scene: SceneStore;
|
|
35
|
+
rows: RowType[];
|
|
36
|
+
windowTime: number[];
|
|
37
|
+
tick: number | null;
|
|
38
|
+
cellWidth: number;
|
|
39
|
+
theme: ResolvedTheme;
|
|
40
|
+
drawEvent?: DrawEventFn;
|
|
41
|
+
bodyRef: React_2.MutableRefObject<HTMLDivElement | null>;
|
|
42
|
+
rendererRef: React_2.MutableRefObject<TimelineRenderer | null>;
|
|
43
|
+
eventPromptRef: React_2.MutableRefObject<EventPromptActionsType | null>;
|
|
44
|
+
rowsHeaderClassName?: string;
|
|
45
|
+
setWindowTime: React_2.Dispatch<React_2.SetStateAction<number[]>>;
|
|
46
|
+
setCellWidth: React_2.Dispatch<React_2.SetStateAction<number>>;
|
|
47
|
+
onDrop?: (props: OnDropProps) => void;
|
|
48
|
+
onResize?: (props: OnResizeProps) => void;
|
|
49
|
+
onEventClick?: (props: OnEventClickProps) => void;
|
|
50
|
+
onEventHover?: (props: OnEventHoverProps) => void;
|
|
51
|
+
eventsResize: boolean;
|
|
52
|
+
panZoom?: PanZoomConfig;
|
|
53
|
+
animations: {
|
|
54
|
+
layoutMs: number;
|
|
55
|
+
fadeMs: number;
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
/** Drop: same cell-snap as row-content.tsx handleOnDrop. */
|
|
60
|
+
export declare const computeDropTimes: ({ pointerX, cellWidth, tick, windowStart, duration, }: {
|
|
61
|
+
pointerX: number;
|
|
62
|
+
cellWidth: number;
|
|
63
|
+
tick: number;
|
|
64
|
+
windowStart: number;
|
|
65
|
+
duration: number;
|
|
66
|
+
}) => {
|
|
67
|
+
startTime: number;
|
|
68
|
+
endTime: number;
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Resize: same rounding and duration-must-stay-positive guard as
|
|
73
|
+
* event.tsx handleDocumentOnMouseUp. Returns null when the resize would
|
|
74
|
+
* collapse or invert the event (legacy keeps the old value silently).
|
|
75
|
+
*/
|
|
76
|
+
export declare const computeResizeTimes: (event: Pick<EventType, "startTime" | "endTime">, deltaPx: number, // raw pointer delta (clientX - initial), sign preserved
|
|
77
|
+
tick: number, direction: "left" | "right") => {
|
|
78
|
+
startTime: number;
|
|
79
|
+
endTime: number;
|
|
80
|
+
} | null;
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Returns the window-visible slice of a startTime-sorted event array.
|
|
84
|
+
* Binary search cuts the tail (startTime > windowEnd) in O(log n); the head
|
|
85
|
+
* is filtered linearly on endTime, which cannot be binary-searched on a
|
|
86
|
+
* startTime ordering.
|
|
87
|
+
*/
|
|
88
|
+
export declare const cullToWindow: (events: EventType[], windowStart: number, windowEnd: number) => EventType[];
|
|
89
|
+
|
|
90
|
+
export declare const default_alias: {
|
|
91
|
+
title: string;
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Canvas board: two viewport-sized canvases (grid + events) kept fixed
|
|
96
|
+
* inside the scrolling body via position:sticky, with a tall spacer div
|
|
97
|
+
* providing the native scrollbar. Drawing is translated by scrollTop, so the
|
|
98
|
+
* canvas never exceeds browser size limits regardless of row count.
|
|
99
|
+
*
|
|
100
|
+
* The forwarded ref targets the content column — the element timeline.tsx
|
|
101
|
+
* measures for tick/cellWidth.
|
|
102
|
+
*/
|
|
103
|
+
export declare const default_alias_1: React_2.ForwardRefExoticComponent<CanvasBoardProps & React_2.RefAttributes<HTMLDivElement>>;
|
|
104
|
+
|
|
105
|
+
export declare const default_alias_10: ({ windowTime, setTick, setCellWidth, contentRef, }: {
|
|
106
|
+
windowTime: number[];
|
|
107
|
+
setTick: React.Dispatch<React.SetStateAction<number | null>>;
|
|
108
|
+
setCellWidth: React.Dispatch<React.SetStateAction<number>>;
|
|
109
|
+
contentRef: React.MutableRefObject<HTMLDivElement | null>;
|
|
110
|
+
}) => void;
|
|
111
|
+
|
|
112
|
+
export declare const default_alias_2: ({ windowTime, tick, contentWidth, scrollWidth, theme, }: {
|
|
113
|
+
windowTime: number[];
|
|
114
|
+
tick: number | null;
|
|
115
|
+
contentWidth: number | null;
|
|
116
|
+
scrollWidth: number;
|
|
117
|
+
theme?: ResolvedTheme;
|
|
118
|
+
}) => React_2.JSX.Element;
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* Hover tooltip for events. Positioned with @floating-ui/dom against the
|
|
122
|
+
* hovered event's rect (viewport coordinates): preferred above the event,
|
|
123
|
+
* flips below when there is no room, and shifts horizontally to stay
|
|
124
|
+
* on-screen.
|
|
125
|
+
*/
|
|
126
|
+
export declare const default_alias_3: React_2.ForwardRefExoticComponent<EventPromptType & React_2.RefAttributes<EventPromptActionsType>>;
|
|
127
|
+
|
|
128
|
+
export declare const default_alias_4: ({ tick, windowTime, }: {
|
|
129
|
+
tick: number | null;
|
|
130
|
+
windowTime: number[];
|
|
131
|
+
}) => React_2.JSX.Element;
|
|
132
|
+
|
|
133
|
+
export declare const default_alias_5: (monthIndex: number) => string;
|
|
134
|
+
|
|
135
|
+
export declare const default_alias_6: (dayIndex: number) => string;
|
|
136
|
+
|
|
137
|
+
export declare const default_alias_7: (eventA: EventType, eventB: EventType) => 1 | -1;
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* Pointer-event state machine for the canvas board: pan the time window,
|
|
141
|
+
* drag events between rows/times (DOM ghost preview), resize event edges,
|
|
142
|
+
* change grid granularity (middle-click mode or ctrl+wheel). Event mutations
|
|
143
|
+
* are applied straight to the SceneStore — no React state on the hot path.
|
|
144
|
+
*/
|
|
145
|
+
export declare const default_alias_8: ({ scene, rendererRef, dynamicCanvasRef, bodyRef, ghostRef, eventPromptRef, setWindowTime, setCellWidth, onDrop, onResize, onEventClick, onEventHover, eventsResize, panZoom, }: UseCanvasInteractionsArgs) => {
|
|
146
|
+
handlePointerDown: (pointerEvent: React_2.PointerEvent<HTMLCanvasElement>) => void;
|
|
147
|
+
handlePointerMove: (pointerEvent: React_2.PointerEvent<HTMLCanvasElement>) => void;
|
|
148
|
+
handlePointerUp: (pointerEvent: React_2.PointerEvent<HTMLCanvasElement>) => void;
|
|
149
|
+
handlePointerLeave: () => void;
|
|
150
|
+
handleAuxClick: (pointerEvent: React_2.MouseEvent<HTMLCanvasElement>) => void;
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
export declare const default_alias_9: ({ windowTime, contentWidth, }: {
|
|
154
|
+
windowTime: number[];
|
|
155
|
+
contentWidth: number | null;
|
|
156
|
+
}) => {
|
|
157
|
+
numberOfHourBlocks: number;
|
|
158
|
+
blockWidth: number;
|
|
159
|
+
};
|
|
160
|
+
|
|
161
|
+
export declare const DEFAULT_FADE_DURATION_MS = 120;
|
|
162
|
+
|
|
163
|
+
export declare const DEFAULT_LAYOUT_DURATION_MS = 200;
|
|
164
|
+
|
|
165
|
+
/** Defaults mirror the pre-0.2.0 stylesheet values. */
|
|
166
|
+
export declare const DEFAULT_THEME: ResolvedTheme;
|
|
167
|
+
|
|
168
|
+
/**
|
|
169
|
+
* Custom canvas renderer for an event. Return false to fall through to the
|
|
170
|
+
* library's default drawing.
|
|
171
|
+
*/
|
|
172
|
+
declare type DrawEventFn = (ctx: CanvasRenderingContext2D, event: EventType, rect: Rect, state: EventState, theme: ResolvedTheme) => void | false;
|
|
173
|
+
export { DrawEventFn }
|
|
174
|
+
export { DrawEventFn as DrawEventFn_alias_1 }
|
|
175
|
+
|
|
176
|
+
/**
|
|
177
|
+
* All window- and viewport-visible events in one pass. Rows fully outside
|
|
178
|
+
* the vertical viewport are skipped without touching their events. Custom
|
|
179
|
+
* renderers resolve per-event drawEvent -> Timeline drawEvent -> default.
|
|
180
|
+
*/
|
|
181
|
+
export declare const drawEvents: (ctx: CanvasRenderingContext2D, view: RendererView, scene: SceneStore, font: string, animator: LayoutAnimator) => void;
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* Vertical grid lines, one per cellWidth — canvas replacement for the ~N
|
|
185
|
+
* line divs of lines-canvas.tsx. Matches the legacy "hide-last-line"
|
|
186
|
+
* behavior: no line within 1px of the right edge.
|
|
187
|
+
*/
|
|
188
|
+
export declare const drawGridLines: (ctx: CanvasRenderingContext2D, { width, height, cellWidth, color, }: {
|
|
189
|
+
width: number;
|
|
190
|
+
height: number;
|
|
191
|
+
cellWidth: number;
|
|
192
|
+
color?: string;
|
|
193
|
+
}) => void;
|
|
194
|
+
|
|
195
|
+
/** Horizontal row dividers — replaces .row-content border-bottom. */
|
|
196
|
+
export declare const drawRowDividers: (ctx: CanvasRenderingContext2D, view: RendererView, scene: SceneStore, animator: LayoutAnimator) => void;
|
|
197
|
+
|
|
198
|
+
/**
|
|
199
|
+
* Day row over hour row — canvas replacement for the day/hour block divs of
|
|
200
|
+
* time-bar.tsx. Background is left transparent so the .time-bar container
|
|
201
|
+
* color shows through, exactly like the DOM blocks did.
|
|
202
|
+
*/
|
|
203
|
+
export declare const drawTimeBar: (ctx: CanvasRenderingContext2D, { width, height, dayBlocks, hourBlocks, font, borderColor, textColor, }: {
|
|
204
|
+
width: number;
|
|
205
|
+
height: number;
|
|
206
|
+
font: string;
|
|
207
|
+
borderColor?: string;
|
|
208
|
+
textColor?: string;
|
|
209
|
+
} & TimeBlocks) => void;
|
|
210
|
+
|
|
211
|
+
export declare const EVENT_BAR_HEIGHT = 20;
|
|
212
|
+
|
|
213
|
+
export declare const EVENT_RADIUS = 5;
|
|
214
|
+
|
|
215
|
+
/** Imperative event mutation, applied without React re-renders. */
|
|
216
|
+
declare type EventPatch = {
|
|
217
|
+
op: "upsert";
|
|
218
|
+
event: EventType;
|
|
219
|
+
} | {
|
|
220
|
+
op: "update";
|
|
221
|
+
id: string;
|
|
222
|
+
changes: Partial<Omit<EventType, "id">>;
|
|
223
|
+
} | {
|
|
224
|
+
op: "remove";
|
|
225
|
+
id: string;
|
|
226
|
+
};
|
|
227
|
+
export { EventPatch }
|
|
228
|
+
export { EventPatch as EventPatch_alias_1 }
|
|
229
|
+
export { EventPatch as EventPatch_alias_2 }
|
|
230
|
+
|
|
231
|
+
export declare type EventPromptActionsType = {
|
|
232
|
+
/** show the prompt for an event, anchored to its rect (viewport coords) */
|
|
233
|
+
show: (event: EventType, anchorRect: Rect) => void;
|
|
234
|
+
hide: () => void;
|
|
235
|
+
};
|
|
236
|
+
|
|
237
|
+
declare type EventPromptType = {
|
|
238
|
+
template?: (event: EventType) => JSX.Element;
|
|
239
|
+
};
|
|
240
|
+
|
|
241
|
+
declare type EventPropsType = {
|
|
242
|
+
isLocked?: boolean;
|
|
243
|
+
isResizable?: boolean;
|
|
244
|
+
showPrompt?: boolean;
|
|
245
|
+
/** plain-text label drawn inside the bar (was `content` before 0.2.0) */
|
|
246
|
+
label?: string;
|
|
247
|
+
/** per-event appearance (was `classNames` before 0.2.0) */
|
|
248
|
+
style?: EventStyle;
|
|
249
|
+
/** per-event custom renderer; overrides the Timeline-level drawEvent */
|
|
250
|
+
drawEvent?: DrawEventFn;
|
|
251
|
+
/** arbitrary data for eventPromptTemplate */
|
|
252
|
+
metadata?: unknown;
|
|
253
|
+
};
|
|
254
|
+
export { EventPropsType }
|
|
255
|
+
export { EventPropsType as EventPropsType_alias_1 }
|
|
256
|
+
|
|
257
|
+
/** Interaction state passed to custom drawEvent renderers. */
|
|
258
|
+
declare type EventState = {
|
|
259
|
+
hovered: boolean;
|
|
260
|
+
dragging: boolean;
|
|
261
|
+
resizing: boolean;
|
|
262
|
+
selected: boolean;
|
|
263
|
+
};
|
|
264
|
+
export { EventState }
|
|
265
|
+
export { EventState as EventState_alias_1 }
|
|
266
|
+
|
|
267
|
+
/** Per-event appearance overrides, merged over the theme defaults. */
|
|
268
|
+
declare type EventStyle = {
|
|
269
|
+
fill?: string;
|
|
270
|
+
stroke?: string;
|
|
271
|
+
strokeWidth?: number;
|
|
272
|
+
textColor?: string;
|
|
273
|
+
font?: string;
|
|
274
|
+
borderRadius?: number;
|
|
275
|
+
opacity?: number;
|
|
276
|
+
};
|
|
277
|
+
export { EventStyle }
|
|
278
|
+
export { EventStyle as EventStyle_alias_1 }
|
|
279
|
+
|
|
280
|
+
declare type EventType = {
|
|
281
|
+
id: string;
|
|
282
|
+
rowId: string;
|
|
283
|
+
startTime: number;
|
|
284
|
+
endTime: number;
|
|
285
|
+
props?: EventPropsType;
|
|
286
|
+
};
|
|
287
|
+
export { EventType }
|
|
288
|
+
export { EventType as EventType_alias_1 }
|
|
289
|
+
|
|
290
|
+
/**
|
|
291
|
+
* Coalesces invalidations into a single requestAnimationFrame callback.
|
|
292
|
+
* Any number of invalidate() calls within one frame produce exactly one
|
|
293
|
+
* onFrame() with the union of dirty layers — the backbone of 60fps under
|
|
294
|
+
* streaming updates.
|
|
295
|
+
*/
|
|
296
|
+
export declare class FrameScheduler {
|
|
297
|
+
private onFrame;
|
|
298
|
+
private rafId;
|
|
299
|
+
private dirty;
|
|
300
|
+
constructor(onFrame: (dirty: LayerDirty) => void);
|
|
301
|
+
invalidate(layer: Layer | "all"): void;
|
|
302
|
+
/** Runs a pending frame immediately (tests, synchronous reads). */
|
|
303
|
+
flush(): void;
|
|
304
|
+
dispose(): void;
|
|
305
|
+
private schedule;
|
|
306
|
+
private run;
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
/**
|
|
310
|
+
* Pure extraction of the day/hour block generation previously inlined as JSX
|
|
311
|
+
* in use-generate-blocks.tsx. Same walk over the window, same Math.round
|
|
312
|
+
* block counting, same labels — but returns positioned data that both the
|
|
313
|
+
* canvas time bar and tests can consume.
|
|
314
|
+
*/
|
|
315
|
+
export declare const generateTimeBlocks: ({ windowStart, tick, contentWidth, blockWidth, }: {
|
|
316
|
+
windowStart: number;
|
|
317
|
+
tick: number | null;
|
|
318
|
+
contentWidth: number | null;
|
|
319
|
+
blockWidth: number;
|
|
320
|
+
}) => TimeBlocks;
|
|
321
|
+
|
|
322
|
+
export declare type HitTarget = {
|
|
323
|
+
kind: "event" | "static";
|
|
324
|
+
event: EventType;
|
|
325
|
+
rowId: string;
|
|
326
|
+
/** rect in viewport (canvas CSS px) coordinates, scroll already applied */
|
|
327
|
+
rect: Rect;
|
|
328
|
+
};
|
|
329
|
+
|
|
330
|
+
/**
|
|
331
|
+
* Point query against the scene at viewport coordinates (x, y).
|
|
332
|
+
* Finds the row by accumulated heights, then scans that row's window-visible
|
|
333
|
+
* events back-to-front (interactive events sit above static ones, later
|
|
334
|
+
* events draw above earlier ones). Per-row event counts are small, so the
|
|
335
|
+
* scan after the row/window cut is cheap — no spatial index needed.
|
|
336
|
+
*/
|
|
337
|
+
export declare const hitTest: (scene: SceneStore, view: HitTestView, x: number, y: number) => HitTarget | null;
|
|
338
|
+
|
|
339
|
+
export declare type HitTestView = {
|
|
340
|
+
windowStart: number;
|
|
341
|
+
windowEnd: number;
|
|
342
|
+
tick: number;
|
|
343
|
+
scrollTop: number;
|
|
344
|
+
};
|
|
345
|
+
|
|
346
|
+
export declare const intersectsWindow: (event: EventType, windowStart: number, windowEnd: number) => boolean;
|
|
347
|
+
|
|
348
|
+
export declare const LANE_HEIGHT = 22;
|
|
349
|
+
|
|
350
|
+
export declare const LANE_TOP_OFFSET = 10;
|
|
351
|
+
|
|
352
|
+
export declare type LaneResult = {
|
|
353
|
+
laneOf: Map<string, number>;
|
|
354
|
+
highestLane: number;
|
|
355
|
+
};
|
|
356
|
+
|
|
357
|
+
export declare const laneTop: (lane: number) => number;
|
|
358
|
+
|
|
359
|
+
export declare type Layer = "static" | "dynamic";
|
|
360
|
+
|
|
361
|
+
export declare type LayerDirty = {
|
|
362
|
+
static: boolean;
|
|
363
|
+
dynamic: boolean;
|
|
364
|
+
};
|
|
365
|
+
|
|
366
|
+
/**
|
|
367
|
+
* Replaces the CSS transitions the DOM renderer got for free:
|
|
368
|
+
* row heights and event tops tween when stacking changes, and resize
|
|
369
|
+
* handles fade in/out. Values are queried per frame; while any tween is
|
|
370
|
+
* live the renderer keeps scheduling frames.
|
|
371
|
+
*
|
|
372
|
+
* Durations are configurable via the Timeline `animations` prop; a duration
|
|
373
|
+
* of 0 disables that animation (values jump straight to target).
|
|
374
|
+
*
|
|
375
|
+
* Coordinate rules: row heights are content-space; event tops are
|
|
376
|
+
* ROW-LOCAL lane offsets. Tweens must never target a value that is itself
|
|
377
|
+
* animated (e.g. an absolute top including the animated row position) —
|
|
378
|
+
* a moving target retargets every frame and the tween lags behind it
|
|
379
|
+
* perpetually, desyncing the layers.
|
|
380
|
+
*/
|
|
381
|
+
export declare class LayoutAnimator {
|
|
382
|
+
private rowHeights;
|
|
383
|
+
private eventTops;
|
|
384
|
+
private handleAlphas;
|
|
385
|
+
private now;
|
|
386
|
+
private activeUntil;
|
|
387
|
+
private layoutDuration;
|
|
388
|
+
private fadeDuration;
|
|
389
|
+
setDurations(layoutMs: number, fadeMs: number): void;
|
|
390
|
+
beginFrame(now: number): void;
|
|
391
|
+
rowHeight(rowId: string, target: number): number;
|
|
392
|
+
eventTop(eventId: string, target: number): number;
|
|
393
|
+
/** 0..1 opacity of an event's resize handles; target 1 = hovered. */
|
|
394
|
+
handleAlpha(eventId: string, target: number): number;
|
|
395
|
+
isAnimating(): boolean;
|
|
396
|
+
/**
|
|
397
|
+
* Drop an event's top tween so its next draw renders at the target
|
|
398
|
+
* instantly — used on drag-drop commit, where the ghost already previewed
|
|
399
|
+
* the final position and a tween would feel like a rubber-band.
|
|
400
|
+
*/
|
|
401
|
+
snapEventTop(eventId: string): void;
|
|
402
|
+
/** Drop all state, e.g. when the scene is reset wholesale. */
|
|
403
|
+
reset(): void;
|
|
404
|
+
private value;
|
|
405
|
+
private current;
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
export declare type ModifableElements = {
|
|
409
|
+
timeBar: string;
|
|
410
|
+
dayRow: string;
|
|
411
|
+
hourRow: string;
|
|
412
|
+
gridLine: string;
|
|
413
|
+
rowsHeader: string;
|
|
414
|
+
};
|
|
415
|
+
|
|
416
|
+
declare type OnDropProps = {
|
|
417
|
+
eventId: string;
|
|
418
|
+
oldRowId: string;
|
|
419
|
+
newRowId: string;
|
|
420
|
+
startTime: number;
|
|
421
|
+
endTime: number;
|
|
422
|
+
};
|
|
423
|
+
export { OnDropProps }
|
|
424
|
+
export { OnDropProps as OnDropProps_alias_1 }
|
|
425
|
+
|
|
426
|
+
declare type OnEventClickProps = {
|
|
427
|
+
eventId: string;
|
|
428
|
+
rowId: string;
|
|
429
|
+
nativeEvent: PointerEvent;
|
|
430
|
+
modifiers: {
|
|
431
|
+
shift: boolean;
|
|
432
|
+
ctrl: boolean;
|
|
433
|
+
meta: boolean;
|
|
434
|
+
alt: boolean;
|
|
435
|
+
};
|
|
436
|
+
};
|
|
437
|
+
export { OnEventClickProps }
|
|
438
|
+
export { OnEventClickProps as OnEventClickProps_alias_1 }
|
|
439
|
+
|
|
440
|
+
declare type OnEventHoverProps = {
|
|
441
|
+
/** null when the pointer leaves all events */
|
|
442
|
+
eventId: string | null;
|
|
443
|
+
rowId: string | null;
|
|
444
|
+
};
|
|
445
|
+
export { OnEventHoverProps }
|
|
446
|
+
export { OnEventHoverProps as OnEventHoverProps_alias_1 }
|
|
447
|
+
|
|
448
|
+
declare type OnResizeProps = {
|
|
449
|
+
eventId: string;
|
|
450
|
+
startTime: number;
|
|
451
|
+
endTime: number;
|
|
452
|
+
};
|
|
453
|
+
export { OnResizeProps }
|
|
454
|
+
export { OnResizeProps as OnResizeProps_alias_1 }
|
|
455
|
+
|
|
456
|
+
declare type PanZoomConfig = {
|
|
457
|
+
/** drag the empty background to pan the time window (default true) */
|
|
458
|
+
panOnDragBackground?: boolean;
|
|
459
|
+
/** ctrl/cmd + wheel changes grid granularity (default true) */
|
|
460
|
+
ctrlWheelZoom?: boolean;
|
|
461
|
+
/** middle-click toggles wheel-granularity mode (default true) */
|
|
462
|
+
middleClickGranularity?: boolean;
|
|
463
|
+
/** seconds per granularity step (default 900 = 15 min) */
|
|
464
|
+
zoomStepSeconds?: number;
|
|
465
|
+
};
|
|
466
|
+
export { PanZoomConfig }
|
|
467
|
+
export { PanZoomConfig as PanZoomConfig_alias_1 }
|
|
468
|
+
|
|
469
|
+
export declare type PartialRecord<K extends keyof any, T> = Partial<Record<K, T>>;
|
|
470
|
+
|
|
471
|
+
declare type Rect = {
|
|
472
|
+
x: number;
|
|
473
|
+
y: number;
|
|
474
|
+
width: number;
|
|
475
|
+
height: number;
|
|
476
|
+
};
|
|
477
|
+
export { Rect }
|
|
478
|
+
export { Rect as Rect_alias_1 }
|
|
479
|
+
export { Rect as Rect_alias_2 }
|
|
480
|
+
|
|
481
|
+
export declare const rectContains: (rect: Rect, x: number, y: number) => boolean;
|
|
482
|
+
|
|
483
|
+
export declare type RendererView = {
|
|
484
|
+
windowTime: [number, number];
|
|
485
|
+
tick: number | null;
|
|
486
|
+
cellWidth: number;
|
|
487
|
+
scrollTop: number;
|
|
488
|
+
width: number;
|
|
489
|
+
height: number;
|
|
490
|
+
theme: ResolvedTheme;
|
|
491
|
+
drawEvent?: DrawEventFn;
|
|
492
|
+
eventsResize: boolean;
|
|
493
|
+
hoveredEventId: string | null;
|
|
494
|
+
draggedEventId: string | null;
|
|
495
|
+
resizePreview: ResizePreview | null;
|
|
496
|
+
};
|
|
497
|
+
|
|
498
|
+
export declare type ResizePreview = {
|
|
499
|
+
eventId: string;
|
|
500
|
+
deltaPx: number;
|
|
501
|
+
direction: "left" | "right";
|
|
502
|
+
};
|
|
503
|
+
|
|
504
|
+
declare type ResolvedTheme = Required<Omit<Theme, "font">> & Pick<Theme, "font">;
|
|
505
|
+
export { ResolvedTheme }
|
|
506
|
+
export { ResolvedTheme as ResolvedTheme_alias_1 }
|
|
507
|
+
|
|
508
|
+
export declare const resolveTheme: (theme?: Theme) => ResolvedTheme;
|
|
509
|
+
|
|
510
|
+
export declare const ROW_BASE_HEIGHT = 40;
|
|
511
|
+
|
|
512
|
+
export declare const rowMinHeight: (highestLane: number) => number;
|
|
513
|
+
|
|
514
|
+
declare type RowType = {
|
|
515
|
+
id: string;
|
|
516
|
+
name: string;
|
|
517
|
+
};
|
|
518
|
+
export { RowType }
|
|
519
|
+
export { RowType as RowType_alias_1 }
|
|
520
|
+
|
|
521
|
+
/**
|
|
522
|
+
* Imperative event store for the canvas renderer. Lives outside React state:
|
|
523
|
+
* streaming patches mutate it directly and the renderer reads from it per
|
|
524
|
+
* frame — React never reconciles individual event motion.
|
|
525
|
+
*
|
|
526
|
+
* Lane assignment (and therefore row height) is computed lazily per row, only
|
|
527
|
+
* when that row is queried for the current window. Bursts of patches against
|
|
528
|
+
* off-screen rows cost nothing beyond an index update.
|
|
529
|
+
*/
|
|
530
|
+
export declare class SceneStore {
|
|
531
|
+
private rowIndexes;
|
|
532
|
+
private rowOrder;
|
|
533
|
+
private eventRow;
|
|
534
|
+
private listeners;
|
|
535
|
+
version: number;
|
|
536
|
+
setRows(rows: RowType[]): void;
|
|
537
|
+
setEvents(events: EventType[]): void;
|
|
538
|
+
setStaticEvents(events: EventType[]): void;
|
|
539
|
+
applyPatches(patches: EventPatch[]): void;
|
|
540
|
+
getEvent(id: string): EventType | undefined;
|
|
541
|
+
getRowIds(): string[];
|
|
542
|
+
getRow(rowId: string): RowType | undefined;
|
|
543
|
+
getRowEvents(rowId: string): EventType[];
|
|
544
|
+
getRowStaticEvents(rowId: string): EventType[];
|
|
545
|
+
getLanes(rowId: string, windowStart: number, windowEnd: number): LaneResult;
|
|
546
|
+
getRowHeight(rowId: string, windowStart: number, windowEnd: number): number;
|
|
547
|
+
/**
|
|
548
|
+
* y offset of each row's top edge (content coordinates, before scroll) plus
|
|
549
|
+
* the total content height — drives both drawing and the scroll spacer.
|
|
550
|
+
*/
|
|
551
|
+
getRowOffsets(windowStart: number, windowEnd: number): {
|
|
552
|
+
offsetOf: Map<string, number>;
|
|
553
|
+
totalHeight: number;
|
|
554
|
+
};
|
|
555
|
+
subscribe(listener: () => void): () => void;
|
|
556
|
+
private insert;
|
|
557
|
+
private remove;
|
|
558
|
+
private bump;
|
|
559
|
+
}
|
|
560
|
+
|
|
561
|
+
/**
|
|
562
|
+
* Sizes a canvas backing store for the given devicePixelRatio and resets the
|
|
563
|
+
* context transform so ALL drawing code works in CSS pixels.
|
|
564
|
+
*/
|
|
565
|
+
export declare const sizeCanvas: (canvas: HTMLCanvasElement, cssWidth: number, cssHeight: number, dpr: number) => CanvasRenderingContext2D | null;
|
|
566
|
+
|
|
567
|
+
export declare const STATIC_EVENT_BASE_HEIGHT = 20;
|
|
568
|
+
|
|
569
|
+
export declare const staticEventHeight: (highestLane: number) => number;
|
|
570
|
+
|
|
571
|
+
/** Grid granularity step: same clamp as content.tsx handleOnWheel. */
|
|
572
|
+
export declare const stepCellWidth: (cellWidth: number, deltaY: number, tick: number) => number;
|
|
573
|
+
|
|
574
|
+
/**
|
|
575
|
+
* Color/font tokens for everything drawn to canvas. Defaults mirror the
|
|
576
|
+
* pre-0.2.0 stylesheet. (Bar geometry — heights, lane spacing, radius — is
|
|
577
|
+
* not yet themeable.)
|
|
578
|
+
*/
|
|
579
|
+
declare type Theme = {
|
|
580
|
+
eventFill?: string;
|
|
581
|
+
eventStroke?: string;
|
|
582
|
+
eventTextColor?: string;
|
|
583
|
+
staticEventFill?: string;
|
|
584
|
+
gridColor?: string;
|
|
585
|
+
timeBarBorder?: string;
|
|
586
|
+
timeBarTextColor?: string;
|
|
587
|
+
/** canvas text font; defaults to the canvas element's computed font */
|
|
588
|
+
font?: string;
|
|
589
|
+
};
|
|
590
|
+
export { Theme }
|
|
591
|
+
export { Theme as Theme_alias_1 }
|
|
592
|
+
|
|
593
|
+
export declare type TimeBlock = {
|
|
594
|
+
label: string;
|
|
595
|
+
x: number;
|
|
596
|
+
width: number;
|
|
597
|
+
};
|
|
598
|
+
|
|
599
|
+
export declare type TimeBlocks = {
|
|
600
|
+
dayBlocks: TimeBlock[];
|
|
601
|
+
hourBlocks: TimeBlock[];
|
|
602
|
+
};
|
|
603
|
+
|
|
604
|
+
declare const Timeline: React_2.ForwardRefExoticComponent<TimelineProps & React_2.RefAttributes<TimelineHandle>>;
|
|
605
|
+
export { Timeline }
|
|
606
|
+
export { Timeline as Timeline_alias_1 }
|
|
607
|
+
|
|
608
|
+
export declare const TimelineCanvas: () => React_2.JSX.Element;
|
|
609
|
+
|
|
610
|
+
/**
|
|
611
|
+
* Imperative handle for streaming/live updates: `const ref =
|
|
612
|
+
* useRef<TimelineHandle>(null); <Timeline ref={ref} ...>`.
|
|
613
|
+
*
|
|
614
|
+
* Reconciliation rule: the `events` PROP is authoritative whenever its
|
|
615
|
+
* reference changes — a new array resets the internal store and discards all
|
|
616
|
+
* imperative state. Pick one mode: declarative (swap the prop) or imperative
|
|
617
|
+
* (stable prop + handle calls).
|
|
618
|
+
*/
|
|
619
|
+
declare type TimelineHandle = {
|
|
620
|
+
/** full replace of all events (does not touch the `events` prop) */
|
|
621
|
+
setEvents(events: EventType[]): void;
|
|
622
|
+
/** batched patches, coalesced into a single redraw per animation frame */
|
|
623
|
+
updateEvents(patches: EventPatch[]): void;
|
|
624
|
+
getEvent(id: string): EventType | undefined;
|
|
625
|
+
/** scroll vertically so the row is at the top of the viewport */
|
|
626
|
+
scrollToRow(rowId: string): void;
|
|
627
|
+
/** move the visible time window, preserving its duration */
|
|
628
|
+
scrollToTime(time: number): void;
|
|
629
|
+
/** set the visible time window explicitly (unix seconds) */
|
|
630
|
+
setWindow(startTime: number, endTime: number): void;
|
|
631
|
+
getVisibleRange(): {
|
|
632
|
+
startTime: number;
|
|
633
|
+
endTime: number;
|
|
634
|
+
};
|
|
635
|
+
/** force a full redraw of both canvas layers */
|
|
636
|
+
redraw(): void;
|
|
637
|
+
};
|
|
638
|
+
export { TimelineHandle }
|
|
639
|
+
export { TimelineHandle as TimelineHandle_alias_1 }
|
|
640
|
+
|
|
641
|
+
export declare const TimelinePrimary: () => React_2.JSX.Element;
|
|
642
|
+
|
|
643
|
+
declare type TimelineProps = {
|
|
644
|
+
rows: RowType[];
|
|
645
|
+
events: EventType[];
|
|
646
|
+
staticEvents?: EventType[];
|
|
647
|
+
startDate: Date;
|
|
648
|
+
endDate: Date;
|
|
649
|
+
onDrop?: (props: OnDropProps) => void;
|
|
650
|
+
onResize?: (props: OnResizeProps) => void;
|
|
651
|
+
onEventClick?: (props: OnEventClickProps) => void;
|
|
652
|
+
onEventHover?: (props: OnEventHoverProps) => void;
|
|
653
|
+
theme?: Theme;
|
|
654
|
+
drawEvent?: DrawEventFn;
|
|
655
|
+
/** only `rowsHeader` still applies — everything else is canvas-drawn (use `theme`) */
|
|
656
|
+
additionalClassNames?: PartialRecord<keyof ModifableElements, string>;
|
|
657
|
+
showRTIndicator?: boolean;
|
|
658
|
+
eventsResize?: boolean;
|
|
659
|
+
showEventPrompt?: boolean;
|
|
660
|
+
eventPromptTemplate?: (event: EventType) => JSX.Element;
|
|
661
|
+
panZoom?: PanZoomConfig;
|
|
662
|
+
/** layout animations: true (default), false to disable, or durations */
|
|
663
|
+
animations?: AnimationConfig;
|
|
664
|
+
};
|
|
665
|
+
export { TimelineProps }
|
|
666
|
+
export { TimelineProps as TimelineProps_alias_1 }
|
|
667
|
+
|
|
668
|
+
/**
|
|
669
|
+
* Owns the two viewport-sized canvases and the frame loop.
|
|
670
|
+
*
|
|
671
|
+
* - static layer: grid lines, day/hour bands, time bar (Phase 2)
|
|
672
|
+
* - dynamic layer: events (Phase 3)
|
|
673
|
+
*
|
|
674
|
+
* React pushes view-state via setView(); the SceneStore pushes data changes
|
|
675
|
+
* via its subscription. Both only flip dirty flags — actual drawing happens
|
|
676
|
+
* once per animation frame.
|
|
677
|
+
*/
|
|
678
|
+
export declare class TimelineRenderer {
|
|
679
|
+
private staticCanvas;
|
|
680
|
+
private dynamicCanvas;
|
|
681
|
+
private scene;
|
|
682
|
+
private view;
|
|
683
|
+
readonly animator: LayoutAnimator;
|
|
684
|
+
private scheduler;
|
|
685
|
+
private unsubscribeScene;
|
|
686
|
+
private unwatchDpr;
|
|
687
|
+
private dpr;
|
|
688
|
+
private font;
|
|
689
|
+
constructor(staticCanvas: HTMLCanvasElement, dynamicCanvas: HTMLCanvasElement, scene: SceneStore);
|
|
690
|
+
getView(): RendererView;
|
|
691
|
+
setView(partial: Partial<RendererView>): void;
|
|
692
|
+
invalidate(layer: Layer | "all"): void;
|
|
693
|
+
/** Force a synchronous draw of anything pending (tests, screenshots). */
|
|
694
|
+
flush(): void;
|
|
695
|
+
dispose(): void;
|
|
696
|
+
private resizeCanvases;
|
|
697
|
+
private drawFrame;
|
|
698
|
+
}
|
|
699
|
+
|
|
700
|
+
/**
|
|
701
|
+
* 10k events across 500 rows with a fake websocket pushing 200 random
|
|
702
|
+
* event moves every 100ms through the imperative handle — zero React
|
|
703
|
+
* re-renders of the board on the hot path.
|
|
704
|
+
*/
|
|
705
|
+
export declare const TimelineStreaming10k: () => React_2.JSX.Element;
|
|
706
|
+
|
|
707
|
+
/** @deprecated renamed to TimelineProps in 0.2.0 */
|
|
708
|
+
declare type TimelineType = TimelineProps;
|
|
709
|
+
export { TimelineType }
|
|
710
|
+
export { TimelineType as TimelineType_alias_1 }
|
|
711
|
+
|
|
712
|
+
export declare const timeToWidth: (startTime: number, endTime: number, tick: number) => number;
|
|
713
|
+
|
|
714
|
+
export declare const timeToX: (time: number, windowStart: number, tick: number) => number;
|
|
715
|
+
|
|
716
|
+
declare type UseCanvasInteractionsArgs = {
|
|
717
|
+
scene: SceneStore;
|
|
718
|
+
rendererRef: React_2.MutableRefObject<TimelineRenderer | null>;
|
|
719
|
+
dynamicCanvasRef: React_2.MutableRefObject<HTMLCanvasElement | null>;
|
|
720
|
+
bodyRef: React_2.MutableRefObject<HTMLDivElement | null>;
|
|
721
|
+
ghostRef: React_2.MutableRefObject<HTMLDivElement | null>;
|
|
722
|
+
eventPromptRef: React_2.MutableRefObject<EventPromptActionsType | null>;
|
|
723
|
+
setWindowTime: React_2.Dispatch<React_2.SetStateAction<number[]>>;
|
|
724
|
+
setCellWidth: React_2.Dispatch<React_2.SetStateAction<number>>;
|
|
725
|
+
onDrop?: (props: OnDropProps) => void;
|
|
726
|
+
onResize?: (props: OnResizeProps) => void;
|
|
727
|
+
onEventClick?: (props: OnEventClickProps) => void;
|
|
728
|
+
onEventHover?: (props: OnEventHoverProps) => void;
|
|
729
|
+
eventsResize: boolean;
|
|
730
|
+
panZoom?: PanZoomConfig;
|
|
731
|
+
};
|
|
732
|
+
|
|
733
|
+
/** Notifies when devicePixelRatio changes (browser zoom, monitor switch). */
|
|
734
|
+
export declare const watchDpr: (onChange: (dpr: number) => void) => (() => void);
|
|
735
|
+
|
|
736
|
+
export declare const xToTime: (x: number, windowStart: number, tick: number) => number;
|
|
737
|
+
|
|
738
|
+
export { }
|