UNPKG

dev-to-git

Version:

A CLI to keep your dev.to posts in sync from a GIT project, using the CI provider of your choice

46 lines (45 loc) 1.2 kB
export declare type Repository = { readonly username: string; readonly name: string; }; export interface ArticleConfigFile { id: number; relativePathToArticle: string; } export interface ArticleConfig extends ArticleConfigFile { repository: Repository; } export interface ArticleApi { article: { body_markdown: string; }; } export interface ArticleApiResponse { id: number; body_markdown: string; } export declare enum UpdateStatus { UPDATED = "Updated", ALREADY_UP_TO_DATE = "AlreadyUpToDate", ERROR = "Error", FAILED_TO_EXTRACT_FRONT_MATTER = "FailedToExtractFrontMatter" } export interface ConfigurationOptions { silent: boolean; config: string; devToToken: string; repository: Repository; } export declare type ArticlePublishedStatus = { articleId: number; } & ({ updateStatus: UpdateStatus.FAILED_TO_EXTRACT_FRONT_MATTER; } | ({ articleTitle: string; published: boolean; } & ({ updateStatus: Exclude<UpdateStatus, UpdateStatus.ERROR | UpdateStatus.FAILED_TO_EXTRACT_FRONT_MATTER>; } | { updateStatus: UpdateStatus.ERROR; error: Error; })));