mirror of
https://github.com/Start9Labs/start-sdk.git
synced 2026-03-26 10:21:55 +00:00
feat: Change the type of the setupInterfaces
This commit is contained in:
@@ -46,7 +46,11 @@ import { defaultTrigger } from "./trigger/defaultTrigger"
|
||||
import { changeOnFirstSuccess, cooldownTrigger } from "./trigger"
|
||||
import setupConfig, { Read, Save } from "./config/setupConfig"
|
||||
import { setupDependencyMounts } from "./dependency/setupDependencyMounts"
|
||||
import { SetInterfaces, setupInterfaces } from "./interfaces/setupInterfaces"
|
||||
import {
|
||||
InterfacesReceipt,
|
||||
SetInterfaces,
|
||||
setupInterfaces,
|
||||
} from "./interfaces/setupInterfaces"
|
||||
import { AddressReceipt } from "./interfaces/AddressReceipt"
|
||||
import { Host } from "./interfaces/Host"
|
||||
|
||||
@@ -161,7 +165,7 @@ export class StartSdk<Manifest extends SDKManifest, Store, Vault> {
|
||||
setupInstall: (fn: InstallFn<Store, Vault>) => Install.of(fn),
|
||||
setupInterfaces: <
|
||||
ConfigInput extends Record<string, any>,
|
||||
Output extends Record<string, Address[] & AddressReceipt>,
|
||||
Output extends InterfacesReceipt,
|
||||
>(
|
||||
config: Config<ConfigInput, Store, Vault>,
|
||||
fn: SetInterfaces<Store, Vault, ConfigInput, Output>,
|
||||
|
||||
@@ -5,7 +5,7 @@ import { Config, ExtractConfigType } from "./builder/config"
|
||||
import { Utils, utils } from "../util/utils"
|
||||
import nullIfEmpty from "../util/nullIfEmpty"
|
||||
import { InterfaceReceipt } from "../interfaces/interfaceReceipt"
|
||||
import { SetInterfacesReceipt } from "../interfaces/setupInterfaces"
|
||||
import { InterfacesReceipt as InterfacesReceipt } from "../interfaces/setupInterfaces"
|
||||
|
||||
declare const dependencyProof: unique symbol
|
||||
export type DependenciesReceipt = void & {
|
||||
@@ -27,8 +27,7 @@ export type Save<
|
||||
dependencies: D.ConfigDependencies<Manifest>
|
||||
}) => Promise<{
|
||||
dependenciesReceipt: DependenciesReceipt
|
||||
interfaceReceipt: InterfaceReceipt
|
||||
setInterfacesReceipt: SetInterfacesReceipt
|
||||
interfacesReceipt: InterfacesReceipt
|
||||
restart: boolean
|
||||
}>
|
||||
export type Read<
|
||||
|
||||
@@ -3,12 +3,12 @@ import { Address, Effects } from "../types"
|
||||
import { Utils } from "../util/utils"
|
||||
import { AddressReceipt } from "./AddressReceipt"
|
||||
|
||||
export type SetInterfacesReceipt = Record<string, Address[] & AddressReceipt>
|
||||
export type InterfacesReceipt = Array<Address[] & AddressReceipt>
|
||||
export type SetInterfaces<
|
||||
Store,
|
||||
Vault,
|
||||
ConfigInput extends Record<string, any>,
|
||||
Output extends Record<string, Address[] & AddressReceipt>,
|
||||
Output extends InterfacesReceipt,
|
||||
> = (opts: {
|
||||
effects: Effects
|
||||
input: null | ConfigInput
|
||||
@@ -18,10 +18,10 @@ export type SetupInterfaces = <
|
||||
Store,
|
||||
Vault,
|
||||
ConfigInput extends Record<string, any>,
|
||||
Output extends Record<string, Address[] & AddressReceipt>,
|
||||
Output extends InterfacesReceipt,
|
||||
>(
|
||||
config: Config<ConfigInput, Store, Vault>,
|
||||
fn: SetInterfaces<Store, Vault, ConfigInput, Output>,
|
||||
) => SetInterfaces<Store, Vault, ConfigInput, Output>
|
||||
export const NO_INTERFACE_CHANGES = {} as SetInterfacesReceipt
|
||||
export const NO_INTERFACE_CHANGES = [] as InterfacesReceipt
|
||||
export const setupInterfaces: SetupInterfaces = (_config, fn) => fn
|
||||
|
||||
Reference in New Issue
Block a user