New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@dearj/types

Package Overview
Dependencies
Maintainers
3
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@dearj/types

Types for Dear J content editor.

latest
npmnpm
Version
0.0.1
Version published
Weekly downloads
3
Maintainers
3
Weekly downloads
 
Created
Source

@dearj/types - TypeScript Definitions for DearJ

🌟 Overview

The @dearj/types package provides comprehensive TypeScript type definitions for the DearJ Drag & Drop Email Editor Suite. These types ensure type safety and enhance developer experience when working with DearJ components in TypeScript projects.

📦 Installation

Install as a development dependency using npm or yarn:

npm install --save-dev @dearj/types

or

yarn add -D @dearj/types

🛠️ Key Type Definitions

Core Template Structure

type Template = {
  counters: Record<string, number>;
  body: Body;
  schemaVersion?: number;
};

type Body = {
  id: string;
  rows: Row[];
  headers?: [];
  footers?: [];
  values?: Values;
};

type Row = {
  id: string;
  cells: number[];
  columns: Column[];
  values: Values;
};

type Column = {
  id: string;
  contents: Content[];
  values: Values;
};

type Content = {
  id: string;
  type: string;
  values: Values;
};

Editor Configuration

type EditorConfig = {
  authorization: string;
  version: string | number;
};

Tool Builder Definitions

type ToolBuilderConfig = {
  id: string;
  name: string;
  icon: ElementType;
  builderOptionsPage: ToolOptionsBuilderConfig;
  toolInsertObject: ReactNode | ((...args) => ReactNode) | Row;
  // ...additional properties
};

type ToolOptionsBuilderConfig = {
  builderGroups: BuilderGroup[];
};

type BuilderGroup = {
  icon: ElementType;
  groupTitle: string;
  builderGroupProperties: BuilderGroupProperties[];
};

Event and Message Types

type IFrameMessage = {
  type: string;
  data: {
    origin: string;
    [key: string]: any;
  };
  timestamp: number;
  securityToken: string;
};

💡 Example

import { EditorConfig, Template, EmailEditor } from "dearj";

const config: EditorConfig = {
  authorization: "your_token_here",
  version: "1.2.0",
};

const initialTemplate: Template = {
  counters: { section: 1 },
  body: {
    id: "main-body",
    rows: [
      // ...row definitions
    ],
  },
};

const editor = new EmailEditor(config, initialTemplate);

📒 Notes

  • These types are automatically recognized when using DearJ in TypeScript projects
  • Includes definitions for all core entities: templates, rows, columns, content blocks
  • Provides strict typing for editor configuration and message passing
  • Covers both React-specific types and framework-agnostic structures

📝 License

DearJ is available under the BSD-3-CLAUSE License.

FAQs

Package last updated on 19 Nov 2025

Did you know?

Socket

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.

Install

Related posts