import { type ReactElement } from 'react'; import { ApolloClient, type NormalizedCacheObject } from '@apollo/client'; import { type MockedResponse } from '@apollo/client/testing'; import type { TFlags } from '@flopflip/types'; import * as rtl from '@testing-library/react'; import { type TProviderProps } from "../../../application-shell-connectors/dist/commercetools-frontend-application-shell-connectors.cjs.js"; import { createEnhancedHistory } from '@commercetools-frontend/browser-history'; import { type TMapNotificationToComponentProps } from '@commercetools-frontend/react-notifications'; import { type TSdkMock } from '@commercetools-frontend/sdk/test-utils'; import { createReduxStore } from "../configure-store.js"; type TPermissions = { [key: string]: boolean; }; type TAllAppliedPermission = { name: string; value: boolean; }; declare const denormalizePermissions: (permissions?: TPermissions) => TAllAppliedPermission[]; type TNormalizedActionRights = { [key: string]: TPermissions; }; type TAllAppliedActionRight = TAllAppliedPermission & { group: string; }; declare const denormalizeActionRights: (actionRights?: TNormalizedActionRights) => TAllAppliedActionRight[]; type TNormalizedDataFenceStorePermissions = { [key: string]: { values: string[]; }; }; type TNormalizedDataFenceStores = { [key: string]: TNormalizedDataFenceStorePermissions; }; type TNormalizedDataFences = { store: TNormalizedDataFenceStores; }; type TAllAppliedDataFence = { __typename: 'StoreDataFence'; type: string; name: string; value: string; group: string; }; declare const denormalizeDataFences: (dataFences?: TNormalizedDataFences) => TAllAppliedDataFence[]; declare const mapResourceAccessToAppliedPermissions: (resourceAccesses: string[]) => TAllAppliedPermission[]; export type TRenderAppOptions = { locale: string; mocks?: ReadonlyArray; apolloClient?: ApolloClient; route: string; disableRoutePermissionCheck: boolean; disableAutomaticEntryPointRoutes: boolean; history: ReturnType; flags: TFlags; environment: Partial['environment']>; user: Partial['user']>; project: Partial['project']>; dataLocale: TProviderProps['projectDataLocale']; } & rtl.RenderOptions; type TRenderAppResult = rtl.RenderResult & Pick, 'history' | 'user' | 'project' | 'environment'>; declare function renderApp(ui: ReactElement, options?: Partial>): TRenderAppResult; export type TRenderAppWithReduxOptions = { store: ReturnType; storeState: StoreState; sdkMocks: TSdkMock[]; mapNotificationToComponent: TMapNotificationToComponentProps['mapNotificationToComponent']; } & TRenderAppOptions; type TRenderAppWithReduxResult = TRenderAppResult & Pick, 'store'>; declare function renderAppWithRedux(ui: ReactElement, options?: Partial>): TRenderAppWithReduxResult; export type TRenderHookOptions = TRenderAppWithReduxOptions & rtl.RenderHookOptions; export type TRenderHookResult = Omit, 'rerender' | 'result'> & { result: { current: RenderHookCallbackValue; }; rerender: (props?: RenderHookCallbackProps) => void; } & Pick, 'store' | 'history' | 'user' | 'project' | 'environment'>; declare function renderHook(callback: (props: RenderedHookProps) => RenderedHookResult, options?: Partial>): TRenderHookResult; declare const hooks: { renderHook: typeof renderHook; }; type TCustomFireEventApi = typeof rtl.fireEvent & { asyncFocus: (element: HTMLElement) => Promise; asyncBlur: (element: HTMLElement) => Promise; }; declare const customFireEvent: TCustomFireEventApi; export * from '@testing-library/react'; export { renderApp, renderAppWithRedux, hooks, mapResourceAccessToAppliedPermissions, denormalizePermissions, denormalizeActionRights, denormalizeDataFences, customFireEvent, };