| | import type { Context } from 'hono'; |
| |
|
| | |
| | |
| | export type Category = |
| | | 'popular' |
| | | 'social-media' |
| | | 'new-media' |
| | | 'traditional-media' |
| | | 'bbs' |
| | | 'blog' |
| | | 'programming' |
| | | 'design' |
| | | 'live' |
| | | 'multimedia' |
| | | 'picture' |
| | | 'anime' |
| | | 'program-update' |
| | | 'university' |
| | | 'forecast' |
| | | 'travel' |
| | | 'shopping' |
| | | 'game' |
| | | 'reading' |
| | | 'government' |
| | | 'study' |
| | | 'journal' |
| | | 'finance' |
| | | 'other'; |
| |
|
| | |
| | export type DataItem = { |
| | title: string; |
| | description?: string; |
| | pubDate?: number | string | Date; |
| | link?: string; |
| | category?: string[]; |
| | author?: |
| | | string |
| | | Array<{ |
| | name: string; |
| | url?: string; |
| | avatar?: string; |
| | }>; |
| | doi?: string; |
| | guid?: string; |
| | id?: string; |
| | content?: { |
| | html: string; |
| | text: string; |
| | }; |
| | image?: string; |
| | banner?: string; |
| | updated?: number | string | Date; |
| | language?: Language; |
| | enclosure_url?: string; |
| | enclosure_type?: string; |
| | enclosure_title?: string; |
| | enclosure_length?: number; |
| | itunes_duration?: number | string; |
| | itunes_item_image?: string; |
| | media?: Record<string, Record<string, string>>; |
| | attachments?: Array<{ |
| | url: string; |
| | mime_type: string; |
| | title?: string; |
| | size_in_bytes?: number; |
| | duration_in_seconds?: number; |
| | }>; |
| |
|
| | _extra?: Record<string, any> & { |
| | links?: Array<{ |
| | url: string; |
| | type: string; |
| | content_html?: string; |
| | }>; |
| | }; |
| | }; |
| |
|
| | export type Data = { |
| | title: string; |
| | description?: string; |
| | link?: string; |
| | item?: DataItem[]; |
| | allowEmpty?: boolean; |
| | image?: string; |
| | author?: string; |
| | language?: Language; |
| | feedLink?: string; |
| | lastBuildDate?: string; |
| | itunes_author?: string; |
| | itunes_category?: string; |
| | itunes_explicit?: string | boolean; |
| | id?: string; |
| | icon?: string; |
| | logo?: string; |
| | atomlink?: string; |
| | ttl?: number; |
| | }; |
| |
|
| | export type Language = |
| | | 'af' |
| | | 'ar-DZ' |
| | | 'ar-IQ' |
| | | 'ar-KW' |
| | | 'ar-MA' |
| | | 'ar-SA' |
| | | 'ar-TN' |
| | | 'be' |
| | | 'bg' |
| | | 'ca' |
| | | 'cs' |
| | | 'da' |
| | | 'de' |
| | | 'de-at' |
| | | 'de-ch' |
| | | 'de-de' |
| | | 'de-li' |
| | | 'de-lu' |
| | | 'el' |
| | | 'en' |
| | | 'en-au' |
| | | 'en-bz' |
| | | 'en-ca' |
| | | 'en-gb' |
| | | 'en-ie' |
| | | 'en-jm' |
| | | 'en-nz' |
| | | 'en-ph' |
| | | 'en-tt' |
| | | 'en-us' |
| | | 'en-za' |
| | | 'en-zw' |
| | | 'es' |
| | | 'es-ar' |
| | | 'es-bo' |
| | | 'es-cl' |
| | | 'es-co' |
| | | 'es-cr' |
| | | 'es-do' |
| | | 'es-ec' |
| | | 'es-es' |
| | | 'es-gt' |
| | | 'es-hn' |
| | | 'es-mx' |
| | | 'es-ni' |
| | | 'es-pa' |
| | | 'es-pe' |
| | | 'es-pr' |
| | | 'es-py' |
| | | 'es-sv' |
| | | 'es-uy' |
| | | 'es-ve' |
| | | 'et' |
| | | 'eu' |
| | | 'fi' |
| | | 'fo' |
| | | 'fr' |
| | | 'fr-be' |
| | | 'fr-ca' |
| | | 'fr-ch' |
| | | 'fr-fr' |
| | | 'fr-lu' |
| | | 'fr-mc' |
| | | 'ga' |
| | | 'gd' |
| | | 'gl' |
| | | 'haw' |
| | | 'hi' |
| | | 'hr' |
| | | 'hu' |
| | | 'in' |
| | | 'is' |
| | | 'it' |
| | | 'it-ch' |
| | | 'it-it' |
| | | 'ja' |
| | | 'ko' |
| | | 'mk' |
| | | 'ne' |
| | | 'nl' |
| | | 'nl-be' |
| | | 'nl-nl' |
| | | 'no' |
| | | 'pl' |
| | | 'pt' |
| | | 'pt-br' |
| | | 'pt-pt' |
| | | 'ro' |
| | | 'ro-mo' |
| | | 'ro-ro' |
| | | 'ru' |
| | | 'ru-mo' |
| | | 'ru-ru' |
| | | 'sk' |
| | | 'sl' |
| | | 'sq' |
| | | 'sr' |
| | | 'sv' |
| | | 'sv-fi' |
| | | 'sv-se' |
| | | 'tr' |
| | | 'uk' |
| | | 'zh-CN' |
| | | 'zh-HK' |
| | | 'zh-TW' |
| | | 'other'; |
| |
|
| | |
| | interface NamespaceItem { |
| | |
| | |
| | |
| | |
| | name: string; |
| |
|
| | |
| | |
| | |
| | url?: string; |
| |
|
| | |
| | |
| | |
| | categories?: Category[]; |
| |
|
| | |
| | |
| | |
| | description?: string; |
| |
|
| | |
| | |
| | |
| | lang?: Language; |
| | } |
| |
|
| | interface Namespace extends NamespaceItem { |
| | |
| | ja?: NamespaceItem; |
| | |
| | zh?: NamespaceItem; |
| | |
| | 'zh-TW'?: NamespaceItem; |
| | } |
| |
|
| | export type { Namespace }; |
| |
|
| | export enum ViewType { |
| | Articles = 0, |
| | SocialMedia = 1, |
| | Pictures = 2, |
| | Videos = 3, |
| | Audios = 4, |
| | Notifications = 5, |
| | } |
| |
|
| | |
| | interface RouteItem { |
| | |
| | |
| | |
| | path: string | string[]; |
| |
|
| | |
| | |
| | |
| | |
| | name: string; |
| |
|
| | |
| | |
| | |
| | url?: string; |
| |
|
| | |
| | |
| | |
| | maintainers: string[]; |
| |
|
| | |
| | |
| | |
| | handler: (ctx: Context) => Promise<Data | null | Response> | Data | null | Response; |
| |
|
| | |
| | |
| | |
| | example: string; |
| |
|
| | |
| | |
| | |
| | parameters?: Record< |
| | string, |
| | | string |
| | | { |
| | description: string; |
| | default?: string; |
| | options?: Array<{ |
| | value: string; |
| | label: string; |
| | }>; |
| | } |
| | >; |
| |
|
| | |
| | |
| | |
| | description?: string; |
| |
|
| | |
| | |
| | |
| | categories?: Category[]; |
| |
|
| | |
| | |
| | |
| | features?: { |
| | |
| | requireConfig?: |
| | | Array<{ |
| | |
| | name: string; |
| | |
| | optional?: boolean; |
| | |
| | description: string; |
| | }> |
| | | false; |
| |
|
| | |
| | requirePuppeteer?: boolean; |
| |
|
| | |
| | antiCrawler?: boolean; |
| |
|
| | |
| | supportRadar?: boolean; |
| |
|
| | |
| | supportBT?: boolean; |
| |
|
| | |
| | supportPodcast?: boolean; |
| |
|
| | |
| | supportScihub?: boolean; |
| |
|
| | |
| | nsfw?: boolean; |
| | }; |
| |
|
| | |
| | |
| | |
| | radar?: RadarItem[]; |
| |
|
| | |
| | |
| | |
| | view?: ViewType; |
| | } |
| |
|
| | export interface Route extends RouteItem { |
| | ja?: RouteItem; |
| | zh?: RouteItem; |
| | 'zh-TW'?: RouteItem; |
| | } |
| |
|
| | |
| | export type RadarItem = { |
| | |
| | |
| | |
| | title?: string; |
| |
|
| | |
| | |
| | |
| | docs?: string; |
| |
|
| | |
| | |
| | |
| | |
| | source: string[]; |
| |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | target?: |
| | | string |
| | | (( |
| | |
| | params: any, |
| | |
| | url: string, |
| | |
| | document: Document |
| | ) => string); |
| | }; |
| |
|
| | export type RadarDomain = { |
| | _name: string; |
| | } & { |
| | [subdomain: string]: RadarItem[]; |
| | }; |
| |
|
| | export interface APIRoute { |
| | |
| | |
| | |
| | path: string; |
| |
|
| | |
| | |
| | |
| | maintainers: string[]; |
| |
|
| | |
| | |
| | |
| | handler: (ctx: Context) => |
| | | Promise<{ |
| | code: number; |
| | message?: string; |
| | data?: any; |
| | }> |
| | | { |
| | code: number; |
| | message?: string; |
| | data?: any; |
| | }; |
| |
|
| | |
| | |
| | |
| | parameters?: Record< |
| | string, |
| | { |
| | description: string; |
| | default?: string; |
| | options?: Array<{ |
| | value: string; |
| | label: string; |
| | }>; |
| | } |
| | >; |
| |
|
| | |
| | |
| | |
| | description?: string; |
| | } |
| |
|