For AI agents: the complete documentation index is available at /en/llms.txt, the full documentation bundle is available at /en/llms-full.txt, and this page is available as Markdown at /en/reference/sdk/node/config/functions/withConfigSchema.md.
  • English
  • Function: withConfigSchema()

    function withConfigSchema<T>(
       value: T, 
       schemaId: ConfigSchemaId, 
       from?: "configs" | "packs" | "modules"): T & {
      $schema: string;
    };

    Defined in: node/config/index.ts:154

    在对象根写入 $schema(不覆盖已有);数组根勿调用。

    Type Parameters

    Type Parameter
    T extends Record<string, unknown>

    Parameters

    ParameterTypeDefault value
    valueTundefined
    schemaIdConfigSchemaIdundefined
    from"configs" | "packs" | "modules""configs"

    Returns

    T & { $schema: string; }