import { ComponentPublicInstance } from 'vue'; declare const CHECK_STATUS_MAP: { readonly checked: "checked"; readonly unchecked: "unchecked"; readonly indeterminate: "indeterminate"; }; type TreeKey = string | number; type CheckStatus = typeof CHECK_STATUS_MAP[keyof typeof CHECK_STATUS_MAP]; type TreeModelValue = TreeKey | TreeKey[] | null; interface TreeDataItem { [key: string]: any; } interface TreeNode { id: TreeKey; label: string; append: string; icon: string; path: string[]; source: TreeDataItem; parentId?: TreeKey; parentIds: TreeKey[]; parents: TreeDataItem[]; level: number; disabled: boolean; checked: CheckStatus; expanded: boolean; visible: boolean; isLeaf: boolean; loaded: boolean; loading: boolean; loadError: unknown; } interface TreeProps { id: string; label: string; children: string; disabled?: string; leaf?: string; append?: string; icon?: string; } interface TreeCheckChangePayload { value: TreeModelValue; keys: TreeKey[]; nodes: TreeNode[]; /** Current half-checked keys in linked multiple-selection mode. */ halfCheckedKeys: TreeKey[]; /** Current half-checked nodes in linked multiple-selection mode. */ halfCheckedNodes: TreeNode[]; node: TreeNode; } interface TreeLoadPayload { node: TreeNode; children: TreeDataItem[]; } interface TreeLoadErrorPayload { node: TreeNode; error: unknown; } interface TreeScrollToOptions { /** Expand ancestors before locating the node. */ expandParents?: boolean; } interface TreeExpandPayload { expanded: boolean; node: TreeNode; } interface TreeNodeClickPayload { id: TreeKey; node: TreeNode; path: TreeNode[]; } interface TreeFilterPayload { value: string; /** Visible keys after filtering, including direct matches, ancestors and descendants. */ keys: TreeKey[]; /** Visible nodes after filtering, including direct matches, ancestors and descendants. */ nodes: TreeNode[]; /** Keys directly matched by the built-in or custom filter rule. */ matchedKeys: TreeKey[]; /** Nodes directly matched by the built-in or custom filter rule. */ matchedNodes: TreeNode[]; } interface TreeSlotProps { node: TreeNode; data: TreeDataItem; path: TreeNode[]; } interface TreeEmptySlotProps { filterValue: string; } interface UniTreeViewSlots { default?: (props: TreeSlotProps) => unknown; label?: (props: TreeSlotProps) => unknown; icon?: (props: TreeSlotProps) => unknown; append?: (props: TreeSlotProps) => unknown; empty?: (props: TreeEmptySlotProps) => unknown; "empty-filter"?: (props: TreeEmptySlotProps) => unknown; } interface UniTreeViewProps { /** Current selected value. Single select uses one key, multiple select uses an array. */ modelValue?: TreeModelValue; /** Tree data. */ data?: TreeDataItem[]; /** Filter keyword. Matching nodes and their related branch stay visible. */ filterValue?: string; /** Custom node matcher used when filterValue is not empty. */ filterMethod?: (value: string, node: TreeNode) => boolean; /** Highlight literal filter keyword matches in the built-in label. */ highlightFilter?: boolean; /** Default checked keys for uncontrolled initial state. */ defaultCheckedKeys?: TreeKey | TreeKey[] | null; /** Field mapping for id, label, children, disabled, leaf, append and icon. */ treeProps?: Partial; /** Theme color for active checkbox/radio. */ themeColor?: string; /** Whether to enable and show the selection control. */ selectable?: boolean; /** Whether to show radio UI in single-select mode. */ showRadioIcon?: boolean; /** Whether to support multiple selection. */ multiple?: boolean; /** Whether clicking a node row changes its selection state. */ checkOnClickNode?: boolean; /** Whether clicking a leaf node row changes its selection state. */ checkOnClickLeaf?: boolean; /** Whether clicking a node row expands or collapses it. */ expandOnClickNode?: boolean; /** Whether expanding a node collapses its expanded siblings. */ accordion?: boolean; /** Whether parent and child checked states are independent. */ checkStrictly?: boolean; /** Single-select mode can only select leaf nodes. Ignored when `multiple` is true. */ onlyRadioLeaf?: boolean; /** Whether all nodes are expanded initially. */ defaultExpandAll?: boolean; /** Default expanded node keys. */ defaultExpandedKeys?: TreeKey[]; /** Whether default expanded keys also expand all their ancestors. */ defaultExpandParent?: boolean; /** Expand ancestors of checked nodes initially. */ expandChecked?: boolean; /** Preserve runtime expanded state when tree data is rebuilt. */ cacheExpandedKeys?: boolean; /** Lazy load mode. Nodes can be expanded before children exist. */ loadMode?: boolean; /** Lazy load function. */ loadApi?: (node: TreeNode) => TreeDataItem[] | Promise; /** Custom leaf resolver. */ isLeafFn?: (item: TreeDataItem, node: TreeNode) => boolean; /** Load once on first expand even when static children exist. */ alwaysFirstLoad?: boolean; /** Whether disabled nodes can participate in selection state changes. */ checkedDisabled?: boolean; /** Whether checked disabled nodes are included in returned keys/nodes. */ packDisabledKey?: boolean; /** @deprecated Use `packDisabledKey` instead. */ packDisabledkey?: boolean; /** Custom class name added to every node row. */ nodeClass?: string; /** Tree item indent in rpx. */ indent?: number; /** Selection control placement. */ selectionPlacement?: "left" | "right"; /** Empty text shown when data is empty. */ emptyText?: string; /** Show label path under the node label. */ showPath?: boolean; /** Separator used by the built-in path display. */ pathSeparator?: string; /** Enable fixed-height virtual rendering for very large visible node lists. */ virtual?: boolean; /** Row height in px when virtual rendering is enabled. */ virtualItemHeight?: number; /** Scroll container height in px when virtual rendering is enabled. */ virtualHeight?: number; /** Extra rows rendered before and after the viewport in virtual mode. */ virtualOverscan?: number; } interface UniTreeViewExposed { setCheckedKeys: (keys: TreeKey | TreeKey[], checked?: boolean) => TreeModelValue; getCheckedKeys: () => TreeKey[]; getHalfCheckedKeys: () => TreeKey[]; getUncheckedKeys: () => TreeKey[]; getCheckedNodes: () => TreeNode[]; getHalfCheckedNodes: () => TreeNode[]; getUncheckedNodes: () => TreeNode[]; setExpandedKeys: (keys: TreeKey[] | "all", expanded?: boolean) => void; getExpandedKeys: () => TreeKey[]; getUnexpandedKeys: () => TreeKey[]; getVisibleKeys: () => TreeKey[]; getMatchedKeys: () => TreeKey[]; getExpandedNodes: () => TreeNode[]; getUnexpandedNodes: () => TreeNode[]; getVisibleNodes: () => TreeNode[]; getMatchedNodes: () => TreeNode[]; getNode: (key: TreeKey) => TreeNode | undefined; getNodePath: (keyOrNode: TreeKey | TreeNode) => TreeNode[]; expandAll: () => void; collapseAll: () => void; loadNode: (node: TreeNode) => Promise; retryLoad: (keyOrNode: TreeKey | TreeNode) => Promise; scrollToKey: (key: TreeKey, options?: TreeScrollToOptions) => Promise; } /** * 事件表使用 Vue 3.3+ 的「具名元组」形态,且必须是 type 别名而非 interface: * `defineEmits()` 的约束是 `Record`,interface 没有隐式索引签名,无法满足。 */ type UniTreeViewEmits = { "update:modelValue": [value: TreeModelValue]; "check-change": [payload: TreeCheckChangePayload]; "expand-change": [payload: TreeExpandPayload]; "load": [payload: TreeLoadPayload]; "load-error": [payload: TreeLoadErrorPayload]; "node-click": [payload: TreeNodeClickPayload]; "filter-change": [payload: TreeFilterPayload]; }; declare function getIsPc(): boolean; interface IPlatform { APP: "APP"; APP_ANDROID: "APP-ANDROID"; APP_IOS: "APP-IOS"; APP_HARMONY: "APP-HARMONY"; WEB: "WEB"; MP: "MP"; MP_WEIXIN: "MP-WEIXIN"; MP_ALIPAY: "MP-ALIPAY"; MP_BAIDU: "MP-BAIDU"; MP_TOUTIAO: "MP-TOUTIAO"; MP_LARK: "MP-LARK"; MP_QQ: "MP-QQ"; MP_KUAISHOU: "MP-KUAISHOU"; MP_JD: "MP-JD"; MP_360: "MP-360"; MP_XHS: "MP-XHS"; MP_HARMONY: "MP-HARMONY"; QUICKAPP_WEBVIEW: "QUICKAPP-WEBVIEW"; QUICKAPP_WEBVIEW_UNION: "QUICKAPP-WEBVIEW-UNION"; QUICKAPP_WEBVIEW_HUAWEI: "QUICKAPP-WEBVIEW-HUAWEI"; OTHER: "OTHER"; } declare const Platform: IPlatform; declare function getPlatform(): IPlatform[keyof IPlatform]; declare const platform: ReturnType; /** App */ declare const isApp: boolean; /** App Android */ declare const isAppAndroid: boolean; /** App iOS */ declare const isAppIos: boolean; /** App HarmonyOS Next */ declare const isAppHarmony: boolean; /** Web */ declare const isWeb: boolean; /** 小程序 */ declare const isMp: boolean; /** 微信小程序 */ declare const isMpWeixin: boolean; /** 支付宝小程序 */ declare const isMpAlipay: boolean; /** 百度小程序 */ declare const isMpBaidu: boolean; /** 头条小程序 */ declare const isMpToutiao: boolean; /** 飞书小程序 */ declare const isMpLark: boolean; /** QQ小程序 */ declare const isMpQq: boolean; /** 快手小程序 */ declare const isMpKuaishou: boolean; /** 京东小程序 */ declare const isMpJd: boolean; /** 360小程序 */ declare const isMp360: boolean; /** 小红书小程序 */ declare const isMpXhs: boolean; /** 鸿蒙元服务 */ declare const isMpHarmony: boolean; /** 快应用 */ declare const isQuickappWebview: boolean; /** 快应用联盟 */ declare const isQuickappWebviewUnion: boolean; /** 快应用华为 */ declare const isQuickappWebviewHuawei: boolean; /** 其他平台 */ declare const isOtherPlatform: boolean; declare function isEmpty(value: unknown): boolean; declare function defaultTo(value: any, ...defaultValues: any[]): any; declare function sleep(timeout: number): Promise; declare function upperFirst(value: string): string; declare function lowerFirst(value: string): string; type EventType = string | symbol; type Handler = (event: T) => void; type WildcardHandler> = ( type: keyof T, event: T[keyof T] ) => void; type EventHandlerList = Array>; type WildCardEventHandlerList> = Array< WildcardHandler >; type EventHandlerMap> = Map< keyof Events | "*", EventHandlerList | WildCardEventHandlerList >; interface Emitter> { events: EventHandlerMap; on: (( type: Key, handler: Handler ) => void) & ((type: "*", handler: WildcardHandler) => void); off: (( type: Key, handler?: Handler ) => void) & ((type: "*", handler?: WildcardHandler) => void); emit: ((type: Key, event: Events[Key]) => void) & (( type: undefined extends Events[Key] ? Key : never ) => void); } declare function mitt>( events?: EventHandlerMap ): Emitter; declare function getDeviceInfo(): UniApp.GetDeviceInfoResult | UniApp.GetSystemInfoResult; declare function getWindowInfo(): UniApp.GetWindowInfoResult | UniApp.GetSystemInfoResult; declare function getAppBaseInfo(): UniApp.GetAppBaseInfoResult | UniApp.GetSystemInfoResult; declare function getVersion(): string; declare function compareVersion(v1: string, v2: string): 0 | 1 | -1; declare function querySelect( component: ComponentPublicInstance, selector: string, fields: UniApp.NodeField ): Promise; export { Platform, compareVersion, defaultTo, getAppBaseInfo, getDeviceInfo, getIsPc, getPlatform, getVersion, getWindowInfo, isApp, isAppAndroid, isAppHarmony, isAppIos, isEmpty, isMp, isMp360, isMpAlipay, isMpBaidu, isMpHarmony, isMpJd, isMpKuaishou, isMpLark, isMpQq, isMpToutiao, isMpWeixin, isMpXhs, isOtherPlatform, isQuickappWebview, isQuickappWebviewHuawei, isQuickappWebviewUnion, isWeb, lowerFirst, mitt, platform, querySelect, sleep, upperFirst }; export type { CheckStatus, Emitter, EventHandlerList, EventHandlerMap, EventType, Handler, IPlatform, TreeCheckChangePayload, TreeDataItem, TreeEmptySlotProps, TreeExpandPayload, TreeFilterPayload, TreeKey, TreeLoadErrorPayload, TreeLoadPayload, TreeModelValue, TreeNode, TreeNodeClickPayload, TreeProps, TreeScrollToOptions, TreeSlotProps, UniTreeViewEmits, UniTreeViewExposed, UniTreeViewProps, UniTreeViewSlots, WildCardEventHandlerList, WildcardHandler };