refactor frontend
This commit is contained in:
73
src/types/browser.ts
Normal file
73
src/types/browser.ts
Normal file
@@ -0,0 +1,73 @@
|
||||
export type BrowserStats = {
|
||||
profileCount: number;
|
||||
extensionCount: number;
|
||||
bookmarkCount: number;
|
||||
};
|
||||
|
||||
export type ProfileSummary = {
|
||||
id: string;
|
||||
name: string;
|
||||
email: string | null;
|
||||
avatarDataUrl: string | null;
|
||||
avatarLabel: string;
|
||||
path: string;
|
||||
};
|
||||
|
||||
export type ExtensionSummary = {
|
||||
id: string;
|
||||
name: string;
|
||||
version: string | null;
|
||||
iconDataUrl: string | null;
|
||||
profileIds: string[];
|
||||
};
|
||||
|
||||
export type BookmarkSummary = {
|
||||
url: string;
|
||||
title: string;
|
||||
profileIds: string[];
|
||||
};
|
||||
|
||||
export type ProfileSortKey = "name" | "email" | "id";
|
||||
export type ExtensionSortKey = "name" | "id";
|
||||
export type BookmarkSortKey = "title" | "url";
|
||||
export type ActiveSection = "profiles" | "extensions" | "bookmarks";
|
||||
export type AppPage = "browserData" | "configuration";
|
||||
export type BrowserConfigSource = "default" | "custom";
|
||||
|
||||
export type BrowserConfigEntry = {
|
||||
id: string;
|
||||
source: BrowserConfigSource;
|
||||
browserFamilyId: string | null;
|
||||
iconKey: string | null;
|
||||
name: string;
|
||||
executablePath: string;
|
||||
userDataPath: string;
|
||||
deletable: boolean;
|
||||
};
|
||||
|
||||
export type BrowserConfigListResponse = {
|
||||
configs: BrowserConfigEntry[];
|
||||
};
|
||||
|
||||
export type CreateCustomBrowserConfigInput = {
|
||||
name: string;
|
||||
iconKey: string | null;
|
||||
executablePath: string;
|
||||
userDataPath: string;
|
||||
};
|
||||
|
||||
export type BrowserView = {
|
||||
browserId: string;
|
||||
browserFamilyId: string | null;
|
||||
browserName: string;
|
||||
iconKey: string | null;
|
||||
dataRoot: string;
|
||||
profiles: ProfileSummary[];
|
||||
extensions: ExtensionSummary[];
|
||||
bookmarks: BookmarkSummary[];
|
||||
stats: BrowserStats;
|
||||
};
|
||||
|
||||
export type ScanResponse = {
|
||||
browsers: BrowserView[];
|
||||
};
|
||||
Reference in New Issue
Block a user