UNPKG

@steambrew/client

Version:
27 lines (26 loc) 1.2 kB
import * as React from 'react'; declare global { interface Window { SP_REACT: typeof React; } } /** * Create a Regular Expression to search for a React component that uses certain props in order. * * @export * @param {string[]} propList Ordererd list of properties to search for * @returns {RegExp} RegEx to call .test(component.toString()) on */ export declare function createPropListRegex(propList: string[], fromStart?: boolean): RegExp; export declare function fakeRenderComponent(fun: Function, customHooks?: any): any; export declare function wrapReactType(node: any, prop?: any): any; export declare function wrapReactClass(node: any, prop?: any): any; export declare function getReactRoot(o: HTMLElement | Element | Node): any; export declare function getReactInstance(o: HTMLElement | Element | Node): any; export interface findInTreeOpts { walkable?: string[]; ignore?: string[]; } export declare type findInTreeFilter = (element: any) => boolean; export declare const findInTree: (parent: any, filter: findInTreeFilter, opts: findInTreeOpts) => any; export declare const findInReactTree: (node: any, filter: findInTreeFilter) => any;