saccade 0.0.1

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.
@@ -0,0 +1,152 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import * as react from 'react';
3
+ import { ReactNode } from 'react';
4
+
5
+ type LapsePosition = 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
6
+ type LapseProps = {
7
+ /** Panel position. Default: 'bottom-left' */
8
+ position?: LapsePosition;
9
+ };
10
+ declare function Lapse({ position }: LapseProps): react_jsx_runtime.JSX.Element;
11
+
12
+ type ExportFilter = 'active' | 'all-animations' | 'all-elements';
13
+ type OutputDetailLevel = 'compact' | 'standard' | 'detailed' | 'forensic';
14
+ type Rect = {
15
+ x: number;
16
+ y: number;
17
+ width: number;
18
+ height: number;
19
+ };
20
+ type AnimationInfo = {
21
+ id: string;
22
+ name: string;
23
+ selector: string;
24
+ elementLabel: string;
25
+ duration: number;
26
+ delay: number;
27
+ easing: string;
28
+ type: string;
29
+ source: string | null;
30
+ resolvedVars: Record<string, string> | null;
31
+ conflicts: string[] | null;
32
+ layoutAnimation?: boolean;
33
+ };
34
+ type PropertySnapshot = {
35
+ property: string;
36
+ value: string;
37
+ from: string | null;
38
+ to: string | null;
39
+ };
40
+ type FrameAnimation = {
41
+ animationId: string;
42
+ currentTime: number;
43
+ progress: number;
44
+ properties: PropertySnapshot[];
45
+ };
46
+ type ElementSnapshot = {
47
+ __styles: Record<string, string>;
48
+ __attrs: Record<string, string | null>;
49
+ __afterOpacity?: string;
50
+ __beforeOpacity?: string;
51
+ };
52
+ type FrameSnapshot = {
53
+ time: number;
54
+ animations: FrameAnimation[];
55
+ elementSnapshots: Record<string, ElementSnapshot>;
56
+ activePortalIds: string[];
57
+ hoveredSels: string[];
58
+ focusSel: string | null;
59
+ pointer: {
60
+ x: number;
61
+ y: number;
62
+ buttons: number;
63
+ };
64
+ scrollPositions: Record<string, {
65
+ x: number;
66
+ y: number;
67
+ }>;
68
+ };
69
+ type TimelineCapture = {
70
+ startTime: number;
71
+ endTime: number;
72
+ duration: number;
73
+ animations: AnimationInfo[];
74
+ frames: FrameSnapshot[];
75
+ boundingBox: Rect | null;
76
+ };
77
+ type TimelineExport = {
78
+ timestamp: string;
79
+ duration: string;
80
+ scrubPosition: number;
81
+ hoveredElements: string[];
82
+ focusedElement: string | null;
83
+ animations: {
84
+ element: string;
85
+ elementLabel: string;
86
+ name: string;
87
+ type: string;
88
+ timing: string;
89
+ progress: string;
90
+ properties: {
91
+ property: string;
92
+ value: string;
93
+ range: string;
94
+ }[];
95
+ source: string | null;
96
+ resolvedVars: Record<string, string> | null;
97
+ conflicts: string[] | null;
98
+ }[];
99
+ };
100
+
101
+ type LapseState = 'idle' | 'recording' | 'scrubbing';
102
+ declare class LapseEngine {
103
+ private timing;
104
+ private recorder;
105
+ private scrubber;
106
+ private capture;
107
+ private _state;
108
+ private listeners;
109
+ get state(): LapseState;
110
+ getCapture(): TimelineCapture | null;
111
+ setSpeed(speed: number): void;
112
+ getSpeed(): number;
113
+ startRecording(boundingBox?: Rect | null): void;
114
+ stopRecording(): TimelineCapture;
115
+ seekTo(timeMs: number): void;
116
+ release(): void;
117
+ generateExport(timeMs: number, filter?: ExportFilter): TimelineExport | null;
118
+ exportForLLM(timeMs: number, filter?: ExportFilter, detail?: OutputDetailLevel): string;
119
+ subscribe(listener: () => void): () => void;
120
+ private notify;
121
+ destroy(): void;
122
+ }
123
+
124
+ declare function LapseProvider({ children }: {
125
+ children: ReactNode;
126
+ }): react_jsx_runtime.JSX.Element;
127
+ declare function useLapseEngine(): LapseEngine;
128
+
129
+ declare function useTimeline(): {
130
+ state: LapseState;
131
+ capture: TimelineCapture | null;
132
+ scrubTime: number;
133
+ copied: boolean;
134
+ exportFilter: ExportFilter;
135
+ setExportFilter: react.Dispatch<react.SetStateAction<ExportFilter>>;
136
+ detailLevel: OutputDetailLevel;
137
+ cycleDetailLevel: () => void;
138
+ startRecording: (boundingBox?: Rect | null) => void;
139
+ stopRecording: () => void;
140
+ seek: (timeMs: number) => void;
141
+ release: () => void;
142
+ exportLLM: (filter?: ExportFilter) => string;
143
+ };
144
+
145
+ declare function useSpeed(): {
146
+ speed: number;
147
+ isPaused: boolean;
148
+ setSpeed: (value: number) => void;
149
+ togglePause: () => void;
150
+ };
151
+
152
+ export { type AnimationInfo, type ExportFilter, type FrameSnapshot, Lapse, LapseEngine, type LapsePosition, type LapseProps, LapseProvider, type LapseState, type OutputDetailLevel, type Rect, type TimelineCapture, type TimelineExport, useLapseEngine, useSpeed, useTimeline };