Andrey Antukh ec1af4ad96 🎉 Import penpot-plugins repository
As commit 819a549e4928d2b1fa98e52bee82d59aec0f70d8
2025-12-30 14:56:15 +01:00

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;
}