UNPKG

@assistant-ui/react

Version:

TypeScript/React library for AI Chat

836 lines 27.9 kB
import { AttachmentRuntime } from "../runtime/AttachmentRuntime"; /** * @deprecated Use `useAssistantApi()` with `api.attachment()` instead. See migration guide: https://docs.assistant-ui.com/docs/migrations/v0-12 */ export declare function useAttachmentRuntime(options?: { optional?: false | undefined; }): AttachmentRuntime; export declare function useAttachmentRuntime(options?: { optional?: boolean | undefined; }): AttachmentRuntime | null; export declare function useThreadComposerAttachmentRuntime(options?: { optional?: false | undefined; }): AttachmentRuntime<"thread-composer">; export declare function useThreadComposerAttachmentRuntime(options?: { optional?: boolean | undefined; }): AttachmentRuntime<"thread-composer"> | null; export declare function useEditComposerAttachmentRuntime(options?: { optional?: false | undefined; }): AttachmentRuntime<"edit-composer">; export declare function useEditComposerAttachmentRuntime(options?: { optional?: boolean | undefined; }): AttachmentRuntime<"edit-composer"> | null; export declare function useMessageAttachmentRuntime(options?: { optional?: false | undefined; }): AttachmentRuntime<"message">; export declare function useMessageAttachmentRuntime(options?: { optional?: boolean | undefined; }): AttachmentRuntime<"message"> | null; /** * @deprecated Use `useAssistantState(({ attachment }) => attachment)` instead. See migration guide: https://docs.assistant-ui.com/docs/migrations/v0-12 */ export declare const useAttachment: { (): import("../runtime").AttachmentState & { source: "thread-composer" | "edit-composer" | "message"; }; <TSelected>(selector: (state: import("../runtime").AttachmentState & { source: "thread-composer" | "edit-composer" | "message"; }) => TSelected): TSelected; <TSelected>(selector: ((state: import("../runtime").AttachmentState & { source: "thread-composer" | "edit-composer" | "message"; }) => TSelected) | undefined): (import("../runtime").AttachmentState & { source: "thread-composer" | "edit-composer" | "message"; }) | TSelected; (options: { optional?: false | undefined; }): import("../runtime").AttachmentState & { source: "thread-composer" | "edit-composer" | "message"; }; (options: { optional?: boolean | undefined; }): (import("../runtime").AttachmentState & { source: "thread-composer" | "edit-composer" | "message"; }) | null; <TSelected>(options: { optional?: false | undefined; selector: (state: import("../runtime").AttachmentState & { source: "thread-composer" | "edit-composer" | "message"; }) => TSelected; }): TSelected; <TSelected>(options: { optional?: false | undefined; selector: ((state: import("../runtime").AttachmentState & { source: "thread-composer" | "edit-composer" | "message"; }) => TSelected) | undefined; }): (import("../runtime").AttachmentState & { source: "thread-composer" | "edit-composer" | "message"; }) | TSelected; <TSelected>(options: { optional?: boolean | undefined; selector: (state: import("../runtime").AttachmentState & { source: "thread-composer" | "edit-composer" | "message"; }) => TSelected; }): TSelected | null; <TSelected>(options: { optional?: boolean | undefined; selector: ((state: import("../runtime").AttachmentState & { source: "thread-composer" | "edit-composer" | "message"; }) => TSelected) | undefined; }): (import("../runtime").AttachmentState & { source: "thread-composer" | "edit-composer" | "message"; }) | TSelected | null; }; export declare const useThreadComposerAttachment: { (): { id: string; type: "image" | "document" | "file"; name: string; contentType: string; file?: File; content?: import("../..").ThreadUserMessagePart[]; } & { status: import("../../types/AttachmentTypes").PendingAttachmentStatus; file: File; } & { readonly source: "thread-composer"; } & { source: "thread-composer"; }; <TSelected>(selector: (state: { id: string; type: "image" | "document" | "file"; name: string; contentType: string; file?: File; content?: import("../..").ThreadUserMessagePart[]; } & { status: import("../../types/AttachmentTypes").PendingAttachmentStatus; file: File; } & { readonly source: "thread-composer"; } & { source: "thread-composer"; }) => TSelected): TSelected; <TSelected>(selector: ((state: { id: string; type: "image" | "document" | "file"; name: string; contentType: string; file?: File; content?: import("../..").ThreadUserMessagePart[]; } & { status: import("../../types/AttachmentTypes").PendingAttachmentStatus; file: File; } & { readonly source: "thread-composer"; } & { source: "thread-composer"; }) => TSelected) | undefined): ({ id: string; type: "image" | "document" | "file"; name: string; contentType: string; file?: File; content?: import("../..").ThreadUserMessagePart[]; } & { status: import("../../types/AttachmentTypes").PendingAttachmentStatus; file: File; } & { readonly source: "thread-composer"; } & { source: "thread-composer"; }) | TSelected; (options: { optional?: false | undefined; }): { id: string; type: "image" | "document" | "file"; name: string; contentType: string; file?: File; content?: import("../..").ThreadUserMessagePart[]; } & { status: import("../../types/AttachmentTypes").PendingAttachmentStatus; file: File; } & { readonly source: "thread-composer"; } & { source: "thread-composer"; }; (options: { optional?: boolean | undefined; }): ({ id: string; type: "image" | "document" | "file"; name: string; contentType: string; file?: File; content?: import("../..").ThreadUserMessagePart[]; } & { status: import("../../types/AttachmentTypes").PendingAttachmentStatus; file: File; } & { readonly source: "thread-composer"; } & { source: "thread-composer"; }) | null; <TSelected>(options: { optional?: false | undefined; selector: (state: { id: string; type: "image" | "document" | "file"; name: string; contentType: string; file?: File; content?: import("../..").ThreadUserMessagePart[]; } & { status: import("../../types/AttachmentTypes").PendingAttachmentStatus; file: File; } & { readonly source: "thread-composer"; } & { source: "thread-composer"; }) => TSelected; }): TSelected; <TSelected>(options: { optional?: false | undefined; selector: ((state: { id: string; type: "image" | "document" | "file"; name: string; contentType: string; file?: File; content?: import("../..").ThreadUserMessagePart[]; } & { status: import("../../types/AttachmentTypes").PendingAttachmentStatus; file: File; } & { readonly source: "thread-composer"; } & { source: "thread-composer"; }) => TSelected) | undefined; }): ({ id: string; type: "image" | "document" | "file"; name: string; contentType: string; file?: File; content?: import("../..").ThreadUserMessagePart[]; } & { status: import("../../types/AttachmentTypes").PendingAttachmentStatus; file: File; } & { readonly source: "thread-composer"; } & { source: "thread-composer"; }) | TSelected; <TSelected>(options: { optional?: boolean | undefined; selector: (state: { id: string; type: "image" | "document" | "file"; name: string; contentType: string; file?: File; content?: import("../..").ThreadUserMessagePart[]; } & { status: import("../../types/AttachmentTypes").PendingAttachmentStatus; file: File; } & { readonly source: "thread-composer"; } & { source: "thread-composer"; }) => TSelected; }): TSelected | null; <TSelected>(options: { optional?: boolean | undefined; selector: ((state: { id: string; type: "image" | "document" | "file"; name: string; contentType: string; file?: File; content?: import("../..").ThreadUserMessagePart[]; } & { status: import("../../types/AttachmentTypes").PendingAttachmentStatus; file: File; } & { readonly source: "thread-composer"; } & { source: "thread-composer"; }) => TSelected) | undefined; }): ({ id: string; type: "image" | "document" | "file"; name: string; contentType: string; file?: File; content?: import("../..").ThreadUserMessagePart[]; } & { status: import("../../types/AttachmentTypes").PendingAttachmentStatus; file: File; } & { readonly source: "thread-composer"; } & { source: "thread-composer"; }) | TSelected | null; }; export declare const useEditComposerAttachment: { (): ({ id: string; type: "image" | "document" | "file"; name: string; contentType: string; file?: File; content?: import("../..").ThreadUserMessagePart[]; } & { status: import("../../types/AttachmentTypes").CompleteAttachmentStatus; content: import("../..").ThreadUserMessagePart[]; } & { readonly source: "edit-composer"; } & { source: "edit-composer"; }) | ({ id: string; type: "image" | "document" | "file"; name: string; contentType: string; file?: File; content?: import("../..").ThreadUserMessagePart[]; } & { status: import("../../types/AttachmentTypes").PendingAttachmentStatus; file: File; } & { readonly source: "edit-composer"; } & { source: "edit-composer"; }); <TSelected>(selector: (state: ({ id: string; type: "image" | "document" | "file"; name: string; contentType: string; file?: File; content?: import("../..").ThreadUserMessagePart[]; } & { status: import("../../types/AttachmentTypes").CompleteAttachmentStatus; content: import("../..").ThreadUserMessagePart[]; } & { readonly source: "edit-composer"; } & { source: "edit-composer"; }) | ({ id: string; type: "image" | "document" | "file"; name: string; contentType: string; file?: File; content?: import("../..").ThreadUserMessagePart[]; } & { status: import("../../types/AttachmentTypes").PendingAttachmentStatus; file: File; } & { readonly source: "edit-composer"; } & { source: "edit-composer"; })) => TSelected): TSelected; <TSelected>(selector: ((state: ({ id: string; type: "image" | "document" | "file"; name: string; contentType: string; file?: File; content?: import("../..").ThreadUserMessagePart[]; } & { status: import("../../types/AttachmentTypes").CompleteAttachmentStatus; content: import("../..").ThreadUserMessagePart[]; } & { readonly source: "edit-composer"; } & { source: "edit-composer"; }) | ({ id: string; type: "image" | "document" | "file"; name: string; contentType: string; file?: File; content?: import("../..").ThreadUserMessagePart[]; } & { status: import("../../types/AttachmentTypes").PendingAttachmentStatus; file: File; } & { readonly source: "edit-composer"; } & { source: "edit-composer"; })) => TSelected) | undefined): ({ id: string; type: "image" | "document" | "file"; name: string; contentType: string; file?: File; content?: import("../..").ThreadUserMessagePart[]; } & { status: import("../../types/AttachmentTypes").CompleteAttachmentStatus; content: import("../..").ThreadUserMessagePart[]; } & { readonly source: "edit-composer"; } & { source: "edit-composer"; }) | ({ id: string; type: "image" | "document" | "file"; name: string; contentType: string; file?: File; content?: import("../..").ThreadUserMessagePart[]; } & { status: import("../../types/AttachmentTypes").PendingAttachmentStatus; file: File; } & { readonly source: "edit-composer"; } & { source: "edit-composer"; }) | TSelected; (options: { optional?: false | undefined; }): ({ id: string; type: "image" | "document" | "file"; name: string; contentType: string; file?: File; content?: import("../..").ThreadUserMessagePart[]; } & { status: import("../../types/AttachmentTypes").CompleteAttachmentStatus; content: import("../..").ThreadUserMessagePart[]; } & { readonly source: "edit-composer"; } & { source: "edit-composer"; }) | ({ id: string; type: "image" | "document" | "file"; name: string; contentType: string; file?: File; content?: import("../..").ThreadUserMessagePart[]; } & { status: import("../../types/AttachmentTypes").PendingAttachmentStatus; file: File; } & { readonly source: "edit-composer"; } & { source: "edit-composer"; }); (options: { optional?: boolean | undefined; }): ({ id: string; type: "image" | "document" | "file"; name: string; contentType: string; file?: File; content?: import("../..").ThreadUserMessagePart[]; } & { status: import("../../types/AttachmentTypes").CompleteAttachmentStatus; content: import("../..").ThreadUserMessagePart[]; } & { readonly source: "edit-composer"; } & { source: "edit-composer"; }) | ({ id: string; type: "image" | "document" | "file"; name: string; contentType: string; file?: File; content?: import("../..").ThreadUserMessagePart[]; } & { status: import("../../types/AttachmentTypes").PendingAttachmentStatus; file: File; } & { readonly source: "edit-composer"; } & { source: "edit-composer"; }) | null; <TSelected>(options: { optional?: false | undefined; selector: (state: ({ id: string; type: "image" | "document" | "file"; name: string; contentType: string; file?: File; content?: import("../..").ThreadUserMessagePart[]; } & { status: import("../../types/AttachmentTypes").CompleteAttachmentStatus; content: import("../..").ThreadUserMessagePart[]; } & { readonly source: "edit-composer"; } & { source: "edit-composer"; }) | ({ id: string; type: "image" | "document" | "file"; name: string; contentType: string; file?: File; content?: import("../..").ThreadUserMessagePart[]; } & { status: import("../../types/AttachmentTypes").PendingAttachmentStatus; file: File; } & { readonly source: "edit-composer"; } & { source: "edit-composer"; })) => TSelected; }): TSelected; <TSelected>(options: { optional?: false | undefined; selector: ((state: ({ id: string; type: "image" | "document" | "file"; name: string; contentType: string; file?: File; content?: import("../..").ThreadUserMessagePart[]; } & { status: import("../../types/AttachmentTypes").CompleteAttachmentStatus; content: import("../..").ThreadUserMessagePart[]; } & { readonly source: "edit-composer"; } & { source: "edit-composer"; }) | ({ id: string; type: "image" | "document" | "file"; name: string; contentType: string; file?: File; content?: import("../..").ThreadUserMessagePart[]; } & { status: import("../../types/AttachmentTypes").PendingAttachmentStatus; file: File; } & { readonly source: "edit-composer"; } & { source: "edit-composer"; })) => TSelected) | undefined; }): ({ id: string; type: "image" | "document" | "file"; name: string; contentType: string; file?: File; content?: import("../..").ThreadUserMessagePart[]; } & { status: import("../../types/AttachmentTypes").CompleteAttachmentStatus; content: import("../..").ThreadUserMessagePart[]; } & { readonly source: "edit-composer"; } & { source: "edit-composer"; }) | ({ id: string; type: "image" | "document" | "file"; name: string; contentType: string; file?: File; content?: import("../..").ThreadUserMessagePart[]; } & { status: import("../../types/AttachmentTypes").PendingAttachmentStatus; file: File; } & { readonly source: "edit-composer"; } & { source: "edit-composer"; }) | TSelected; <TSelected>(options: { optional?: boolean | undefined; selector: (state: ({ id: string; type: "image" | "document" | "file"; name: string; contentType: string; file?: File; content?: import("../..").ThreadUserMessagePart[]; } & { status: import("../../types/AttachmentTypes").CompleteAttachmentStatus; content: import("../..").ThreadUserMessagePart[]; } & { readonly source: "edit-composer"; } & { source: "edit-composer"; }) | ({ id: string; type: "image" | "document" | "file"; name: string; contentType: string; file?: File; content?: import("../..").ThreadUserMessagePart[]; } & { status: import("../../types/AttachmentTypes").PendingAttachmentStatus; file: File; } & { readonly source: "edit-composer"; } & { source: "edit-composer"; })) => TSelected; }): TSelected | null; <TSelected>(options: { optional?: boolean | undefined; selector: ((state: ({ id: string; type: "image" | "document" | "file"; name: string; contentType: string; file?: File; content?: import("../..").ThreadUserMessagePart[]; } & { status: import("../../types/AttachmentTypes").CompleteAttachmentStatus; content: import("../..").ThreadUserMessagePart[]; } & { readonly source: "edit-composer"; } & { source: "edit-composer"; }) | ({ id: string; type: "image" | "document" | "file"; name: string; contentType: string; file?: File; content?: import("../..").ThreadUserMessagePart[]; } & { status: import("../../types/AttachmentTypes").PendingAttachmentStatus; file: File; } & { readonly source: "edit-composer"; } & { source: "edit-composer"; })) => TSelected) | undefined; }): ({ id: string; type: "image" | "document" | "file"; name: string; contentType: string; file?: File; content?: import("../..").ThreadUserMessagePart[]; } & { status: import("../../types/AttachmentTypes").CompleteAttachmentStatus; content: import("../..").ThreadUserMessagePart[]; } & { readonly source: "edit-composer"; } & { source: "edit-composer"; }) | ({ id: string; type: "image" | "document" | "file"; name: string; contentType: string; file?: File; content?: import("../..").ThreadUserMessagePart[]; } & { status: import("../../types/AttachmentTypes").PendingAttachmentStatus; file: File; } & { readonly source: "edit-composer"; } & { source: "edit-composer"; }) | TSelected | null; }; export declare const useMessageAttachment: { (): { id: string; type: "image" | "document" | "file"; name: string; contentType: string; file?: File; content?: import("../..").ThreadUserMessagePart[]; } & { status: import("../../types/AttachmentTypes").CompleteAttachmentStatus; content: import("../..").ThreadUserMessagePart[]; } & { readonly source: "message"; } & { source: "message"; }; <TSelected>(selector: (state: { id: string; type: "image" | "document" | "file"; name: string; contentType: string; file?: File; content?: import("../..").ThreadUserMessagePart[]; } & { status: import("../../types/AttachmentTypes").CompleteAttachmentStatus; content: import("../..").ThreadUserMessagePart[]; } & { readonly source: "message"; } & { source: "message"; }) => TSelected): TSelected; <TSelected>(selector: ((state: { id: string; type: "image" | "document" | "file"; name: string; contentType: string; file?: File; content?: import("../..").ThreadUserMessagePart[]; } & { status: import("../../types/AttachmentTypes").CompleteAttachmentStatus; content: import("../..").ThreadUserMessagePart[]; } & { readonly source: "message"; } & { source: "message"; }) => TSelected) | undefined): ({ id: string; type: "image" | "document" | "file"; name: string; contentType: string; file?: File; content?: import("../..").ThreadUserMessagePart[]; } & { status: import("../../types/AttachmentTypes").CompleteAttachmentStatus; content: import("../..").ThreadUserMessagePart[]; } & { readonly source: "message"; } & { source: "message"; }) | TSelected; (options: { optional?: false | undefined; }): { id: string; type: "image" | "document" | "file"; name: string; contentType: string; file?: File; content?: import("../..").ThreadUserMessagePart[]; } & { status: import("../../types/AttachmentTypes").CompleteAttachmentStatus; content: import("../..").ThreadUserMessagePart[]; } & { readonly source: "message"; } & { source: "message"; }; (options: { optional?: boolean | undefined; }): ({ id: string; type: "image" | "document" | "file"; name: string; contentType: string; file?: File; content?: import("../..").ThreadUserMessagePart[]; } & { status: import("../../types/AttachmentTypes").CompleteAttachmentStatus; content: import("../..").ThreadUserMessagePart[]; } & { readonly source: "message"; } & { source: "message"; }) | null; <TSelected>(options: { optional?: false | undefined; selector: (state: { id: string; type: "image" | "document" | "file"; name: string; contentType: string; file?: File; content?: import("../..").ThreadUserMessagePart[]; } & { status: import("../../types/AttachmentTypes").CompleteAttachmentStatus; content: import("../..").ThreadUserMessagePart[]; } & { readonly source: "message"; } & { source: "message"; }) => TSelected; }): TSelected; <TSelected>(options: { optional?: false | undefined; selector: ((state: { id: string; type: "image" | "document" | "file"; name: string; contentType: string; file?: File; content?: import("../..").ThreadUserMessagePart[]; } & { status: import("../../types/AttachmentTypes").CompleteAttachmentStatus; content: import("../..").ThreadUserMessagePart[]; } & { readonly source: "message"; } & { source: "message"; }) => TSelected) | undefined; }): ({ id: string; type: "image" | "document" | "file"; name: string; contentType: string; file?: File; content?: import("../..").ThreadUserMessagePart[]; } & { status: import("../../types/AttachmentTypes").CompleteAttachmentStatus; content: import("../..").ThreadUserMessagePart[]; } & { readonly source: "message"; } & { source: "message"; }) | TSelected; <TSelected>(options: { optional?: boolean | undefined; selector: (state: { id: string; type: "image" | "document" | "file"; name: string; contentType: string; file?: File; content?: import("../..").ThreadUserMessagePart[]; } & { status: import("../../types/AttachmentTypes").CompleteAttachmentStatus; content: import("../..").ThreadUserMessagePart[]; } & { readonly source: "message"; } & { source: "message"; }) => TSelected; }): TSelected | null; <TSelected>(options: { optional?: boolean | undefined; selector: ((state: { id: string; type: "image" | "document" | "file"; name: string; contentType: string; file?: File; content?: import("../..").ThreadUserMessagePart[]; } & { status: import("../../types/AttachmentTypes").CompleteAttachmentStatus; content: import("../..").ThreadUserMessagePart[]; } & { readonly source: "message"; } & { source: "message"; }) => TSelected) | undefined; }): ({ id: string; type: "image" | "document" | "file"; name: string; contentType: string; file?: File; content?: import("../..").ThreadUserMessagePart[]; } & { status: import("../../types/AttachmentTypes").CompleteAttachmentStatus; content: import("../..").ThreadUserMessagePart[]; } & { readonly source: "message"; } & { source: "message"; }) | TSelected | null; }; //# sourceMappingURL=AttachmentContext.d.ts.map