Browse files

Improved typings (#940)

* Improved render typings

* Use IMessage type instead of any
  • Loading branch information...
danilobuerger authored and xcarpentier committed Nov 8, 2018
1 parent 89c7b57 commit ebe4b31510de9c69e2f004805618a379aec1dc1e
Showing with 9 additions and 9 deletions.
  1. +9 −9 index.d.ts
@@ -143,11 +143,11 @@ export interface GiftedChatProps {
/* Placeholder when text is empty; default is 'Type a message...' */
placeholder?: string;
/* Generate an id for new messages. Defaults to UUID v4, generated by uuid */
messageIdGenerator?<T extends any>(message: T): string;
messageIdGenerator?(message: IMessage): string;
/* User sending the messages: { _id, name, avatar } */
user?: User;
/* Callback when sending a message */
onSend?<T extends any>(messages: T[]): void;
onSend?(messages: IMessage[]): void;
/* Locale to localize the dates */
locale?: string;
/* Format to use for rendering times; default is 'LT' */
@@ -207,13 +207,13 @@ export interface GiftedChatProps {
/* Custom message composer container */
renderInputToolbar?(props: InputToolbarProps): React.ReactNode;
/* Custom text input message composer */
renderComposer?(): React.ReactNode;
renderComposer?(props: ComposerProps): React.ReactNode;
/* Custom action button on the left of the message composer */
renderActions?(): React.ReactNode;
renderActions?(props: ActionsProps): React.ReactNode;
/* Custom send button; you can pass children to the original Send component quite easily, for example to use a custom icon (example) */
renderSend?(): React.ReactNode;
renderSend?(props: SendProps): React.ReactNode;
/*Custom second line of actions below the message composer */
renderAccessory?(): React.ReactNode;
renderAccessory?(props: InputToolbarProps): React.ReactNode;
/*Callback when the Action button is pressed (if set, the default actionSheet will not be used) */
onPressActionButton?(): void;
/*Distance of the chat from the bottom of the screen (e.g. useful if you display a tab bar) */
@@ -249,9 +249,9 @@ export class GiftedChat extends React.Component<GiftedChatProps> {
interface InputToolbarProps {
renderAccessory?(props: InputToolbarProps): React.ReactNode;
renderActions?(props: InputToolbarProps): React.ReactNode;
renderSend?(props: InputToolbarProps): React.ReactNode;
renderComposer?(props: InputToolbarProps): React.ReactNode;
renderActions?(props: ActionsProps): React.ReactNode;
renderSend?(props: SendProps): React.ReactNode;
renderComposer?(props: ComposerProps): React.ReactNode;
onPressActionButton?(): void;
containerStyle?: ViewStyle;
primaryStyle?: ViewStyle;

0 comments on commit ebe4b31

Please sign in to comment.