summaryrefslogtreecommitdiff
path: root/apps/web/src/types
diff options
context:
space:
mode:
authorKha Nguyen <hi@khanguyen.com>2025-07-24 16:50:14 -0500
committerKha Nguyen <hi@khanguyen.com>2025-07-24 16:50:14 -0500
commit262a7d53d63cc9997f730c7f64b7f8ec29723926 (patch)
tree894d6e3986b3ca339dc3ff7ec62fb31b3690be82 /apps/web/src/types
parent5a7745f806edf4a386b8cfd079861f96c3b92baf (diff)
parent5931ddb77aac23ffe1b82d9d7c03afde3e671109 (diff)
downloadopencut-262a7d53d63cc9997f730c7f64b7f8ec29723926.tar.gz
Merge branch 'main' into fix/improve-shortcuts
Diffstat (limited to 'apps/web/src/types')
-rw-r--r--apps/web/src/types/editor.ts24
-rw-r--r--apps/web/src/types/keybinding.ts58
-rw-r--r--apps/web/src/types/post.ts169
-rw-r--r--apps/web/src/types/timeline.ts3
4 files changed, 150 insertions, 104 deletions
diff --git a/apps/web/src/types/editor.ts b/apps/web/src/types/editor.ts
index dce7ac50..b0449991 100644
--- a/apps/web/src/types/editor.ts
+++ b/apps/web/src/types/editor.ts
@@ -1,12 +1,12 @@
-export type BackgroundType = "blur" | "mirror" | "color";
-
-export interface CanvasSize {
- width: number;
- height: number;
-}
-
-export interface CanvasPreset {
- name: string;
- width: number;
- height: number;
-}
+export type BackgroundType = "blur" | "mirror" | "color";
+
+export interface CanvasSize {
+ width: number;
+ height: number;
+}
+
+export interface CanvasPreset {
+ name: string;
+ width: number;
+ height: number;
+}
diff --git a/apps/web/src/types/keybinding.ts b/apps/web/src/types/keybinding.ts
index d97c88da..831f3abd 100644
--- a/apps/web/src/types/keybinding.ts
+++ b/apps/web/src/types/keybinding.ts
@@ -16,12 +16,58 @@ export type ModifierKeys =
/* eslint-disable prettier/prettier */
// prettier-ignore
export type Key =
- | "a" | "b" | "c" | "d" | "e" | "f" | "g" | "h" | "i" | "j"
- | "k" | "l" | "m" | "n" | "o" | "p" | "q" | "r" | "s" | "t"
- | "u" | "v" | "w" | "x" | "y" | "z" | "0" | "1" | "2" | "3"
- | "4" | "5" | "6" | "7" | "8" | "9" | "up" | "down" | "left"
- | "right" | "/" | "?" | "." | "enter" | "tab" | "space"
- | "escape" | "esc" | "backspace" | "delete" | "home" | "end"
+ | "a"
+ | "b"
+ | "c"
+ | "d"
+ | "e"
+ | "f"
+ | "g"
+ | "h"
+ | "i"
+ | "j"
+ | "k"
+ | "l"
+ | "m"
+ | "n"
+ | "o"
+ | "p"
+ | "q"
+ | "r"
+ | "s"
+ | "t"
+ | "u"
+ | "v"
+ | "w"
+ | "x"
+ | "y"
+ | "z"
+ | "0"
+ | "1"
+ | "2"
+ | "3"
+ | "4"
+ | "5"
+ | "6"
+ | "7"
+ | "8"
+ | "9"
+ | "up"
+ | "down"
+ | "left"
+ | "right"
+ | "/"
+ | "?"
+ | "."
+ | "enter"
+ | "tab"
+ | "space"
+ | "escape"
+ | "esc"
+ | "backspace"
+ | "delete"
+ | "home"
+ | "end";
/* eslint-enable */
export type ModifierBasedShortcutKey = `${ModifierKeys}+${Key}`;
diff --git a/apps/web/src/types/post.ts b/apps/web/src/types/post.ts
index c3436847..fbee239e 100644
--- a/apps/web/src/types/post.ts
+++ b/apps/web/src/types/post.ts
@@ -1,93 +1,92 @@
export type Post = {
- id: string;
- slug: string;
- title: string;
- content: string;
- description: string;
- coverImage: string;
- publishedAt: Date;
- updatedAt: Date;
- authors: {
- id: string;
- name: string;
- image: string;
- }[];
- category: {
- id: string;
- slug: string;
- name: string;
- };
- tags: {
- id: string;
- slug: string;
- name: string;
- }[];
- attribution: {
- author: string;
- url: string;
- } | null;
- };
-
- export type Pagination = {
- limit: number;
- currpage: number;
- nextPage: number | null;
- prevPage: number | null;
- totalItems: number;
- totalPages: number;
- };
-
- export type MarblePostList = {
- posts: Post[];
- pagination: Pagination;
- };
-
- export type MarblePost = {
- post: Post;
- };
-
- export type Tag = {
+ id: string;
+ slug: string;
+ title: string;
+ content: string;
+ description: string;
+ coverImage: string;
+ publishedAt: Date;
+ updatedAt: Date;
+ authors: {
id: string;
name: string;
- slug: string;
- };
-
- export type MarbleTag = {
- tag: Tag;
- };
-
- export type MarbleTagList = {
- tags: Tag[];
- pagination: Pagination;
- };
-
- export type Category = {
+ image: string;
+ }[];
+ category: {
id: string;
- name: string;
slug: string;
+ name: string;
};
-
- export type MarbleCategory = {
- category: Category;
- };
-
- export type MarbleCategoryList = {
- categories: Category[];
- pagination: Pagination;
- };
-
- export type Author = {
+ tags: {
id: string;
+ slug: string;
name: string;
- image: string;
- };
-
- export type MarbleAuthor = {
- author: Author;
- };
-
- export type MarbleAuthorList = {
- authors: Author[];
- pagination: Pagination;
- };
- \ No newline at end of file
+ }[];
+ attribution: {
+ author: string;
+ url: string;
+ } | null;
+};
+
+export type Pagination = {
+ limit: number;
+ currpage: number;
+ nextPage: number | null;
+ prevPage: number | null;
+ totalItems: number;
+ totalPages: number;
+};
+
+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;
+};
diff --git a/apps/web/src/types/timeline.ts b/apps/web/src/types/timeline.ts
index f8a79d03..ef20c642 100644
--- a/apps/web/src/types/timeline.ts
+++ b/apps/web/src/types/timeline.ts
@@ -138,7 +138,8 @@ export function canElementGoOnTrack(
): boolean {
if (elementType === "text") {
return trackType === "text";
- } else if (elementType === "media") {
+ }
+ if (elementType === "media") {
return trackType === "media" || trackType === "audio";
}
return false;