Interface EventsMap

Represents a mapping of events to their corresponding types in Penpot. This interface provides information about various events that can be triggered in the application.

penpot.on('pagechange', (event) => {
console.log(event);
});
interface EventsMap {
    pagechange: Page;
    filechange: File;
    selectionchange: string[];
    themechange: Theme;
    finish: string;
    shapechange: Shape;
    contentsave: void;
}

Properties

pagechange: Page

The pagechange event is triggered when the active page in the project is changed.

filechange: File

The filechange event is triggered when there are changes in the current file.

selectionchange: string[]

The selectionchange event is triggered when the selection of elements changes. This event passes a list of identifiers of the selected elements.

themechange: Theme

The themechange event is triggered when the application theme is changed.

finish: string

The finish event is triggered when some operation is finished.

shapechange: Shape

This event will triger whenever the shape in the props change. It's mandatory to send with the props an object like { shapeId: '<id>' }

contentsave: void

The contentsave event will trigger when the content file changes.