import { SDKManifest } from "../manifest/ManifestTypes" import { Effects, ExpectedExports } from "../types" export type InstallFn = (opts: { effects: Effects }) => Promise export class Install { private constructor(readonly fn: InstallFn) {} static of( fn: InstallFn, ) { return new Install(fn) } async init({ effects, previousVersion, }: Parameters[0]) { if (!previousVersion) await this.fn({ effects, }) } } export function setupInstall( fn: InstallFn, ) { return Install.of(fn) }