Core API
@makoojs/core runs in the browser: it creates Core instances, declares components and listeners, reads status, and handles errors. If this is your first time, complete the Quick Start first.
Export Index
Functions
| Export | Purpose | Reference |
|---|---|---|
createMakoo() | Create a Core instance | Core Instance |
inject() | Declare a component | Declarations |
injectEach() | Declare an Each Injection: one component on every matching element | Declarations |
listen() | Declare a host listener | Declarations |
Classes and Constants
| Export | Purpose | Reference |
|---|---|---|
MakooError | Errors thrown or reported by Makoo | Errors |
MakooAggregateError | Collects multiple child errors | Errors |
MakooErrorCode | Core error codes | Errors |
Types
| Type | Reference |
|---|---|
MakooRuntime | Core Instance |
ComponentInjection, ComponentEachInjection, ChildInjection, ListenerInjection | Core Instance |
MakooComponentInput, MakooComponentDeclaration | Declarations |
MakooComponentEachInput, MakooComponentEachDeclaration | Declarations |
MakooListenerInput, MakooListenerDeclaration | Declarations |
MakooInjectionDeclaration | Declarations |
ComponentCommand, ChildCommand, ListenerCommand, InjectionCommand | Commands and Status |
ComponentStatusHandle, ComponentEachStatusHandle, ChildStatusHandle, ListenerStatusHandle, InjectionStatusHandle | Commands and Status |
ComponentStatus, ComponentEachStatus, ListenerStatus | Commands and Status |
StateView | Commands and Status |
ObservationNotice, ObservationHandler | Commands and Status |
MountAdapter, AdapterMountParams | Adapter Contract |
Minimal Example
ts
import { createMakoo, inject } from '@makoojs/core';
import { createVueAdapter } from '@makoojs/vue';
import Panel from './Panel.vue';
const core = createMakoo();
core.useAdapter(createVueAdapter());
core.apply([
inject({ name: 'panel', injectAt: 'body', adapter: 'vue', component: Panel })
]);For the APIs used inside Vue and React components, see Vue and React.