Type Alias: ConfigShape<C>
type ConfigShape<C> = { readonly [K in keyof C]?: ConfigField<NonNullable<C[K]>> };
Defined in: packages/overcast-core/src/config-schema.ts:140
The string-configurable slice of a layer config C, as the shape a
ConfigSchema is built from.
Every key optional, and deliberately a subset: plenty of a layer config is
unreachable from a string — EvmConfig's publicClient, walletClient,
account, chain and rpcTransport are objects a program constructs, not
values an operator types. ? on every key says so, and NonNullable means a
field declared chainId?: number wants a parser producing number rather
than one that has to restate the undefined ConfigField already
expresses.
Written as a satisfies on the shape passed to z.object, which is what
makes a schema that disagrees with its config fail to compile — on the field
name as much as the type:
export const EVM_CONFIG_SCHEMA = z.object({
chainId: configField(z.coerce.number(), { env: "CHAIN_ID", describe: "…" }),
} satisfies ConfigShape<EvmConfig<ChainName>>);
Type Parameters
| Type Parameter |
|---|
C |