summaryrefslogtreecommitdiff
path: root/.cursor/rules/codebase-index.mdc
blob: cd6ed84b8c01a9e265d66c6c8c7b9d4801ff4b6b (plain) (blame)
1
2
3
4
5
6
7
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
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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
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
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
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
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
---
alwaysApply: true
---

# video-editor-oss Codebase Index

**This file provides an index of exported functions, types, interfaces, classes, and constants in your codebase.**

Updated in real-time by Twiggy. Use this to discover existing utilities and avoid duplicating code.

## How to Use

When implementing new features:
1. Check if similar functionality already exists
2. Reuse existing types and utilities
3. Understand the API surface of your codebase

```typescript
## apps/web/src/components/editor/timeline

audio-waveform.tsx
  export function AudioWaveform({

  	audioUrl,

  	audioBuffer,

  	height = 32,

  	className = "",

  }: AudioWaveformProps)

## apps/web/src/constants

editor-constants.ts
  export const PLATFORM_LAYOUTS: Record<TPlatformLayout, string>
  export const PANEL_CONFIG

export-constants.ts
  export const DEFAULT_EXPORT_OPTIONS
  export const EXPORT_MIME_TYPES

font-constants.ts
  export interface FontOption {
    value: string
    label: string
    category: "system" | "google" | "custom"
    weights?: number[]
    hasClassName?: boolean
  }
  export const FONT_OPTIONS: FontOption[]
  export const DEFAULT_FONT
  export type FontFamily = (typeof FONT_OPTIONS)[number]["value"]
  export const getFontByValue = (value: string): FontOption | undefined => ...
  export const getGoogleFonts = (): FontOption[] => ...
  export const getSystemFonts = (): FontOption[] => ...

language-constants.ts
  export const LANGUAGES

project-constants.ts
  export const DEFAULT_CANVAS_PRESETS: TCanvasSize[]
  export const FPS_PRESETS
  export const BLUR_INTENSITY_PRESETS: { label: string; value: number }[]
  export const DEFAULT_CANVAS_SIZE: TCanvasSize
  export const DEFAULT_FPS
  export const DEFAULT_BLUR_INTENSITY
  export const DEFAULT_COLOR

site-constants.ts
  export const SITE_URL
  export const SITE_INFO
  export type ExternalTool = {

  	name: string;

  	description: string;

  	url: string;

  	icon: React.ElementType;

  }
  export const EXTERNAL_TOOLS: ExternalTool[]
  export const DEFAULT_LOGO_URL
  export const SOCIAL_LINKS
  export type Sponsor = {

  	name: string;

  	url: string;

  	logo: string;

  	description: string;

  }
  export const SPONSORS: Sponsor[]

stickers-constants.ts
  export const STICKER_CATEGORIES
  export const STICKER_CATEGORY_CONFIG: Record<

  	(typeof STICKER_CATEGORIES)[number],

  	string | undefined

  >

text-constants.ts
  export const DEFAULT_TEXT_ELEMENT: Omit<TextElement, "id">

timeline-constants.tsx
  export const TRACK_COLORS: Record<TrackType, { background: string }>
  export const TRACK_HEIGHTS: Record<TrackType, number>
  export const TRACK_GAP
  export const TIMELINE_CONSTANTS
  export const DEFAULT_TIMELINE_VIEW_STATE: TTimelineViewState
  export const TRACK_ICONS: Record<TrackType, React.ReactNode>

transcription-constants.ts
  export const TRANSCRIPTION_LANGUAGES
  export const TRANSCRIPTION_MODELS: TranscriptionModel[]
  export const DEFAULT_TRANSCRIPTION_MODEL: TranscriptionModelId
  export const DEFAULT_CHUNK_LENGTH_SECONDS
  export const DEFAULT_STRIDE_SECONDS
  export const DEFAULT_WORDS_PER_CAPTION
  export const MIN_CAPTION_DURATION_SECONDS

## apps/web/src/core

index.ts
  export class EditorCore {
    instance: EditorCore | null
    command: CommandManager
    playback: PlaybackManager
    timeline: TimelineManager
    scenes: ScenesManager
    project: ProjectManager
    media: MediaManager
    renderer: RendererManager
    save: SaveManager
    audio: AudioManager
    selection: SelectionManager
    static getInstance(): EditorCore
    static reset(): void
  }

## apps/web/src/hooks

use-editor.ts
  export function useEditor(): EditorCore

use-file-upload.ts
  export function useFileUpload({

  	accept,

  	multiple,

  	onFilesSelected,

  }: UseFileUploadOptions = {})

use-infinite-scroll.ts
  export function useInfiniteScroll({

  	onLoadMore,

  	hasMore,

  	isLoading,

  	threshold = 200,

  	enabled = true,

  }: UseInfiniteScrollOptions)

use-keybindings.ts
  export function useKeybindingsListener()
  export function useKeybindingDisabler()

use-keyboard-shortcuts-help.ts
  export interface KeyboardShortcut {
    id: string
    keys: string[]
    description: string
    category: string
    action: TAction
    icon?: React.ReactNode
  }
  export function useKeyboardShortcutsHelp()

use-mobile.ts
  export function useIsMobile()

use-raf-loop.ts
  export function useRafLoop(callback: ({ time }: { time: number }) => void)

use-reveal-item.ts
  export function useRevealItem(

  	highlightId: string | null,

  	onClearHighlight: () => void,

  	highlightDuration = 1000,

  )

use-sound-search.ts
  export function useSoundSearch({

  	query,

  	commercialOnly,

  }: {

  	query: string;

  	commercialOnly: boolean;

  })

## apps/web/src/hooks/actions

use-action-handler.ts
  export function useActionHandler(

  	action: A,

  	handler: TActionFunc<A>,

  	isActive: TActionHandlerOptions,

  )

use-editor-actions.ts
  export function useEditorActions()

## apps/web/src/hooks/storage

use-local-storage.ts
  export function useLocalStorage({

  	key,

  	defaultValue,

  }: {

  	key: string;

  	defaultValue: T;

  }): [

  	T,

  	({ value }: { value: T | ((previousValue: T) => T) }) => void,

  	boolean,

  ]

## apps/web/src/hooks/timeline

use-edge-auto-scroll.ts
  export function useEdgeAutoScroll({

  	isActive,

  	getMouseClientX,

  	rulerScrollRef,

  	tracksScrollRef,

  	contentWidth,

  	edgeThreshold = 100,

  	maxScrollSpeed = 15,

  }: UseEdgeAutoScrollParams): void

use-scroll-sync.ts
  export function useScrollSync({

  	tracksScrollRef,

  	rulerScrollRef,

  	trackLabelsScrollRef,

  	bookmarksScrollRef,

  }: UseScrollSyncProps)

use-selection-box.ts
  export function useSelectionBox({

  	containerRef,

  	onSelectionComplete,

  	isEnabled = true,

  	tracksScrollRef,

  	zoomLevel,

  }: UseSelectionBoxProps)

use-snap-indicator-position.ts
  export function useSnapIndicatorPosition({

  	snapPoint,

  	zoomLevel,

  	tracks,

  	timelineRef,

  	trackLabelsRef,

  	tracksScrollRef,

  }: UseSnapIndicatorPositionParams): SnapIndicatorPosition

use-timeline-drag-drop.ts
  export function useTimelineDragDrop({

  	containerRef,

  	headerRef,

  	zoomLevel,

  }: UseTimelineDragDropProps)

use-timeline-playhead.ts
  export function useTimelinePlayhead({

  	zoomLevel,

  	rulerRef,

  	rulerScrollRef,

  	tracksScrollRef,

  	playheadRef,

  }: UseTimelinePlayheadProps)

use-timeline-seek.ts
  export function useTimelineSeek({

  	playheadRef,

  	trackLabelsRef,

  	rulerScrollRef,

  	tracksScrollRef,

  	zoomLevel,

  	duration,

  	isSelecting,

  	clearSelectedElements,

  	seek,

  }: UseTimelineSeekProps)

use-timeline-snapping.ts
  export interface SnapPoint {
    time: number
    type: "element-start" | "element-end" | "playhead"
    elementId?: string
    trackId?: string
  }
  export interface SnapResult {
    snappedTime: number
    snapPoint: SnapPoint | null
    snapDistance: number
  }
  export interface UseTimelineSnappingOptions {
    snapThreshold?: number
    enableElementSnapping?: boolean
    enablePlayheadSnapping?: boolean
  }
  export function useTimelineSnapping({

  	snapThreshold = 10,

  	enableElementSnapping = true,

  	enablePlayheadSnapping = true,

  }: UseTimelineSnappingOptions = {})

use-timeline-zoom.ts
  export function useTimelineZoom({

  	containerRef,

  	minZoom = TIMELINE_CONSTANTS.ZOOM_MIN,

  	initialZoom,

  	initialScrollLeft,

  	initialPlayheadTime,

  	tracksScrollRef,

  	rulerScrollRef,

  }: UseTimelineZoomProps): UseTimelineZoomReturn

## apps/web/src/hooks/timeline/element

use-element-interaction.ts
  export function useElementInteraction({

  	zoomLevel,

  	timelineRef,

  	tracksContainerRef,

  	tracksScrollRef,

  	headerRef,

  	snappingEnabled,

  	onSnapPointChange,

  }: UseElementInteractionProps)

use-element-resize.ts
  export interface ResizeState {
    elementId: string
    side: "left" | "right"
    startX: number
    initialTrimStart: number
    initialTrimEnd: number
    initialStartTime: number
    initialDuration: number
  }
  export function useTimelineElementResize({

  	element,

  	track,

  	zoomLevel,

  	onSnapPointChange,

  	onResizeStateChange,

  }: UseTimelineElementResizeProps)

use-element-selection.ts
  export function useElementSelection()

## apps/web/src/lib

drag-data.ts
  export function setDragData({

  	dataTransfer,

  	dragData,

  }: {

  	dataTransfer: DataTransfer;

  	dragData: TimelineDragData;

  }): void
  export function getDragData({

  	dataTransfer,

  }: {

  	dataTransfer: DataTransfer;

  }): TimelineDragData | null
  export function hasDragData({

  	dataTransfer,

  }: {

  	dataTransfer: DataTransfer;

  }): boolean
  export function clearDragData(): void

export.ts
  export function getExportMimeType({

  	format,

  }: {

  	format: ExportFormat;

  }): string
  export function getExportFileExtension({

  	format,

  }: {

  	format: ExportFormat;

  }): string

iconify-api.ts
  export const ICONIFY_HOSTS
  export interface IconSet {
    prefix: string
    name: string
    total: number
    author?: {

  		name: string;

  		url?: string;

  	}
    license?: {

  		title: string;

  		spdx?: string;

  		url?: string;

  	}
    samples?: string[]
    category?: string
    palette?: boolean
  }
  export interface IconSearchResult {
    icons: string[]
    total: number
    limit: number
    start: number
    collections: Record<string, IconSet>
  }
  export interface CollectionInfo {
    prefix: string
    total: number
    title?: string
    uncategorized?: string[]
    categories?: Record<string, string[]>
    hidden?: string[]
    aliases?: Record<string, string>
  }
  export function getCollections(

  	category?: string,

  ): Promise<Record<string, IconSet>>
  export function getCollection(

  	prefix: string,

  ): Promise<CollectionInfo | null>
  export function searchIcons(

  	query: string,

  	limit: number = 64,

  	prefixes?: string[],

  	category?: string,

  ): Promise<IconSearchResult>
  export function buildIconSvgUrl(

  	host: string,

  	iconName: string,

  	params?: {

  		color?: string;

  		width?: number;

  		height?: number;

  		flip?: "horizontal" | "vertical" | "horizontal,vertical";

  		rotate?: number | string;

  	},

  ): string
  export function getIconSvgUrl(

  	iconName: string,

  	params?: Parameters<typeof buildIconSvgUrl>[2],

  ): string
  export function downloadSvgAsText(

  	iconName: string,

  	params?: Parameters<typeof getIconSvgUrl>[1],

  ): Promise<string>
  export function svgToFile(svgText: string, fileName: string): File
  export const POPULAR_COLLECTIONS
  export function getCategoriesFromCollections(

  	collections: Record<string, IconSet>,

  ): string[]

rate-limit.ts
  export const baseRateLimit
  export function checkRateLimit({ request }: { request: Request })

scenes.ts
  export function getMainScene({ scenes }: { scenes: TScene[] }): TScene | null
  export function ensureMainScene({ scenes }: { scenes: TScene[] }): TScene[]
  export function buildDefaultScene({

  	name,

  	isMain,

  }: {

  	name: string;

  	isMain: boolean;

  }): TScene
  export function canDeleteScene({ scene }: { scene: TScene }): {

  	canDelete: boolean;

  	reason?: string;

  }
  export function getFallbackSceneAfterDelete({

  	scenes,

  	deletedSceneId,

  	currentSceneId,

  }: {

  	scenes: TScene[];

  	deletedSceneId: string;

  	currentSceneId: string | null;

  }): TScene | null
  export function findCurrentScene({

  	scenes,

  	currentSceneId,

  }: {

  	scenes: TScene[];

  	currentSceneId: string;

  }): TScene | null
  export function getProjectDurationFromScenes({

  	scenes,

  }: {

  	scenes: TScene[];

  }): number
  export function updateSceneInArray({

  	scenes,

  	sceneId,

  	updates,

  }: {

  	scenes: TScene[];

  	sceneId: string;

  	updates: Partial<TScene>;

  }): TScene[]

time.ts
  export function roundToFrame({
  	time,
  	fps,
  }: {
  	time: number;
  	fps: number;
  }): number
  export function formatTimeCode({
  	timeInSeconds,
  	format = "HH:MM:SS:CS",
  	fps,
  }: {
  	timeInSeconds: number;
  	format?: TTimeCode;
  	fps?: number;
  }): string
  export function parseTimeCode({
  	timeCode,
  	format = "HH:MM:SS:CS",
  	fps,
  }: {
  	timeCode: string;
  	format?: TTimeCode;
  	fps: number;
  }): number | null
  export function guessTimeCodeFormat({
  	timeCode,
  }: {
  	timeCode: string;
  }): TTimeCode | null
  export function timeToFrame({
  	time,
  	fps,
  }: {
  	time: number;
  	fps: number;
  }): number
  export function frameToTime({
  	frame,
  	fps,
  }: {
  	frame: number;
  	fps: number;
  }): number
  export function snapTimeToFrame({
  	time,
  	fps,
  }: {
  	time: number;
  	fps: number;
  }): number
  export function getSnappedSeekTime({
  	rawTime,
  	duration,
  	fps,
  }: {
  	rawTime: number;
  	duration: number;
  	fps: number;
  }): number
  export function getLastFrameTime({
  	duration,
  	fps,
  }: {
  	duration: number;
  	fps: number;
  }): number

## apps/web/src/lib/actions

definitions.ts
  export type TActionCategory = | "playback"

  	| "navigation"

  	| "editing"

  	| "selection"

  	| "history"

  	| "timeline"

  	| "con...
  export interface TActionDefinition {
    description: string
    category: TActionCategory
    defaultShortcuts?: ShortcutKey[]
    args?: Record<string, unknown>
  }
  export const ACTIONS
  export type TAction = keyof typeof ACTIONS
  export function getActionDefinition(action: TAction): TActionDefinition
  export function getDefaultShortcuts(): Record<ShortcutKey, TAction>

registry.ts
  export function bindAction(

  	action: A,

  	handler: TActionFunc<A>,

  )
  export function unbindAction(

  	action: A,

  	handler: TActionFunc<A>,

  )
  export const invokeAction = (

  	action: A,

  	args?: TArgOfAction<A>,

  	trigger?: TInvocationTrigger,

  ) => ...

types.ts
  export type TActionArgsMap = {

  	"seek-forward": { seconds: number } | undefined;

  	"seek-backward": { seconds: number } | und...
  export type TActionWithArgs = keyof TActionArgsMap
  export type TActionWithOptionalArgs = | TActionWithNoArgs

  	| TKeysWithValueUndefined<TActionArgsMap>
  export type TActionWithNoArgs = Exclude<TAction, TActionWithArgs>
  export type TArgOfAction<A extends TAction> = A extends TActionWithArgs

  	? TActionArgsMap[A]

  	: undefined
  export type TActionFunc<A extends TAction> = A extends TActionWithArgs

  	? (arg: TArgOfAction<A>, trigger?: TInvocationTrigger) => void

  	: (_...
  export type TInvocationTrigger = "keypress" | "mouseclick"
  export type TBoundActionList = {

  	[A in TAction]?: Array<TActionFunc<A>>;

  }
  export type TActionHandlerOptions = | MutableRefObject<boolean>

  	| boolean

  	| undefined

## apps/web/src/lib/auth

server.ts
  export const auth
  export type Auth = typeof auth

## apps/web/src/lib/blog

query.ts
  export function getPosts()
  export function getTags()
  export function getSinglePost({ slug }: { slug: string })
  export function getCategories()
  export function getAuthors()
  export function processHtmlContent({

  	html,

  }: {

  	html: string;

  }): Promise<string>

## apps/web/src/lib/db

index.ts
  export const db

schema.ts
  export const users
  export const sessions
  export const accounts
  export const verifications

## apps/web/src/lib/gradients

canvas.ts
  export function drawCssBackground({

  	ctx,

  	width,

  	height,

  	css,

  }: {

  	ctx: CanvasRenderingContext2D | OffscreenCanvasRenderingContext2D;

  	width: number;

  	height: number;

  	css: string;

  }): void

parser.ts
  export type GradientOrientation = LinearOrientation | Array<RadialOrientation>
  export type Color = | { type: "hex"; value: string }

  	| { type: "literal"; value: string }

  	| { type: "rgb"; value:...
  export type ColorStop = Color & { length?: Distance }
  export type GradientAst = {

  	type: GradientType;

  	orientation: GradientOrientation | undefined;

  	colorStops: Array<Color...
  export const parseGradient = ({

  	code,

  }: {

  	code: string;

  }): Array<GradientAst> => ...
  export const GradientParser

## apps/web/src/lib/media

audio.ts
  export type CollectedAudioElement = Omit<

  	AudioElement,

  	"type" | "mediaId" | "volume" | "id" | "name" | "sourceType" | "sourceUrl...
  export function createAudioContext(): AudioContext
  export interface DecodedAudio {
    samples: Float32Array
    sampleRate: number
  }
  export function decodeAudioToFloat32({

  	audioBlob,

  }: {

  	audioBlob: Blob;

  }): Promise<DecodedAudio>
  export function collectAudioElements({

  	tracks,

  	mediaAssets,

  	audioContext,

  }: {

  	tracks: TimelineTrack[];

  	mediaAssets: MediaAsset[];

  	audioContext: AudioContext;

  }): Promise<CollectedAudioElement[]>
  export interface AudioClipSource {
    id: string
    sourceKey: string
    file: File
    startTime: number
    duration: number
    trimStart: number
    trimEnd: number
    muted: boolean
  }
  export function collectAudioMixSources({

  	tracks,

  	mediaAssets,

  }: {

  	tracks: TimelineTrack[];

  	mediaAssets: MediaAsset[];

  }): Promise<AudioMixSource[]>
  export function collectAudioClips({

  	tracks,

  	mediaAssets,

  }: {

  	tracks: TimelineTrack[];

  	mediaAssets: MediaAsset[];

  }): Promise<AudioClipSource[]>
  export function createTimelineAudioBuffer({

  	tracks,

  	mediaAssets,

  	duration,

  	sampleRate = 44100,

  	audioContext,

  }: {

  	tracks: TimelineTrack[];

  	mediaAssets: MediaAsset[];

  	duration: number;

  	sampleRate?: number;

  	audioContext?: AudioContext;

  }): Promise<AudioBuffer | null>

media-utils.ts
  export const SUPPORTS_AUDIO: readonly MediaType[]
  export function mediaSupportsAudio({

  	media,

  }: {

  	media: MediaAsset | null | undefined;

  }): boolean
  export const getMediaTypeFromFile = ({

  	file,

  }: {

  	file: File;

  }): MediaType | null => ...

mediabunny.ts
  export function getVideoInfo({

  	videoFile,

  }: {

  	videoFile: File;

  }): Promise<{

  	duration: number;

  	width: number;

  	height: number;

  	fps: number;

  }>
  export const extractTimelineAudio = ({

  	tracks,

  	mediaAssets,

  	totalDuration,

  	onProgress,

  }: {

  	tracks: TimelineTrack[];

  	mediaAssets: MediaAsset[];

  	totalDuration: number;

  	onProgress?: (progress: number) => void;

  }): Promise<Blob> => ...

processing.ts
  export interface ProcessedMediaAsset extends Omit<MediaAsset, "id">
  export function generateThumbnail({

  	videoFile,

  	timeInSeconds,

  }: {

  	videoFile: File;

  	timeInSeconds: number;

  }): Promise<string>
  export function generateImageThumbnail({

  	imageFile,

  }: {

  	imageFile: File;

  }): Promise<string>
  export function processMediaAssets({

  	files,

  	onProgress,

  }: {

  	files: FileList | File[];

  	onProgress?: ({ progress }: { progress: number }) => void;

  }): Promise<ProcessedMediaAsset[]>

## apps/web/src/lib/timeline

bookmarks.ts
  export function findBookmarkIndex({

  	bookmarks,

  	frameTime,

  }: {

  	bookmarks: number[];

  	frameTime: number;

  }): number
  export function isBookmarkAtTime({

  	bookmarks,

  	frameTime,

  }: {

  	bookmarks: number[];

  	frameTime: number;

  }): boolean
  export function toggleBookmarkInArray({

  	bookmarks,

  	frameTime,

  }: {

  	bookmarks: number[];

  	frameTime: number;

  }): number[]
  export function removeBookmarkFromArray({

  	bookmarks,

  	frameTime,

  }: {

  	bookmarks: number[];

  	frameTime: number;

  }): number[]
  export function getFrameTime({

  	time,

  	fps,

  }: {

  	time: number;

  	fps: number;

  }): number

drop-utils.ts
  export function computeDropTarget({

  	elementType,

  	mouseX,

  	mouseY,

  	tracks,

  	playheadTime,

  	isExternalDrop,

  	elementDuration,

  	pixelsPerSecond,

  	zoomLevel,

  	verticalDragDirection,

  	startTimeOverride,

  	excludeElementId,

  }: ComputeDropTargetParams): DropTarget
  export function getDropLineY({

  	dropTarget,

  	tracks,

  }: {

  	dropTarget: DropTarget;

  	tracks: TimelineTrack[];

  }): number

element-utils.ts
  export function canElementHaveAudio(

  	element: TimelineElement,

  )
  export function canElementBeHidden(

  	element: TimelineElement,

  )
  export function hasMediaId(

  	element: TimelineElement,

  )
  export function requiresMediaId({

  	element,

  }: {

  	element: CreateTimelineElement;

  }): boolean
  export function checkElementOverlaps({

  	elements,

  }: {

  	elements: TimelineElement[];

  }): boolean
  export function resolveElementOverlaps({

  	elements,

  }: {

  	elements: TimelineElement[];

  }): TimelineElement[]
  export function wouldElementOverlap({

  	elements,

  	startTime,

  	endTime,

  	excludeElementId,

  }: {

  	elements: TimelineElement[];

  	startTime: number;

  	endTime: number;

  	excludeElementId?: string;

  }): boolean
  export function buildTextElement({

  	raw,

  	startTime,

  }: {

  	raw: Partial<Omit<TextElement, "type" | "id">>;

  	startTime: number;

  }): CreateTimelineElement
  export function buildStickerElement({

  	iconName,

  	startTime,

  }: {

  	iconName: string;

  	startTime: number;

  }): CreateStickerElement
  export function buildVideoElement({

  	mediaId,

  	name,

  	duration,

  	startTime,

  }: {

  	mediaId: string;

  	name: string;

  	duration: number;

  	startTime: number;

  }): CreateVideoElement
  export function buildImageElement({

  	mediaId,

  	name,

  	duration,

  	startTime,

  }: {

  	mediaId: string;

  	name: string;

  	duration: number;

  	startTime: number;

  }): CreateImageElement
  export function buildUploadAudioElement({

  	mediaId,

  	name,

  	duration,

  	startTime,

  	buffer,

  }: {

  	mediaId: string;

  	name: string;

  	duration: number;

  	startTime: number;

  	buffer?: AudioBuffer;

  }): CreateUploadAudioElement
  export function buildLibraryAudioElement({

  	sourceUrl,

  	name,

  	duration,

  	startTime,

  	buffer,

  }: {

  	sourceUrl: string;

  	name: string;

  	duration: number;

  	startTime: number;

  	buffer?: AudioBuffer;

  }): CreateLibraryAudioElement
  export function getElementsAtTime({

  	tracks,

  	time,

  }: {

  	tracks: TimelineTrack[];

  	time: number;

  }): { trackId: string; elementId: string }[]

index.ts
  export function calculateTotalDuration({
  	tracks,
  }: {
  	tracks: TimelineTrack[];
  }): number

ruler-utils.ts
  export interface RulerConfig {
    labelIntervalSeconds: number
    tickIntervalSeconds: number
  }
  export function getRulerConfig({

  	zoomLevel,

  	fps,

  }: {

  	zoomLevel: number;

  	fps: number;

  }): RulerConfig
  export function shouldShowLabel({

  	time,

  	labelIntervalSeconds,

  }: {

  	time: number;

  	labelIntervalSeconds: number;

  }): boolean
  export function formatRulerLabel({

  	timeInSeconds,

  	fps,

  }: {

  	timeInSeconds: number;

  	fps: number;

  }): string

track-utils.ts
  export function canTracktHaveAudio(

  	track: TimelineTrack,

  )
  export function canTrackBeHidden(

  	track: TimelineTrack,

  )
  export function getTrackColor({ type }: { type: TrackType })
  export function getTrackClasses({ type }: { type: TrackType })
  export function getTrackHeight({ type }: { type: TrackType }): number
  export function getCumulativeHeightBefore({

  	tracks,

  	trackIndex,

  }: {

  	tracks: Array<{ type: TrackType }>;

  	trackIndex: number;

  }): number
  export function getTotalTracksHeight({

  	tracks,

  }: {

  	tracks: Array<{ type: TrackType }>;

  }): number
  export function buildEmptyTrack({

  	id,

  	type,

  	name,

  }: {

  	id: string;

  	type: TrackType;

  	name?: string;

  }): TimelineTrack
  export function getDefaultInsertIndexForTrack({

  	tracks,

  	trackType,

  }: {

  	tracks: TimelineTrack[];

  	trackType: TrackType;

  }): number
  export function getHighestInsertIndexForTrack({

  	tracks,

  	trackType,

  }: {

  	tracks: TimelineTrack[];

  	trackType: TrackType;

  }): number
  export function isMainTrack(track: TimelineTrack)
  export function getMainTrack({

  	tracks,

  }: {

  	tracks: TimelineTrack[];

  }): TimelineTrack | null
  export function ensureMainTrack({

  	tracks,

  }: {

  	tracks: TimelineTrack[];

  }): TimelineTrack[]
  export function canElementGoOnTrack({

  	elementType,

  	trackType,

  }: {

  	elementType: ElementType;

  	trackType: TrackType;

  }): boolean
  export function validateElementTrackCompatibility({

  	element,

  	track,

  }: {

  	element: { type: ElementType };

  	track: { type: TrackType };

  }): { isValid: boolean; errorMessage?: string }

zoom-utils.ts
  export function getTimelineZoomMin({
  	duration,
  	containerWidth,
  }: {
  	duration: number;
  	containerWidth: number | null | undefined;
  }): number
  export function getTimelinePaddingPx({
  	containerWidth,
  	zoomLevel,
  	minZoom,
  }: {
  	containerWidth: number;
  	zoomLevel: number;
  	minZoom: number;
  }): number
  export function getZoomPercent({
  	zoomLevel,
  	minZoom,
  }: {
  	zoomLevel: number;
  	minZoom: number;
  }): number

## apps/web/src/lib/transcription

caption.ts
  export function buildCaptionChunks({

  	segments,

  	wordsPerChunk = DEFAULT_WORDS_PER_CAPTION,

  	minDuration = MIN_CAPTION_DURATION_SECONDS,

  }: {

  	segments: TranscriptionSegment[];

  	wordsPerChunk?: number;

  	minDuration?: number;

  }): CaptionChunk[]

## apps/web/src/services/renderer

canvas-renderer.ts
  export type CanvasRendererParams = {

  	width: number;

  	height: number;

  	fps: number;

  }
  export class CanvasRenderer {
    canvas: OffscreenCanvas | HTMLCanvasElement
    context: OffscreenCanvasRenderingContext2D | CanvasRenderingContext2D
    width: number
    height: number
    fps: number
    constructor({ width, height, fps }: CanvasRendererParams)
    setSize({ width, height }: { width: number; height: number })
    async render({ node, time }: { node: BaseNode; time: number })
    async renderToCanvas({

  		node,

  		time,

  		targetCanvas,

  	}: {

  		node: BaseNode;

  		time: number;

  		targetCanvas: HTMLCanvasElement;

  	})
  }

scene-builder.ts
  export type BuildSceneParams = {

  	canvasSize: TCanvasSize;

  	tracks: TimelineTrack[];

  	mediaAssets: MediaAsset[];

  	duration: ...
  export function buildScene(params: BuildSceneParams)

scene-exporter.ts
  export type ExportFormat = "mp4" | "webm"
  export type ExportQuality = "low" | "medium" | "high" | "very_high"
  export type SceneExporterEvents = {

  	progress: [progress: number];

  	complete: [buffer: ArrayBuffer];

  	error: [error: Error];

  	c...
  export class SceneExporter extends EventEmitter<SceneExporterEvents> {
    renderer: CanvasRenderer
    format: ExportFormat
    quality: ExportQuality
    shouldIncludeAudio: boolean
    audioBuffer: AudioBuffer
    isCancelled
    constructor({

  		width,

  		height,

  		fps,

  		format,

  		quality,

  		shouldIncludeAudio,

  		audioBuffer,

  	}: ExportParams)
    cancel(): void
    async export({

  		rootNode,

  	}: {

  		rootNode: RootNode;

  	}): Promise<ArrayBuffer | null>
  }

## apps/web/src/services/storage

indexeddb-adapter.ts
  export class IndexedDBAdapter implements StorageAdapter<T> {
    dbName: string
    storeName: string
    version: number
    constructor(dbName: string, storeName: string, version = 1)
    async get(key: string): Promise<T | null>
    async set(key: string, value: T): Promise<void>
    async remove(key: string): Promise<void>
    async list(): Promise<string[]>
    async getAll(): Promise<T[]>
    async clear(): Promise<void>
  }

opfs-adapter.ts
  export class OPFSAdapter implements StorageAdapter<File> {
    directoryName: string
    constructor(directoryName = "media")
    async get(key: string): Promise<File | null>
    async set(key: string, file: File): Promise<void>
    async remove(key: string): Promise<void>
    async list(): Promise<string[]>
    async clear(): Promise<void>
    static isSupported(): boolean
  }

service.ts
  export const storageService

types.ts
  export interface StorageAdapter<T> {
    get(key: string): Promise<T | null>
    set(key: string, value: T): Promise<void>
    remove(key: string): Promise<void>
    list(): Promise<string[]>
    clear(): Promise<void>
  }
  export interface MediaAssetData {
    id: string
    name: string
    type: MediaType
    size: number
    lastModified: number
    width?: number
    height?: number
    duration?: number
    fps?: number
    ephemeral?: boolean
    thumbnailUrl?: string
    sourceStickerIconName?: string
  }
  export type SerializedScene = Omit<TScene, "createdAt" | "updatedAt"> & {

  	createdAt: string;

  	updatedAt: string;

  }
  export type SerializedProjectMetadata = Omit<

  	TProjectMetadata,

  	"createdAt" | "updatedAt"

  > & {

  	createdAt: string;

  	updatedAt: st...
  export type SerializedProject = Omit<TProject, "metadata" | "scenes"> & {

  	metadata: SerializedProjectMetadata;

  	scenes: Serial...
  export interface StorageConfig {
    projectsDb: string
    mediaDb: string
    savedSoundsDb: string
    version: number
  }

## apps/web/src/services/transcription

service.ts
  export const transcriptionService

worker.ts
  export type WorkerMessage = | { type: "init"; modelId: string }

  	| { type: "transcribe"; audio: Float32Array; language: stri...
  export type WorkerResponse = | { type: "init-progress"; progress: number }

  	| { type: "init-complete" }

  	| { type: "init-err...

## apps/web/src/services/video-cache

service.ts
  export class VideoCache {
    sinks
    initPromises
    async getFrameAt({

  		mediaId,

  		file,

  		time,

  	}: {

  		mediaId: string;

  		file: File;

  		time: number;

  	}): Promise<WrappedCanvas | null>
    clearVideo({ mediaId }: { mediaId: string }): void
    clearAll(): void
    getStats()
  }
  export const videoCache

## apps/web/src/stores

assets-panel-store.tsx
  export const TAB_KEYS
  export type Tab = (typeof TAB_KEYS)[number]
  export const tabs
  export const useAssetsPanelStore

editor-store.ts
  export const useEditorStore

keybindings-store.ts
  export const defaultKeybindings: KeybindingConfig
  export interface KeybindingConflict {
    key: ShortcutKey
    existingAction: TActionWithOptionalArgs
    newAction: TActionWithOptionalArgs
  }
  export const useKeybindingsStore

panel-store.ts
  export interface PanelSizes {
    tools: number
    preview: number
    properties: number
    mainContent: number
    timeline: number
  }
  export type PanelId = keyof PanelSizes
  export const usePanelStore

sounds-store.ts
  export const useSoundsStore

stickers-store.ts
  export const useStickersStore

text-properties-store.ts
  export type TextPropertiesTab = "text" | "transform"
  export interface TextPropertiesTabMeta {
    value: TextPropertiesTab
    label: string
  }
  export const TEXT_PROPERTIES_TABS: ReadonlyArray<TextPropertiesTabMeta>
  export function isTextPropertiesTab(value: string)
  export const useTextPropertiesStore

timeline-store.ts
  export const useTimelineStore

## apps/web/src/types

assets.ts
  export type MediaType = "image" | "video" | "audio"
  export interface MediaAsset extends Omit<MediaAssetData, "size" | "lastModified"> {
    file: File
    url?: string
  }

blog.ts
  export type Post = {

  	id: string;

  	slug: string;

  	title: string;

  	content: string;

  	description: string;

  	cove...
  export type Pagination = {

  	limit: number;

  	currpage: number;

  	nextPage: number | null;

  	prevPage: number | null;

  	to...
  export type MarblePostList = {

  	posts: Post[];

  	pagination: Pagination;

  }
  export type MarblePost = {

  	post: Post;

  }
  export type Tag = {

  	id: string;

  	name: string;

  	slug: string;

  }
  export type MarbleTag = {

  	tag: Tag;

  }
  export type MarbleTagList = {

  	tags: Tag[];

  	pagination: Pagination;

  }
  export type Category = {

  	id: string;

  	name: string;

  	slug: string;

  }
  export type MarbleCategory = {

  	category: Category;

  }
  export type MarbleCategoryList = {

  	categories: Category[];

  	pagination: Pagination;

  }
  export type Author = {

  	id: string;

  	name: string;

  	image: string;

  }
  export type MarbleAuthor = {

  	author: Author;

  }
  export type MarbleAuthorList = {

  	authors: Author[];

  	pagination: Pagination;

  }

drag.ts
  export interface MediaDragData extends BaseDragData {
    type: "media"
    mediaType: "image" | "video" | "audio"
  }
  export interface TextDragData extends BaseDragData {
    type: "text"
    content: string
  }
  export interface StickerDragData extends BaseDragData {
    type: "sticker"
    iconName: string
  }
  export type TimelineDragData = MediaDragData | TextDragData | StickerDragData

editor.ts
  export type TPlatformLayout = "tiktok"

export.ts
  export const EXPORT_QUALITY_VALUES
  export const EXPORT_FORMAT_VALUES
  export type ExportFormat = (typeof EXPORT_FORMAT_VALUES)[number]
  export type ExportQuality = (typeof EXPORT_QUALITY_VALUES)[number]
  export interface ExportOptions {
    format: ExportFormat
    quality: ExportQuality
    fps?: number
    includeAudio?: boolean
    onProgress?: ({ progress }: { progress: number }) => void
    onCancel?: () => boolean
  }
  export interface ExportResult {
    success: boolean
    buffer?: ArrayBuffer
    error?: string
    cancelled?: boolean
  }

keybinding.ts
  export type ModifierKeys = | "ctrl"

  	| "alt"

  	| "shift"

  	| "ctrl+shift"

  	| "alt+shift"

  	| "ctrl+alt"

  	| "ctrl+alt+shift"
  export type Key = | "a"

  	| "b"

  	| "c"

  	| "d"

  	| "e"

  	| "f"

  	| "g"

  	| "h"

  	| "i"

  	| "j"

  	| "k"

  	| "l"

  	|...
  export type ModifierBasedShortcutKey = `${ModifierKeys}+${Key}`
  export type SingleCharacterShortcutKey = `${Key}`
  export type ShortcutKey = ModifierBasedShortcutKey | SingleCharacterShortcutKey
  export type KeybindingConfig = {

  	[key in ShortcutKey]?: TActionWithOptionalArgs;

  }

language.ts
  export type Language = (typeof LANGUAGES)[number]
  export type LanguageCode = Language["code"]

project.ts
  export type TBackground = | {

  			type: "color";

  			color: string;

  	  }

  	| {

  			type: "blur";

  			blurIntensity: number...
  export interface TCanvasSize {
    width: number
    height: number
  }
  export interface TProjectMetadata {
    id: string
    name: string
    thumbnail?: string
    duration: number
    createdAt: Date
    updatedAt: Date
  }
  export interface TProjectSettings {
    fps: number
    canvasSize: TCanvasSize
    originalCanvasSize?: TCanvasSize | null
    background: TBackground
  }
  export interface TTimelineViewState {
    zoomLevel: number
    scrollLeft: number
    playheadTime: number
  }
  export interface TProject {
    metadata: TProjectMetadata
    scenes: TScene[]
    currentSceneId: string
    settings: TProjectSettings
    version: number
    timelineViewState?: TTimelineViewState
  }
  export type TProjectSortKey = "createdAt" | "updatedAt" | "name" | "duration"
  export type TSortOrder = "asc" | "desc"
  export type TProjectSortOption = `${TProjectSortKey}-${TSortOrder}`

sounds.ts
  export interface SoundEffect {
    id: number
    name: string
    description: string
    url: string
    previewUrl?: string
    downloadUrl?: string
    duration: number
    filesize: number
    type: string
    channels: number
    bitrate: number
    bitdepth: number
    samplerate: number
    username: string
    tags: string[]
    license: string
    created: string
    downloads: number
    rating: number
    ratingCount: number
  }
  export interface SavedSound {
    id: number
    name: string
    username: string
    previewUrl?: string
    downloadUrl?: string
    duration: number
    tags: string[]
    license: string
    savedAt: string
  }
  export interface SavedSoundsData {
    sounds: SavedSound[]
    lastModified: string
  }

stickers.ts
  export type StickerCategory = (typeof STICKER_CATEGORIES)[number]

time.ts
  export type TTimeCode = "MM:SS" | "HH:MM:SS" | "HH:MM:SS:CS" | "HH:MM:SS:FF"

timeline.ts
  export interface TScene {
    id: string
    name: string
    isMain: boolean
    tracks: TimelineTrack[]
    bookmarks: number[]
    createdAt: Date
    updatedAt: Date
  }
  export type TrackType = "video" | "text" | "audio" | "sticker"
  export interface VideoTrack extends BaseTrack {
    type: "video"
    elements: (VideoElement | ImageElement)[]
    isMain: boolean
    muted: boolean
    hidden: boolean
  }
  export interface TextTrack extends BaseTrack {
    type: "text"
    elements: TextElement[]
    hidden: boolean
  }
  export interface AudioTrack extends BaseTrack {
    type: "audio"
    elements: AudioElement[]
    muted: boolean
  }
  export interface StickerTrack extends BaseTrack {
    type: "sticker"
    elements: StickerElement[]
    hidden: boolean
  }
  export type TimelineTrack = VideoTrack | TextTrack | AudioTrack | StickerTrack
  export interface Transform {
    scale: number
    position: {

  		x: number;

  		y: number;

  	}
    rotate: number
  }
  export interface UploadAudioElement extends BaseAudioElement {
    sourceType: "upload"
    mediaId: string
  }
  export interface LibraryAudioElement extends BaseAudioElement {
    sourceType: "library"
    sourceUrl: string
  }
  export type AudioElement = UploadAudioElement | LibraryAudioElement
  export interface VideoElement extends BaseTimelineElement {
    type: "video"
    mediaId: string
    muted?: boolean
    hidden?: boolean
    transform: Transform
    opacity: number
  }
  export interface ImageElement extends BaseTimelineElement {
    type: "image"
    mediaId: string
    hidden?: boolean
    transform: Transform
    opacity: number
  }
  export interface TextElement extends BaseTimelineElement {
    type: "text"
    content: string
    fontSize: number
    fontFamily: string
    color: string
    backgroundColor: string
    textAlign: "left" | "center" | "right"
    fontWeight: "normal" | "bold"
    fontStyle: "normal" | "italic"
    textDecoration: "none" | "underline" | "line-through"
    hidden?: boolean
    transform: Transform
    opacity: number
  }
  export interface StickerElement extends BaseTimelineElement {
    type: "sticker"
    iconName: string
    hidden?: boolean
    transform: Transform
    opacity: number
    color?: string
  }
  export type TimelineElement = | AudioElement

  	| VideoElement

  	| ImageElement

  	| TextElement

  	| StickerElement
  export type ElementType = TimelineElement["type"]
  export type CreateUploadAudioElement = Omit<UploadAudioElement, "id">
  export type CreateLibraryAudioElement = Omit<LibraryAudioElement, "id">
  export type CreateAudioElement = | CreateUploadAudioElement

  	| CreateLibraryAudioElement
  export type CreateVideoElement = Omit<VideoElement, "id">
  export type CreateImageElement = Omit<ImageElement, "id">
  export type CreateTextElement = Omit<TextElement, "id">
  export type CreateStickerElement = Omit<StickerElement, "id">
  export type CreateTimelineElement = | CreateAudioElement

  	| CreateVideoElement

  	| CreateImageElement

  	| CreateTextElement

  	| Crea...
  export interface ElementDragState {
    isDragging: boolean
    elementId: string | null
    trackId: string | null
    startMouseX: number
    startMouseY: number
    startElementTime: number
    clickOffsetTime: number
    currentTime: number
    currentMouseY: number
  }
  export interface DropTarget {
    trackIndex: number
    isNewTrack: boolean
    insertPosition: "above" | "below" | null
    xPosition: number
  }
  export interface ComputeDropTargetParams {
    elementType: ElementType
    mouseX: number
    mouseY: number
    tracks: TimelineTrack[]
    playheadTime: number
    isExternalDrop: boolean
    elementDuration: number
    pixelsPerSecond: number
    zoomLevel: number
    verticalDragDirection?: "up" | "down" | null
    startTimeOverride?: number
    excludeElementId?: string
  }
  export interface ClipboardItem {
    trackId: string
    trackType: TrackType
    element: CreateTimelineElement
  }

transcription.ts
  export type TranscriptionLanguage = LanguageCode | "auto"
  export interface TranscriptionSegment {
    text: string
    start: number
    end: number
  }
  export interface TranscriptionResult {
    text: string
    segments: TranscriptionSegment[]
    language: string
  }
  export type TranscriptionStatus = | "idle"

  	| "loading-model"

  	| "transcribing"

  	| "complete"

  	| "error"
  export interface TranscriptionProgress {
    status: TranscriptionStatus
    progress: number
    message?: string
  }
  export type TranscriptionModelId = | "whisper-tiny"

  	| "whisper-small"

  	| "whisper-medium"

  	| "whisper-large-v3-turbo"
  export interface TranscriptionModel {
    id: TranscriptionModelId
    name: string
    huggingFaceId: string
    description: string
  }
  export interface CaptionChunk {
    text: string
    startTime: number
    duration: number
  }

## apps/web/src/utils

browser.ts
  export function isTypableDOMElement({

  	element,

  }: {

  	element: HTMLElement;

  }): boolean

date.ts
  export function formatDate({ date }: { date: Date }): string

geometry.ts
  export function dimensionToAspectRatio({

  	width,

  	height,

  }: {

  	width: number;

  	height: number;

  }): string

id.ts
  export function generateUUID(): string

math.ts
  export function clamp({

  	value,

  	min,

  	max,

  }: {

  	value: number;

  	min: number;

  	max: number;

  }): number

platform.ts
  export function getPlatformSpecialKey(): string
  export function getPlatformAlternateKey(): string
  export function isAppleDevice(): boolean

string.ts
  export function capitalizeFirstLetter({ string }: { string: string })
  export function uppercase({ string }: { string: string })

ui.ts
  export function cn(...inputs: ClassValue[]): string

## packages/ui/src/icons

brand.tsx
  export function OcVercelIcon({ className }: { className?: string })
  export function OcMarbleIcon({

  	className = "",

  	size = 32,

  }: {

  	className?: string;

  	size?: number;

  })
  export function OcDataBuddyIcon({

  	className = "",

  	size = 32,

  }: {

  	className?: string;

  	size?: number;

  })

ui.tsx
  export function OcVideoIcon({

  	className = "",

  	size = 32,

  }: {

  	className?: string;

  	size?: number;

  })

```

---

*Generated and maintained by [Twiggy](https://github.com/twiggy-tools/Twiggy)*