mirror of
https://github.com/penpot/penpot.git
synced 2026-05-09 01:58:46 +00:00
58 lines
1021 B
TypeScript
58 lines
1021 B
TypeScript
import { Shape } from '@penpot/plugin-types';
|
|
|
|
export interface ReadyPluginEvent {
|
|
type: 'ready';
|
|
}
|
|
export interface InitPluginEvent {
|
|
type: 'init';
|
|
content: {
|
|
theme: string;
|
|
selection: Shape[];
|
|
};
|
|
}
|
|
|
|
export interface SelectionPluginEvent {
|
|
type: 'selection';
|
|
content: {
|
|
selection: Shape[];
|
|
};
|
|
}
|
|
export interface ThemePluginEvent {
|
|
type: 'theme';
|
|
content: string;
|
|
}
|
|
|
|
export interface ReplaceTextPluginEvent {
|
|
type: 'replace-text';
|
|
content: ReplaceText;
|
|
}
|
|
|
|
export interface AddTextPluginEvent {
|
|
type: 'add-text';
|
|
content: AddText[];
|
|
}
|
|
|
|
export interface PreviewReplaceTextPluginEvent {
|
|
type: 'preview-replace-text';
|
|
content: ReplaceText;
|
|
}
|
|
|
|
export type PluginMessageEvent =
|
|
| ReadyPluginEvent
|
|
| InitPluginEvent
|
|
| SelectionPluginEvent
|
|
| ThemePluginEvent
|
|
| ReplaceTextPluginEvent
|
|
| AddTextPluginEvent
|
|
| PreviewReplaceTextPluginEvent;
|
|
|
|
export interface ReplaceText {
|
|
search: string;
|
|
replace: string;
|
|
}
|
|
|
|
export interface AddText {
|
|
current: string;
|
|
new: string;
|
|
}
|