import type { ZodTypeAny } from 'zod' import { type Opaque } from 'type-fest' import type { IO, Service, Transport } from '@fission-codes/channel/types' import type * as Schemas from './schemas' import type { Workflow } from './workflow/types' export * from '@fission-codes/channel/types' // Export schemas types export * from './schemas' export * from './workflow/types' export type InferError = Extract< ReturnType, { success: false } >['error'] export interface HomestarOptions { transport: Transport } export interface HomestarEvents { error: Error } export type ReceiptOut = ['ok' | 'error', Out] export interface Receipt extends Schemas.Receipt { out: ReceiptOut } export type HomestarService = Service< [ IO<{ method: 'metrics' }, Schemas.Metrics>, IO<{ method: 'node' }, Schemas.Node>, IO<{ method: 'health' }, Schemas.Health>, IO<{ method: 'subscribe_run_workflow'; params: Workflow[] }, string>, IO<{ method: 'subscribe_network_events' }, string>, IO< { method: 'unsubscribe_run_workflow' | 'unsubscribe_network_events' params: [string] }, null >, ], | { subscription: string /** * IPLD dag-json encoded {@link Schemas.WorkflowNotification} * */ result: Opaque } | { subscription: string /** * IPLD dag-json encoded {@link Schemas.EventNotification} * */ result: Opaque } > export interface WitOptions { entryPoint?: string source?: string worldName: string wasiImports?: Set } export interface WasmifyOptions { /** * The entry point of the js module */ entryPoint: string /** * The directory to output the generated files * * @default '' */ outDir?: string /** * The name of the generated Wit World * * @default '' */ worldName?: string /** * Wit dependencies directory * * NOTE: this should be the directory where you run `wit-deps` and this script maybe delete any top level .wit files not inside the deps directory * * @default '' */ witPath?: string /** * Componentize JS debug flag * * @default false */ debug?: boolean }