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