Skip to main content

Interface: MappletType<State>

Defined in: mapplet.ts:32

Represents the configuration interface for a Mapplet application. A Mapplet is a self-contained application that can be embedded or run standalone.

MappletType

Example

interface MyAppState {
user: { name: string; email: string };
settings: { theme: string };
}

const myMapplet: MappletType<MyAppState> = {
state: {
user: { name: 'John', email: 'john@example.com' },
settings: { theme: 'dark' }
},
onAction: (action) => {
console.log('Mapplet action:', action);
// Handle analytics, logging, etc.
}
};

Type Parameters

State

State extends object = object

The type of the application state (must extend object)

Properties

state?

optional state: State

Defined in: mapplet.ts:34

Optional initial state object for the Mapplet


onAction()?

optional onAction: (action) => void

Defined in: mapplet.ts:36

Optional callback function to handle actions emitted by the Mapplet

Parameters

action

Action

Returns

void