rhino-editor
Version:
A custom element wrapped rich text editor
100 lines (99 loc) • 2.98 kB
TypeScript
import { PropertyValues, TemplateResult } from "lit";
import { BaseElement } from "../../internal/elements/base-element.js";
export declare const LOADING_STATES: Readonly<{
notStarted: "not-started";
loading: "loading";
error: "error";
success: "success";
}>;
export type LoadingState = (typeof LOADING_STATES)[keyof typeof LOADING_STATES];
/**
* An attachment editor element for managing tip-tap attachments. This encompasses the
* delete button, tooltip, and progress handler.
*/
export declare class AttachmentEditor extends BaseElement {
fileName?: string;
fileSize?: number;
progress?: number;
showMetadata?: boolean;
previewable?: boolean;
loadingState?: LoadingState;
fileUploadErrorMessage?: TemplateResult | string;
removeFigure: () => void;
setNodeAttributes: (attrs: Partial<{
altTextDialogOpen: boolean;
alt: string;
}>) => void;
/**
* Whether or not to enable the alt text editor for images on attachments.
*/
altTextEditor: boolean;
altTextDialogOpen: boolean;
altText: string;
imgSrc: string;
editorValue: string | null;
altTextMaxLength: number;
altTextMinLength: number;
waitForDialogOpen: boolean;
constructor();
static baseName: string;
closeIcon(parts?: string[]): TemplateResult<1>;
warningIcon(): TemplateResult<1>;
static get properties(): {
fileName: {
attribute: string;
type: StringConstructor;
};
fileSize: {
attribute: string;
type: NumberConstructor;
};
progress: {
type: NumberConstructor;
};
class: {
attribute: string;
type: StringConstructor;
};
loadingState: {
attribute: string;
};
fileUploadErrorMessage: {
state: boolean;
};
altTextDialogOpen: {
attribute: string;
type: BooleanConstructor;
};
altTextMaxLength: {
type: NumberConstructor;
};
imgSrc: {
attribute: string;
};
showMetadata: {
attribute: string;
reflect: boolean;
type: BooleanConstructor;
};
editorValue: {};
altText: {
attribute: string;
};
previewable: {
reflect: boolean;
type: BooleanConstructor;
};
};
handleClick: (e: Event) => void;
handleKeydown: (e: KeyboardEvent) => void;
connectedCallback(): void;
protected firstUpdated(_changedProperties: PropertyValues): void;
disconnectedCallback(): void;
static get styles(): import("lit").CSSResult;
toFileSize(): string;
protected updated(changedProperties: PropertyValues<this>): void;
render(): TemplateResult<1>;
renderAltTextButton(): TemplateResult<1>;
renderAltTextDialog(): TemplateResult<1>;
}