chore: fix types
This commit is contained in:
31
src/types/contenteditable.d.ts
vendored
Normal file
31
src/types/contenteditable.d.ts
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
declare module "react-contenteditable" {
|
||||
import React from "react";
|
||||
|
||||
type ChangeEventHandler<T = Element> = (event: React.ChangeEvent<T>) => void;
|
||||
type KeyUpHandler<T = Element> = (event: React.KeyboardEvent<T>) => void;
|
||||
type KeyDownHandler<T = Element> = (event: React.KeyboardEvent<T>) => void;
|
||||
|
||||
interface ContentEditableProps extends React.HTMLAttributes<HTMLDivElement> {
|
||||
html: string;
|
||||
onChange?: ChangeEventHandler<HTMLTextAreaElement | HTMLInputElement>;
|
||||
onBlur?: () => void;
|
||||
onKeyUp?: KeyUpHandler<HTMLTextAreaElement | HTMLInputElement>;
|
||||
onKeyDown?: KeyDownHandler<HTMLTextAreaElement | HTMLInputElement>;
|
||||
disabled?: boolean;
|
||||
tagName?: string;
|
||||
className?: string;
|
||||
style?: React.CSSProperties;
|
||||
innerRef?:
|
||||
| React.RefObject<HTMLElement>
|
||||
| ((instance: HTMLElement | null) => void);
|
||||
placeholder?: string;
|
||||
}
|
||||
|
||||
class ContentEditable extends React.Component<ContentEditableProps> {}
|
||||
|
||||
interface ContentEditableElement extends HTMLElement {
|
||||
value: string;
|
||||
}
|
||||
|
||||
export default ContentEditable;
|
||||
}
|
||||
Reference in New Issue
Block a user