-
Notifications
You must be signed in to change notification settings - Fork 128
Expand file tree
/
Copy pathtypes.ts
More file actions
81 lines (70 loc) · 2.88 KB
/
types.ts
File metadata and controls
81 lines (70 loc) · 2.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
export interface LinkItem {
id: string;
title: string;
url: string;
icon?: string;
description?: string;
categoryId: string;
createdAt: number;
pinned?: boolean; // New field for pinning
}
export interface Category {
id: string;
name: string;
icon: string; // Lucide icon name or emoji
password?: string; // Optional password for category protection
}
export interface SiteSettings {
title: string;
navTitle: string;
favicon: string;
cardStyle: 'detailed' | 'simple';
}
export interface AppState {
links: LinkItem[];
categories: Category[];
darkMode: boolean;
settings?: SiteSettings;
}
export interface WebDavConfig {
url: string;
username: string;
password: string;
enabled: boolean;
}
export type AIProvider = 'gemini' | 'openai';
export interface AIConfig {
provider: AIProvider;
apiKey: string;
baseUrl: string;
model: string;
}
export const DEFAULT_CATEGORIES: Category[] = [
{ id: 'common', name: '常用推荐', icon: 'Star' },
{ id: 'dev', name: '开发工具', icon: 'Code' },
{ id: 'design', name: '设计资源', icon: 'Palette' },
{ id: 'read', name: '阅读资讯', icon: 'BookOpen' },
{ id: 'ent', name: '休闲娱乐', icon: 'Gamepad2' },
{ id: 'ai', name: '人工智能', icon: 'Bot' },
];
export const INITIAL_LINKS: LinkItem[] = [
{ id: '1', title: 'GitHub', url: 'https://github.com', categoryId: 'dev', createdAt: Date.now(), description: '代码托管平台', pinned: true },
{ id: '2', title: 'React', url: 'https://react.dev', categoryId: 'dev', createdAt: Date.now(), description: '构建Web用户界面的库' },
{ id: '3', title: 'Tailwind CSS', url: 'https://tailwindcss.com', categoryId: 'design', createdAt: Date.now(), description: '原子化CSS框架' },
{ id: '4', title: 'ChatGPT', url: 'https://chat.openai.com', categoryId: 'ai', createdAt: Date.now(), description: 'OpenAI聊天机器人', pinned: true },
{ id: '5', title: 'Gemini', url: 'https://gemini.google.com', categoryId: 'ai', createdAt: Date.now(), description: 'Google DeepMind AI' },
];
export interface SearchEngine {
id: string;
name: string;
url: string; // e.g., https://www.google.com/search?q=
icon: string; // url or key
}
export const DEFAULT_SEARCH_ENGINES: SearchEngine[] = [
{ id: 'local', name: '站内', url: '', icon: 'Search' },
{ id: 'google', name: 'Google', url: 'https://www.google.com/search?q=', icon: 'https://www.google.com/favicon.ico' },
{ id: 'bing', name: '必应', url: 'https://www.bing.com/search?q=', icon: 'https://www.bing.com/favicon.ico' },
{ id: 'baidu', name: '百度', url: 'https://www.baidu.com/s?wd=', icon: 'https://www.baidu.com/favicon.ico' },
{ id: 'github', name: 'GitHub', url: 'https://github.com/search?q=', icon: 'https://github.com/favicon.ico' },
{ id: 'bilibili', name: 'B站', url: 'https://search.bilibili.com/all?keyword=', icon: 'https://www.bilibili.com/favicon.ico' },
];