import { ValidateExVer } from "../../exver" import * as T from "../../types" export class Migration< Manifest extends T.Manifest, Store, Version extends string, > { constructor( readonly options: { version: Version & ValidateExVer up: (opts: { effects: T.Effects }) => Promise down: (opts: { effects: T.Effects }) => Promise }, ) {} static of< Manifest extends T.Manifest, Store, Version extends string, >(options: { version: Version & ValidateExVer up: (opts: { effects: T.Effects }) => Promise down: (opts: { effects: T.Effects }) => Promise }) { return new Migration(options) } async up(opts: { effects: T.Effects }) { this.up(opts) } async down(opts: { effects: T.Effects }) { this.down(opts) } }