Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ts): add sendAction method in definition file #257

Merged
merged 1 commit into from
Apr 3, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export interface RichEditorProps extends WebViewProps {
* String value to set return key type
* See: https://reactnative.dev/docs/textinput#returnkeytype
*/
enterKeyHint?: 'done' | 'go' | 'next' | 'search' | 'send'
enterKeyHint?: 'done' | 'go' | 'next' | 'search' | 'send';

/**
* Boolean value to enable paste as plain text. The default value is false.
Expand Down Expand Up @@ -111,7 +111,7 @@ export interface RichEditorProps extends WebViewProps {
/**
* Callback Enter the position of the cursor
*/
onCursorPosition?: (offsetY: number)=> void;
onCursorPosition?: (offsetY: number) => void;

/**
* Callback after height change
Expand All @@ -120,6 +120,9 @@ export interface RichEditorProps extends WebViewProps {

onMessage?: (message: {type: string; id: string; data?: any}) => void;

/** Custom action sent to editor */
sendAction(type: string, action: string, data?: any, options?: any): void;

/**
* When first gaining focus, the cursor moves to the end of the text
* Default is true
Expand Down Expand Up @@ -202,13 +205,13 @@ export class RichEditor extends React.Component<RichEditorProps> {
* The background color of the selected text
* @param color
*/
setHiliteColor: (color: string)=> void;
setHiliteColor: (color: string) => void;

/**
* The color of the selected text
* @param color
*/
setForeColor: (color: string)=> void;
setForeColor: (color: string) => void;

/**
* $ = document.querySelector
Expand Down