chore: Update to fix the types

This commit is contained in:
J H
2024-01-31 10:07:30 -07:00
parent b24a0145bc
commit 7be894bda6
10 changed files with 133 additions and 75 deletions

View File

@@ -1,25 +1,28 @@
import { Config } from "../config/builder/config"
import { SDKManifest } from "../manifest/ManifestTypes"
import { Address, Effects } from "../types"
import { Utils } from "../util/utils"
import { AddressReceipt } from "./AddressReceipt"
export type InterfacesReceipt = Array<Address[] & AddressReceipt>
export type SetInterfaces<
Manifest extends SDKManifest,
Store,
ConfigInput extends Record<string, any>,
Output extends InterfacesReceipt,
> = (opts: {
effects: Effects
input: null | ConfigInput
utils: Utils<Store>
utils: Utils<Manifest, Store>
}) => Promise<Output>
export type SetupInterfaces = <
Manifest extends SDKManifest,
Store,
ConfigInput extends Record<string, any>,
Output extends InterfacesReceipt,
>(
config: Config<ConfigInput, Store>,
fn: SetInterfaces<Store, ConfigInput, Output>,
) => SetInterfaces<Store, ConfigInput, Output>
fn: SetInterfaces<Manifest, Store, ConfigInput, Output>,
) => SetInterfaces<Manifest, Store, ConfigInput, Output>
export const NO_INTERFACE_CHANGES = [] as InterfacesReceipt
export const setupInterfaces: SetupInterfaces = (_config, fn) => fn