import React, { ComponentType } from 'react'; import { API } from '@storybook/api'; interface AssertionResult { status: string; fullName: string; title: string; failureMessages: string[]; } export interface Test { name: string; result: { status: string; assertionResults: AssertionResult[]; }; } interface InjectedProps { tests?: Test[]; } export interface HocProps { api: API; active?: boolean; } export interface HocState { kind?: string; storyName?: string; tests?: Test[]; } declare const provideTests: (Component: ComponentType) => { new (props: Readonly): { state: HocState; componentDidMount(): void; componentWillUnmount(): void; onAddTests: ({ kind, storyName, tests }: HocState) => void; mounted: boolean; stopListeningOnStory: () => void; render(): JSX.Element; context: any; setState(state: HocState | ((prevState: Readonly, props: Readonly) => HocState | Pick) | Pick, callback?: () => void): void; forceUpdate(callback?: () => void): void; readonly props: Readonly & Readonly<{ children?: React.ReactNode; }>; refs: { [key: string]: React.ReactInstance; }; shouldComponentUpdate?(nextProps: Readonly, nextState: Readonly, nextContext: any): boolean; componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void; getSnapshotBeforeUpdate?(prevProps: Readonly, prevState: Readonly): any; componentDidUpdate?(prevProps: Readonly, prevState: Readonly, snapshot?: any): void; componentWillMount?(): void; UNSAFE_componentWillMount?(): void; componentWillReceiveProps?(nextProps: Readonly, nextContext: any): void; UNSAFE_componentWillReceiveProps?(nextProps: Readonly, nextContext: any): void; componentWillUpdate?(nextProps: Readonly, nextState: Readonly, nextContext: any): void; UNSAFE_componentWillUpdate?(nextProps: Readonly, nextState: Readonly, nextContext: any): void; }; new (props: HocProps, context?: any): { state: HocState; componentDidMount(): void; componentWillUnmount(): void; onAddTests: ({ kind, storyName, tests }: HocState) => void; mounted: boolean; stopListeningOnStory: () => void; render(): JSX.Element; context: any; setState(state: HocState | ((prevState: Readonly, props: Readonly) => HocState | Pick) | Pick, callback?: () => void): void; forceUpdate(callback?: () => void): void; readonly props: Readonly & Readonly<{ children?: React.ReactNode; }>; refs: { [key: string]: React.ReactInstance; }; shouldComponentUpdate?(nextProps: Readonly, nextState: Readonly, nextContext: any): boolean; componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void; getSnapshotBeforeUpdate?(prevProps: Readonly, prevState: Readonly): any; componentDidUpdate?(prevProps: Readonly, prevState: Readonly, snapshot?: any): void; componentWillMount?(): void; UNSAFE_componentWillMount?(): void; componentWillReceiveProps?(nextProps: Readonly, nextContext: any): void; UNSAFE_componentWillReceiveProps?(nextProps: Readonly, nextContext: any): void; componentWillUpdate?(nextProps: Readonly, nextState: Readonly, nextContext: any): void; UNSAFE_componentWillUpdate?(nextProps: Readonly, nextState: Readonly, nextContext: any): void; }; defaultProps: { active: boolean; }; contextType?: React.Context; }; export default provideTests;