For AI agents: the complete documentation index is available at /next/zh/llms.txt, the full documentation bundle is available at /next/zh/llms-full.txt, and this page is available as Markdown at /next/zh/api/packages/rspeedy/interfaces/ExposedAPI.md.
Lynx
  • 简体中文
  • 接口: ExposedAPI

    Rspeedy 暴露的 API。可以在 Rsbuild 插件中通过 api.useExposed 使用。

    示例

    import type { ExposedAPI } from '@lynx-js/rspeedy'
    const RsbuildPlugin = {
      name: 'my-rsbuild-plugin',
      pre: ['lynx:rsbuild:plugin-api'],
      setup(api) {
        const rspeedyAPI = api.useExposed<ExposedAPI>(Symbol.for('rspeedy.api'))
      },
    }

    属性

    config

    config: Config

    用户配置。


    debug

    debug: (message: string | (() => string)) => void

    打印调试日志。

    参数

    参数类型描述
    messagestring | (() => string)打印的消息。

    返回

    void


    exit

    exit: (code?: number) => void | Promise<void>

    退出进程。

    参数

    参数类型描述
    code?number退出码。

    返回

    void | Promise<void>


    logger

    logger: Logger

    获取 Rspeedy 的 logger。


    version

    version: string

    Rspeedy 的版本。

    除非另有说明,本项目采用知识共享署名 4.0 国际许可协议进行许可,代码示例采用 Apache License 2.0 许可协议进行许可。