
Security News
Frontier AI Is Now Critical Infrastructure
The Fable shutdown shows how quickly model access can become a business continuity risk for AI-dependent engineering teams.
@templatical/types
Advanced tools
Shared TypeScript types, block factory functions, and event emitter for Templatical email editor
Shared TypeScript types, block factory functions, and type guards for the Templatical email editor.
Zero-dependency package containing all shared types for the Templatical email editor ecosystem. Block schemas, template config, factory helpers, and type guards.
Use this directly if you need to programmatically create or transform Templatical templates — for example, in a backend service, codegen pipeline, or migration script.
npm install @templatical/types
import {
createTitleBlock,
createParagraphBlock,
createButtonBlock,
isImage,
isSection,
} from '@templatical/types';
import type { TemplateContent, Block } from '@templatical/types';
// Build a template programmatically
const content: TemplateContent = {
blocks: [
createTitleBlock({ text: 'Welcome to Templatical', level: 1 }),
createParagraphBlock({ text: 'Build email templates visually.' }),
createButtonBlock({ text: 'Get started', href: 'https://templatical.com' }),
],
settings: { width: 600, backgroundColor: '#ffffff' },
};
// Type-narrow blocks safely
function describeBlock(block: Block): string {
if (isImage(block)) return `Image: ${block.src}`;
if (isSection(block)) return `Section with ${block.columns.length} columns`;
return block.type;
}
Block, TitleBlock, ParagraphBlock, ImageBlock, ButtonBlock, SectionBlock, DividerBlock, SpacerBlock, SocialIconsBlock, MenuBlock, TableBlock, HtmlBlock, VideoBlock, CountdownBlock, CustomBlockcreateTitleBlock(), createParagraphBlock(), etc. for every block typeisTitle(), isParagraph(), isImage(), isSection(), etc.Template, TemplateContent, TemplateSettingsThemeOverrides, UiTheme, BlockDefaults, FontsConfigMergeTagsConfig, DisplayConditionsConfig, CustomBlockDefinitionEventEmitter (used internally by core)Full reference at docs.templatical.com.
MIT
FAQs
Shared TypeScript types, block factory functions, and event emitter for Templatical email editor
The npm package @templatical/types receives a total of 3,065 weekly downloads. As such, @templatical/types popularity was classified as popular.
We found that @templatical/types demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
The Fable shutdown shows how quickly model access can become a business continuity risk for AI-dependent engineering teams.

Security News
AI agents are pulling packages into environments no scanner is watching, creating exposure before security teams can see it.

Security News
GitHub Actions checkout now blocks risky pull_request_target checkouts by default to help prevent pwn request supply chain attacks.