import { Checking, type Test } from "hry-types"; import type { ReadonlyDeep } from "hry-types/src/Any/ReadonlyDeep"; import { RootComponent, type SpecificType } from "../../../../.."; // 组件时 RootComponent()({ properties: { obj: Object, optionalObj: { type: Object as SpecificType<{ name: string }>, value: { name: "zhao" }, }, }, lifetimes: { attached() { // 组件实例对象格外添加null类型 Checking, Test.Pass>; }, }, }); // 页面时 RootComponent()({ isPage: true, properties: { obj: Object, optionalObj: { type: Object as SpecificType<{ name: string }>, value: { name: "zhao" }, }, }, pageLifetimes: { onLoad(data) { Checking; // 页面实例对象不额外添加null Checking, Test.Pass>; // 页面实例对象不额外添加null Checking; }, }, });