import { writable } from 'svelte/store';
import type { Writable } from 'svelte/store';

export type SortOrderValue =
  | 'newest'
  | 'oldest'
  | 'from-asc'
  | 'from-desc'
  | 'subject-asc'
  | 'subject-desc';

export const threadingEnabled: Writable<boolean> = writable(true);
export const sidebarOpen: Writable<boolean> = writable(true);
export const showFilters: Writable<boolean> = writable(false);
export const sortOrder: Writable<SortOrderValue> = writable('newest');
export const query: Writable<string> = writable('');
export const unreadOnly: Writable<boolean> = writable(false);
export const hasAttachmentsOnly: Writable<boolean> = writable(false);
export const filterByLabel: Writable<string[]> = writable([]);
export const starredOnly: Writable<boolean> = writable(false);
