mirror of
https://github.com/Start9Labs/start-sdk.git
synced 2026-03-26 10:21:55 +00:00
25 lines
631 B
TypeScript
25 lines
631 B
TypeScript
import { ExpectedExports } from "../types";
|
|
import { Migrations } from "./migrations/setupMigrations";
|
|
import { Install } from "./setupInstall";
|
|
import { Uninstall } from "./setupUninstall";
|
|
|
|
export function setupInit<WrapperData>(
|
|
migrations: Migrations,
|
|
install: Install<WrapperData>,
|
|
uninstall: Uninstall<WrapperData>,
|
|
): {
|
|
init: ExpectedExports.init;
|
|
uninit: ExpectedExports.uninit;
|
|
} {
|
|
return {
|
|
init: async (opts) => {
|
|
await migrations.init(opts);
|
|
await install.init(opts);
|
|
},
|
|
uninit: async (opts) => {
|
|
await migrations.uninit(opts);
|
|
await uninstall.uninit(opts);
|
|
},
|
|
};
|
|
}
|