blog / src /shared /types.ts
hadadrjt's picture
blog: Bump to 0.0.6 version.
6c25065
//
// SPDX-FileCopyrightText: Hadad <hadad@linuxmail.org>
// SPDX-License-Identifier: Apache-2.0
//
export interface PostFrontMatter {
title: string;
date: string;
description: string;
author?: string;
tags?: string[];
image?: string;
}
export interface Post {
slug: string;
frontMatter: PostFrontMatter;
content: string;
rawContent: string;
lastModified: number;
}
export type PostSummary = Omit<Post, "content" | "rawContent">;
export interface ApiResponse<T> {
success: boolean;
data?: T;
error?: string;
}
interface BaseRequest {
content: string;
title: string;
}
export interface AIAnalysisRequest extends BaseRequest {}
export interface TranslationRequest extends BaseRequest {
targetLanguage: SupportedLanguage;
}
export interface AIStreamChunk {
type: "reasoning" | "content" | "done" | "error";
content?: string;
}
interface BaseStreamState {
isOpen: boolean;
isLoading: boolean;
reasoning: string;
content: string;
isReasoningComplete: boolean;
error: string | null;
}
export interface AnalysisState extends BaseStreamState {}
export type SupportedLanguage = "id" | "zh" | "ja" | "fr" | "es";
export interface TranslationState extends BaseStreamState {
targetLanguage: SupportedLanguage | null;
}
export interface StreamRequestConfig {
systemPrompt: string;
userMessage: string;
}
interface BaseMeta {
title: string;
description: string;
keywords: string;
author: string;
robots: string;
}
interface OgMeta {
ogType: string;
ogUrl?: string;
ogImage?: string;
ogSiteName?: string;
}
interface ArticleMeta {
articlePublishedTime?: string;
articleAuthor?: string;
articleTags?: string[];
}
interface TwitterMeta {
twitterUrl?: string;
twitterImage?: string;
}
export interface PageMetaConfig extends BaseMeta, OgMeta, ArticleMeta, TwitterMeta {}
export interface SitemapEntry {
location: string;
lastModified: string;
changeFrequency: string;
priority: string;
}