This commit is contained in:
Tommy D. Rossi
2026-02-22 15:21:38 +01:00
parent e475c2f582
commit f87b0243cd
101 changed files with 14997 additions and 11339 deletions
+71 -190
View File
@@ -93,10 +93,7 @@ declare namespace chrome {
* identity: chrome.ghostPublicAPI.NEW_TEMPORARY_IDENTITY
* }, (tabId) => console.log('Opened tab:', tabId))
*/
export function openTab(
params: OpenTabParams,
callback?: (tabId: number) => void
): Promise<number>
export function openTab(params: OpenTabParams, callback?: (tabId: number) => void): Promise<number>
}
// ============================================================================
@@ -151,107 +148,73 @@ declare namespace chrome {
}
// Proxy CRUD operations
export function add(
proxy: AddProxyParams,
callback?: (proxy: GhostProxy) => void
): Promise<GhostProxy>
export function add(proxy: AddProxyParams, callback?: (proxy: GhostProxy) => void): Promise<GhostProxy>
export function import_(
proxy: AddProxyParams,
callback?: (proxy: GhostProxy) => void
): Promise<GhostProxy>
export function import_(proxy: AddProxyParams, callback?: (proxy: GhostProxy) => void): Promise<GhostProxy>
export function remove(
proxy_id: string,
callback?: (success: boolean) => void
): Promise<boolean>
export function remove(proxy_id: string, callback?: (success: boolean) => void): Promise<boolean>
export function removeAll(callback?: (success: boolean) => void): Promise<boolean>
export function getList(callback?: (proxies: GhostProxy[]) => void): Promise<GhostProxy[]>
export function get(
proxy_id: string,
callback?: (proxy: GhostProxy) => void
): Promise<GhostProxy>
export function get(proxy_id: string, callback?: (proxy: GhostProxy) => void): Promise<GhostProxy>
export function move(
proxy_id: string,
new_index: number,
callback?: (success: boolean) => void
): Promise<boolean>
export function move(proxy_id: string, new_index: number, callback?: (success: boolean) => void): Promise<boolean>
export function modify(
proxy_id: string,
params: ModifyProxyParams,
callback?: (proxy: GhostProxy) => void
callback?: (proxy: GhostProxy) => void,
): Promise<GhostProxy>
// Set proxy at different levels
export function setProjectProxy(
proxy_id: string,
keep_overrides: boolean,
callback?: (success: boolean) => void
callback?: (success: boolean) => void,
): Promise<boolean>
export function setSessionProxy(
session_id: string,
proxy_id: string,
keep_overrides: boolean,
callback?: (success: boolean) => void
callback?: (success: boolean) => void,
): Promise<boolean>
export function setIdentityProxy(
identity_id: string,
proxy_id: string,
callback?: (success: boolean) => void
callback?: (success: boolean) => void,
): Promise<boolean>
export function setTabProxy(
tab_id: number,
proxy_id: string,
callback?: (success: boolean) => void
callback?: (success: boolean) => void,
): Promise<boolean>
// Get proxy at different levels
export function getProjectProxy(callback?: (proxy: GhostProxy) => void): Promise<GhostProxy>
export function getSessionProxy(
session_id: string,
callback?: (proxy: GhostProxy) => void
): Promise<GhostProxy>
export function getSessionProxy(session_id: string, callback?: (proxy: GhostProxy) => void): Promise<GhostProxy>
export function getIdentityProxy(
identity_id: string,
callback?: (proxy: GhostProxy) => void
): Promise<GhostProxy>
export function getIdentityProxy(identity_id: string, callback?: (proxy: GhostProxy) => void): Promise<GhostProxy>
export function getTabProxy(
tab_id: number,
callback?: (proxy: GhostProxy) => void
): Promise<GhostProxy>
export function getTabProxy(tab_id: number, callback?: (proxy: GhostProxy) => void): Promise<GhostProxy>
// Clear proxy at different levels
export function clearProjectProxy(
keep_overrides: boolean,
callback?: (success: boolean) => void
): Promise<boolean>
export function clearProjectProxy(keep_overrides: boolean, callback?: (success: boolean) => void): Promise<boolean>
export function clearSessionProxy(
session_id: string,
keep_overrides: boolean,
callback?: (success: boolean) => void
callback?: (success: boolean) => void,
): Promise<boolean>
export function clearIdentityProxy(
identity_id: string,
callback?: (success: boolean) => void
): Promise<boolean>
export function clearIdentityProxy(identity_id: string, callback?: (success: boolean) => void): Promise<boolean>
export function clearTabProxy(
tab_id: number,
callback?: (success: boolean) => void
): Promise<boolean>
export function clearTabProxy(tab_id: number, callback?: (success: boolean) => void): Promise<boolean>
// Events
export const onAdded: chrome.events.Event<(proxy: GhostProxy) => void>
@@ -259,15 +222,9 @@ declare namespace chrome {
export const onChanged: chrome.events.Event<(proxy: GhostProxy) => void>
export const onMoved: chrome.events.Event<(proxy: GhostProxy, old_index: number) => void>
export const onProjectProxyChanged: chrome.events.Event<(proxy: GhostProxy) => void>
export const onSessionProxyChanged: chrome.events.Event<
(session_id: string, proxy: GhostProxy) => void
>
export const onTabProxyChanged: chrome.events.Event<
(tab_id: number, proxy: GhostProxy) => void
>
export const onIdentityProxyChanged: chrome.events.Event<
(identity_id: string, proxy: GhostProxy) => void
>
export const onSessionProxyChanged: chrome.events.Event<(session_id: string, proxy: GhostProxy) => void>
export const onTabProxyChanged: chrome.events.Event<(tab_id: number, proxy: GhostProxy) => void>
export const onIdentityProxyChanged: chrome.events.Event<(identity_id: string, proxy: GhostProxy) => void>
}
// ============================================================================
@@ -405,42 +362,24 @@ declare namespace chrome {
}
// Project functions
export function getProjectsList(
callback?: (projects: GhostProject[]) => void
): Promise<GhostProject[]>
export function getProjectsList(callback?: (projects: GhostProject[]) => void): Promise<GhostProject[]>
export function getProject(
project_id: string,
callback?: (project: GhostProject) => void
): Promise<GhostProject>
export function getProject(project_id: string, callback?: (project: GhostProject) => void): Promise<GhostProject>
export function getActiveProject(
callback?: (project: GhostProject) => void
): Promise<GhostProject>
export function getActiveProject(callback?: (project: GhostProject) => void): Promise<GhostProject>
export function addProject(
project: AddProjectDetails,
callback?: () => void
): Promise<void>
export function addProject(project: AddProjectDetails, callback?: () => void): Promise<void>
export function removeProject(project_id: string, callback?: () => void): Promise<void>
export function moveProject(
project_id: string,
new_index: number,
callback?: () => void
): Promise<void>
export function moveProject(project_id: string, new_index: number, callback?: () => void): Promise<void>
export function renameProject(
project_id: string,
project_name: string,
callback?: () => void
): Promise<void>
export function renameProject(project_id: string, project_name: string, callback?: () => void): Promise<void>
export function setProjectDescription(
project_id: string,
project_description: string,
callback?: () => void
callback?: () => void,
): Promise<void>
export function lockProject(project_id: string, callback?: () => void): Promise<void>
@@ -448,141 +387,115 @@ declare namespace chrome {
export function openProject(project_id: string, callback?: () => void): Promise<void>
// Archived projects
export function getArchivedProjects(
callback?: (projects: ArchivedProject[]) => void
): Promise<ArchivedProject[]>
export function getArchivedProjects(callback?: (projects: ArchivedProject[]) => void): Promise<ArchivedProject[]>
export function archiveProject(project_id: string, callback?: () => void): Promise<void>
export function restoreArchivedProject(
project_id: string,
callback?: () => void
): Promise<void>
export function restoreArchivedProject(project_id: string, callback?: () => void): Promise<void>
export function deleteArchivedProject(
project_id: string,
callback?: () => void
): Promise<void>
export function deleteArchivedProject(project_id: string, callback?: () => void): Promise<void>
// Session functions
export function getSessionsList(
project_id: string,
callback?: (sessions: GhostSession[]) => void
callback?: (sessions: GhostSession[]) => void,
): Promise<GhostSession[]>
export function getSession(
project_id: string,
session_id: string,
callback?: (session: GhostSession) => void
callback?: (session: GhostSession) => void,
): Promise<GhostSession>
export function renameSession(
project_id: string,
session_id: string,
session_name: string,
callback?: () => void
callback?: () => void,
): Promise<void>
export function changeSessionColor(
project_id: string,
session_id: string,
session_color: string,
callback?: () => void
callback?: () => void,
): Promise<void>
export function clearSessionData(
project_id: string,
session_id: string,
type: ClearSessionDataType,
callback?: () => void
callback?: () => void,
): Promise<void>
// Identity functions
export function getIdentitiesList(
callback?: (identities: GhostIdentity[]) => void
): Promise<GhostIdentity[]>
export function getIdentitiesList(callback?: (identities: GhostIdentity[]) => void): Promise<GhostIdentity[]>
export function sortIdentitiesList(
condition: IdentitySortCondition,
desc: boolean,
callback?: (identities: GhostIdentity[]) => void
callback?: (identities: GhostIdentity[]) => void,
): Promise<GhostIdentity[]>
export function getIdentity(
identity_id: string,
callback?: (identity: GhostIdentity) => void
callback?: (identity: GhostIdentity) => void,
): Promise<GhostIdentity>
export function addIdentity(
identity: AddIdentityDetails,
callback?: (identity: GhostIdentity) => void
callback?: (identity: GhostIdentity) => void,
): Promise<GhostIdentity>
export function removeIdentity(identity_id: string, callback?: () => void): Promise<void>
export function moveIdentity(
identity_id: string,
new_index: number,
callback?: () => void
): Promise<void>
export function moveIdentity(identity_id: string, new_index: number, callback?: () => void): Promise<void>
export function renameIdentity(
identity_id: string,
identity_name: string,
callback?: () => void
): Promise<void>
export function renameIdentity(identity_id: string, identity_name: string, callback?: () => void): Promise<void>
export function changeIdentityColor(
identity_id: string,
identity_color: string,
callback?: () => void
callback?: () => void,
): Promise<void>
export function setIdentityTag(
identity_id: string,
identity_tag: string,
callback?: () => void
): Promise<void>
export function setIdentityTag(identity_id: string, identity_tag: string, callback?: () => void): Promise<void>
export function setIdentityDescription(
identity_id: string,
identity_description: string,
callback?: () => void
callback?: () => void,
): Promise<void>
export function setIdentityDedication(
identity_id: string,
identity_dedication: string,
callback?: () => void
callback?: () => void,
): Promise<void>
export function setIdentityDedicationIsStrict(
identity_id: string,
identity_dedication_is_strict: boolean,
callback?: () => void
callback?: () => void,
): Promise<void>
export function setIdentityUserAgent(
identity_id: string,
user_agent: string,
callback?: () => void
): Promise<void>
export function setIdentityUserAgent(identity_id: string, user_agent: string, callback?: () => void): Promise<void>
export function resetIdentity(
identity_id: string,
callback?: (identity: GhostIdentity) => void
callback?: (identity: GhostIdentity) => void,
): Promise<GhostIdentity>
export function clearIdentityData(
identity_id: string,
type: ClearIdentityDataType,
callback?: () => void
callback?: () => void,
): Promise<void>
export function getIdentityTabsList(
project_id: string,
identity_id: string,
callback?: (tabs: GhostTab[]) => void
callback?: (tabs: GhostTab[]) => void,
): Promise<GhostTab[]>
/** Opens a new tab in a new identity */
@@ -594,110 +507,80 @@ declare namespace chrome {
// Window functions
export function getWindowsList(
project_id: string,
callback?: (windows: GhostWindow[]) => void
callback?: (windows: GhostWindow[]) => void,
): Promise<GhostWindow[]>
export function getWindowTabsList(
project_id: string,
window_id: number,
callback?: (tabs: GhostTab[]) => void
callback?: (tabs: GhostTab[]) => void,
): Promise<GhostTab[]>
export function addWindow(window: AddWindowDetails, callback?: () => void): Promise<void>
export function removeWindow(
project_id: string,
window_id: number,
callback?: () => void
): Promise<void>
export function removeWindow(project_id: string, window_id: number, callback?: () => void): Promise<void>
// Tab functions
export function getSessionTabsList(
project_id: string,
session_id: string,
callback?: (tabs: GhostTab[]) => void
callback?: (tabs: GhostTab[]) => void,
): Promise<GhostTab[]>
export function getTab(
project_id: string,
tab_id: number,
callback?: (tab: GhostTab) => void
): Promise<GhostTab>
export function getTab(project_id: string, tab_id: number, callback?: (tab: GhostTab) => void): Promise<GhostTab>
export function addTab(tab: AddTabDetails, callback?: () => void): Promise<void>
export function removeTab(
project_id: string,
tab_id: number,
callback?: () => void
): Promise<void>
export function removeTab(project_id: string, tab_id: number, callback?: () => void): Promise<void>
export function updateTab(
project_id: string,
tab_id: number,
tab_info: TabInfo,
callback?: () => void
callback?: () => void,
): Promise<void>
// Multi-extension options
export function isMultiExtensionEnabled(
callback?: (enabled: boolean) => void
): Promise<boolean>
export function isMultiExtensionEnabled(callback?: (enabled: boolean) => void): Promise<boolean>
export function getMultiExtensionOptions(
identity_id: string,
callback?: (options: GhostMultiExtensionOption[]) => void
callback?: (options: GhostMultiExtensionOption[]) => void,
): Promise<GhostMultiExtensionOption[]>
export function setMultiExtensionOption(
identity_id: string,
id: string,
value: number,
callback?: (success: boolean) => void
callback?: (success: boolean) => void,
): Promise<boolean>
export function clearMultiExtensionOptions(
identity_id: string,
callback?: (success: boolean) => void
callback?: (success: boolean) => void,
): Promise<boolean>
// Events
export const onProjectWillOpen: chrome.events.Event<
(project_id: string, first_time: boolean) => void
>
export const onProjectOpened: chrome.events.Event<
(project_id: string, first_time: boolean) => void
>
export const onProjectWillOpen: chrome.events.Event<(project_id: string, first_time: boolean) => void>
export const onProjectOpened: chrome.events.Event<(project_id: string, first_time: boolean) => void>
export const onProjectClosed: chrome.events.Event<(project_id: string) => void>
export const onProjectAdded: chrome.events.Event<(project: GhostProject) => void>
export const onProjectRemoved: chrome.events.Event<(project_id: string) => void>
export const onProjectNameChanged: chrome.events.Event<
(project_id: string, new_name: string) => void
>
export const onProjectDescriptionChanged: chrome.events.Event<
(project_id: string, description: string) => void
>
export const onProjectLockStateChanged: chrome.events.Event<
(project_id: string, locked: boolean) => void
>
export const onProjectNameChanged: chrome.events.Event<(project_id: string, new_name: string) => void>
export const onProjectDescriptionChanged: chrome.events.Event<(project_id: string, description: string) => void>
export const onProjectLockStateChanged: chrome.events.Event<(project_id: string, locked: boolean) => void>
export const onIdentityAdded: chrome.events.Event<(identity: GhostIdentity) => void>
export const onIdentityRemoved: chrome.events.Event<(identity_id: string) => void>
export const onIdentityNameChanged: chrome.events.Event<
(identity_id: string, identity_name: string) => void
>
export const onIdentityColorChanged: chrome.events.Event<
(identity_id: string, identity_color: string) => void
>
export const onIdentityNameChanged: chrome.events.Event<(identity_id: string, identity_name: string) => void>
export const onIdentityColorChanged: chrome.events.Event<(identity_id: string, identity_color: string) => void>
export const onIdentityUserAgentChanged: chrome.events.Event<
(identity_id: string, identity_user_agent: string) => void
>
export const onIdentitiesChanged: chrome.events.Event<() => void>
export const onSessionAdded: chrome.events.Event<(session: GhostSession) => void>
export const onSessionRemoved: chrome.events.Event<
(project_id: string, session_id: string) => void
>
export const onSessionRemoved: chrome.events.Event<(project_id: string, session_id: string) => void>
export const onSessionNameChanged: chrome.events.Event<
(project_id: string, session_id: string, new_name: string) => void
>
@@ -712,9 +595,7 @@ declare namespace chrome {
export const onTabUpdated: chrome.events.Event<(project_id: string, tab_id: number) => void>
export const onWindowAdded: chrome.events.Event<(window: GhostWindow) => void>
export const onWindowRemoved: chrome.events.Event<
(project_id: string, window_id: number) => void
>
export const onWindowRemoved: chrome.events.Event<(project_id: string, window_id: number) => void>
}
// ============================================================================