UNPKG

@sanity/form-builder

Version:
76 lines 3.94 kB
import React from 'react'; import { Path, SanityDocument } from '@sanity/types'; interface WithParentProps<ParentType extends unknown = unknown> { parent: ParentType; } export default function withParent<T extends WithParentProps = WithParentProps>(ComposedComponent: React.ComponentType<T>): { new (props: Omit<React.PropsWithoutRef<T & { document: SanityDocument; getValuePath: () => Path; }> & React.RefAttributes<unknown>, "getValuePath">, context: any): { _input: any; _didShowFocusWarning: boolean; state: { document: Record<string, unknown>; }; unsubscribe: () => void; componentWillUnmount(): void; focus(): void; setRef: (input: any) => void; render(): React.JSX.Element; context: any; setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<Omit<Omit<React.PropsWithoutRef<T & { document: SanityDocument; getValuePath: () => Path; }> & React.RefAttributes<unknown>, "getValuePath">, "document">>) => {} | Pick<{}, K>) | Pick<{}, K>, callback?: () => void): void; forceUpdate(callback?: () => void): void; readonly props: Readonly<Omit<Omit<React.PropsWithoutRef<T & { document: SanityDocument; getValuePath: () => Path; }> & React.RefAttributes<unknown>, "getValuePath">, "document">> & Readonly<{ children?: React.ReactNode; }>; refs: { [key: string]: React.ReactInstance; }; componentDidMount?(): void; shouldComponentUpdate?(nextProps: Readonly<Omit<Omit<React.PropsWithoutRef<T & { document: SanityDocument; getValuePath: () => Path; }> & React.RefAttributes<unknown>, "getValuePath">, "document">>, nextState: Readonly<{}>, nextContext: any): boolean; componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void; getSnapshotBeforeUpdate?(prevProps: Readonly<Omit<Omit<React.PropsWithoutRef<T & { document: SanityDocument; getValuePath: () => Path; }> & React.RefAttributes<unknown>, "getValuePath">, "document">>, prevState: Readonly<{}>): any; componentDidUpdate?(prevProps: Readonly<Omit<Omit<React.PropsWithoutRef<T & { document: SanityDocument; getValuePath: () => Path; }> & React.RefAttributes<unknown>, "getValuePath">, "document">>, prevState: Readonly<{}>, snapshot?: any): void; componentWillMount?(): void; UNSAFE_componentWillMount?(): void; componentWillReceiveProps?(nextProps: Readonly<Omit<Omit<React.PropsWithoutRef<T & { document: SanityDocument; getValuePath: () => Path; }> & React.RefAttributes<unknown>, "getValuePath">, "document">>, nextContext: any): void; UNSAFE_componentWillReceiveProps?(nextProps: Readonly<Omit<Omit<React.PropsWithoutRef<T & { document: SanityDocument; getValuePath: () => Path; }> & React.RefAttributes<unknown>, "getValuePath">, "document">>, nextContext: any): void; componentWillUpdate?(nextProps: Readonly<Omit<Omit<React.PropsWithoutRef<T & { document: SanityDocument; getValuePath: () => Path; }> & React.RefAttributes<unknown>, "getValuePath">, "document">>, nextState: Readonly<{}>, nextContext: any): void; UNSAFE_componentWillUpdate?(nextProps: Readonly<Omit<Omit<React.PropsWithoutRef<T & { document: SanityDocument; getValuePath: () => Path; }> & React.RefAttributes<unknown>, "getValuePath">, "document">>, nextState: Readonly<{}>, nextContext: any): void; }; displayName: string; contextTypes: { formBuilder: import("prop-types").Requireable<any>; }; contextType?: React.Context<any>; }; export {}; //# sourceMappingURL=withParent.d.ts.map