// API response types from backend
export type ApiMemo = {
  id: string; // MongoDB ObjectId
  uid?: string; // User-defined unique ID (preferred for URLs)
  content: string;
  visibility?: string | null;
  tags?: string[];
  creator_id?: string;
  row_status?: string;   // "NORMAL" | "ARCHIVED"
  pinned?: boolean;
  create_time?: string;
  update_time?: string;
  display_time?: string;
  parent?: string | null; // ID of parent memo (if this is a comment)
  comment_count?: number; // Number of comments for this memo
};

export type ApiAttachment = {
  id: string;
  filename: string;
  url: string;
};

export type ApiShortcut = {
  id: string;
  name: string;
  filter: string;
};

export type ApiActivity = {
  id: string;
  type?: string | null;
  description?: string | null;
};

export type ApiIdentityProvider = {
  id: string;
  name: string;
  type?: string | null;
};

export type ApiInstanceInfo = {
  mode?: string | null;
  version?: string | null;
};

export type ApiUser = {
  id: string;
  email?: string | null;
  nickname?: string | null;
  // New fields from backend for proper user display
  username?: string | null;
  displayName?: string | null;
  avatarUrl?: string | null;
  name?: string | null;  // Resource name: users/{id}
};


export type RequestOptions = {
  method?: string;
  body?: unknown;
  headers?: HeadersInit;
};

