mirror of
https://github.com/Start9Labs/start-sdk.git
synced 2026-03-26 02:11:56 +00:00
feat: Make the multi better
This commit is contained in:
@@ -8,7 +8,7 @@ describe("host", () => {
|
||||
test("Testing that the types work", () => {
|
||||
async function test(effects: Effects) {
|
||||
const utils = createUtils<never, never>(effects)
|
||||
const foo = utils.host.multi({ id: "foo" })
|
||||
const foo = utils.host.multi("foo")
|
||||
const fooOrigin = await foo.bindPort(80, { protocol: "http" as const })
|
||||
const fooInterface = new NetworkInterfaceBuilder({
|
||||
effects,
|
||||
|
||||
@@ -50,9 +50,9 @@ export type Utils<Store, Vault, WrapperOverWrite = { const: never }> = {
|
||||
getSystemSmtp: () => GetSystemSmtp & WrapperOverWrite
|
||||
host: {
|
||||
of: (options: { kind: "static" | "single" | "multi"; id: string }) => Host
|
||||
static: (options: { id: string }) => StaticHost
|
||||
single: (options: { id: string }) => SingleHost
|
||||
multi: (options: { id: string }) => MultiHost
|
||||
static: (id: string) => StaticHost
|
||||
single: (id: string) => SingleHost
|
||||
multi: (id: string) => MultiHost
|
||||
}
|
||||
mountDependencies: <
|
||||
In extends
|
||||
@@ -120,11 +120,9 @@ export const utils = <
|
||||
host: {
|
||||
of: (options: { kind: "static" | "single" | "multi"; id: string }) =>
|
||||
new Host({ ...options, effects }),
|
||||
static: (options: { id: string }) =>
|
||||
new StaticHost({ ...options, effects }),
|
||||
single: (options: { id: string }) =>
|
||||
new SingleHost({ ...options, effects }),
|
||||
multi: (options: { id: string }) => new MultiHost({ ...options, effects }),
|
||||
static: (id: string) => new StaticHost({ id, effects }),
|
||||
single: (id: string) => new SingleHost({ id, effects }),
|
||||
multi: (id: string) => new MultiHost({ id, effects }),
|
||||
},
|
||||
readFile: <A>(fileHelper: FileHelper<A>) => fileHelper.read(effects),
|
||||
writeFile: <A>(fileHelper: FileHelper<A>, data: A) =>
|
||||
|
||||
Reference in New Issue
Block a user