import type { ComponentType, ComponentPropsWithoutRef, HTMLAttributes, LegacyRef } from 'react'; type IsNeverType = [T] extends [never] ? true : false; type Rest = T extends [any, ...infer Rest] ? Rest : never; type AllKeys = T extends any ? keyof T : never; type PickType> = T extends { [k in K]?: any; } ? T[K] : undefined; type PickTypeOf = T extends any ? K extends AllKeys ? PickType : never : never; type Merge = { [K in keyof T]: PickTypeOf; } & { [K in Exclude, keyof T>]?: PickTypeOf; }; type IsArrayIndex = `${number}` extends T ? true : string extends T ? true : T extends `${infer Head}${infer Rest}` ? Head extends '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' ? Rest extends '' ? true : IsArrayIndex : false : false; type ExtractProperty = Merge> extends infer MergedProps ? PropKeys[0] extends undefined ? Props : PropKeys[0] extends keyof MergedProps ? IfNever>, unknown> extends ReadonlyArray ? PropKeys[1] extends undefined ? MergedProps[PropKeys[0]] : IsArrayIndex extends true ? ExtractProperty>> : never : ExtractProperty> : never : never; type Split = string extends String ? string[] : String extends '' ? [] : String extends `${infer T}${Delimiter}${infer U}` ? [T, ...Split] : [String]; type NormalizeKeypath = Path extends `${infer A}.[${infer B}].${infer C}` ? NormalizeKeypath<`${A}.${B}.${C}`> : Path extends `${infer A}[${infer B}].${infer C}` ? NormalizeKeypath<`${A}.${B}.${C}`> : Path extends `${infer A}[${infer B}]${infer C}` ? NormalizeKeypath<`${A}.${B}.${C}`> : Path; export type ExtractKeypath = ExtractProperty, '.'>> extends infer R ? R extends KeyPathFunction ? R : never : never; type IfNever = IsNeverType extends true ? F : C; type IsUnknown = unknown extends T ? [T] extends [null] ? false : true : false; type IsSkippedType = IsUnknown extends true ? true : string extends Path ? true : false; export type KeyPathFunction = Function | ((...args: any[]) => any); export type TriggerKeypathParams = IsSkippedType extends false ? [ keypath: IsNeverType extends true ? never : Path, ...args: ExtractedFunction extends (...args: any[]) => any ? DeepPartialArguments> : any[] ] : [keypath: string, ...args: unknown[]]; export type TriggerKeypathReturn = IsSkippedType extends false ? ExtractedFunction extends (...args: any[]) => any ? ReturnType : any : any; export type PropsFor> = T extends string ? T extends keyof JSX.IntrinsicElements ? JSX.IntrinsicElements[T] : HTMLAttributes : T extends ComponentType ? ComponentPropsWithoutRef : never; export type UnknowablePropsFor | unknown> = T extends string | ComponentType ? PropsFor : unknown; export type FunctionKeys = { [K in keyof T]-?: NonNullable extends (...args: any[]) => any ? K : never; }[keyof T]; interface DeepPartialArray extends Array> { } interface DeepPartialReadonlyArray extends ReadonlyArray> { } type DeepPartialObject = { [K in keyof T]?: DeepPartial; }; type DeepPartial = T extends (infer U)[] ? DeepPartialArray : T extends ReadonlyArray ? DeepPartialReadonlyArray : T extends object ? DeepPartialObject : T; export type DeepPartialArguments = { [K in keyof T]?: DeepPartial; } & any[]; export declare enum Tag { FunctionComponent = 0, ClassComponent = 1, IndeterminateComponent = 2, HostRoot = 3, HostPortal = 4, HostComponent = 5, HostText = 6, Fragment = 7, Mode = 8, ContextConsumer = 9, ContextProvider = 10, ForwardRef = 11, Profiler = 12, SuspenseComponent = 13, MemoComponent = 14, SimpleMemoComponent = 15, LazyComponent = 16, IncompleteClassComponent = 17, DehydratedSuspenseComponent = 18 } export interface Fiber { tag: Tag; key: null | string; elementType: ComponentType | string | null; type: ComponentType | string | null; stateNode: any; return: Fiber | null; child: Fiber | null; sibling: Fiber | null; index: number; ref: LegacyRef; pendingProps: unknown; memoizedProps: unknown; memoizedState: unknown; } export interface ReactInstance { _reactInternals: Fiber; } export type Predicate = (node: Node) => boolean; export interface Node { readonly props: Props; readonly type: string | ComponentType | null; readonly isDOM: boolean; readonly instance: any; readonly children: Node[]; readonly descendants: Node[]; readonly domNodes: HTMLElement[]; readonly domNode: HTMLElement | null; data(key: string): string | undefined; prop(key: K): Props[K]; text(): string; html(): string; is | string>(type: Type): this is Node>; find | string>(type: Type, props?: Partial>): Node> | null; findAll | string>(type: Type, props?: Partial>): Node>[]; findWhere(predicate: Predicate): Node | null; findAllWhere(predicate: Predicate): Node[]; trigger>(prop: K, ...args: DeepPartialArguments): NonNullable extends (...args: any[]) => any ? ReturnType> : never; triggerKeypath>(...args: TriggerKeypathParams): TriggerKeypathReturn; debug(options?: DebugOptions): string; toString(): string; } export interface DebugOptions { allProps?: boolean; depth?: number; verbosity?: number; } export {}; //# sourceMappingURL=types.d.ts.map