import { type Signal } from '@wix/services-definitions/core-services/signals'; export interface FaqCategory { _id?: string | null; title?: string | null; description?: string | null; sortOrder?: number | null; visible?: boolean; } /** * Configuration interface for the FAQ Categories service. * Contains the initial FAQ categories data that will be loaded into the service. * * @interface FaqCategoriesServiceConfig */ export type FaqCategoriesServiceConfig = { /** Array of FAQ category objects to initialize the service with */ categories: FaqCategory[]; }; /** * Service definition for the FAQ Categories service. * This defines the reactive API contract for managing a list of FAQ categories. * * @constant */ export declare const FaqCategoriesServiceDefinition: string & { __api: { /** Reactive signal containing the list of FAQ categories */ categories: Signal; /** Reactive signal indicating if categories are currently being loaded */ isLoading: Signal; /** Reactive signal containing any error message, or null if no error */ error: Signal; /** Reactive signal indicating if there are categories to display */ hasCategories: Signal; }; __config: FaqCategoriesServiceConfig; isServiceDefinition?: boolean; } & { /** Reactive signal containing the list of FAQ categories */ categories: Signal; /** Reactive signal indicating if categories are currently being loaded */ isLoading: Signal; /** Reactive signal containing any error message, or null if no error */ error: Signal; /** Reactive signal indicating if there are categories to display */ hasCategories: Signal; }; /** * Implementation of the FAQ Categories service that manages reactive FAQ categories data. * This service provides signals for categories data, loading state, and error handling. * The service is initialized with pre-loaded categories and maintains them in reactive signals. * * @example * ```tsx * import { FaqCategoriesService, FaqCategoriesServiceDefinition } from '@wix/faq/services'; * import { useService } from '@wix/services-manager-react'; * * function FaqCategoriesComponent({ categoriesConfig }) { * return ( * * * * ); * } * * function FaqCategoriesDisplay() { * const categoriesService = useService(FaqCategoriesServiceDefinition); * const categories = categoriesService.categories.get(); * const isLoading = categoriesService.isLoading.get(); * const error = categoriesService.error.get(); * const hasCategories = categoriesService.hasCategories.get(); * * if (isLoading) return
Loading FAQ categories...
; * if (error) return
Error: {error}
; * if (!hasCategories) return
No FAQ categories found.
; * * return ( *
    * {categories.map(category => ( *
  • {category.name}
  • * ))} *
* ); * } * ``` */ export declare const FaqCategoriesService: import("@wix/services-definitions").ServiceFactory; /** Reactive signal indicating if categories are currently being loaded */ isLoading: Signal; /** Reactive signal containing any error message, or null if no error */ error: Signal; /** Reactive signal indicating if there are categories to display */ hasCategories: Signal; }; __config: FaqCategoriesServiceConfig; isServiceDefinition?: boolean; } & { /** Reactive signal containing the list of FAQ categories */ categories: Signal; /** Reactive signal indicating if categories are currently being loaded */ isLoading: Signal; /** Reactive signal containing any error message, or null if no error */ error: Signal; /** Reactive signal indicating if there are categories to display */ hasCategories: Signal; }, FaqCategoriesServiceConfig>; /** * Loads FAQ categories service configuration from the Wix FAQ API for SSR initialization. * This function is designed to be used during Server-Side Rendering (SSR) to preload * all visible FAQ categories. * * @returns {Promise} Promise that resolves to the FAQ categories configuration * * @example * ```astro * --- * // Astro page example - pages/faq.astro * import { loadFaqCategoriesServiceConfig } from '@wix/faq/services'; * import { FaqCategories } from '@wix/faq/react'; * * // Load FAQ categories data during SSR * const faqCategoriesConfig = await loadFaqCategoriesServiceConfig(); * --- * * * * * * * * * * * * * * * ``` */ export declare function loadFaqCategoriesServiceConfig(): Promise;