From c69f97669239595798c3090692866c7ce0a7e96b Mon Sep 17 00:00:00 2001 From: Lucas De Morais Date: Mon, 25 Nov 2024 16:50:42 +0100 Subject: [PATCH] fix: change type of orama oss instance --- packages/ui-stencil/src/components.d.ts | 1969 +++++++++-------- .../orama-chat-box/orama-chat-box.tsx | 4 +- 2 files changed, 1099 insertions(+), 874 deletions(-) diff --git a/packages/ui-stencil/src/components.d.ts b/packages/ui-stencil/src/components.d.ts index cf75498..8375cd5 100644 --- a/packages/ui-stencil/src/components.d.ts +++ b/packages/ui-stencil/src/components.d.ts @@ -4,903 +4,1128 @@ * This is an autogenerated file created by the Stencil compiler. * It contains typing information for all components that exist in this project. */ -import { HTMLStencilElement, JSXBase } from "@stencil/core/internal"; -import { ButtonProps } from "./components/internal/orama-button/orama-button"; -import { ChatMarkdownLinkHref, ChatMarkdownLinkTarget, ChatMarkdownLinkTitle, CloudIndexConfig, ColorScheme, Facet, OnAnswerGeneratedCallbackProps, OnAnswerSourceClickCallbackProps, OnChatMarkdownLinkClickedCallbackProps, OnSearchCompletedCallbackProps, OnSearchResultClickCallbackProps, ResultMap, SearchResult, SearchResultBySection, SourcesMap } from "./types/index"; -import { TChatInteraction } from "./context/chatContext"; -import { OramaClient } from "@oramacloud/client"; -import { AnyOrama, Orama, SearchParams } from "@orama/orama"; -import { Facet } from "./components/internal/orama-facets/orama-facets"; -import { InputProps } from "./components/internal/orama-input/orama-input"; -import { ModalStatus } from "./components/internal/orama-modal/orama-modal"; -import { HighlightOptions } from "@orama/highlight"; -import { TThemeOverrides } from "./config/theme"; -import { TThemeOverrides as TThemeOverrides1 } from "./components.d"; -import { SearchResultsProps } from "./components/internal/orama-search-results/orama-search-results"; -import { TextProps } from "./components/internal/orama-text/orama-text"; -export { ButtonProps } from "./components/internal/orama-button/orama-button"; -export { ChatMarkdownLinkHref, ChatMarkdownLinkTarget, ChatMarkdownLinkTitle, CloudIndexConfig, ColorScheme, Facet, OnAnswerGeneratedCallbackProps, OnAnswerSourceClickCallbackProps, OnChatMarkdownLinkClickedCallbackProps, OnSearchCompletedCallbackProps, OnSearchResultClickCallbackProps, ResultMap, SearchResult, SearchResultBySection, SourcesMap } from "./types/index"; -export { TChatInteraction } from "./context/chatContext"; -export { OramaClient } from "@oramacloud/client"; -export { AnyOrama, Orama, SearchParams } from "@orama/orama"; -export { Facet } from "./components/internal/orama-facets/orama-facets"; -export { InputProps } from "./components/internal/orama-input/orama-input"; -export { ModalStatus } from "./components/internal/orama-modal/orama-modal"; -export { HighlightOptions } from "@orama/highlight"; -export { TThemeOverrides } from "./config/theme"; -export { TThemeOverrides as TThemeOverrides1 } from "./components.d"; -export { SearchResultsProps } from "./components/internal/orama-search-results/orama-search-results"; -export { TextProps } from "./components/internal/orama-text/orama-text"; +import { HTMLStencilElement, JSXBase } from "@stencil/core/internal" +import { ButtonProps } from "./components/internal/orama-button/orama-button" +import { + ChatMarkdownLinkHref, + ChatMarkdownLinkTarget, + ChatMarkdownLinkTitle, + CloudIndexConfig, + ColorScheme, + Facet, + OnAnswerGeneratedCallbackProps, + OnAnswerSourceClickCallbackProps, + OnChatMarkdownLinkClickedCallbackProps, + OnSearchCompletedCallbackProps, + OnSearchResultClickCallbackProps, + ResultMap, + SearchResult, + SearchResultBySection, + SourcesMap +} from "./types/index" +import { TChatInteraction } from "./context/chatContext" +import { OramaClient } from "@oramacloud/client" +import { InputProps } from "./components/internal/orama-input/orama-input" +import { ModalStatus } from "./components/internal/orama-modal/orama-modal" +import { HighlightOptions } from "@orama/highlight" +import { TThemeOverrides } from "./config/theme" +import { AnyOrama, Orama, SearchParams } from "@orama/orama" +import { TThemeOverrides as TThemeOverrides1 } from "./components.d" +import { SearchResultsProps } from "./components/internal/orama-search-results/orama-search-results" +import { TextProps } from "./components/internal/orama-text/orama-text" + +export { ButtonProps } from "./components/internal/orama-button/orama-button" +export { + ChatMarkdownLinkHref, + ChatMarkdownLinkTarget, + ChatMarkdownLinkTitle, + CloudIndexConfig, + ColorScheme, + Facet, + OnAnswerGeneratedCallbackProps, + OnAnswerSourceClickCallbackProps, + OnChatMarkdownLinkClickedCallbackProps, + OnSearchCompletedCallbackProps, + OnSearchResultClickCallbackProps, + ResultMap, + SearchResult, + SearchResultBySection, + SourcesMap +} from "./types/index" +export { TChatInteraction } from "./context/chatContext" +export { OramaClient } from "@oramacloud/client" +export { InputProps } from "./components/internal/orama-input/orama-input" +export { ModalStatus } from "./components/internal/orama-modal/orama-modal" +export { HighlightOptions } from "@orama/highlight" +export { TThemeOverrides } from "./config/theme" +export { AnyOrama, Orama, SearchParams } from "@orama/orama" +export { TThemeOverrides as TThemeOverrides1 } from "./components.d" +export { SearchResultsProps } from "./components/internal/orama-search-results/orama-search-results" +export { TextProps } from "./components/internal/orama-text/orama-text" export namespace Components { - interface OramaButton { - "as"?: ButtonProps['as']; - "class"?: string; - "disabled"?: boolean; - "size": 'small' | 'medium' | 'large'; - "type"?: ButtonProps['type']; - "variant"?: ButtonProps['variant']; - "withTooltip"?: string; - } - interface OramaChat { - "chatMarkdownLinkHref"?: ChatMarkdownLinkHref; - "chatMarkdownLinkTarget"?: ChatMarkdownLinkTarget; - "chatMarkdownLinkTitle"?: ChatMarkdownLinkTitle; - "defaultTerm"?: string; - "focusInput"?: boolean; - "linksRel"?: string; - "linksTarget"?: string; - "placeholder"?: string; - "showClearChat"?: boolean; - "sourceBaseUrl"?: string; - "sourcesMap"?: SourcesMap; - "suggestions"?: string[]; - "systemPrompts"?: string[]; - } - interface OramaChatAssistentMessage { - "chatMarkdownLinkHref"?: ChatMarkdownLinkHref; - "chatMarkdownLinkTarget"?: ChatMarkdownLinkTarget; - "chatMarkdownLinkTitle"?: ChatMarkdownLinkTitle; - "interaction": TChatInteraction; - } - interface OramaChatBox { - "autoFocus": boolean; - "chatMarkdownLinkHref"?: ChatMarkdownLinkHref; - "chatMarkdownLinkTarget"?: ChatMarkdownLinkTarget; - "chatMarkdownLinkTitle"?: ChatMarkdownLinkTitle; - "clientInstance"?: OramaClient | Orama; - "index"?: CloudIndexConfig; - "linksRel"?: string; - "linksTarget"?: string; - "placeholder"?: string; - "sourceBaseUrl"?: string; - "sourcesMap"?: SourcesMap; - "suggestions"?: string[]; - "systemPrompts"?: string[]; - } - interface OramaChatButton { - "active"?: boolean; - "class"?: string; - "highlight"?: boolean; - "label": string; - } - interface OramaChatMessagesContainer { - "chatMarkdownLinkHref"?: ChatMarkdownLinkHref; - "chatMarkdownLinkTarget"?: ChatMarkdownLinkTarget; - "chatMarkdownLinkTitle"?: ChatMarkdownLinkTitle; - "interactions": TChatInteraction[]; - } - interface OramaChatUserMessage { - "interaction": TChatInteraction; - } - interface OramaDotsLoader { - } - interface OramaEmbed { - } - interface OramaFacets { - "facetClicked": (facetName: string) => void; - "facets": Facet[]; - "selectedFacet": string; - } - interface OramaFooter { - "class"?: string; - "colorScheme"?: Omit; - } - interface OramaInput { - "autoFocus"?: boolean; - "defaultValue": InputProps['defaultValue']; - "label"?: InputProps['label']; - "labelForScreenReaders"?: InputProps['labelForScreenReaders']; - "name": InputProps['name']; - "placeholder"?: InputProps['placeholder']; - "size"?: InputProps['size']; - "type"?: InputProps['type']; - } - interface OramaLogoIcon { - "size": number; - } - interface OramaMarkdown { - "chatMarkdownLinkHref"?: ChatMarkdownLinkHref; - "chatMarkdownLinkTarget"?: ChatMarkdownLinkTarget; - "chatMarkdownLinkTitle"?: ChatMarkdownLinkTitle; - "content": string; - } - interface OramaModal { - "closeOnEscape": boolean; - "closeOnOutsideClick": boolean; - "mainTitle": string; - "open": boolean; - } - interface OramaNavigationBar { - "handleClose": () => void; - "showBackButton": boolean; - "showChatActions": boolean; - } - interface OramaSearch { - "disableChat"?: boolean; - "focusInput"?: boolean; - "highlightDescription"?: HighlightOptions | false; - "highlightTitle"?: HighlightOptions | false; - "linksRel"?: string; - "linksTarget"?: string; - "placeholder"?: string; - "sourceBaseUrl"?: string; - "suggestions"?: string[]; - } - interface OramaSearchBox { - "chatMarkdownLinkHref"?: ChatMarkdownLinkHref; - "chatMarkdownLinkTarget"?: ChatMarkdownLinkTarget; - "chatMarkdownLinkTitle"?: ChatMarkdownLinkTitle; - "chatPlaceholder"?: string; - "clientInstance"?: OramaClient | AnyOrama; - "colorScheme"?: ColorScheme; - "disableChat"?: boolean; - "facetProperty"?: string; - "highlightDescription"?: HighlightOptions | false; - "highlightTitle"?: HighlightOptions | false; - "index"?: CloudIndexConfig; - "layout"?: 'modal' | 'embed'; - "linksRel"?: string; - "linksTarget"?: string; - "open": boolean; - "placeholder"?: string; - "resultMap"?: Partial; - "searchParams"?: SearchParams>; - "searchPlaceholder"?: string; - "sourceBaseUrl"?: string; - "sourcesMap"?: SourcesMap; - "suggestions"?: string[]; - "themeConfig"?: Partial; - } - interface OramaSearchButton { - "colorScheme"?: ColorScheme; - "size": 'small' | 'medium' | 'large'; - "themeConfig"?: Partial; - } - interface OramaSearchResults { - "error": boolean; - "highlightDescription"?: HighlightOptions | false; - "highlightTitle"?: HighlightOptions | false; - "linksRel"?: string; - "linksTarget"?: string; - "loading": boolean; - "searchTerm": SearchResultsProps['searchTerm']; - "sections": SearchResultBySection[]; - "setChatTerm": (term: string) => void; - "sourceBaseUrl"?: string; - "suggestions"?: string[]; - } - interface OramaSlidingPanel { - "backdrop": boolean; - "closed": () => void; - "open": boolean; - } - interface OramaSources { - "linksRel"?: string; - "linksTarget"?: string; - "sourceBaseURL"?: string; - "sources": any; - "sourcesMap"?: SourcesMap; - } - interface OramaSuggestions { - "as": 'chips' | 'list'; - "icon"?: Node; - "suggestionClicked": (suggestion: string) => void; - "suggestions": string[]; - } - interface OramaText { - /** - * optionally change text alignment - */ - "align"?: TextProps['align']; - /** - * it defines the HTML tag to be used - */ - "as"?: TextProps['as']; - "bold"?: boolean; - /** - * the optional class name - */ - "class"?: string; - /** - * show as inactive - */ - "inactive"?: TextProps['inactive']; - /** - * it defines how it should look like - */ - "styledAs"?: TextProps['styledAs']; - /** - * optionally change variant style - default is primary - */ - "variant": TextProps['variant']; - } - interface OramaTextarea { - "autoFocus": boolean; - "maxRows": number | string; - "minRows": number | string; - "placeholder": string; - "value": string | null; - } - interface OramaToggler { - "performInitialAnimation": boolean; - } + interface OramaButton { + "as"?: ButtonProps["as"]; + "class"?: string; + "disabled"?: boolean; + "size": "small" | "medium" | "large"; + "type"?: ButtonProps["type"]; + "variant"?: ButtonProps["variant"]; + "withTooltip"?: string; + } + + interface OramaChat { + "chatMarkdownLinkHref"?: ChatMarkdownLinkHref; + "chatMarkdownLinkTarget"?: ChatMarkdownLinkTarget; + "chatMarkdownLinkTitle"?: ChatMarkdownLinkTitle; + "defaultTerm"?: string; + "focusInput"?: boolean; + "linksRel"?: string; + "linksTarget"?: string; + "placeholder"?: string; + "showClearChat"?: boolean; + "sourceBaseUrl"?: string; + "sourcesMap"?: SourcesMap; + "suggestions"?: string[]; + "systemPrompts"?: string[]; + } + + interface OramaChatAssistentMessage { + "chatMarkdownLinkHref"?: ChatMarkdownLinkHref; + "chatMarkdownLinkTarget"?: ChatMarkdownLinkTarget; + "chatMarkdownLinkTitle"?: ChatMarkdownLinkTitle; + "interaction": TChatInteraction; + } + + interface OramaChatBox { + "autoFocus": boolean; + "chatMarkdownLinkHref"?: ChatMarkdownLinkHref; + "chatMarkdownLinkTarget"?: ChatMarkdownLinkTarget; + "chatMarkdownLinkTitle"?: ChatMarkdownLinkTitle; + "clientInstance"?: OramaClient | AnyOrama; + "index"?: CloudIndexConfig; + "linksRel"?: string; + "linksTarget"?: string; + "placeholder"?: string; + "sourceBaseUrl"?: string; + "sourcesMap"?: SourcesMap; + "suggestions"?: string[]; + "systemPrompts"?: string[]; + } + + interface OramaChatButton { + "active"?: boolean; + "class"?: string; + "highlight"?: boolean; + "label": string; + } + + interface OramaChatMessagesContainer { + "chatMarkdownLinkHref"?: ChatMarkdownLinkHref; + "chatMarkdownLinkTarget"?: ChatMarkdownLinkTarget; + "chatMarkdownLinkTitle"?: ChatMarkdownLinkTitle; + "interactions": TChatInteraction[]; + } + + interface OramaChatUserMessage { + "interaction": TChatInteraction; + } + + interface OramaDotsLoader { + } + + interface OramaEmbed { + } + + interface OramaFacets { + "facetClicked": (facetName: string) => void; + "facets": Facet[]; + "selectedFacet": string; + } + + interface OramaFooter { + "class"?: string; + "colorScheme"?: Omit; + } + + interface OramaInput { + "autoFocus"?: boolean; + "defaultValue": InputProps["defaultValue"]; + "label"?: InputProps["label"]; + "labelForScreenReaders"?: InputProps["labelForScreenReaders"]; + "name": InputProps["name"]; + "placeholder"?: InputProps["placeholder"]; + "size"?: InputProps["size"]; + "type"?: InputProps["type"]; + } + + interface OramaLogoIcon { + "size": number; + } + + interface OramaMarkdown { + "chatMarkdownLinkHref"?: ChatMarkdownLinkHref; + "chatMarkdownLinkTarget"?: ChatMarkdownLinkTarget; + "chatMarkdownLinkTitle"?: ChatMarkdownLinkTitle; + "content": string; + } + + interface OramaModal { + "closeOnEscape": boolean; + "closeOnOutsideClick": boolean; + "mainTitle": string; + "open": boolean; + } + + interface OramaNavigationBar { + "handleClose": () => void; + "showBackButton": boolean; + "showChatActions": boolean; + } + + interface OramaSearch { + "disableChat"?: boolean; + "focusInput"?: boolean; + "highlightDescription"?: HighlightOptions | false; + "highlightTitle"?: HighlightOptions | false; + "linksRel"?: string; + "linksTarget"?: string; + "placeholder"?: string; + "sourceBaseUrl"?: string; + "suggestions"?: string[]; + } + + interface OramaSearchBox { + "chatMarkdownLinkHref"?: ChatMarkdownLinkHref; + "chatMarkdownLinkTarget"?: ChatMarkdownLinkTarget; + "chatMarkdownLinkTitle"?: ChatMarkdownLinkTitle; + "chatPlaceholder"?: string; + "clientInstance"?: OramaClient | AnyOrama; + "colorScheme"?: ColorScheme; + "disableChat"?: boolean; + "facetProperty"?: string; + "highlightDescription"?: HighlightOptions | false; + "highlightTitle"?: HighlightOptions | false; + "index"?: CloudIndexConfig; + "layout"?: "modal" | "embed"; + "linksRel"?: string; + "linksTarget"?: string; + "open": boolean; + "placeholder"?: string; + "resultMap"?: Partial; + "searchParams"?: SearchParams>; + "searchPlaceholder"?: string; + "sourceBaseUrl"?: string; + "sourcesMap"?: SourcesMap; + "suggestions"?: string[]; + "themeConfig"?: Partial; + } + + interface OramaSearchButton { + "colorScheme"?: ColorScheme; + "size": "small" | "medium" | "large"; + "themeConfig"?: Partial; + } + + interface OramaSearchResults { + "error": boolean; + "highlightDescription"?: HighlightOptions | false; + "highlightTitle"?: HighlightOptions | false; + "linksRel"?: string; + "linksTarget"?: string; + "loading": boolean; + "searchTerm": SearchResultsProps["searchTerm"]; + "sections": SearchResultBySection[]; + "setChatTerm": (term: string) => void; + "sourceBaseUrl"?: string; + "suggestions"?: string[]; + } + + interface OramaSlidingPanel { + "backdrop": boolean; + "closed": () => void; + "open": boolean; + } + + interface OramaSources { + "linksRel"?: string; + "linksTarget"?: string; + "sourceBaseURL"?: string; + "sources": any; + "sourcesMap"?: SourcesMap; + } + + interface OramaSuggestions { + "as": "chips" | "list"; + "icon"?: Node; + "suggestionClicked": (suggestion: string) => void; + "suggestions": string[]; + } + + interface OramaText { + /** + * optionally change text alignment + */ + "align"?: TextProps["align"]; + /** + * it defines the HTML tag to be used + */ + "as"?: TextProps["as"]; + "bold"?: boolean; + /** + * the optional class name + */ + "class"?: string; + /** + * show as inactive + */ + "inactive"?: TextProps["inactive"]; + /** + * it defines how it should look like + */ + "styledAs"?: TextProps["styledAs"]; + /** + * optionally change variant style - default is primary + */ + "variant": TextProps["variant"]; + } + + interface OramaTextarea { + "autoFocus": boolean; + "maxRows": number | string; + "minRows": number | string; + "placeholder": string; + "value": string | null; + } + + interface OramaToggler { + "performInitialAnimation": boolean; + } } + export interface OramaChatCustomEvent extends CustomEvent { - detail: T; - target: HTMLOramaChatElement; + detail: T; + target: HTMLOramaChatElement; } + export interface OramaChatBoxCustomEvent extends CustomEvent { - detail: T; - target: HTMLOramaChatBoxElement; + detail: T; + target: HTMLOramaChatBoxElement; } + export interface OramaChatMessagesContainerCustomEvent extends CustomEvent { - detail: T; - target: HTMLOramaChatMessagesContainerElement; + detail: T; + target: HTMLOramaChatMessagesContainerElement; } + export interface OramaInputCustomEvent extends CustomEvent { - detail: T; - target: HTMLOramaInputElement; + detail: T; + target: HTMLOramaInputElement; } + export interface OramaMarkdownCustomEvent extends CustomEvent { - detail: T; - target: HTMLOramaMarkdownElement; + detail: T; + target: HTMLOramaMarkdownElement; } + export interface OramaModalCustomEvent extends CustomEvent { - detail: T; - target: HTMLOramaModalElement; + detail: T; + target: HTMLOramaModalElement; } + export interface OramaSearchCustomEvent extends CustomEvent { - detail: T; - target: HTMLOramaSearchElement; + detail: T; + target: HTMLOramaSearchElement; } + export interface OramaSearchBoxCustomEvent extends CustomEvent { - detail: T; - target: HTMLOramaSearchBoxElement; + detail: T; + target: HTMLOramaSearchBoxElement; } + export interface OramaSearchResultsCustomEvent extends CustomEvent { - detail: T; - target: HTMLOramaSearchResultsElement; + detail: T; + target: HTMLOramaSearchResultsElement; } + export interface OramaSourcesCustomEvent extends CustomEvent { - detail: T; - target: HTMLOramaSourcesElement; + detail: T; + target: HTMLOramaSourcesElement; } + declare global { - interface HTMLOramaButtonElement extends Components.OramaButton, HTMLStencilElement { - } - var HTMLOramaButtonElement: { - prototype: HTMLOramaButtonElement; - new (): HTMLOramaButtonElement; - }; - interface HTMLOramaChatElementEventMap { - "answerGenerated": OnAnswerGeneratedCallbackProps; - } - interface HTMLOramaChatElement extends Components.OramaChat, HTMLStencilElement { - addEventListener(type: K, listener: (this: HTMLOramaChatElement, ev: OramaChatCustomEvent) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; - removeEventListener(type: K, listener: (this: HTMLOramaChatElement, ev: OramaChatCustomEvent) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; - } - var HTMLOramaChatElement: { - prototype: HTMLOramaChatElement; - new (): HTMLOramaChatElement; - }; - interface HTMLOramaChatAssistentMessageElement extends Components.OramaChatAssistentMessage, HTMLStencilElement { - } - var HTMLOramaChatAssistentMessageElement: { - prototype: HTMLOramaChatAssistentMessageElement; - new (): HTMLOramaChatAssistentMessageElement; - }; - interface HTMLOramaChatBoxElementEventMap { - "answerGenerated": OnAnswerGeneratedCallbackProps; - "answerSourceClick": OnAnswerSourceClickCallbackProps; - "chatMarkdownLinkClicked": OnChatMarkdownLinkClickedCallbackProps; - } - interface HTMLOramaChatBoxElement extends Components.OramaChatBox, HTMLStencilElement { - addEventListener(type: K, listener: (this: HTMLOramaChatBoxElement, ev: OramaChatBoxCustomEvent) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; - removeEventListener(type: K, listener: (this: HTMLOramaChatBoxElement, ev: OramaChatBoxCustomEvent) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; - } - var HTMLOramaChatBoxElement: { - prototype: HTMLOramaChatBoxElement; - new (): HTMLOramaChatBoxElement; - }; - interface HTMLOramaChatButtonElement extends Components.OramaChatButton, HTMLStencilElement { - } - var HTMLOramaChatButtonElement: { - prototype: HTMLOramaChatButtonElement; - new (): HTMLOramaChatButtonElement; - }; - interface HTMLOramaChatMessagesContainerElementEventMap { - "answerGenerated": OnAnswerGeneratedCallbackProps; - } - interface HTMLOramaChatMessagesContainerElement extends Components.OramaChatMessagesContainer, HTMLStencilElement { - addEventListener(type: K, listener: (this: HTMLOramaChatMessagesContainerElement, ev: OramaChatMessagesContainerCustomEvent) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; - removeEventListener(type: K, listener: (this: HTMLOramaChatMessagesContainerElement, ev: OramaChatMessagesContainerCustomEvent) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; - } - var HTMLOramaChatMessagesContainerElement: { - prototype: HTMLOramaChatMessagesContainerElement; - new (): HTMLOramaChatMessagesContainerElement; - }; - interface HTMLOramaChatUserMessageElement extends Components.OramaChatUserMessage, HTMLStencilElement { - } - var HTMLOramaChatUserMessageElement: { - prototype: HTMLOramaChatUserMessageElement; - new (): HTMLOramaChatUserMessageElement; - }; - interface HTMLOramaDotsLoaderElement extends Components.OramaDotsLoader, HTMLStencilElement { - } - var HTMLOramaDotsLoaderElement: { - prototype: HTMLOramaDotsLoaderElement; - new (): HTMLOramaDotsLoaderElement; - }; - interface HTMLOramaEmbedElement extends Components.OramaEmbed, HTMLStencilElement { - } - var HTMLOramaEmbedElement: { - prototype: HTMLOramaEmbedElement; - new (): HTMLOramaEmbedElement; - }; - interface HTMLOramaFacetsElement extends Components.OramaFacets, HTMLStencilElement { - } - var HTMLOramaFacetsElement: { - prototype: HTMLOramaFacetsElement; - new (): HTMLOramaFacetsElement; - }; - interface HTMLOramaFooterElement extends Components.OramaFooter, HTMLStencilElement { - } - var HTMLOramaFooterElement: { - prototype: HTMLOramaFooterElement; - new (): HTMLOramaFooterElement; - }; - interface HTMLOramaInputElementEventMap { - "resetValue": void; - } - interface HTMLOramaInputElement extends Components.OramaInput, HTMLStencilElement { - addEventListener(type: K, listener: (this: HTMLOramaInputElement, ev: OramaInputCustomEvent) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; - removeEventListener(type: K, listener: (this: HTMLOramaInputElement, ev: OramaInputCustomEvent) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; - } - var HTMLOramaInputElement: { - prototype: HTMLOramaInputElement; - new (): HTMLOramaInputElement; - }; - interface HTMLOramaLogoIconElement extends Components.OramaLogoIcon, HTMLStencilElement { - } - var HTMLOramaLogoIconElement: { - prototype: HTMLOramaLogoIconElement; - new (): HTMLOramaLogoIconElement; - }; - interface HTMLOramaMarkdownElementEventMap { - "chatMarkdownLinkClicked": OnChatMarkdownLinkClickedCallbackProps; - } - interface HTMLOramaMarkdownElement extends Components.OramaMarkdown, HTMLStencilElement { - addEventListener(type: K, listener: (this: HTMLOramaMarkdownElement, ev: OramaMarkdownCustomEvent) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; - removeEventListener(type: K, listener: (this: HTMLOramaMarkdownElement, ev: OramaMarkdownCustomEvent) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; - } - var HTMLOramaMarkdownElement: { - prototype: HTMLOramaMarkdownElement; - new (): HTMLOramaMarkdownElement; - }; - interface HTMLOramaModalElementEventMap { - "modalStatusChanged": ModalStatus; - } - interface HTMLOramaModalElement extends Components.OramaModal, HTMLStencilElement { - addEventListener(type: K, listener: (this: HTMLOramaModalElement, ev: OramaModalCustomEvent) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; - removeEventListener(type: K, listener: (this: HTMLOramaModalElement, ev: OramaModalCustomEvent) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; - } - var HTMLOramaModalElement: { - prototype: HTMLOramaModalElement; - new (): HTMLOramaModalElement; - }; - interface HTMLOramaNavigationBarElement extends Components.OramaNavigationBar, HTMLStencilElement { - } - var HTMLOramaNavigationBarElement: { - prototype: HTMLOramaNavigationBarElement; - new (): HTMLOramaNavigationBarElement; - }; - interface HTMLOramaSearchElementEventMap { - "searchCompleted": OnSearchCompletedCallbackProps; - "answerGenerated": OnAnswerGeneratedCallbackProps; - } - interface HTMLOramaSearchElement extends Components.OramaSearch, HTMLStencilElement { - addEventListener(type: K, listener: (this: HTMLOramaSearchElement, ev: OramaSearchCustomEvent) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; - removeEventListener(type: K, listener: (this: HTMLOramaSearchElement, ev: OramaSearchCustomEvent) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; - } - var HTMLOramaSearchElement: { - prototype: HTMLOramaSearchElement; - new (): HTMLOramaSearchElement; - }; - interface HTMLOramaSearchBoxElementEventMap { - "searchCompleted": OnSearchCompletedCallbackProps; - "searchResultClick": OnSearchResultClickCallbackProps; - "answerGenerated": OnAnswerGeneratedCallbackProps; - "answerSourceClick": OnAnswerSourceClickCallbackProps; - "chatMarkdownLinkClicked": OnChatMarkdownLinkClickedCallbackProps; - } - interface HTMLOramaSearchBoxElement extends Components.OramaSearchBox, HTMLStencilElement { - addEventListener(type: K, listener: (this: HTMLOramaSearchBoxElement, ev: OramaSearchBoxCustomEvent) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; - removeEventListener(type: K, listener: (this: HTMLOramaSearchBoxElement, ev: OramaSearchBoxCustomEvent) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; - } - var HTMLOramaSearchBoxElement: { - prototype: HTMLOramaSearchBoxElement; - new (): HTMLOramaSearchBoxElement; - }; - interface HTMLOramaSearchButtonElement extends Components.OramaSearchButton, HTMLStencilElement { - } - var HTMLOramaSearchButtonElement: { - prototype: HTMLOramaSearchButtonElement; - new (): HTMLOramaSearchButtonElement; - }; - interface HTMLOramaSearchResultsElementEventMap { - "searchResultClick": SearchResult; - } - interface HTMLOramaSearchResultsElement extends Components.OramaSearchResults, HTMLStencilElement { - addEventListener(type: K, listener: (this: HTMLOramaSearchResultsElement, ev: OramaSearchResultsCustomEvent) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; - removeEventListener(type: K, listener: (this: HTMLOramaSearchResultsElement, ev: OramaSearchResultsCustomEvent) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; - } - var HTMLOramaSearchResultsElement: { - prototype: HTMLOramaSearchResultsElement; - new (): HTMLOramaSearchResultsElement; - }; - interface HTMLOramaSlidingPanelElement extends Components.OramaSlidingPanel, HTMLStencilElement { - } - var HTMLOramaSlidingPanelElement: { - prototype: HTMLOramaSlidingPanelElement; - new (): HTMLOramaSlidingPanelElement; - }; - interface HTMLOramaSourcesElementEventMap { - "answerSourceClick": SearchResult; - } - interface HTMLOramaSourcesElement extends Components.OramaSources, HTMLStencilElement { - addEventListener(type: K, listener: (this: HTMLOramaSourcesElement, ev: OramaSourcesCustomEvent) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; - removeEventListener(type: K, listener: (this: HTMLOramaSourcesElement, ev: OramaSourcesCustomEvent) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; - } - var HTMLOramaSourcesElement: { - prototype: HTMLOramaSourcesElement; - new (): HTMLOramaSourcesElement; - }; - interface HTMLOramaSuggestionsElement extends Components.OramaSuggestions, HTMLStencilElement { - } - var HTMLOramaSuggestionsElement: { - prototype: HTMLOramaSuggestionsElement; - new (): HTMLOramaSuggestionsElement; - }; - interface HTMLOramaTextElement extends Components.OramaText, HTMLStencilElement { - } - var HTMLOramaTextElement: { - prototype: HTMLOramaTextElement; - new (): HTMLOramaTextElement; - }; - interface HTMLOramaTextareaElement extends Components.OramaTextarea, HTMLStencilElement { - } - var HTMLOramaTextareaElement: { - prototype: HTMLOramaTextareaElement; - new (): HTMLOramaTextareaElement; - }; - interface HTMLOramaTogglerElement extends Components.OramaToggler, HTMLStencilElement { - } - var HTMLOramaTogglerElement: { - prototype: HTMLOramaTogglerElement; - new (): HTMLOramaTogglerElement; - }; - interface HTMLElementTagNameMap { - "orama-button": HTMLOramaButtonElement; - "orama-chat": HTMLOramaChatElement; - "orama-chat-assistent-message": HTMLOramaChatAssistentMessageElement; - "orama-chat-box": HTMLOramaChatBoxElement; - "orama-chat-button": HTMLOramaChatButtonElement; - "orama-chat-messages-container": HTMLOramaChatMessagesContainerElement; - "orama-chat-user-message": HTMLOramaChatUserMessageElement; - "orama-dots-loader": HTMLOramaDotsLoaderElement; - "orama-embed": HTMLOramaEmbedElement; - "orama-facets": HTMLOramaFacetsElement; - "orama-footer": HTMLOramaFooterElement; - "orama-input": HTMLOramaInputElement; - "orama-logo-icon": HTMLOramaLogoIconElement; - "orama-markdown": HTMLOramaMarkdownElement; - "orama-modal": HTMLOramaModalElement; - "orama-navigation-bar": HTMLOramaNavigationBarElement; - "orama-search": HTMLOramaSearchElement; - "orama-search-box": HTMLOramaSearchBoxElement; - "orama-search-button": HTMLOramaSearchButtonElement; - "orama-search-results": HTMLOramaSearchResultsElement; - "orama-sliding-panel": HTMLOramaSlidingPanelElement; - "orama-sources": HTMLOramaSourcesElement; - "orama-suggestions": HTMLOramaSuggestionsElement; - "orama-text": HTMLOramaTextElement; - "orama-textarea": HTMLOramaTextareaElement; - "orama-toggler": HTMLOramaTogglerElement; - } + interface HTMLOramaButtonElement extends Components.OramaButton, HTMLStencilElement { + } + + var HTMLOramaButtonElement: { + prototype: HTMLOramaButtonElement; + new(): HTMLOramaButtonElement; + } + + interface HTMLOramaChatElementEventMap { + "answerGenerated": OnAnswerGeneratedCallbackProps; + } + + interface HTMLOramaChatElement extends Components.OramaChat, HTMLStencilElement { + addEventListener(type: K, listener: (this: HTMLOramaChatElement, ev: OramaChatCustomEvent) => any, options?: boolean | AddEventListenerOptions): void; + + addEventListener(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + + addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + + removeEventListener(type: K, listener: (this: HTMLOramaChatElement, ev: OramaChatCustomEvent) => any, options?: boolean | EventListenerOptions): void; + + removeEventListener(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void; + + removeEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; + + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + } + + var HTMLOramaChatElement: { + prototype: HTMLOramaChatElement; + new(): HTMLOramaChatElement; + } + + interface HTMLOramaChatAssistentMessageElement extends Components.OramaChatAssistentMessage, HTMLStencilElement { + } + + var HTMLOramaChatAssistentMessageElement: { + prototype: HTMLOramaChatAssistentMessageElement; + new(): HTMLOramaChatAssistentMessageElement; + } + + interface HTMLOramaChatBoxElementEventMap { + "answerGenerated": OnAnswerGeneratedCallbackProps; + "answerSourceClick": OnAnswerSourceClickCallbackProps; + "chatMarkdownLinkClicked": OnChatMarkdownLinkClickedCallbackProps; + } + + interface HTMLOramaChatBoxElement extends Components.OramaChatBox, HTMLStencilElement { + addEventListener(type: K, listener: (this: HTMLOramaChatBoxElement, ev: OramaChatBoxCustomEvent) => any, options?: boolean | AddEventListenerOptions): void; + + addEventListener(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + + addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + + removeEventListener(type: K, listener: (this: HTMLOramaChatBoxElement, ev: OramaChatBoxCustomEvent) => any, options?: boolean | EventListenerOptions): void; + + removeEventListener(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void; + + removeEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; + + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + } + + var HTMLOramaChatBoxElement: { + prototype: HTMLOramaChatBoxElement; + new(): HTMLOramaChatBoxElement; + } + + interface HTMLOramaChatButtonElement extends Components.OramaChatButton, HTMLStencilElement { + } + + var HTMLOramaChatButtonElement: { + prototype: HTMLOramaChatButtonElement; + new(): HTMLOramaChatButtonElement; + } + + interface HTMLOramaChatMessagesContainerElementEventMap { + "answerGenerated": OnAnswerGeneratedCallbackProps; + } + + interface HTMLOramaChatMessagesContainerElement extends Components.OramaChatMessagesContainer, HTMLStencilElement { + addEventListener(type: K, listener: (this: HTMLOramaChatMessagesContainerElement, ev: OramaChatMessagesContainerCustomEvent) => any, options?: boolean | AddEventListenerOptions): void; + + addEventListener(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + + addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + + removeEventListener(type: K, listener: (this: HTMLOramaChatMessagesContainerElement, ev: OramaChatMessagesContainerCustomEvent) => any, options?: boolean | EventListenerOptions): void; + + removeEventListener(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void; + + removeEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; + + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + } + + var HTMLOramaChatMessagesContainerElement: { + prototype: HTMLOramaChatMessagesContainerElement; + new(): HTMLOramaChatMessagesContainerElement; + } + + interface HTMLOramaChatUserMessageElement extends Components.OramaChatUserMessage, HTMLStencilElement { + } + + var HTMLOramaChatUserMessageElement: { + prototype: HTMLOramaChatUserMessageElement; + new(): HTMLOramaChatUserMessageElement; + } + + interface HTMLOramaDotsLoaderElement extends Components.OramaDotsLoader, HTMLStencilElement { + } + + var HTMLOramaDotsLoaderElement: { + prototype: HTMLOramaDotsLoaderElement; + new(): HTMLOramaDotsLoaderElement; + } + + interface HTMLOramaEmbedElement extends Components.OramaEmbed, HTMLStencilElement { + } + + var HTMLOramaEmbedElement: { + prototype: HTMLOramaEmbedElement; + new(): HTMLOramaEmbedElement; + } + + interface HTMLOramaFacetsElement extends Components.OramaFacets, HTMLStencilElement { + } + + var HTMLOramaFacetsElement: { + prototype: HTMLOramaFacetsElement; + new(): HTMLOramaFacetsElement; + } + + interface HTMLOramaFooterElement extends Components.OramaFooter, HTMLStencilElement { + } + + var HTMLOramaFooterElement: { + prototype: HTMLOramaFooterElement; + new(): HTMLOramaFooterElement; + } + + interface HTMLOramaInputElementEventMap { + "resetValue": void; + } + + interface HTMLOramaInputElement extends Components.OramaInput, HTMLStencilElement { + addEventListener(type: K, listener: (this: HTMLOramaInputElement, ev: OramaInputCustomEvent) => any, options?: boolean | AddEventListenerOptions): void; + + addEventListener(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + + addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + + removeEventListener(type: K, listener: (this: HTMLOramaInputElement, ev: OramaInputCustomEvent) => any, options?: boolean | EventListenerOptions): void; + + removeEventListener(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void; + + removeEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; + + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + } + + var HTMLOramaInputElement: { + prototype: HTMLOramaInputElement; + new(): HTMLOramaInputElement; + } + + interface HTMLOramaLogoIconElement extends Components.OramaLogoIcon, HTMLStencilElement { + } + + var HTMLOramaLogoIconElement: { + prototype: HTMLOramaLogoIconElement; + new(): HTMLOramaLogoIconElement; + } + + interface HTMLOramaMarkdownElementEventMap { + "chatMarkdownLinkClicked": OnChatMarkdownLinkClickedCallbackProps; + } + + interface HTMLOramaMarkdownElement extends Components.OramaMarkdown, HTMLStencilElement { + addEventListener(type: K, listener: (this: HTMLOramaMarkdownElement, ev: OramaMarkdownCustomEvent) => any, options?: boolean | AddEventListenerOptions): void; + + addEventListener(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + + addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + + removeEventListener(type: K, listener: (this: HTMLOramaMarkdownElement, ev: OramaMarkdownCustomEvent) => any, options?: boolean | EventListenerOptions): void; + + removeEventListener(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void; + + removeEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; + + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + } + + var HTMLOramaMarkdownElement: { + prototype: HTMLOramaMarkdownElement; + new(): HTMLOramaMarkdownElement; + } + + interface HTMLOramaModalElementEventMap { + "modalStatusChanged": ModalStatus; + } + + interface HTMLOramaModalElement extends Components.OramaModal, HTMLStencilElement { + addEventListener(type: K, listener: (this: HTMLOramaModalElement, ev: OramaModalCustomEvent) => any, options?: boolean | AddEventListenerOptions): void; + + addEventListener(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + + addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + + removeEventListener(type: K, listener: (this: HTMLOramaModalElement, ev: OramaModalCustomEvent) => any, options?: boolean | EventListenerOptions): void; + + removeEventListener(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void; + + removeEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; + + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + } + + var HTMLOramaModalElement: { + prototype: HTMLOramaModalElement; + new(): HTMLOramaModalElement; + } + + interface HTMLOramaNavigationBarElement extends Components.OramaNavigationBar, HTMLStencilElement { + } + + var HTMLOramaNavigationBarElement: { + prototype: HTMLOramaNavigationBarElement; + new(): HTMLOramaNavigationBarElement; + } + + interface HTMLOramaSearchElementEventMap { + "searchCompleted": OnSearchCompletedCallbackProps; + "answerGenerated": OnAnswerGeneratedCallbackProps; + } + + interface HTMLOramaSearchElement extends Components.OramaSearch, HTMLStencilElement { + addEventListener(type: K, listener: (this: HTMLOramaSearchElement, ev: OramaSearchCustomEvent) => any, options?: boolean | AddEventListenerOptions): void; + + addEventListener(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + + addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + + removeEventListener(type: K, listener: (this: HTMLOramaSearchElement, ev: OramaSearchCustomEvent) => any, options?: boolean | EventListenerOptions): void; + + removeEventListener(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void; + + removeEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; + + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + } + + var HTMLOramaSearchElement: { + prototype: HTMLOramaSearchElement; + new(): HTMLOramaSearchElement; + } + + interface HTMLOramaSearchBoxElementEventMap { + "searchCompleted": OnSearchCompletedCallbackProps; + "searchResultClick": OnSearchResultClickCallbackProps; + "answerGenerated": OnAnswerGeneratedCallbackProps; + "answerSourceClick": OnAnswerSourceClickCallbackProps; + "chatMarkdownLinkClicked": OnChatMarkdownLinkClickedCallbackProps; + } + + interface HTMLOramaSearchBoxElement extends Components.OramaSearchBox, HTMLStencilElement { + addEventListener(type: K, listener: (this: HTMLOramaSearchBoxElement, ev: OramaSearchBoxCustomEvent) => any, options?: boolean | AddEventListenerOptions): void; + + addEventListener(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + + addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + + removeEventListener(type: K, listener: (this: HTMLOramaSearchBoxElement, ev: OramaSearchBoxCustomEvent) => any, options?: boolean | EventListenerOptions): void; + + removeEventListener(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void; + + removeEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; + + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + } + + var HTMLOramaSearchBoxElement: { + prototype: HTMLOramaSearchBoxElement; + new(): HTMLOramaSearchBoxElement; + } + + interface HTMLOramaSearchButtonElement extends Components.OramaSearchButton, HTMLStencilElement { + } + + var HTMLOramaSearchButtonElement: { + prototype: HTMLOramaSearchButtonElement; + new(): HTMLOramaSearchButtonElement; + } + + interface HTMLOramaSearchResultsElementEventMap { + "searchResultClick": SearchResult; + } + + interface HTMLOramaSearchResultsElement extends Components.OramaSearchResults, HTMLStencilElement { + addEventListener(type: K, listener: (this: HTMLOramaSearchResultsElement, ev: OramaSearchResultsCustomEvent) => any, options?: boolean | AddEventListenerOptions): void; + + addEventListener(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + + addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + + removeEventListener(type: K, listener: (this: HTMLOramaSearchResultsElement, ev: OramaSearchResultsCustomEvent) => any, options?: boolean | EventListenerOptions): void; + + removeEventListener(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void; + + removeEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; + + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + } + + var HTMLOramaSearchResultsElement: { + prototype: HTMLOramaSearchResultsElement; + new(): HTMLOramaSearchResultsElement; + } + + interface HTMLOramaSlidingPanelElement extends Components.OramaSlidingPanel, HTMLStencilElement { + } + + var HTMLOramaSlidingPanelElement: { + prototype: HTMLOramaSlidingPanelElement; + new(): HTMLOramaSlidingPanelElement; + } + + interface HTMLOramaSourcesElementEventMap { + "answerSourceClick": SearchResult; + } + + interface HTMLOramaSourcesElement extends Components.OramaSources, HTMLStencilElement { + addEventListener(type: K, listener: (this: HTMLOramaSourcesElement, ev: OramaSourcesCustomEvent) => any, options?: boolean | AddEventListenerOptions): void; + + addEventListener(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + + addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + + removeEventListener(type: K, listener: (this: HTMLOramaSourcesElement, ev: OramaSourcesCustomEvent) => any, options?: boolean | EventListenerOptions): void; + + removeEventListener(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void; + + removeEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; + + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + } + + var HTMLOramaSourcesElement: { + prototype: HTMLOramaSourcesElement; + new(): HTMLOramaSourcesElement; + } + + interface HTMLOramaSuggestionsElement extends Components.OramaSuggestions, HTMLStencilElement { + } + + var HTMLOramaSuggestionsElement: { + prototype: HTMLOramaSuggestionsElement; + new(): HTMLOramaSuggestionsElement; + } + + interface HTMLOramaTextElement extends Components.OramaText, HTMLStencilElement { + } + + var HTMLOramaTextElement: { + prototype: HTMLOramaTextElement; + new(): HTMLOramaTextElement; + } + + interface HTMLOramaTextareaElement extends Components.OramaTextarea, HTMLStencilElement { + } + + var HTMLOramaTextareaElement: { + prototype: HTMLOramaTextareaElement; + new(): HTMLOramaTextareaElement; + } + + interface HTMLOramaTogglerElement extends Components.OramaToggler, HTMLStencilElement { + } + + var HTMLOramaTogglerElement: { + prototype: HTMLOramaTogglerElement; + new(): HTMLOramaTogglerElement; + } + + interface HTMLElementTagNameMap { + "orama-button": HTMLOramaButtonElement; + "orama-chat": HTMLOramaChatElement; + "orama-chat-assistent-message": HTMLOramaChatAssistentMessageElement; + "orama-chat-box": HTMLOramaChatBoxElement; + "orama-chat-button": HTMLOramaChatButtonElement; + "orama-chat-messages-container": HTMLOramaChatMessagesContainerElement; + "orama-chat-user-message": HTMLOramaChatUserMessageElement; + "orama-dots-loader": HTMLOramaDotsLoaderElement; + "orama-embed": HTMLOramaEmbedElement; + "orama-facets": HTMLOramaFacetsElement; + "orama-footer": HTMLOramaFooterElement; + "orama-input": HTMLOramaInputElement; + "orama-logo-icon": HTMLOramaLogoIconElement; + "orama-markdown": HTMLOramaMarkdownElement; + "orama-modal": HTMLOramaModalElement; + "orama-navigation-bar": HTMLOramaNavigationBarElement; + "orama-search": HTMLOramaSearchElement; + "orama-search-box": HTMLOramaSearchBoxElement; + "orama-search-button": HTMLOramaSearchButtonElement; + "orama-search-results": HTMLOramaSearchResultsElement; + "orama-sliding-panel": HTMLOramaSlidingPanelElement; + "orama-sources": HTMLOramaSourcesElement; + "orama-suggestions": HTMLOramaSuggestionsElement; + "orama-text": HTMLOramaTextElement; + "orama-textarea": HTMLOramaTextareaElement; + "orama-toggler": HTMLOramaTogglerElement; + } } declare namespace LocalJSX { - interface OramaButton { - "as"?: ButtonProps['as']; - "class"?: string; - "disabled"?: boolean; - "size"?: 'small' | 'medium' | 'large'; - "type"?: ButtonProps['type']; - "variant"?: ButtonProps['variant']; - "withTooltip"?: string; - } - interface OramaChat { - "chatMarkdownLinkHref"?: ChatMarkdownLinkHref; - "chatMarkdownLinkTarget"?: ChatMarkdownLinkTarget; - "chatMarkdownLinkTitle"?: ChatMarkdownLinkTitle; - "defaultTerm"?: string; - "focusInput"?: boolean; - "linksRel"?: string; - "linksTarget"?: string; - "onAnswerGenerated"?: (event: OramaChatCustomEvent) => void; - "placeholder"?: string; - "showClearChat"?: boolean; - "sourceBaseUrl"?: string; - "sourcesMap"?: SourcesMap; - "suggestions"?: string[]; - "systemPrompts"?: string[]; - } - interface OramaChatAssistentMessage { - "chatMarkdownLinkHref"?: ChatMarkdownLinkHref; - "chatMarkdownLinkTarget"?: ChatMarkdownLinkTarget; - "chatMarkdownLinkTitle"?: ChatMarkdownLinkTitle; - "interaction"?: TChatInteraction; - } - interface OramaChatBox { - "autoFocus"?: boolean; - "chatMarkdownLinkHref"?: ChatMarkdownLinkHref; - "chatMarkdownLinkTarget"?: ChatMarkdownLinkTarget; - "chatMarkdownLinkTitle"?: ChatMarkdownLinkTitle; - "clientInstance"?: OramaClient | Orama; - "index"?: CloudIndexConfig; - "linksRel"?: string; - "linksTarget"?: string; - /** - * Fired when answer generation is successfully completed - */ - "onAnswerGenerated"?: (event: OramaChatBoxCustomEvent) => void; - /** - * Fired when user clicks on answer source - */ - "onAnswerSourceClick"?: (event: OramaChatBoxCustomEvent) => void; - /** - * Fired when user clicks on chat markdown link - */ - "onChatMarkdownLinkClicked"?: (event: OramaChatBoxCustomEvent) => void; - "placeholder"?: string; - "sourceBaseUrl"?: string; - "sourcesMap"?: SourcesMap; - "suggestions"?: string[]; - "systemPrompts"?: string[]; - } - interface OramaChatButton { - "active"?: boolean; - "class"?: string; - "highlight"?: boolean; - "label"?: string; - } - interface OramaChatMessagesContainer { - "chatMarkdownLinkHref"?: ChatMarkdownLinkHref; - "chatMarkdownLinkTarget"?: ChatMarkdownLinkTarget; - "chatMarkdownLinkTitle"?: ChatMarkdownLinkTitle; - "interactions"?: TChatInteraction[]; - "onAnswerGenerated"?: (event: OramaChatMessagesContainerCustomEvent) => void; - } - interface OramaChatUserMessage { - "interaction"?: TChatInteraction; - } - interface OramaDotsLoader { - } - interface OramaEmbed { - } - interface OramaFacets { - "facetClicked"?: (facetName: string) => void; - "facets"?: Facet[]; - "selectedFacet"?: string; - } - interface OramaFooter { - "class"?: string; - "colorScheme"?: Omit; - } - interface OramaInput { - "autoFocus"?: boolean; - "defaultValue"?: InputProps['defaultValue']; - "label"?: InputProps['label']; - "labelForScreenReaders"?: InputProps['labelForScreenReaders']; - "name"?: InputProps['name']; - "onResetValue"?: (event: OramaInputCustomEvent) => void; - "placeholder"?: InputProps['placeholder']; - "size"?: InputProps['size']; - "type"?: InputProps['type']; - } - interface OramaLogoIcon { - "size"?: number; - } - interface OramaMarkdown { - "chatMarkdownLinkHref"?: ChatMarkdownLinkHref; - "chatMarkdownLinkTarget"?: ChatMarkdownLinkTarget; - "chatMarkdownLinkTitle"?: ChatMarkdownLinkTitle; - "content"?: string; - "onChatMarkdownLinkClicked"?: (event: OramaMarkdownCustomEvent) => void; - } - interface OramaModal { - "closeOnEscape"?: boolean; - "closeOnOutsideClick"?: boolean; - "mainTitle"?: string; - "onModalStatusChanged"?: (event: OramaModalCustomEvent) => void; - "open"?: boolean; - } - interface OramaNavigationBar { - "handleClose"?: () => void; - "showBackButton"?: boolean; - "showChatActions"?: boolean; - } - interface OramaSearch { - "disableChat"?: boolean; - "focusInput"?: boolean; - "highlightDescription"?: HighlightOptions | false; - "highlightTitle"?: HighlightOptions | false; - "linksRel"?: string; - "linksTarget"?: string; - "onAnswerGenerated"?: (event: OramaSearchCustomEvent) => void; - "onSearchCompleted"?: (event: OramaSearchCustomEvent) => void; - "placeholder"?: string; - "sourceBaseUrl"?: string; - "suggestions"?: string[]; - } - interface OramaSearchBox { - "chatMarkdownLinkHref"?: ChatMarkdownLinkHref; - "chatMarkdownLinkTarget"?: ChatMarkdownLinkTarget; - "chatMarkdownLinkTitle"?: ChatMarkdownLinkTitle; - "chatPlaceholder"?: string; - "clientInstance"?: OramaClient | AnyOrama; - "colorScheme"?: ColorScheme; - "disableChat"?: boolean; - "facetProperty"?: string; - "highlightDescription"?: HighlightOptions | false; - "highlightTitle"?: HighlightOptions | false; - "index"?: CloudIndexConfig; - "layout"?: 'modal' | 'embed'; - "linksRel"?: string; - "linksTarget"?: string; - /** - * Fired when answer generation is successfully completed - */ - "onAnswerGenerated"?: (event: OramaSearchBoxCustomEvent) => void; - /** - * Fired when user clicks on answer source - */ - "onAnswerSourceClick"?: (event: OramaSearchBoxCustomEvent) => void; - /** - * Fired when user clicks on chat markdown link - */ - "onChatMarkdownLinkClicked"?: (event: OramaSearchBoxCustomEvent) => void; - /** - * Fired when search successfully resolves - */ - "onSearchCompleted"?: (event: OramaSearchBoxCustomEvent) => void; - /** - * Fired when user clicks on search result - */ - "onSearchResultClick"?: (event: OramaSearchBoxCustomEvent) => void; - "open"?: boolean; - "placeholder"?: string; - "resultMap"?: Partial; - "searchParams"?: SearchParams>; - "searchPlaceholder"?: string; - "sourceBaseUrl"?: string; - "sourcesMap"?: SourcesMap; - "suggestions"?: string[]; - "themeConfig"?: Partial; - } - interface OramaSearchButton { - "colorScheme"?: ColorScheme; - "size"?: 'small' | 'medium' | 'large'; - "themeConfig"?: Partial; - } - interface OramaSearchResults { - "error"?: boolean; - "highlightDescription"?: HighlightOptions | false; - "highlightTitle"?: HighlightOptions | false; - "linksRel"?: string; - "linksTarget"?: string; - "loading"?: boolean; - "onSearchResultClick"?: (event: OramaSearchResultsCustomEvent) => void; - "searchTerm"?: SearchResultsProps['searchTerm']; - "sections"?: SearchResultBySection[]; - "setChatTerm"?: (term: string) => void; - "sourceBaseUrl"?: string; - "suggestions"?: string[]; - } - interface OramaSlidingPanel { - "backdrop"?: boolean; - "closed"?: () => void; - "open"?: boolean; - } - interface OramaSources { - "linksRel"?: string; - "linksTarget"?: string; - "onAnswerSourceClick"?: (event: OramaSourcesCustomEvent) => void; - "sourceBaseURL"?: string; - "sources"?: any; - "sourcesMap"?: SourcesMap; - } - interface OramaSuggestions { - "as"?: 'chips' | 'list'; - "icon"?: Node; - "suggestionClicked"?: (suggestion: string) => void; - "suggestions"?: string[]; - } - interface OramaText { - /** - * optionally change text alignment - */ - "align"?: TextProps['align']; - /** - * it defines the HTML tag to be used - */ - "as"?: TextProps['as']; - "bold"?: boolean; - /** - * the optional class name - */ - "class"?: string; - /** - * show as inactive - */ - "inactive"?: TextProps['inactive']; - /** - * it defines how it should look like - */ - "styledAs"?: TextProps['styledAs']; - /** - * optionally change variant style - default is primary - */ - "variant"?: TextProps['variant']; - } - interface OramaTextarea { - "autoFocus"?: boolean; - "maxRows"?: number | string; - "minRows"?: number | string; - "placeholder"?: string; - "value"?: string | null; - } - interface OramaToggler { - "performInitialAnimation"?: boolean; - } - interface IntrinsicElements { - "orama-button": OramaButton; - "orama-chat": OramaChat; - "orama-chat-assistent-message": OramaChatAssistentMessage; - "orama-chat-box": OramaChatBox; - "orama-chat-button": OramaChatButton; - "orama-chat-messages-container": OramaChatMessagesContainer; - "orama-chat-user-message": OramaChatUserMessage; - "orama-dots-loader": OramaDotsLoader; - "orama-embed": OramaEmbed; - "orama-facets": OramaFacets; - "orama-footer": OramaFooter; - "orama-input": OramaInput; - "orama-logo-icon": OramaLogoIcon; - "orama-markdown": OramaMarkdown; - "orama-modal": OramaModal; - "orama-navigation-bar": OramaNavigationBar; - "orama-search": OramaSearch; - "orama-search-box": OramaSearchBox; - "orama-search-button": OramaSearchButton; - "orama-search-results": OramaSearchResults; - "orama-sliding-panel": OramaSlidingPanel; - "orama-sources": OramaSources; - "orama-suggestions": OramaSuggestions; - "orama-text": OramaText; - "orama-textarea": OramaTextarea; - "orama-toggler": OramaToggler; - } + interface OramaButton { + "as"?: ButtonProps["as"]; + "class"?: string; + "disabled"?: boolean; + "size"?: "small" | "medium" | "large"; + "type"?: ButtonProps["type"]; + "variant"?: ButtonProps["variant"]; + "withTooltip"?: string; + } + + interface OramaChat { + "chatMarkdownLinkHref"?: ChatMarkdownLinkHref; + "chatMarkdownLinkTarget"?: ChatMarkdownLinkTarget; + "chatMarkdownLinkTitle"?: ChatMarkdownLinkTitle; + "defaultTerm"?: string; + "focusInput"?: boolean; + "linksRel"?: string; + "linksTarget"?: string; + "onAnswerGenerated"?: (event: OramaChatCustomEvent) => void; + "placeholder"?: string; + "showClearChat"?: boolean; + "sourceBaseUrl"?: string; + "sourcesMap"?: SourcesMap; + "suggestions"?: string[]; + "systemPrompts"?: string[]; + } + + interface OramaChatAssistentMessage { + "chatMarkdownLinkHref"?: ChatMarkdownLinkHref; + "chatMarkdownLinkTarget"?: ChatMarkdownLinkTarget; + "chatMarkdownLinkTitle"?: ChatMarkdownLinkTitle; + "interaction"?: TChatInteraction; + } + + interface OramaChatBox { + "autoFocus"?: boolean; + "chatMarkdownLinkHref"?: ChatMarkdownLinkHref; + "chatMarkdownLinkTarget"?: ChatMarkdownLinkTarget; + "chatMarkdownLinkTitle"?: ChatMarkdownLinkTitle; + "clientInstance"?: OramaClient | AnyOrama; + "index"?: CloudIndexConfig; + "linksRel"?: string; + "linksTarget"?: string; + /** + * Fired when answer generation is successfully completed + */ + "onAnswerGenerated"?: (event: OramaChatBoxCustomEvent) => void; + /** + * Fired when user clicks on answer source + */ + "onAnswerSourceClick"?: (event: OramaChatBoxCustomEvent) => void; + /** + * Fired when user clicks on chat markdown link + */ + "onChatMarkdownLinkClicked"?: (event: OramaChatBoxCustomEvent) => void; + "placeholder"?: string; + "sourceBaseUrl"?: string; + "sourcesMap"?: SourcesMap; + "suggestions"?: string[]; + "systemPrompts"?: string[]; + } + + interface OramaChatButton { + "active"?: boolean; + "class"?: string; + "highlight"?: boolean; + "label"?: string; + } + + interface OramaChatMessagesContainer { + "chatMarkdownLinkHref"?: ChatMarkdownLinkHref; + "chatMarkdownLinkTarget"?: ChatMarkdownLinkTarget; + "chatMarkdownLinkTitle"?: ChatMarkdownLinkTitle; + "interactions"?: TChatInteraction[]; + "onAnswerGenerated"?: (event: OramaChatMessagesContainerCustomEvent) => void; + } + + interface OramaChatUserMessage { + "interaction"?: TChatInteraction; + } + + interface OramaDotsLoader { + } + + interface OramaEmbed { + } + + interface OramaFacets { + "facetClicked"?: (facetName: string) => void; + "facets"?: Facet[]; + "selectedFacet"?: string; + } + + interface OramaFooter { + "class"?: string; + "colorScheme"?: Omit; + } + + interface OramaInput { + "autoFocus"?: boolean; + "defaultValue"?: InputProps["defaultValue"]; + "label"?: InputProps["label"]; + "labelForScreenReaders"?: InputProps["labelForScreenReaders"]; + "name"?: InputProps["name"]; + "onResetValue"?: (event: OramaInputCustomEvent) => void; + "placeholder"?: InputProps["placeholder"]; + "size"?: InputProps["size"]; + "type"?: InputProps["type"]; + } + + interface OramaLogoIcon { + "size"?: number; + } + + interface OramaMarkdown { + "chatMarkdownLinkHref"?: ChatMarkdownLinkHref; + "chatMarkdownLinkTarget"?: ChatMarkdownLinkTarget; + "chatMarkdownLinkTitle"?: ChatMarkdownLinkTitle; + "content"?: string; + "onChatMarkdownLinkClicked"?: (event: OramaMarkdownCustomEvent) => void; + } + + interface OramaModal { + "closeOnEscape"?: boolean; + "closeOnOutsideClick"?: boolean; + "mainTitle"?: string; + "onModalStatusChanged"?: (event: OramaModalCustomEvent) => void; + "open"?: boolean; + } + + interface OramaNavigationBar { + "handleClose"?: () => void; + "showBackButton"?: boolean; + "showChatActions"?: boolean; + } + + interface OramaSearch { + "disableChat"?: boolean; + "focusInput"?: boolean; + "highlightDescription"?: HighlightOptions | false; + "highlightTitle"?: HighlightOptions | false; + "linksRel"?: string; + "linksTarget"?: string; + "onAnswerGenerated"?: (event: OramaSearchCustomEvent) => void; + "onSearchCompleted"?: (event: OramaSearchCustomEvent) => void; + "placeholder"?: string; + "sourceBaseUrl"?: string; + "suggestions"?: string[]; + } + + interface OramaSearchBox { + "chatMarkdownLinkHref"?: ChatMarkdownLinkHref; + "chatMarkdownLinkTarget"?: ChatMarkdownLinkTarget; + "chatMarkdownLinkTitle"?: ChatMarkdownLinkTitle; + "chatPlaceholder"?: string; + "clientInstance"?: OramaClient | AnyOrama; + "colorScheme"?: ColorScheme; + "disableChat"?: boolean; + "facetProperty"?: string; + "highlightDescription"?: HighlightOptions | false; + "highlightTitle"?: HighlightOptions | false; + "index"?: CloudIndexConfig; + "layout"?: "modal" | "embed"; + "linksRel"?: string; + "linksTarget"?: string; + /** + * Fired when answer generation is successfully completed + */ + "onAnswerGenerated"?: (event: OramaSearchBoxCustomEvent) => void; + /** + * Fired when user clicks on answer source + */ + "onAnswerSourceClick"?: (event: OramaSearchBoxCustomEvent) => void; + /** + * Fired when user clicks on chat markdown link + */ + "onChatMarkdownLinkClicked"?: (event: OramaSearchBoxCustomEvent) => void; + /** + * Fired when search successfully resolves + */ + "onSearchCompleted"?: (event: OramaSearchBoxCustomEvent) => void; + /** + * Fired when user clicks on search result + */ + "onSearchResultClick"?: (event: OramaSearchBoxCustomEvent) => void; + "open"?: boolean; + "placeholder"?: string; + "resultMap"?: Partial; + "searchParams"?: SearchParams>; + "searchPlaceholder"?: string; + "sourceBaseUrl"?: string; + "sourcesMap"?: SourcesMap; + "suggestions"?: string[]; + "themeConfig"?: Partial; + } + + interface OramaSearchButton { + "colorScheme"?: ColorScheme; + "size"?: "small" | "medium" | "large"; + "themeConfig"?: Partial; + } + + interface OramaSearchResults { + "error"?: boolean; + "highlightDescription"?: HighlightOptions | false; + "highlightTitle"?: HighlightOptions | false; + "linksRel"?: string; + "linksTarget"?: string; + "loading"?: boolean; + "onSearchResultClick"?: (event: OramaSearchResultsCustomEvent) => void; + "searchTerm"?: SearchResultsProps["searchTerm"]; + "sections"?: SearchResultBySection[]; + "setChatTerm"?: (term: string) => void; + "sourceBaseUrl"?: string; + "suggestions"?: string[]; + } + + interface OramaSlidingPanel { + "backdrop"?: boolean; + "closed"?: () => void; + "open"?: boolean; + } + + interface OramaSources { + "linksRel"?: string; + "linksTarget"?: string; + "onAnswerSourceClick"?: (event: OramaSourcesCustomEvent) => void; + "sourceBaseURL"?: string; + "sources"?: any; + "sourcesMap"?: SourcesMap; + } + + interface OramaSuggestions { + "as"?: "chips" | "list"; + "icon"?: Node; + "suggestionClicked"?: (suggestion: string) => void; + "suggestions"?: string[]; + } + + interface OramaText { + /** + * optionally change text alignment + */ + "align"?: TextProps["align"]; + /** + * it defines the HTML tag to be used + */ + "as"?: TextProps["as"]; + "bold"?: boolean; + /** + * the optional class name + */ + "class"?: string; + /** + * show as inactive + */ + "inactive"?: TextProps["inactive"]; + /** + * it defines how it should look like + */ + "styledAs"?: TextProps["styledAs"]; + /** + * optionally change variant style - default is primary + */ + "variant"?: TextProps["variant"]; + } + + interface OramaTextarea { + "autoFocus"?: boolean; + "maxRows"?: number | string; + "minRows"?: number | string; + "placeholder"?: string; + "value"?: string | null; + } + + interface OramaToggler { + "performInitialAnimation"?: boolean; + } + + interface IntrinsicElements { + "orama-button": OramaButton; + "orama-chat": OramaChat; + "orama-chat-assistent-message": OramaChatAssistentMessage; + "orama-chat-box": OramaChatBox; + "orama-chat-button": OramaChatButton; + "orama-chat-messages-container": OramaChatMessagesContainer; + "orama-chat-user-message": OramaChatUserMessage; + "orama-dots-loader": OramaDotsLoader; + "orama-embed": OramaEmbed; + "orama-facets": OramaFacets; + "orama-footer": OramaFooter; + "orama-input": OramaInput; + "orama-logo-icon": OramaLogoIcon; + "orama-markdown": OramaMarkdown; + "orama-modal": OramaModal; + "orama-navigation-bar": OramaNavigationBar; + "orama-search": OramaSearch; + "orama-search-box": OramaSearchBox; + "orama-search-button": OramaSearchButton; + "orama-search-results": OramaSearchResults; + "orama-sliding-panel": OramaSlidingPanel; + "orama-sources": OramaSources; + "orama-suggestions": OramaSuggestions; + "orama-text": OramaText; + "orama-textarea": OramaTextarea; + "orama-toggler": OramaToggler; + } } -export { LocalJSX as JSX }; +export { LocalJSX as JSX } declare module "@stencil/core" { - export namespace JSX { - interface IntrinsicElements { - "orama-button": LocalJSX.OramaButton & JSXBase.HTMLAttributes; - "orama-chat": LocalJSX.OramaChat & JSXBase.HTMLAttributes; - "orama-chat-assistent-message": LocalJSX.OramaChatAssistentMessage & JSXBase.HTMLAttributes; - "orama-chat-box": LocalJSX.OramaChatBox & JSXBase.HTMLAttributes; - "orama-chat-button": LocalJSX.OramaChatButton & JSXBase.HTMLAttributes; - "orama-chat-messages-container": LocalJSX.OramaChatMessagesContainer & JSXBase.HTMLAttributes; - "orama-chat-user-message": LocalJSX.OramaChatUserMessage & JSXBase.HTMLAttributes; - "orama-dots-loader": LocalJSX.OramaDotsLoader & JSXBase.HTMLAttributes; - "orama-embed": LocalJSX.OramaEmbed & JSXBase.HTMLAttributes; - "orama-facets": LocalJSX.OramaFacets & JSXBase.HTMLAttributes; - "orama-footer": LocalJSX.OramaFooter & JSXBase.HTMLAttributes; - "orama-input": LocalJSX.OramaInput & JSXBase.HTMLAttributes; - "orama-logo-icon": LocalJSX.OramaLogoIcon & JSXBase.HTMLAttributes; - "orama-markdown": LocalJSX.OramaMarkdown & JSXBase.HTMLAttributes; - "orama-modal": LocalJSX.OramaModal & JSXBase.HTMLAttributes; - "orama-navigation-bar": LocalJSX.OramaNavigationBar & JSXBase.HTMLAttributes; - "orama-search": LocalJSX.OramaSearch & JSXBase.HTMLAttributes; - "orama-search-box": LocalJSX.OramaSearchBox & JSXBase.HTMLAttributes; - "orama-search-button": LocalJSX.OramaSearchButton & JSXBase.HTMLAttributes; - "orama-search-results": LocalJSX.OramaSearchResults & JSXBase.HTMLAttributes; - "orama-sliding-panel": LocalJSX.OramaSlidingPanel & JSXBase.HTMLAttributes; - "orama-sources": LocalJSX.OramaSources & JSXBase.HTMLAttributes; - "orama-suggestions": LocalJSX.OramaSuggestions & JSXBase.HTMLAttributes; - "orama-text": LocalJSX.OramaText & JSXBase.HTMLAttributes; - "orama-textarea": LocalJSX.OramaTextarea & JSXBase.HTMLAttributes; - "orama-toggler": LocalJSX.OramaToggler & JSXBase.HTMLAttributes; - } - } + export namespace JSX { + interface IntrinsicElements { + "orama-button": LocalJSX.OramaButton & JSXBase.HTMLAttributes; + "orama-chat": LocalJSX.OramaChat & JSXBase.HTMLAttributes; + "orama-chat-assistent-message": LocalJSX.OramaChatAssistentMessage & JSXBase.HTMLAttributes; + "orama-chat-box": LocalJSX.OramaChatBox & JSXBase.HTMLAttributes; + "orama-chat-button": LocalJSX.OramaChatButton & JSXBase.HTMLAttributes; + "orama-chat-messages-container": LocalJSX.OramaChatMessagesContainer & JSXBase.HTMLAttributes; + "orama-chat-user-message": LocalJSX.OramaChatUserMessage & JSXBase.HTMLAttributes; + "orama-dots-loader": LocalJSX.OramaDotsLoader & JSXBase.HTMLAttributes; + "orama-embed": LocalJSX.OramaEmbed & JSXBase.HTMLAttributes; + "orama-facets": LocalJSX.OramaFacets & JSXBase.HTMLAttributes; + "orama-footer": LocalJSX.OramaFooter & JSXBase.HTMLAttributes; + "orama-input": LocalJSX.OramaInput & JSXBase.HTMLAttributes; + "orama-logo-icon": LocalJSX.OramaLogoIcon & JSXBase.HTMLAttributes; + "orama-markdown": LocalJSX.OramaMarkdown & JSXBase.HTMLAttributes; + "orama-modal": LocalJSX.OramaModal & JSXBase.HTMLAttributes; + "orama-navigation-bar": LocalJSX.OramaNavigationBar & JSXBase.HTMLAttributes; + "orama-search": LocalJSX.OramaSearch & JSXBase.HTMLAttributes; + "orama-search-box": LocalJSX.OramaSearchBox & JSXBase.HTMLAttributes; + "orama-search-button": LocalJSX.OramaSearchButton & JSXBase.HTMLAttributes; + "orama-search-results": LocalJSX.OramaSearchResults & JSXBase.HTMLAttributes; + "orama-sliding-panel": LocalJSX.OramaSlidingPanel & JSXBase.HTMLAttributes; + "orama-sources": LocalJSX.OramaSources & JSXBase.HTMLAttributes; + "orama-suggestions": LocalJSX.OramaSuggestions & JSXBase.HTMLAttributes; + "orama-text": LocalJSX.OramaText & JSXBase.HTMLAttributes; + "orama-textarea": LocalJSX.OramaTextarea & JSXBase.HTMLAttributes; + "orama-toggler": LocalJSX.OramaToggler & JSXBase.HTMLAttributes; + } + } } diff --git a/packages/ui-stencil/src/components/orama-chat-box/orama-chat-box.tsx b/packages/ui-stencil/src/components/orama-chat-box/orama-chat-box.tsx index fc7df29..eea8377 100644 --- a/packages/ui-stencil/src/components/orama-chat-box/orama-chat-box.tsx +++ b/packages/ui-stencil/src/components/orama-chat-box/orama-chat-box.tsx @@ -14,7 +14,7 @@ import type { } from '@/types' import type { OramaClient } from '@oramacloud/client' import '@phosphor-icons/webcomponents/dist/icons/PhArrowClockwise.mjs' -import type { Orama } from '@orama/orama' +import type { AnyOrama, Orama } from "@orama/orama" @Component({ tag: 'orama-chat-box', @@ -24,7 +24,7 @@ import type { Orama } from '@orama/orama' export class ChatBox { @Element() el: HTMLElement @Prop() index?: CloudIndexConfig - @Prop() clientInstance?: OramaClient | Orama + @Prop() clientInstance?: OramaClient | AnyOrama @Prop() sourceBaseUrl?: string @Prop() linksTarget?: string @Prop() linksRel?: string