Licence
MIT
Version
0.1.0
Deps
0
Size
40 kB
Vulns
0
Weekly
0
DeprecatedThis package is deprecated
@sakia/template-format
Third-party format integration scaffold — copy this package to bootstrap a new Sakia format adapter.
Reference implementation: @sakia/loaders (DXF placeholder).
Package layout
| File | Role |
|---|---|
templateDocument.ts |
IDocument + entities with typeId |
parseTemplate.ts |
Text → document (IFormatParser candidate) |
index.ts |
Loader plugin, Painter, mount helpers, RegisterTemplateLoaders() |
Quick start
import { NullEngine, DocumentLoader } from "@sakia/core";
import {
RegisterTemplateLoaders,
loadAndMountTemplateDocument,
} from "@sakia/template-format";
RegisterTemplateLoaders();
const engine = new NullEngine();
await engine.setup();
const source = `# demo
LINE 0 0 10 5
LINE 10 5 20 0`;
await loadAndMountTemplateDocument(engine, source, "demo.template");
engine.render();
Customize
- Rename package and
formatstring on your document class. - Replace
parseTemplatewith real decoding; optionally exportIFormatParser/IDocumentSerializer. - Add
ItemPaintersubclasses per entitytypeId(or rely onDocumentPainterconstructor fallback during migration). - Register loader via
RegisterDocumentLoaderPlugin(idempotentRegister*helper recommended). - Export
loadAndMount*using coreloadAndMountDocument+ yourmount*function.
Sample .template syntax (placeholder)
# comment
LINE x1 y1 x2 y2
Coordinates are world mm, same unit system as Sakia scenes.