mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-04-03 18:12:07 -07:00
42 lines
1.4 KiB
TypeScript
42 lines
1.4 KiB
TypeScript
import {
|
|
composeStartupLifecycleHandlers,
|
|
type StartupLifecycleComposerOptions,
|
|
} from './runtime/composers';
|
|
|
|
export interface StartupLifecycleRuntimeInput {
|
|
protocolUrl: StartupLifecycleComposerOptions['registerProtocolUrlHandlersMainDeps'];
|
|
cleanup: StartupLifecycleComposerOptions['onWillQuitCleanupMainDeps'];
|
|
shouldRestoreWindowsOnActivate: StartupLifecycleComposerOptions['shouldRestoreWindowsOnActivateMainDeps'];
|
|
restoreWindowsOnActivate: StartupLifecycleComposerOptions['restoreWindowsOnActivateMainDeps'];
|
|
}
|
|
|
|
export interface StartupLifecycleRuntime {
|
|
registerProtocolUrlHandlers: () => void;
|
|
onWillQuitCleanup: () => void;
|
|
shouldRestoreWindowsOnActivate: () => boolean;
|
|
restoreWindowsOnActivate: () => void;
|
|
}
|
|
|
|
export function createStartupLifecycleRuntime(
|
|
input: StartupLifecycleRuntimeInput,
|
|
): StartupLifecycleRuntime {
|
|
const {
|
|
registerProtocolUrlHandlers,
|
|
onWillQuitCleanup,
|
|
shouldRestoreWindowsOnActivate,
|
|
restoreWindowsOnActivate,
|
|
} = composeStartupLifecycleHandlers({
|
|
registerProtocolUrlHandlersMainDeps: input.protocolUrl,
|
|
onWillQuitCleanupMainDeps: input.cleanup,
|
|
shouldRestoreWindowsOnActivateMainDeps: input.shouldRestoreWindowsOnActivate,
|
|
restoreWindowsOnActivateMainDeps: input.restoreWindowsOnActivate,
|
|
});
|
|
|
|
return {
|
|
registerProtocolUrlHandlers,
|
|
onWillQuitCleanup,
|
|
shouldRestoreWindowsOnActivate,
|
|
restoreWindowsOnActivate,
|
|
};
|
|
}
|