UNPKG

@woocommerce/data

Version:
89 lines 3.71 kB
import { UserPreferences } from './types'; /** * Custom react hook for retrieving thecurrent user's WooCommerce preferences. * * This is a wrapper around @wordpress/core-data's getCurrentUser() and saveUser(). */ export declare const useUserPreferences: () => { updateUserPreferences: <T extends Record<string, unknown> = UserPreferences>(userPrefs: UserPreferences | T) => Promise<{ error: Error; updatedUser: undefined; } | { error: unknown; updatedUser: never; } | { updatedUser: { woocommerce_meta: { activity_panel_inbox_last_read?: any; activity_panel_reviews_last_read?: any; android_app_banner_dismissed?: any; categories_report_columns?: any; coupons_report_columns?: any; customers_report_columns?: any; dashboard_chart_interval?: any; dashboard_chart_type?: any; dashboard_leaderboard_rows?: any; dashboard_sections?: any; help_panel_highlight_shown?: any; homepage_layout?: any; homepage_stats?: any; orders_report_columns?: any; products_report_columns?: any; revenue_report_columns?: any; task_list_tracked_started_tasks?: any; taxes_report_columns?: any; variable_product_tour_shown?: any; variable_product_block_tour_shown?: any; variations_report_columns?: any; local_attributes_notice_dismissed_ids?: any; variable_items_without_price_notice_dismissed?: any; product_advice_card_dismissed?: any; }; id: number; slug: string; _embedded?: Record<string, any[]> | undefined; name: string; description: string; _links: Record<string, { [k: string]: any; href: string; }[]>; link: string; meta: any[]; avatar_urls: Record<number, string>; url: string; is_super_admin: boolean; }; error?: undefined; }>; activity_panel_inbox_last_read?: string | undefined; activity_panel_reviews_last_read?: string | undefined; android_app_banner_dismissed?: string | undefined; categories_report_columns?: string | undefined; coupons_report_columns?: string | undefined; customers_report_columns?: string | undefined; dashboard_chart_interval?: string | undefined; dashboard_chart_type?: string | undefined; dashboard_leaderboard_rows?: string | undefined; dashboard_sections?: string | undefined; help_panel_highlight_shown?: string | undefined; homepage_layout?: string | undefined; homepage_stats?: string | undefined; orders_report_columns?: string | undefined; products_report_columns?: string | undefined; revenue_report_columns?: string | undefined; task_list_tracked_started_tasks?: { [key: string]: number; } | undefined; taxes_report_columns?: string | undefined; variable_product_tour_shown?: string | undefined; variable_product_block_tour_shown?: string | undefined; variations_report_columns?: string | undefined; local_attributes_notice_dismissed_ids?: number[] | undefined; variable_items_without_price_notice_dismissed?: Record<number, string> | undefined; product_advice_card_dismissed?: { [key: string]: "yes" | "no"; } | undefined; isRequesting: unknown; }; //# sourceMappingURL=use-user-preferences.d.ts.map