diff options
| author | Jan Tuomi <jans.tuomi@gmail.com> | 2024-03-13 21:21:05 +0200 |
|---|---|---|
| committer | Jan Tuomi <jans.tuomi@gmail.com> | 2024-03-14 17:20:01 +0200 |
| commit | c890ea83d6e49702f0e3201b29c472f095193133 (patch) | |
| tree | fc95bc2502b468a12a8e4a574fd8e3ca5021df5a /src/tasks.ts | |
| parent | 0dda3ef940ce63196df949a8e31712b15ce35cf7 (diff) | |
Initial commit
Diffstat (limited to 'src/tasks.ts')
| -rw-r--r-- | src/tasks.ts | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/tasks.ts b/src/tasks.ts new file mode 100644 index 0000000..388dde8 --- /dev/null +++ b/src/tasks.ts @@ -0,0 +1,24 @@ +export interface InstagramTask { + type: "download_instagram"; + url: string; + replyId: string; +} + +export interface SlackReplyTask { + type: "slack_reply"; + replyId: string; + message: string; + filePath: string; +} + +export type Task = InstagramTask | SlackReplyTask; + +const taskQueue: Task[] = []; + +export const addTask = (task: Task) => { + taskQueue.push(task); +}; + +export const getTask = (): Task | undefined => { + return taskQueue.shift(); +}; |
