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