@antdv/pro-utils
Version:
@antdv/pro-utils
25 lines (24 loc) • 1.47 kB
TypeScript
import type { VNode, VNodeArrayChildren, VNodeNormalizedChildren, VNodeProps } from 'vue';
export declare function filterEmpty(children?: any[]): any[];
export declare function filterEmptyWithUndefined(children: any[]): any[] | undefined;
export declare const skipFlattenKey: unique symbol;
export declare function flattenChildren(children?: any[], isFilterEmpty?: boolean): any[];
export declare function getSlot(self: any, name?: string, options?: {}): any[];
export interface RefObject extends Function {
current?: any;
}
type NodeProps = Record<string, any> & Omit<VNodeProps, 'ref'> & {
ref?: VNodeProps['ref'] | RefObject;
};
export declare function cloneElement<T, U>(vnode: VNode<T, U> | Array<VNode<T, U>>, nodeProps?: NodeProps, override?: boolean, mergeRef?: boolean): VNode<T, U> | null;
export declare function ensureOnlyChild(children: VNodeArrayChildren | undefined): VNodeArrayChildren | (string | number | boolean | void | VNode<import("vue").RendererNode, import("vue").RendererElement, {
[key: string]: any;
}> | null | undefined);
export declare function getNormalizedProps(node: VNode): Record<string, any>;
export declare function getFirstValidNode(nodes: VNodeNormalizedChildren, maxDepth?: number): string | number | boolean | void | VNodeArrayChildren | {
[name: string]: unknown;
$stable?: boolean;
} | VNode<import("vue").RendererNode, import("vue").RendererElement, {
[key: string]: any;
}> | null | undefined;
export {};