carta-md
Version:
A lightweight, fully customizable, Markdown editor
49 lines (48 loc) • 1.3 kB
TypeScript
import type { Carta } from '../carta';
import type { UIEventHandler } from 'svelte/elements';
import type { TextAreaProps } from '../textarea-props';
import { type Snippet } from 'svelte';
interface Props {
/**
* The Carta instance to use.
*/
carta: Carta;
/**
* The editor content.
*/
value: string;
/**
* The placeholder text for the textarea.
*/
placeholder: string;
/**
* The element of the wrapper div.
*/
elem: HTMLDivElement | undefined;
/**
* Additional textarea properties.
*/
props: TextAreaProps;
/**
* Whether this component is hidden (display: none).
*/
hidden: boolean;
/**
* Highlight delay in milliseconds.
*/
highlightDelay: number;
onscroll: UIEventHandler<HTMLDivElement>;
children: Snippet;
}
/**
* A wrapped textarea component integrated with Carta. It handles the highlighting
* and propagates events to the Carta instance.
*/
declare const Input: import("svelte").Component<Props, {
/**
* Manually resize the textarea to fit the content, so that it
* always perfectly overlaps the highlighting overlay.
*/ resize: () => void;
}, "value" | "elem">;
type Input = ReturnType<typeof Input>;
export default Input;