mirror of
https://github.com/johannesjo/super-productivity.git
synced 2026-07-20 10:01:00 +00:00
* master: fix(build): remove deprecated win32metadata from electron-builder config fix(focus-mode): address critical focus mode and Android notification issues test(task-repeat): fix flaky tests and add Mon/Wed/Fri coverage (#5594) fix(electron): delay window focus after notification to prevent accidental input feat(task): add Go to Task button for all newly created tasks fix(sync): show context-aware permission error for Flatpak/Snap fix(android): skip reminder dialog on Android to fix snooze button fix(focus-mode): respect isFocusModeEnabled setting in App Features fix(android): sync notification timer when time spent is manually changed feat(sync): add WebDAV Test Connection button and improve UX fix(build): ensure consistent Windows EXE metadata for installer and portable Update es.json Update es.json Update es.json feat(i18n): update Turkish language 16.7.3 fix: es.json # Conflicts: # src/app/features/android/store/android.effects.ts # src/app/features/config/form-cfgs/sync-form.const.ts # src/app/features/focus-mode/store/focus-mode.effects.ts # src/app/features/tasks/store/task-ui.effects.ts # src/app/imex/sync/sync-wrapper.service.ts # src/app/pages/config-page/config-page.component.ts # src/app/pfapi/api/sync/providers/webdav/webdav.ts # src/app/t.const.ts
160 lines
3.9 KiB
TypeScript
160 lines
3.9 KiB
TypeScript
import { IpcRendererEvent } from 'electron';
|
|
import {
|
|
GlobalConfigState,
|
|
TakeABreakConfig,
|
|
} from '../src/app/features/config/global-config.model';
|
|
import { KeyboardConfig } from '../src/app/features/config/keyboard-config.model';
|
|
import { JiraCfg } from '../src/app/features/issue/providers/jira/jira.model';
|
|
import { AppDataCompleteLegacy, SyncGetRevResult } from '../src/app/imex/sync/sync.model';
|
|
import { Task } from '../src/app/features/tasks/task.model';
|
|
import { LocalBackupMeta } from '../src/app/imex/local-backup/local-backup.model';
|
|
import { AppDataCompleteNew } from '../src/app/pfapi/pfapi-config';
|
|
import {
|
|
PluginNodeScriptRequest,
|
|
PluginNodeScriptResult,
|
|
PluginManifest,
|
|
} from '../packages/plugin-api/src/types';
|
|
|
|
export interface ElectronAPI {
|
|
on(
|
|
channel: string,
|
|
listener: (event: IpcRendererEvent, ...args: unknown[]) => void,
|
|
): void;
|
|
|
|
// INVOKE
|
|
// ------
|
|
getUserDataPath(): Promise<string>;
|
|
|
|
getBackupPath(): Promise<string>;
|
|
|
|
checkBackupAvailable(): Promise<false | LocalBackupMeta>;
|
|
|
|
loadBackupData(backupPath: string): Promise<string>;
|
|
|
|
fileSyncGetRevAndClientUpdate(args: {
|
|
filePath: string;
|
|
localRev: string | null;
|
|
}): Promise<{ rev: string; clientUpdate?: number } | SyncGetRevResult>;
|
|
|
|
fileSyncSave(args: {
|
|
filePath: string;
|
|
localRev: string | null;
|
|
dataStr: string;
|
|
}): Promise<string | Error>;
|
|
|
|
fileSyncLoad(args: {
|
|
filePath: string;
|
|
localRev: string | null;
|
|
}): Promise<{ rev: string; dataStr: string | undefined } | Error>;
|
|
|
|
fileSyncRemove(args: { filePath: string }): Promise<unknown | Error>;
|
|
|
|
fileSyncListFiles(args: { dirPath: string }): Promise<string[] | Error>; // NEW
|
|
|
|
checkDirExists(args: { dirPath: string }): Promise<true | Error>;
|
|
|
|
pickDirectory(): Promise<string | undefined>;
|
|
|
|
// checkDirExists(dirPath: string): Promise<true | Error>;
|
|
|
|
// STANDARD
|
|
// --------
|
|
setZoomFactor(zoomFactor: number): void;
|
|
|
|
getZoomFactor(): number;
|
|
|
|
openPath(path: string): void;
|
|
|
|
openExternalUrl(url: string): void;
|
|
|
|
saveFileDialog(
|
|
filename: string,
|
|
data: string,
|
|
): Promise<{ success: boolean; path?: string }>;
|
|
|
|
shareNative(payload: {
|
|
text?: string;
|
|
url?: string;
|
|
title?: string;
|
|
files?: string[];
|
|
}): Promise<{ success: boolean; error?: string }>;
|
|
|
|
isLinux(): boolean;
|
|
|
|
isMacOS(): boolean;
|
|
|
|
isSnap(): boolean;
|
|
|
|
isFlatpak(): boolean;
|
|
|
|
// SEND
|
|
// ----
|
|
reloadMainWin(): void;
|
|
|
|
openDevTools(): void;
|
|
|
|
showEmojiPanel(): void;
|
|
|
|
relaunch(): void;
|
|
|
|
exit(exitCode: number): void;
|
|
|
|
shutdownNow(): void;
|
|
|
|
flashFrame(): void;
|
|
|
|
showOrFocus(): void;
|
|
|
|
lockScreen(): void;
|
|
|
|
informAboutAppReady(): void;
|
|
|
|
scheduleRegisterBeforeClose(id: string): void;
|
|
|
|
unscheduleRegisterBeforeClose(id: string): void;
|
|
|
|
setDoneRegisterBeforeClose(id: string): void;
|
|
|
|
setProgressBar(args: {
|
|
progress: number;
|
|
progressBarMode: 'normal' | 'pause' | 'none';
|
|
}): void;
|
|
|
|
sendAppSettingsToElectron(globalCfg: GlobalConfigState): void;
|
|
|
|
sendSettingsUpdate(globalCfg: GlobalConfigState): void;
|
|
|
|
updateTitleBarDarkMode(isDarkMode: boolean): void;
|
|
|
|
registerGlobalShortcuts(keyboardConfig: KeyboardConfig): void;
|
|
|
|
showFullScreenBlocker(args: { msg?: string; takeABreakCfg: TakeABreakConfig }): void;
|
|
|
|
// TODO use invoke instead
|
|
makeJiraRequest(args: {
|
|
requestId: string;
|
|
url: string;
|
|
requestInit: RequestInit;
|
|
jiraCfg: JiraCfg;
|
|
}): void;
|
|
|
|
jiraSetupImgHeaders(args: { jiraCfg: JiraCfg }): void;
|
|
|
|
backupAppData(appData: AppDataCompleteLegacy | AppDataCompleteNew): void;
|
|
|
|
updateCurrentTask(
|
|
task: Task | null,
|
|
isPomodoroEnabled: boolean,
|
|
currentPomodoroSessionTime: number,
|
|
isFocusModeEnabled?: boolean,
|
|
currentFocusSessionTime?: number,
|
|
);
|
|
|
|
exec(command: string): void;
|
|
|
|
pluginExecNodeScript(
|
|
pluginId: string,
|
|
manifest: PluginManifest,
|
|
request: PluginNodeScriptRequest,
|
|
): Promise<PluginNodeScriptResult>;
|
|
}
|