Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@magicul/react-chat-stream

Package Overview
Dependencies
Maintainers
2
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@magicul/react-chat-stream - npm Package Compare versions

Comparing version 0.2.0 to 0.2.1

19

dist/hooks/useChatStream.d.ts

@@ -8,11 +8,2 @@ import { ChangeEvent, Dispatch, FormEvent, SetStateAction } from 'react';

};
type UseChatStreamResult = {
messages: ChatMessage[];
setMessages: Dispatch<SetStateAction<ChatMessage[]>>;
input: string;
setInput: Dispatch<SetStateAction<string>>;
handleInputChange: (event: ChangeEvent<HTMLInputElement>) => void;
handleSubmit: (event?: FormEvent<HTMLFormElement>, newMessage?: string) => void;
isLoading: boolean;
};
export type UseChatStreamOptions = {

@@ -33,4 +24,12 @@ url: string;

};
declare const useChatStream: (input: UseChatStreamInput) => UseChatStreamResult;
declare const useChatStream: (input: UseChatStreamInput) => {
messages: ChatMessage[];
setMessages: Dispatch<SetStateAction<ChatMessage[]>>;
input: string;
setInput: Dispatch<SetStateAction<string>>;
handleInputChange: (e: ChangeEvent<HTMLInputElement> | ChangeEvent<HTMLTextAreaElement>) => void;
handleSubmit: (e?: FormEvent<HTMLFormElement>, newMessage?: string) => Promise<void>;
isLoading: boolean;
};
export default useChatStream;
//# sourceMappingURL=useChatStream.d.ts.map
{
"name": "@magicul/react-chat-stream",
"description": "A React hook that lets you easily integrate your custom ChatGPT-like chat in React.",
"version": "0.2.0",
"version": "0.2.1",
"main": "dist/index.js",

@@ -6,0 +6,0 @@ "types": "dist/index.d.ts",

@@ -15,12 +15,2 @@ import { ChangeEvent, Dispatch, FormEvent, SetStateAction, useState } from 'react';

type UseChatStreamResult = {
messages: ChatMessage[];
setMessages: Dispatch<SetStateAction<ChatMessage[]>>
input: string;
setInput: Dispatch<SetStateAction<string>>;
handleInputChange: (event: ChangeEvent<HTMLInputElement>) => void;
handleSubmit: (event?: FormEvent<HTMLFormElement>, newMessage?: string) => void;
isLoading: boolean;
}
export type UseChatStreamOptions = {

@@ -44,3 +34,3 @@ url: string;

const useChatStream = (input: UseChatStreamInput): UseChatStreamResult => {
const useChatStream = (input: UseChatStreamInput) => {
const [messages, setMessages] = useState<ChatMessage[]>([]);

@@ -50,3 +40,3 @@ const [message, setMessage] = useState('');

const handleInputChange = (e: ChangeEvent<HTMLInputElement>) => {
const handleInputChange = (e: ChangeEvent<HTMLInputElement> | ChangeEvent<HTMLTextAreaElement>) => {
setMessage(e.target.value);

@@ -53,0 +43,0 @@ };

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc