Files
newsnow/shared/types.ts
T
2024-09-30 18:53:57 +08:00

35 lines
682 B
TypeScript

import type { sectionIds, sourceList } from "./data"
export type SourceID = keyof(typeof sourceList)
export type SectionID = (typeof sectionIds)[number]
export type Metadata = Record<SectionID, Section>
export interface Section {
name: string
sourceList: SourceID[]
}
export interface NewsItem {
title: string
cover?: string
author?: string
desc?: string
url: string
timestamp?: number
mobileUrl?: string
}
// 路由数据
export interface SourceInfo {
name: string
title: string
type: string
description?: string
params?: Record<string, string | object>
total: number
link?: string
updateTime: string
fromCache: boolean
data: NewsItem[]
}