import { type Signal } from '@wix/services-definitions/core-services/signals'; export interface FaqEntry { _id?: string | null; question?: string | null; plainText?: string | null; draftjs?: string | null; categoryId?: string | null; sortOrder?: number | null; labels?: string[]; visible?: boolean; } /** * Configuration interface for the FAQ service. * Contains FAQ entry data for a specific category. * * @interface FaqServiceConfig */ export type FaqServiceConfig = { /** Array of FAQ entry objects for a category */ faqs: FaqEntry[]; /** Category ID these FAQs belong to */ categoryId?: string | null; }; /** * Service definition for the FAQ service. * This defines the reactive API contract for managing FAQ entries within a category. * * @constant */ export declare const FaqServiceDefinition: string & { __api: { /** Reactive signal containing the list of FAQ entries */ faqs: Signal; /** Reactive signal indicating if FAQs 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 FAQs to display */ hasFaqs: Signal; /** Category ID these FAQs belong to */ categoryId: Signal; }; __config: FaqServiceConfig; isServiceDefinition?: boolean; } & { /** Reactive signal containing the list of FAQ entries */ faqs: Signal; /** Reactive signal indicating if FAQs 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 FAQs to display */ hasFaqs: Signal; /** Category ID these FAQs belong to */ categoryId: Signal; }; /** * Implementation of the FAQ service that manages reactive FAQ entries data. * This service provides signals for FAQ data, loading state, and error handling. * The service is initialized with pre-loaded FAQ entries and maintains them in reactive signals. * * @example * ```tsx * import { FaqService, FaqServiceDefinition } from '@wix/faq/services'; * import { useService } from '@wix/services-manager-react'; * * function FaqComponent({ faqConfig }) { * return ( * * * * ); * } * * function FaqDisplay() { * const faqService = useService(FaqServiceDefinition); * const faqs = faqService.faqs.get(); * const isLoading = faqService.isLoading.get(); * const error = faqService.error.get(); * const hasFaqs = faqService.hasFaqs.get(); * * if (isLoading) return
Loading FAQs...
; * if (error) return
Error: {error}
; * if (!hasFaqs) return
No FAQs found.
; * * return ( *
    * {faqs.map(faq => ( *
  • *

    {faq.question}

    *

    {faq.answer}

    *
  • * ))} *
* ); * } * ``` */ export declare const FaqService: import("@wix/services-definitions").ServiceFactory; /** Reactive signal indicating if FAQs 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 FAQs to display */ hasFaqs: Signal; /** Category ID these FAQs belong to */ categoryId: Signal; }; __config: FaqServiceConfig; isServiceDefinition?: boolean; } & { /** Reactive signal containing the list of FAQ entries */ faqs: Signal; /** Reactive signal indicating if FAQs 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 FAQs to display */ hasFaqs: Signal; /** Category ID these FAQs belong to */ categoryId: Signal; }, FaqServiceConfig>; /** * Loads FAQ service configuration from the Wix FAQ API for a specific category for SSR initialization. * This function is designed to be used during Server-Side Rendering (SSR) to preload * FAQ entries for a specific category. * * @param categoryId - The ID of the category to load FAQs for * @returns {Promise} Promise that resolves to the FAQ configuration * * @example * ```tsx * // Load FAQ data for a specific category during SSR * const faqConfig = await loadFaqServiceConfig('category-id'); * ``` */ export declare function loadFaqServiceConfig(categoryId?: string): Promise; /** * Loads all FAQ entries grouped by category for SSR initialization. * This function is useful when you want to preload all FAQ data at once. * * @returns {Promise>} Promise that resolves to FAQs grouped by category ID * * @example * ```tsx * // Load all FAQ data grouped by category during SSR * const allFaqsByCategory = await loadAllFaqsByCategory(); * ``` */ export declare function loadAllFaqsByCategory(): Promise>;