
Security News
White House Authorizes Private Companies to Conduct Offensive Cyber Operations
A new federal program will let vetted U.S. cybersecurity firms help investigate and disrupt foreign cybercrime groups under government direction.
@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 9,965 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
A new federal program will let vetted U.S. cybersecurity firms help investigate and disrupt foreign cybercrime groups under government direction.

Research
/Security News
The campaign amassed more than 75,000 installs by targeting Russian-speaking users seeking access to blocked services.

Company News
Open source maintainers are under more pressure than ever. We're raising our open source program from the Team plan to the Business plan, free.