diff --git a/src/types/channels/list_active_threads.ts b/src/types/channels/threads/list_active_threads.ts similarity index 100% rename from src/types/channels/list_active_threads.ts rename to src/types/channels/threads/list_active_threads.ts diff --git a/src/types/channels/list_public_archived_threads.ts b/src/types/channels/threads/list_public_archived_threads.ts similarity index 100% rename from src/types/channels/list_public_archived_threads.ts rename to src/types/channels/threads/list_public_archived_threads.ts diff --git a/src/types/channels/modify_thread.ts b/src/types/channels/threads/modify_thread.ts similarity index 100% rename from src/types/channels/modify_thread.ts rename to src/types/channels/threads/modify_thread.ts diff --git a/src/types/channels/start_thread.ts b/src/types/channels/threads/start_thread.ts similarity index 100% rename from src/types/channels/start_thread.ts rename to src/types/channels/threads/start_thread.ts diff --git a/src/types/channels/thread_list_sync.ts b/src/types/channels/threads/thread_list_sync.ts similarity index 100% rename from src/types/channels/thread_list_sync.ts rename to src/types/channels/threads/thread_list_sync.ts diff --git a/src/types/channels/threads/thread_member.ts b/src/types/channels/threads/thread_member.ts new file mode 100644 index 000000000..2b3d1b54a --- /dev/null +++ b/src/types/channels/threads/thread_member.ts @@ -0,0 +1,10 @@ +export interface ThreadMember { + /** The id of the thread */ + id: string; + /** The id of the user */ + userId: string; + /** The time the current user last joined the thread */ + joinTimestamp: string; + /** Any user-thread settings, currently only used for notifications */ + flags: number; +} diff --git a/src/types/channels/thread_members_update.ts b/src/types/channels/threads/thread_members_update.ts similarity index 100% rename from src/types/channels/thread_members_update.ts rename to src/types/channels/threads/thread_members_update.ts diff --git a/src/types/channels/threads/thread_metadata.ts b/src/types/channels/threads/thread_metadata.ts new file mode 100644 index 000000000..ea67fd966 --- /dev/null +++ b/src/types/channels/threads/thread_metadata.ts @@ -0,0 +1,13 @@ +export interface ThreadMetadata { + /** Whether the thread is archived */ + archived: boolean; + /** Id of the user that last archived or unarchived the thread */ + archiverId?: string; + /** Duration in minutes to automatically archive the thread after recent activity */ + autoArchiveDuration: 60 | 1440 | 4320 | 10080; + // TODO(threads): channel struct should convert this to a unixx + /** Timestamp when the thread's archive status was last changed, used for calculating recent activity */ + archiveTimestamp: string; + /** When a thread is locked, only users with `MANAGE_THREADS` can unarchive it */ + locked?: boolean; +}