mirror of
https://github.com/yaklang/yaklang-chrome-extension.git
synced 2026-09-26 21:21:53 +08:00
add proxy switch demo
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
export const ProxyActionType = {
|
||||
CONNECT: "CONNECT",
|
||||
SEND_MESSAGE: "SEND_MESSAGE",
|
||||
DISCONNECT: "DISCONNECT",
|
||||
SET_PROXY: "SET_PROXY",
|
||||
CLEAR_PROXY: "CLEAR_PROXY",
|
||||
PROXY_STATUS: "PROXY_STATUS",
|
||||
INJECT_SCRIPT: "INJECT_SCRIPT",
|
||||
BADGE_COUNT: "BADGE_COUNT",
|
||||
SET_PROXY_CONFIG: "SET_PROXY_CONFIG",
|
||||
CLEAR_PROXY_CONFIG: "CLEAR_PROXY_CONFIG",
|
||||
GET_PROXY_STATUS: "GET_PROXY_STATUS"
|
||||
} as const;
|
||||
|
||||
export type ProxyActionType = typeof ProxyActionType[keyof typeof ProxyActionType];
|
||||
@@ -0,0 +1,19 @@
|
||||
export interface StorageChange<T = any> {
|
||||
oldValue?: T;
|
||||
newValue?: T;
|
||||
}
|
||||
|
||||
export interface StorageChanges {
|
||||
[key: string]: StorageChange;
|
||||
}
|
||||
|
||||
export interface ProxyConfig {
|
||||
host: string;
|
||||
port: number;
|
||||
scheme: 'http' | 'https' | 'socks5';
|
||||
proxyType: 'fixed_server';
|
||||
enabled?: boolean;
|
||||
id?: string;
|
||||
name?: string;
|
||||
timestamp?: number;
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
export interface ProxyConfig {
|
||||
id: string;
|
||||
name: string;
|
||||
enabled: boolean;
|
||||
proxyType: "direct" | "fixed_server" | "pac_script" | "auto_detect" | "bypass_list";
|
||||
host?: string;
|
||||
port?: number;
|
||||
scheme?: "http" | "https" | "socks4" | "socks5";
|
||||
pacScript?: string;
|
||||
bypassList?: string[];
|
||||
}
|
||||
Reference in New Issue
Block a user