@coveo/headless-react
    Preparing search index...

    Interface SmartSnippetQuestionsList

    The SmartSnippetQuestionsList controller allows to manage additional queries for which a SmartSnippet model can provide relevant excerpts.

    Example: smart-snippet-questions-list.fn.tsx

    interface SmartSnippetQuestionsList {
        state: SmartSnippetQuestionsListState;
        beginDelayedSelectInlineLink(identifier: string, link: InlineLink): void;
        beginDelayedSelectSource(identifier: string): void;
        cancelPendingSelectInlineLink(identifier: string, link: InlineLink): void;
        cancelPendingSelectSource(identifier: string): void;
        collapse(identifier: string): void;
        expand(identifier: string): void;
        selectInlineLink(identifier: string, link: InlineLink): void;
        selectSource(identifier: string): void;
        subscribe(listener: () => void): Unsubscribe;
    }

    Hierarchy (View Summary)

    Index

    Methods

    • Prepares to select a link inside an answer after a certain delay, sending analytics if it was never selected before.

      In a DOM context, call this method on the touchstart event.

      Parameters

      • identifier: string

        The questionAnswerId of the smart snippet containing the link.

      • link: InlineLink

        The link to select.

      Returns void

    • Prepares to select the source after a certain delay, sending analytics if it hadn't been selected before.

      In a DOM context, call this method on the touchstart event.

      Parameters

      • identifier: string

        The questionAnswerId of the smart snippet to collapse.

      Returns void

    • Cancels the pending selection caused by beginDelayedSelectInlineLink.

      In a DOM context, call this method on the touchend event.

      Parameters

      • identifier: string

        The questionAnswerId of the smart snippet containing the link.

      • link: InlineLink

        The link to select.

      Returns void

    • Cancels the pending selection caused by beginDelayedSelect.

      In a DOM context, call this method on the touchend event.

      Parameters

      • identifier: string

        The questionAnswerId of the smart snippet to collapse.

      Returns void

    • Collapse the specified snippet suggestion.

      Parameters

      • identifier: string

        The questionAnswerId of the smart snippet to collapse.

      Returns void

    • Expand the specified snippet suggestion.

      Parameters

      • identifier: string

        The questionAnswerId of the smart snippet to expand.

      Returns void

    • Selects a link inside an answer, logging a UA event to the Coveo Platform if it was never selected before.

      In a DOM context, call this method on all of the following events:

      • contextmenu
      • click
      • mouseup
      • mousedown

      Parameters

      • identifier: string

        The questionAnswerId of the smart snippet containing the link.

      • link: InlineLink

        The link to select.

      Returns void

    • Selects the source, logging a UA event to the Coveo Platform if the source hadn't been selected before.

      In a DOM context, call this method on all of the following events:

      • contextmenu
      • click
      • mouseup
      • mousedown

      Parameters

      • identifier: string

        The questionAnswerId of the smart snippet to collapse.

      Returns void

    • Adds a callback that's invoked on state change.

      Parameters

      • listener: () => void

        A callback that's invoked on state change.

      Returns Unsubscribe

      A function to remove the listener.

    Properties

    The state of the SmartSnippetQuestionsList controller.