/** 页面实例对象 */ export interface PageInstance { /** 页面唯一标识 */ pageId: string; /** 页面路径 */ route: string; /** 页面参数对象(跳转时传递的 query 参数) */ options?: Record; /** 页面数据对象 */ data?: Record; [key: string]: any; } /** * 获取当前页面栈。返回一个数组,数组中的元素为页面栈中的页面对象,数组第一个元素为首页,最后一个元素为当前页面。 * * @public * @alias getCurrentPages * @since @ray-js/ray 0.2.0 * @returns 页面栈数组,每个元素为 PageInstance 对象 * @remarks * 1. 不要尝试修改页面栈,会导致路由以及页面状态错误。 * 2. 不要在 App.onLaunch 的时候调用 getCurrentPages(),此时 page 还没有生成。 * @example 基础用法 * ```tsx * import React from 'react'; * import { View, Button, getCurrentPages } from '@ray-js/ray'; * * export default function Home() { * const handleGetPages = () => { * const pages = getCurrentPages(); * console.log('当前页面栈长度:', pages.length); * console.log('当前页面:', pages[pages.length - 1]); * * pages.forEach((page, index) => { * console.log(`页面 ${index}:`, page.route); * }); * }; * * return ( * * * * ); * } * ``` */ export default function (): PageInstance[];