@pawngine/types
v0.1.0
Published
TypeScript type definitions for Pawngine plugin development
Maintainers
Readme
@pawngine/types
TypeScript type definitions for Pawngine plugin development.
Installation
npm install -D @pawngine/typesUsage
import type { PawnginePlugin, PluginContext, Entity } from "@pawngine/types";
export default {
name: "@myplugin/hello",
version: "1.0.0",
description: "A simple hello world plugin",
icon: "👋",
activate(ctx: PluginContext) {
const pet = ctx.spawn({
id: "hello-pet",
type: "pet",
tags: ["character"],
});
ctx.renderer.attach(pet, { type: "text", content: "👋" });
ctx.onUpdate((dt) => {
// Update logic runs every frame
});
},
} satisfies PawnginePlugin;What's Included
PawnginePlugin— Plugin interfacePluginContext— Full plugin API (ctx)Entity,Transform,Vec2— ECS typesEngineEvents,EntityEvents— Event mapsSettingsSchema,SettingField— Plugin settingsComponentTypeMap— Extensible component registry- Hook types:
SyncHook,SyncBailHook,SyncWaterfallHook,AsyncSeriesHook SystemDef,PipelineBuilder,Query— Systems and queries
License
MIT
