Files
upage-git/app/lib/stores/chat-message.ts
2025-09-24 17:02:44 +08:00

17 lines
487 B
TypeScript

import { atom } from 'nanostores';
import type { UPageMessageMetadata } from '~/types/message';
export type SendChatMessageParams = {
messageContent: string;
files: File[];
metadata?: UPageMessageMetadata;
};
export type SendChatMessageFunction = (params: SendChatMessageParams) => Promise<void>;
export const sendChatMessageStore = atom<SendChatMessageFunction | null>(null);
export function setSendChatMessage(fn: SendChatMessageFunction) {
sendChatMessageStore.set(fn);
}