@dineug/erd-editor
Version:
Entity-Relationship Diagram Editor
169 lines (168 loc) • 4.69 kB
TypeScript
import { Action, AnyAction, DOMTemplateLiterals } from '@dineug/r-html';
import { ValuesType } from '../internal-types';
import { ThemeOptions } from '../themes/radix-ui-theme';
declare const InternalActionType: {
readonly openColorPicker: "openColorPicker";
readonly closeColorPicker: "closeColorPicker";
readonly openToast: "openToast";
readonly loadShikiService: "loadShikiService";
readonly openTableProperties: "openTableProperties";
readonly dragendColumnAll: "dragendColumnAll";
readonly copy: "copy";
readonly paste: "paste";
readonly schemaGC: "schemaGC";
readonly toggleSearch: "toggleSearch";
readonly openThemeBuilder: "openThemeBuilder";
readonly setThemeOptions: "setThemeOptions";
readonly mouseTrackerStart: "mouseTrackerStart";
readonly mouseTrackerEnd: "mouseTrackerEnd";
readonly openDiffViewer: "openDiffViewer";
};
type InternalActionType = ValuesType<typeof InternalActionType>;
type InternalActionMap = {
[InternalActionType.openColorPicker]: {
x: number;
y: number;
color: string;
};
[InternalActionType.closeColorPicker]: void;
[InternalActionType.openToast]: {
message: DOMTemplateLiterals;
close?: Promise<void>;
};
[InternalActionType.loadShikiService]: void;
[InternalActionType.openTableProperties]: {
tableId: string;
};
[InternalActionType.dragendColumnAll]: void;
[InternalActionType.copy]: {
event: ClipboardEvent;
};
[InternalActionType.paste]: {
event: ClipboardEvent;
};
[InternalActionType.schemaGC]: void;
[InternalActionType.toggleSearch]: void;
[InternalActionType.openThemeBuilder]: void;
[InternalActionType.setThemeOptions]: Partial<ThemeOptions>;
[InternalActionType.mouseTrackerStart]: void;
[InternalActionType.mouseTrackerEnd]: void;
[InternalActionType.openDiffViewer]: {
value: string;
};
};
type ListenerRecord = {
[P in keyof InternalActionMap]: (action: Action<P, InternalActionMap>) => void;
};
export declare class Emitter {
#private;
on(listeners: Partial<ListenerRecord>): () => void;
emit(action: AnyAction): void;
clear(): void;
}
export declare const openColorPickerAction: {
(payload: {
x: number;
y: number;
color: string;
}): AnyAction<{
x: number;
y: number;
color: string;
}>;
toString(): string;
type: string;
};
export declare const closeColorPickerAction: {
(payload: void): AnyAction<void>;
toString(): string;
type: string;
};
export declare const openToastAction: {
(payload: {
message: DOMTemplateLiterals;
close?: Promise<void>;
}): AnyAction<{
message: DOMTemplateLiterals;
close?: Promise<void>;
}>;
toString(): string;
type: string;
};
export declare const loadShikiServiceAction: {
(payload: void): AnyAction<void>;
toString(): string;
type: string;
};
export declare const openTablePropertiesAction: {
(payload: {
tableId: string;
}): AnyAction<{
tableId: string;
}>;
toString(): string;
type: string;
};
export declare const dragendColumnAllAction: {
(payload: void): AnyAction<void>;
toString(): string;
type: string;
};
export declare const copyAction: {
(payload: {
event: ClipboardEvent;
}): AnyAction<{
event: ClipboardEvent;
}>;
toString(): string;
type: string;
};
export declare const pasteAction: {
(payload: {
event: ClipboardEvent;
}): AnyAction<{
event: ClipboardEvent;
}>;
toString(): string;
type: string;
};
export declare const schemaGCAction: {
(payload: void): AnyAction<void>;
toString(): string;
type: string;
};
export declare const toggleSearchAction: {
(payload: void): AnyAction<void>;
toString(): string;
type: string;
};
export declare const openThemeBuilderAction: {
(payload: void): AnyAction<void>;
toString(): string;
type: string;
};
export declare const setThemeOptionsAction: {
(payload: Partial<ThemeOptions>): AnyAction<Partial<ThemeOptions>>;
toString(): string;
type: string;
};
export declare const mouseTrackerStartAction: {
(payload: void): AnyAction<void>;
toString(): string;
type: string;
};
export declare const mouseTrackerEndAction: {
(payload: void): AnyAction<void>;
toString(): string;
type: string;
};
export declare const openDiffViewerAction: {
(payload: {
value: string;
}): AnyAction<{
value: string;
}>;
toString(): string;
type: string;
};
export {};