@shashimadushan/docx-editor-legal-templates
v0.1.0
Published
Sri Lankan legal document templates (deeds, powers of attorney, affidavits, agreements, pleadings) for @shashimadushan/docx-editor-editor, with merge-field rendering.
Maintainers
Readme
@shashimadushan/docx-editor-legal-templates
Sri Lankan legal document templates (deeds, powers of attorney, affidavits, agreements, pleadings, letters, and corporate resolutions) for use with @shashimadushan/docx-editor-editor and @shashimadushan/docx-editor-agent.
Each template is a structured, merge-field-aware document definition that can be rendered into TipTap/editor content and filled in programmatically.
Install
npm install @shashimadushan/docx-editor-legal-templatesUsage
import {
createDefaultLegalTemplateRegistry,
renderLegalTemplate,
getMissingRequiredFields,
} from "@shashimadushan/docx-editor-legal-templates";
const registry = createDefaultLegalTemplateRegistry();
const template = registry.get("deed-of-gift");
const missing = getMissingRequiredFields(template, { donorName: "Jane Doe" });
const content = renderLegalTemplate(template, {
donorName: "Jane Doe",
doneeName: "John Doe",
// ...other merge fields
});What's included
- Templates — deeds (gift, transfer, mortgage, long-term lease, declaration), powers of attorney (general, special, revocation), affidavits, lease and loan agreements, NDAs, employment/partnership/service agreements, demand and cease-and-desist letters, wills, plaints, trust deeds, board resolutions, and meeting minutes.
- Clause library — reusable, searchable legal clauses that can be composed into custom documents.
- Checklists — supporting-document checklists per template.
- Bulk rendering — render many documents from a dataset in one call.
- Export presets — common export configurations for generated documents.
API
See exported types and functions in src/index.ts for the full public surface: LegalTemplateRegistry, renderLegalTemplate, extractTemplateTokens, getMissingRequiredFields, the built-in template list, and the clause library helpers.
License
MIT
