export interface Note {
  id: number | string;
  user_id: number;
  content: string;
  date: string;
  time: string;
  created_at: string;
  updated_at?: string;
  is_pinned: 0 | 1;
  is_archived: 0 | 1;
  is_private?: 0 | 1;
  pinned_at?: string;
  images: NoteImage[];
  files: NoteFile[];
  syncStatus?: 'synced' | 'pending' | 'error';
}

export interface NoteImage {
  id: number | string;
  note_id: number | string;
  filename: string;
  original_name: string;
  file_path: string;
  file_size: number;
  mime_type: string;
  created_at: string;
  base64Data?: string;
}

export interface NoteFile {
  id: number | string;
  note_id: number | string;
  filename: string;
  original_name: string;
  file_path: string;
  file_size: number;
  mime_type: string;
  created_at: string;
  base64Data?: string;
}

export type SyncActionType = 'create' | 'update' | 'delete' | 'uploadImage' | 'uploadFile';

export interface SyncQueueItem {
  id: string;
  type: SyncActionType;
  noteId: string | number;
  data: any;
  timestamp: number;
  retries: number;
  lastError?: string;
}

export interface PendingAction {
  id: string;
  type: SyncActionType;
  noteId: string | number;
  data: any;
  timestamp: number;
}
