/** * 设置小程序顶部导航栏标题,支持超长文本自动截断 * @public * @since @ray-js/panel-sdk 1.0.0 * @param title - 要设置的标题文本 * @param ellipsis - 标题最大字符数,超出后自动添加省略号,默认为 14 * @typeOverride ellipsis number * @returns 元组 `[setTitle]`,包含一个可手动设置标题的函数 * @remarks * 该 Hook 会在 `title` 变化时自动更新导航栏标题。 * 底层依赖 `@ray-js/ray` 提供的 `setNavigationBarTitle` API 设置小程序导航栏标题。 * 若标题长度超过 `ellipsis` 指定的字符数,将自动截断并添加 `...` 后缀。 * @example * ```tsx * import { useTopBarTitle } from '@ray-js/panel-sdk'; * * function DevicePage() { * // 自动设置顶部标题,超过 14 个字符会截断 * const [setTitle] = useTopBarTitle('智能灯光控制面板'); * * // 也可以手动更新标题 * const handleRename = (newName: string) => setTitle(newName); * } * ``` */ export declare const useTopBarTitle: (title: string, ellipsis?: number) => ((titleRes: string) => void)[];