2021-03-24 21:29:37 +00:00
|
|
|
/**
|
|
|
|
* External dependencies
|
|
|
|
*/
|
|
|
|
import '@wordpress/core-data';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Internal dependencies
|
|
|
|
*/
|
|
|
|
import type { REVIEWS_STORE_NAME } from './reviews';
|
|
|
|
import type { SETTINGS_STORE_NAME } from './settings';
|
|
|
|
import type { PLUGINS_STORE_NAME } from './plugins';
|
|
|
|
import type { ONBOARDING_STORE_NAME } from './onboarding';
|
|
|
|
import type { USER_STORE_NAME } from './user';
|
|
|
|
import type { OPTIONS_STORE_NAME } from './options';
|
|
|
|
import type { NAVIGATION_STORE_NAME } from './navigation';
|
|
|
|
import type { NOTES_STORE_NAME } from './notes';
|
|
|
|
import type { REPORTS_STORE_NAME } from './reports';
|
|
|
|
import type { ITEMS_STORE_NAME } from './items';
|
|
|
|
import { OnboardingSelectors } from './onboarding/selectors';
|
|
|
|
import { WPDataSelectors } from './types';
|
2021-04-20 17:17:19 +00:00
|
|
|
import { PluginSelectors } from './plugins/selectors';
|
2021-03-24 21:29:37 +00:00
|
|
|
|
2021-04-20 17:17:19 +00:00
|
|
|
export * from './types';
|
2021-03-24 21:29:37 +00:00
|
|
|
export { SETTINGS_STORE_NAME } from './settings';
|
|
|
|
export { withSettingsHydration } from './settings/with-settings-hydration';
|
|
|
|
export { useSettings } from './settings/use-settings';
|
|
|
|
|
|
|
|
export { PLUGINS_STORE_NAME } from './plugins';
|
2021-04-20 17:17:19 +00:00
|
|
|
export type { Plugin } from './plugins/types';
|
2021-09-09 12:25:13 +00:00
|
|
|
export { ActionDispatchers as PluginsStoreActions } from './plugins/actions';
|
2021-03-24 21:29:37 +00:00
|
|
|
export { pluginNames } from './plugins/constants';
|
|
|
|
export { withPluginsHydration } from './plugins/with-plugins-hydration';
|
|
|
|
|
|
|
|
export { ONBOARDING_STORE_NAME } from './onboarding';
|
|
|
|
export { withOnboardingHydration } from './onboarding/with-onboarding-hydration';
|
2021-09-01 21:28:24 +00:00
|
|
|
export type { TaskType, TaskListType } from './onboarding/types';
|
2021-03-24 21:29:37 +00:00
|
|
|
|
|
|
|
export { USER_STORE_NAME } from './user';
|
|
|
|
export { withCurrentUserHydration } from './user/with-current-user-hydration';
|
|
|
|
export { useUser } from './user/use-user';
|
|
|
|
export { useUserPreferences } from './user/use-user-preferences';
|
|
|
|
|
|
|
|
export { OPTIONS_STORE_NAME } from './options';
|
2021-04-20 17:17:19 +00:00
|
|
|
export {
|
|
|
|
withOptionsHydration,
|
|
|
|
useOptionsHydration,
|
|
|
|
} from './options/with-options-hydration';
|
2021-03-24 21:29:37 +00:00
|
|
|
|
|
|
|
export { REVIEWS_STORE_NAME } from './reviews';
|
|
|
|
|
|
|
|
export { NOTES_STORE_NAME } from './notes';
|
|
|
|
|
|
|
|
export { REPORTS_STORE_NAME } from './reports';
|
|
|
|
|
|
|
|
export { ITEMS_STORE_NAME } from './items';
|
|
|
|
export { getLeaderboard, searchItemsByString } from './items/utils';
|
|
|
|
|
|
|
|
export { NAVIGATION_STORE_NAME } from './navigation';
|
|
|
|
export { withNavigationHydration } from './navigation/with-navigation-hydration';
|
|
|
|
|
2021-05-24 17:29:44 +00:00
|
|
|
export { PAYMENT_GATEWAYS_STORE_NAME } from './payment-gateways';
|
|
|
|
|
2021-03-24 21:29:37 +00:00
|
|
|
export {
|
|
|
|
getFilterQuery,
|
|
|
|
getSummaryNumbers,
|
|
|
|
getReportTableData,
|
|
|
|
getReportTableQuery,
|
|
|
|
getReportChartData,
|
|
|
|
getTooltipValueFormat,
|
|
|
|
} from './reports/utils';
|
|
|
|
|
|
|
|
export {
|
|
|
|
MAX_PER_PAGE,
|
|
|
|
QUERY_DEFAULTS,
|
|
|
|
NAMESPACE,
|
|
|
|
WC_ADMIN_NAMESPACE,
|
|
|
|
WCS_NAMESPACE,
|
|
|
|
SECOND,
|
|
|
|
MINUTE,
|
|
|
|
HOUR,
|
|
|
|
DAY,
|
|
|
|
WEEK,
|
|
|
|
MONTH,
|
|
|
|
} from './constants';
|
|
|
|
|
|
|
|
export { EXPORT_STORE_NAME } from './export';
|
|
|
|
|
|
|
|
export { IMPORT_STORE_NAME } from './import';
|
|
|
|
|
2021-04-20 17:17:19 +00:00
|
|
|
export type WCDataStoreName =
|
2021-03-24 21:29:37 +00:00
|
|
|
| typeof REVIEWS_STORE_NAME
|
|
|
|
| typeof SETTINGS_STORE_NAME
|
|
|
|
| typeof PLUGINS_STORE_NAME
|
|
|
|
| typeof ONBOARDING_STORE_NAME
|
|
|
|
| typeof USER_STORE_NAME
|
|
|
|
| typeof OPTIONS_STORE_NAME
|
|
|
|
| typeof NAVIGATION_STORE_NAME
|
|
|
|
| typeof NOTES_STORE_NAME
|
|
|
|
| typeof REPORTS_STORE_NAME
|
|
|
|
| typeof ITEMS_STORE_NAME;
|
|
|
|
|
|
|
|
// As we add types to all the package selectors we can fill out these unknown types with real ones. See one
|
|
|
|
// of the already typed selectors for an example of how you can do this.
|
2021-04-20 17:17:19 +00:00
|
|
|
export type WCSelectorType< T > = T extends typeof REVIEWS_STORE_NAME
|
2021-03-24 21:29:37 +00:00
|
|
|
? WPDataSelectors
|
|
|
|
: T extends typeof SETTINGS_STORE_NAME
|
|
|
|
? WPDataSelectors
|
|
|
|
: T extends typeof PLUGINS_STORE_NAME
|
2021-04-20 17:17:19 +00:00
|
|
|
? PluginSelectors
|
2021-03-24 21:29:37 +00:00
|
|
|
: T extends typeof ONBOARDING_STORE_NAME
|
|
|
|
? OnboardingSelectors
|
|
|
|
: T extends typeof USER_STORE_NAME
|
|
|
|
? WPDataSelectors
|
|
|
|
: T extends typeof OPTIONS_STORE_NAME
|
|
|
|
? WPDataSelectors
|
|
|
|
: T extends typeof NAVIGATION_STORE_NAME
|
|
|
|
? WPDataSelectors
|
|
|
|
: T extends typeof NOTES_STORE_NAME
|
|
|
|
? WPDataSelectors
|
|
|
|
: T extends typeof REPORTS_STORE_NAME
|
|
|
|
? WPDataSelectors
|
|
|
|
: T extends typeof ITEMS_STORE_NAME
|
|
|
|
? WPDataSelectors
|
|
|
|
: never;
|
|
|
|
|
|
|
|
export interface WCDataSelector {
|
|
|
|
< T extends WCDataStoreName >( storeName: T ): WCSelectorType< T >;
|
|
|
|
}
|
|
|
|
export * from './onboarding/selectors';
|
2021-10-06 18:47:41 +00:00
|
|
|
export * from './onboarding/types';
|