Skip to content

Commit

Permalink
fix types exports
Browse files Browse the repository at this point in the history
  • Loading branch information
ElemelonWind committed Jul 14, 2022
1 parent fd3c8c8 commit 80b0b36
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions src/deprecated.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
import { useSearchActions, SearchActions } from './useSearchActions';
import { useSearchState } from './useSearchState';
import { StateSelector, useSearchState } from './useSearchState';
import { useSearchUtilities, SearchUtilities } from './useSearchUtilities';
import { SearchHeadlessProvider } from './SearchHeadlessProvider';
import { SearchHeadlessContext } from './SearchHeadlessContext';
import { PropsWithChildren } from 'react';
import { HeadlessConfig } from '@yext/answers-headless';

type Props = HeadlessConfig & {
verticalKey?: string,
sessionTrackingEnabled?: boolean
};

/**
* @deprecated AnswersHeadlessContext has been deprecated and replaced by SearchHeadlessContext
Expand All @@ -22,19 +29,23 @@ export type AnswersUtilities = SearchUtilities;
/**
* @deprecated useAnswersActions has been deprecated and replaced by useSearchActions
*/
export const useAnswersActions = useSearchActions;
export function useAnswersActions(): SearchActions { return useSearchActions(); }

/**
* @deprecated useAnswersState has been deprecated and replaced by useSearchState
*/
export const useAnswersState = useSearchState;
export function useAnswersState<T>(stateSelector: StateSelector<T>): T {
return useSearchState(stateSelector);
}

/**
* @deprecated useAnswersUtilities has been deprecated and repalced by useSearchUtilities
*/
export const useAnswersUtilities = useSearchUtilities;
export function useAnswersUtilities(): SearchUtilities { return useSearchUtilities(); }

/**
* @deprecated AnswersHeadlessProvider has been deprecated and replaced by SearfchHeadlessProvider
*/
export const AnswersHeadlessProvider = SearchHeadlessProvider;
export function AnswersHeadlessProvider(props: PropsWithChildren<Props>): JSX.Element {
return SearchHeadlessProvider(props);
}

0 comments on commit 80b0b36

Please sign in to comment.