@dineug/erd-editor
Version:
Entity-Relationship Diagram Editor
33 lines (32 loc) • 1.45 kB
TypeScript
import { DatabaseVendor } from '../../constants/sql/database';
import { SharedStore, SharedStoreConfig } from '../../engine/shared-store';
import { ThemeOptions } from '../../themes/radix-ui-theme';
import { Theme as ThemeType } from '../../themes/tokens';
import { KeyBindingMap, KeyBindingName } from '../../utils/keyboard-shortcut';
declare global {
interface HTMLElementTagNameMap {
'erd-editor': ErdEditorElement;
}
}
export type ErdEditorProps = {
readonly: boolean;
systemDarkMode: boolean;
enableThemeBuilder: boolean;
};
export interface ErdEditorElement extends ErdEditorProps, HTMLElement {
value: string;
focus: () => void;
blur: () => void;
clear: () => void;
destroy: () => void;
setInitialValue: (value: string) => void;
setPresetTheme: (themeOptions: Partial<ThemeOptions>) => void;
setTheme: (theme: Partial<ThemeType>) => void;
setKeyBindingMap: (keyBindingMap: Partial<Omit<KeyBindingMap, typeof KeyBindingName.edit | typeof KeyBindingName.stop | typeof KeyBindingName.search | typeof KeyBindingName.undo | typeof KeyBindingName.redo | typeof KeyBindingName.zoomIn | typeof KeyBindingName.zoomOut>>) => void;
setSchemaSQL: (value: string) => void;
getSchemaSQL: (databaseVendor?: DatabaseVendor) => string;
getSharedStore: (config?: SharedStoreConfig & {
mouseTracker?: boolean;
}) => SharedStore;
setDiffValue: (value: string) => void;
}