Comments (11)
Update: Work on the Typescript typings is in progress. It will be available soon :)
from chat-ui-kit-react.
Hey @zhan2016 I'm glad you asked. It will be available this week.
from chat-ui-kit-react.
Hello guys. Thank you for developing Such a Great project!!!
I also very much want Typescript to be used with this library so I can use it freely in my project. Also, I think a lot of other people will be interested in at least typescript definitions for this library(I personally cannot imagine how to work without autocomplete but this library will be exception:) ). So if you will have any updates, will be glad to hear that. Thank you.
from chat-ui-kit-react.
Hey @nzayatz14,
I'm glad you appreciate my work, mate!
I know Typescript is a must-have for this project.
Version 2.0 will definitely be rewritten to Typescript. I am not sure yet, but it is possible that as a temporary solution I will add typing in the first version...
BTW my second library for managing chat state is already written in Typescript. I hope it will be released tomorrow...
from chat-ui-kit-react.
Finally, there it is!
https://github.com/chatscope/chat-ui-kit-react/releases/tag/v1.9.1
(Please do not use version v1.9.0. It is buggy - it lacks type definition files :))
Sorry for the delay to everyone who waited so long for this.
I know the lack of types is annoying (for me too :) ).
Thank you for being so patient, my friends!
from chat-ui-kit-react.
@supersnager Thank you!
If you guys have(or will have In future) some problems with typescript I would like to contribute and help too.
from chat-ui-kit-react.
@supersnager no worries, I found a workaround for now but obviously not as nice as actual type definitions.
If you wanted to quickly add types without rewriting the entire project. You could just create a file chat-ui-kit-react.d.ts
and have your declared export types in there. It looks like you already have a reasonable grasp on what types you want each prop to be based on your documentation.
I created a pretty bare-bones version of this where I just declared all of the components I was using as extensions of React.ComponentClass<any>
. It allows for my local Typescript transpile without any issues, but I don't get any nice autocomplete or anything like that.
declare module "@chatscope/chat-ui-kit-react" {
import * as React from 'react';
interface Avatar extends React.ComponentClass<any> {
}
export const Avatar: Avatar;
interface ChatContainer extends React.ComponentClass<any> {
}
export const ChatContainer: ChatContainer;
interface ConversationHeader extends React.ComponentClass<any> {
Back: any
Content: any
Actions: any
}
export const ConversationHeader: ConversationHeader;
...remaining components...
}
You can read more about this here: https://www.typescriptlang.org/docs/handbook/declaration-files/templates/module-d-ts.html
from chat-ui-kit-react.
@nzayatz14 Thanks for the advice, it will definitely come in handy.
from chat-ui-kit-react.
Hello guys. Thanks for your excellent work! Does typescript typings have a smooth work? when is it going to be available? @supersnager
from chat-ui-kit-react.
Thank you very much. Such a good news.
from chat-ui-kit-react.
Is it availble now?
from chat-ui-kit-react.
Related Issues (20)
- MessageGroup.Footer with Avatar looks odd
- Expose onKeyPress for MessageInput
- Allow using send button when there is no message text HOT 3
- Scroll to message on browser-native find
- Regarding Chat Reply UI of one another user HOT 1
- IOS 16 version issue of clicking button as Message.CustomContent HOT 3
- Unexpected overflow on ChatContainer HOT 2
- transitionning between the chatcontainer and the sidebar in mobile display HOT 3
- Simple styling with tailwind
- Unexpected width and height change inside components in Message.HtmlContent. HOT 1
- [HELP] How to use the streaming message feature? HOT 4
- Not working on Next.js HOT 4
- Bug: unable to use scroll bar when using custom css HOT 1
- The requested module '/node_modules/prop-types/index.js' does not provide an export named 'default' HOT 1
- Getting started!
- Warning from FontAwesomeIcon about using defaultProps
- Set message input value from another component HOT 1
- Is there a way to actually set a proper max-length for MessageInput? HOT 1
- Avatar isn't displayed when custom content is used
- Sass deprecation warning
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from chat-ui-kit-react.