mirror of
https://github.com/actualbudget/actual.git
synced 2026-05-06 20:15:33 -05:00
* fix github actions inconsistencies * fix pinning of transitive deps in eslint-plugin * drop use of node-fetch in api * drop md5 dependency in favour of node:crypto * drop slash * drop unused top level packages * add note about node-polyfills warning * remove unused deps from desktop-client * drop pegjs types * note * drop node-jq
31 lines
768 B
TypeScript
31 lines
768 B
TypeScript
import { init as initLootCore } from '@actual-app/core/server/main';
|
|
import type { InitConfig, lib } from '@actual-app/core/server/main';
|
|
|
|
import { validateNodeVersion } from './validateNodeVersion';
|
|
|
|
export * from './methods';
|
|
export * as utils from './utils';
|
|
|
|
/** @deprecated Please use return value of `init` instead */
|
|
export let internal: typeof lib | null = null;
|
|
|
|
export async function init(config: InitConfig = {}) {
|
|
validateNodeVersion();
|
|
|
|
internal = await initLootCore(config);
|
|
return internal;
|
|
}
|
|
|
|
export async function shutdown() {
|
|
if (internal) {
|
|
try {
|
|
await internal.send('sync');
|
|
} catch {
|
|
// most likely that no budget is loaded, so the sync failed
|
|
}
|
|
|
|
await internal.send('close-budget');
|
|
internal = null;
|
|
}
|
|
}
|