@neo-office/core-types
v0.1.1
Published
TypeScript type definitions and model mappers for Office Open XML documents (DOCX, PPTX).
Maintainers
Readme
@neo-office/core-types
TypeScript type definitions, document models, and mappers for Office Open XML documents (DOCX, PPTX, XLSX).
Installation
npm install @neo-office/core-typesWhat's Inside
- Document models —
ParsedDocument,PptxPresentation,DocxDocument,XlsxWorkbookand all their child types - Engine interfaces —
PreviewEngine,DocumentHandle,RenderResult,SearchResult - Renderer types —
RenderMode,ViewMode,PageInfo - Mutation types —
DocumentMutationfor edit operations EditSession— tracks in-progress edits before they are committedmapParsedDocument/mapShape— map raw WASM JSON output into typed models
Usage
import type { ParsedDocument, PptxPresentation, DocxDocument } from '@neo-office/core-types';
import { mapParsedDocument } from '@neo-office/core-types';
// Map raw JSON from the WASM engine into a typed document
const doc: ParsedDocument = mapParsedDocument(rawJson);
if (doc.format === 'pptx') {
const pptx: PptxPresentation = doc.presentation;
console.log(pptx.slides.length, 'slides');
}Packages that depend on this
| Package | Role |
|---|---|
| @neo-office/renderer | WASM engine client |
| @neo-office/ui-shell | React viewer components |
| @neo-office/web-sdk | High-level browser SDK |
License
MIT
