Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: Haze <hazeone@users.noreply.github.com> Co-authored-by: paisley <8197966+su8su@users.noreply.github.com> Co-authored-by: Felix <24791380+vcfgv@users.noreply.github.com>
12 lines
350 B
TypeScript
12 lines
350 B
TypeScript
export interface SignalQuitHandlerHooks {
|
|
logInfo: (message: string) => void;
|
|
requestQuit: () => void;
|
|
}
|
|
|
|
export function createSignalQuitHandler(hooks: SignalQuitHandlerHooks): (signal: NodeJS.Signals) => void {
|
|
return (signal: NodeJS.Signals) => {
|
|
hooks.logInfo(`Received ${signal}; requesting app quit`);
|
|
hooks.requestQuit();
|
|
};
|
|
}
|