import * as ng_primitives_ai from 'ng-primitives/ai'; import * as _angular_core from '@angular/core'; import { Signal, Provider } from '@angular/core'; import { BooleanInput, NumberInput } from '@angular/cdk/coercion'; import * as ng_primitives_state from 'ng-primitives/state'; declare class NgpPromptComposerInput { /** The state of the prompt composer input. */ protected readonly state: ng_primitives_ai.NgpPromptComposerInputState; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵdir: _angular_core.ɵɵDirectiveDeclaration; } declare class NgpPromptComposerSubmit { /** Whether the submit button should be disabled */ readonly disabled: _angular_core.InputSignalWithTransform; /** The state of the prompt composer submit. */ protected readonly state: ng_primitives_ai.NgpPromptComposerSubmitState; /** Whether dictation is currently active */ readonly isDictating: _angular_core.Signal; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵdir: _angular_core.ɵɵDirectiveDeclaration; } declare class NgpPromptComposer { /** Emits whenever the user submits the prompt. */ readonly submit: _angular_core.OutputEmitterRef; /** The state of the prompt composer. */ protected readonly state: ng_primitives_ai.NgpPromptComposerState; /** @internal The current prompt text. */ readonly prompt: _angular_core.Signal; /** @internal Whether the prompt is currently being dictated. */ readonly isDictating: _angular_core.Signal; /** @internal Whether the prompt input has content. */ readonly hasPrompt: _angular_core.Signal; /** Whether dictation is supported by the browser. */ readonly dictationSupported: boolean; /** * @internal * Submits the current prompt if there is content, and clears the input. */ submitPrompt(): void; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵdir: _angular_core.ɵɵDirectiveDeclaration; } declare class NgpThreadMessage { /** The state of the thread message. */ protected readonly state: ng_primitives_ai.NgpThreadMessageState; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵdir: _angular_core.ɵɵDirectiveDeclaration; } declare class NgpThread { /** The state of the thread. */ protected readonly state: ng_primitives_ai.NgpThreadState; /** * Scroll the thread viewport to the bottom. * @param behavior The scroll behavior to use. */ scrollToBottom(behavior: ScrollBehavior): void; /** * Set the prompt text in the associated prompt composer. * @param value The prompt text. */ setPrompt(value: string): void; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵdir: _angular_core.ɵɵDirectiveDeclaration; } declare class NgpPromptComposerDictation { /** Access the global AI configuration. */ private readonly config; /** Whether the dictation button should be disabled. */ readonly disabled: _angular_core.InputSignalWithTransform; /** * The BCP 47 language tag dictation transcribes in, e.g. `en-US` or `es-ES`. * Defaults to the page's own language: the document's `lang` attribute, then the browser's. */ readonly language: _angular_core.InputSignal; /** The state of the prompt composer dictation. */ protected readonly state: ng_primitives_ai.NgpPromptComposerDictationState; /** Whether dictation is currently active */ readonly isDictating: _angular_core.Signal; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵdir: _angular_core.ɵɵDirectiveDeclaration; } declare class NgpThreadViewport { /** * The distance in pixels from the bottom of the scrollable container that is considered "at the bottom". * When the user scrolls within this threshold, the thread is treated as being at the bottom. * This value is used to determine whether automatic scrolling to the bottom should occur, * for example when new content is added or the container is resized. * * @default 70 */ readonly threshold: _angular_core.InputSignalWithTransform; /** * Whether the thread should automatically scroll to the bottom when new content is added. */ readonly autoScroll: _angular_core.InputSignalWithTransform; /** * The initial scroll position. Start waits for a scroll to the bottom before following content. * @default 'end' */ readonly initialScrollPosition: _angular_core.InputSignal<"start" | "end">; /** The state of the thread viewport. */ protected readonly state: ng_primitives_ai.NgpThreadViewportState; /** * Whether the thread viewport is currently scrolled to the bottom (within threshold). * Initially false for start until a scroll reaches the bottom, even when the content fits. */ readonly isAtBottom: _angular_core.Signal; /** * Scroll the container to the bottom. * @internal */ scrollToBottom(behavior: ScrollBehavior): void; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵdir: _angular_core.ɵɵDirectiveDeclaration; } declare class NgpThreadSuggestion { /** The suggested text to display in the input field. */ readonly suggestion: _angular_core.InputSignal; /** Whether the suggestion should populate the prompt when clicked. */ readonly setPromptOnClick: _angular_core.InputSignalWithTransform; /** The state of the thread suggestion. */ protected readonly state: ng_primitives_ai.NgpThreadSuggestionState; /** Populate the prompt with this suggestion. */ submitSuggestion(): void; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵdir: _angular_core.ɵɵDirectiveDeclaration; } interface NgpPromptComposerState { /** * The current prompt text. */ readonly prompt: Signal; /** * Whether the prompt input has content. */ readonly hasPrompt: Signal; /** * Whether the prompt is currently being dictated. */ readonly isDictating: Signal; /** * Whether dictation is supported by the browser. */ readonly dictationSupported: boolean; /** * @internal * Set the current prompt text. */ setPrompt(value: string): void; /** * @internal * Set whether the prompt is currently being dictated. */ setDictating(value: boolean): void; /** * @internal * Submit the current prompt if there is content, and clear the input. */ submitPrompt(): void; } interface NgpPromptComposerProps { /** * Emits whenever the user submits the prompt. */ readonly onSubmit?: (prompt: string) => void; } declare const NgpPromptComposerStateToken: _angular_core.InjectionToken<_angular_core.WritableSignal>; declare const ngpPromptComposer: ({ onSubmit }: NgpPromptComposerProps) => NgpPromptComposerState; declare const injectPromptComposerState: { (): Signal; (options: ng_primitives_state.StateInjectionOptions): Signal; (options?: ng_primitives_state.StateInjectionOptions): Signal | Signal; }; declare const providePromptComposerState: (opts?: { inherit?: boolean; }) => _angular_core.FactoryProvider; interface NgpPromptComposerDictationState { /** * Whether dictation is currently active. */ readonly isDictating: Signal; } interface NgpPromptComposerDictationProps { /** * Whether the dictation button should be disabled. */ readonly disabled?: Signal; /** * The BCP 47 language tag dictation transcribes in. Falls back to the page's own language. */ readonly language?: Signal; } declare const NgpPromptComposerDictationStateToken: _angular_core.InjectionToken<_angular_core.WritableSignal>; declare const ngpPromptComposerDictation: ({ disabled, language, }: NgpPromptComposerDictationProps) => NgpPromptComposerDictationState; declare const injectPromptComposerDictationState: { (): Signal; (options: ng_primitives_state.StateInjectionOptions): Signal; (options?: ng_primitives_state.StateInjectionOptions): Signal | Signal; }; declare const providePromptComposerDictationState: (opts?: { inherit?: boolean; }) => _angular_core.FactoryProvider; interface NgpPromptComposerInputState { /** * @internal * Set the prompt text, moving the cursor to the end and focusing the input. */ setPrompt(value: string): void; } declare const NgpPromptComposerInputStateToken: _angular_core.InjectionToken<_angular_core.WritableSignal>; declare const ngpPromptComposerInput: () => NgpPromptComposerInputState; declare const injectPromptComposerInputState: { (): _angular_core.Signal; (options: ng_primitives_state.StateInjectionOptions): _angular_core.Signal; (options?: ng_primitives_state.StateInjectionOptions): _angular_core.Signal | _angular_core.Signal; }; declare const providePromptComposerInputState: (opts?: { inherit?: boolean; }) => _angular_core.FactoryProvider; interface NgpPromptComposerSubmitState { /** * Whether dictation is currently active. */ readonly isDictating: Signal; } interface NgpPromptComposerSubmitProps { /** * Whether the submit button should be disabled. */ readonly disabled?: Signal; } declare const NgpPromptComposerSubmitStateToken: _angular_core.InjectionToken<_angular_core.WritableSignal>; declare const ngpPromptComposerSubmit: ({ disabled }: NgpPromptComposerSubmitProps) => NgpPromptComposerSubmitState; declare const injectPromptComposerSubmitState: { (): Signal; (options: ng_primitives_state.StateInjectionOptions): Signal; (options?: ng_primitives_state.StateInjectionOptions): Signal | Signal; }; declare const providePromptComposerSubmitState: (opts?: { inherit?: boolean; }) => _angular_core.FactoryProvider; interface NgpThreadMessageState { } declare const NgpThreadMessageStateToken: _angular_core.InjectionToken<_angular_core.WritableSignal>; declare const ngpThreadMessage: () => NgpThreadMessageState; declare const injectThreadMessageState: { (): _angular_core.Signal; (options: ng_primitives_state.StateInjectionOptions): _angular_core.Signal; (options?: ng_primitives_state.StateInjectionOptions): _angular_core.Signal | _angular_core.Signal; }; declare const provideThreadMessageState: (opts?: { inherit?: boolean; }) => _angular_core.FactoryProvider; interface NgpThreadViewportState { /** * Whether the viewport is currently scrolled to the bottom (within threshold). * Initially false for start until a scroll reaches the bottom. */ readonly isAtBottom: Signal; /** * @internal * Scroll the viewport to the bottom. */ scrollToBottom(behavior: ScrollBehavior): void; /** * @internal * Scroll the viewport to the bottom, but only if it is already at the bottom, so content * arriving while the user is reading further up does not pull them away from it. */ scrollToBottomIfNeeded(behavior: ScrollBehavior): void; } interface NgpThreadViewportProps { /** * Whether the thread should automatically scroll to the bottom when new content is added. */ readonly autoScroll?: Signal; /** The position at which the thread viewport initially opens. */ readonly initialScrollPosition?: Signal<'start' | 'end'>; /** * The distance in pixels from the bottom that is still considered "at the bottom". */ readonly threshold?: Signal; } declare const NgpThreadViewportStateToken: _angular_core.InjectionToken<_angular_core.WritableSignal>; declare const ngpThreadViewport: ({ autoScroll, initialScrollPosition, threshold, }: NgpThreadViewportProps) => NgpThreadViewportState; declare const injectThreadViewportState: { (): Signal; (options: ng_primitives_state.StateInjectionOptions): Signal; (options?: ng_primitives_state.StateInjectionOptions): Signal | Signal; }; declare const provideThreadViewportState: (opts?: { inherit?: boolean; }) => _angular_core.FactoryProvider; interface NgpThreadState { /** * Scroll the thread viewport to the bottom. * @param behavior The scroll behavior to use. */ scrollToBottom(behavior: ScrollBehavior): void; /** * @internal * Scroll the thread viewport to the bottom, but only if it is already at the bottom. * @param behavior The scroll behavior to use. */ scrollToBottomIfNeeded(behavior: ScrollBehavior): void; /** * Set the prompt text in the associated prompt composer. * @param value The prompt text. */ setPrompt(value: string): void; /** * @internal * Register the viewport that scrolls this thread. */ setViewport(viewport: NgpThreadViewportState): void; /** * @internal * Deregister the viewport that scrolls this thread. */ removeViewport(viewport: NgpThreadViewportState): void; /** * @internal * Register the prompt input that receives the prompt text. */ setPromptInput(input: NgpPromptComposerInputState): void; /** * @internal * Deregister the prompt input that receives the prompt text. */ removePromptInput(input: NgpPromptComposerInputState): void; /** * @internal * Register a message with the thread. */ registerMessage(message: NgpThreadMessageState): void; /** * @internal * Deregister a message from the thread. */ unregisterMessage(message: NgpThreadMessageState): void; /** * @internal * Determine if the given message is the last message in the thread. */ isLastMessage(message: NgpThreadMessageState): boolean; } declare const NgpThreadStateToken: _angular_core.InjectionToken<_angular_core.WritableSignal>; declare const ngpThread: () => NgpThreadState; declare const injectThreadState: { (): _angular_core.Signal; (options: ng_primitives_state.StateInjectionOptions): _angular_core.Signal; (options?: ng_primitives_state.StateInjectionOptions): _angular_core.Signal | _angular_core.Signal; }; declare const provideThreadState: (opts?: { inherit?: boolean; }) => _angular_core.FactoryProvider; interface NgpThreadSuggestionState { /** * Populate the prompt with this suggestion. */ submitSuggestion(): void; } interface NgpThreadSuggestionProps { /** * The suggested text to display in the input field. */ readonly suggestion?: Signal; /** * Whether the suggestion should populate the prompt when clicked. */ readonly setPromptOnClick?: Signal; } declare const NgpThreadSuggestionStateToken: _angular_core.InjectionToken<_angular_core.WritableSignal>; declare const ngpThreadSuggestion: ({ suggestion, setPromptOnClick, }: NgpThreadSuggestionProps) => NgpThreadSuggestionState; declare const injectThreadSuggestionState: { (): Signal; (options: ng_primitives_state.StateInjectionOptions): Signal; (options?: ng_primitives_state.StateInjectionOptions): Signal | Signal; }; declare const provideThreadSuggestionState: (opts?: { inherit?: boolean; }) => _angular_core.FactoryProvider; interface NgpAiConfig { /** * The BCP 47 language tag dictation transcribes in, e.g. `en-US` or `es-ES`. * When undefined the page's own language is used: the document's `lang` attribute, * falling back to the browser's language. * @default undefined */ dictationLanguage: string | undefined; } /** * Provide the default Ai configuration * @param config The Ai configuration * @returns The provider */ declare function provideAiConfig(config: Partial): Provider[]; export { NgpPromptComposer, NgpPromptComposerDictation, NgpPromptComposerDictationStateToken, NgpPromptComposerInput, NgpPromptComposerInputStateToken, NgpPromptComposerStateToken, NgpPromptComposerSubmit, NgpPromptComposerSubmitStateToken, NgpThread, NgpThreadMessage, NgpThreadMessageStateToken, NgpThreadStateToken, NgpThreadSuggestion, NgpThreadSuggestionStateToken, NgpThreadViewport, NgpThreadViewportStateToken, injectPromptComposerDictationState, injectPromptComposerInputState, injectPromptComposerState, injectPromptComposerSubmitState, injectThreadMessageState, injectThreadState, injectThreadSuggestionState, injectThreadViewportState, ngpPromptComposer, ngpPromptComposerDictation, ngpPromptComposerInput, ngpPromptComposerSubmit, ngpThread, ngpThreadMessage, ngpThreadSuggestion, ngpThreadViewport, provideAiConfig, providePromptComposerDictationState, providePromptComposerInputState, providePromptComposerState, providePromptComposerSubmitState, provideThreadMessageState, provideThreadState, provideThreadSuggestionState, provideThreadViewportState }; export type { NgpAiConfig, NgpPromptComposerDictationProps, NgpPromptComposerDictationState, NgpPromptComposerInputState, NgpPromptComposerProps, NgpPromptComposerState, NgpPromptComposerSubmitProps, NgpPromptComposerSubmitState, NgpThreadMessageState, NgpThreadState, NgpThreadSuggestionProps, NgpThreadSuggestionState, NgpThreadViewportProps, NgpThreadViewportState };