Tà i liá»u CatApi
Tá»ng quanâ
Các API Äặc thù cá»§a tiá»n Ãch má» rá»ng nà y Äá»u ÄÆ°á»£c Äá»nh nghÄ©a vá»i tiá»n tá» CAT_.
Bạn cũng có thỠtìm các và dụ liên quan trong thư mục và dụ.
Äá»nh nghÄ©aâ
CAT_setProxyâ
Äã lá»i thá»i từ phiên bản á»n Äá»nh 0.9.1; có thá» quay lại trong phiên bản beta.
Äặt proxy. Lưu ý rằng chức nÄng nà y sẽ xung Äá»t vá»i các tiá»n Ãch má» rá»ng như Proxy SwitchyOmega. Nhiá»u script có thá» sá» dụng proxy mà không xung Äá»t.
Vui lòng Äá»c trưá»c vá» PAC và các hạn chế URL Äầy Äá»§ cá»§a Chromium trong PAC.
declare function CAT_setProxy(rule: CAT_Types.ProxyRule[] | string): void;
declare namespace CAT_Types {
interface ProxyRule {
proxyServer: ProxyServer;
matchUrl: string[];
}
type ProxyScheme = "http" | "https" | "quic" | "socks4" | "socks5";
interface ProxyServer {
scheme?: ProxyScheme;
host: string;
port?: number;
}
}
CAT_clearProxyâ
Äã lá»i thá»i từ phiên bản á»n Äá»nh 0.9.1; có thá» quay lại trong phiên bản beta.
Xóa proxy.
declare function CAT_clearProxy(): void;
CAT_clickâ
Äã lá»i thá»i từ phiên bản á»n Äá»nh 0.9.1; có thá» quay lại trong phiên bản beta.
Má»t lần nhấp thá»±c sá»±. API nà y mang tÃnh thá» nghiá»m và có thá» thay Äá»i hoặc bá» xóa.
ÄÆ°á»£c triá»n khai bằng Input.dispatchMouseEvent. Äảm bảo rằng phần tá» nằm trong vùng hiá»n thá» và tá»a Äá» tương Äá»i so vá»i vá» trà cá»a sá».
declare function CAT_click(x: number, y: number): void;
CAT_userConfigâ
Bạn có thá» gá»i API nà y Äá» má» trang UserConfig cá»§a script.
declare function CAT_userConfig(): void;
CAT_fileStorageâ
Äiá»u khiá»n há» thá»ng lưu trữ ÄÆ°á»£c cấu hình bá»i manager. Thư mục app/uuid sẽ ÄÆ°á»£c tạo cho API nà y.
/**
* Äiá»u khiá»n há» thá»ng lưu trữ ÄÆ°á»£c cấu hình bá»i manager.
* @param action Loại thao tác: list, upload, download, delete, config
* @param details
*/
declare function CAT_fileStorage(
action: "list",
details: {
path?: string;
baseDir?: string;
onload?: (files: CATType.FileStorageFileInfo[]) => void;
onerror?: (error: CATType.FileStorageError) => void;
}
): void;
declare function CAT_fileStorage(
action: "download",
details: {
file: CATType.FileStorageFileInfo;
onload: (data: Blob) => void;
onerror?: (error: CATType.FileStorageError) => void;
}
): void;
declare function CAT_fileStorage(
action: "delete",
details: {
path: string;
onload?: () => void;
onerror?: (error: CATType.FileStorageError) => void;
}
): void;
declare function CAT_fileStorage(
action: "upload",
details: {
path: string;
baseDir?: string;
data: Blob;
onload?: () => void;
onerror?: (error: CATType.FileStorageError) => void;
}
): void;
declare function CAT_fileStorage(action: "config"): void;
CAT_scriptLoadedâ
Khi sá» dụng early-start, bạn có thá» sá» dụng hà m nà y Äá» xác Äá»nh xem script Äã tải hoà n toà n chưa.
function CAT_ScriptLoaded(): Promise<void>;
CAT_scriptLoaded().then(() => {
console.log("Script Äã tải hoà n toà n");
});