import {
  ArticleModel,
  ArticlesModel,
  AuthorModel
} from "./models";

export interface ArticleContextModel {
  articles: ArticlesModel;
  loading: boolean;
  error: string | null;
  refreshArticles: () => Promise<void>;
  updateArticle: (article: ArticleModel) => Promise<ArticleModel | void>;
  createArticle: (article: ArticleModel) => Promise<ArticleModel | void>;
}

export interface AuthContextModel {
  currentUser: AuthorModel | null;
  authors: AuthorModel[];
  loading: boolean;
  error: string | null;

  refreshAuthors: () => Promise<void>;
  updateProfile: (user: AuthorModel) => Promise<AuthorModel | void>;
}

export interface UploadContextModel {
  uploadFile: (file: File) => Promise<string | null>;
  uploading: boolean;
  error: string | null;
}
