Paradoc
SchemasArtifactsShared schemas

Layer

Last updated on

Rendering output specification for artifacts

A Layer defines how an artifact can be rendered into a specific format. Layers enable artifacts to have multiple output representations (PDF, HTML, Markdown, etc.).

type Layer = InlineLayer | FileLayer

Layer Types

InlineLayer

Inline layer with embedded text content. Used when content is stored directly in the artifact definition.

kind: 'inline'
Discriminator for inline layer type
mimeType: string
MIME type of the content (e.g., text/markdown, text/html)
text: string
Layer content with interpolation placeholders
title?: string
Human-readable title for this layer
description?: string
Description of what this layer represents
bindings?: Record<string, string>
Field bindings mapping form field names to layer target identifiers (typically for PDF)
signatures?: Record<string, SignatureSlot>
Unified signature slots keyed by slot id, each binding a party to a placement

FileLayer

File-backed layer with external file reference. Used when content is stored in a separate file.

kind: 'file'
Discriminator for file layer type
mimeType: string
MIME type of the file (e.g., application/pdf)
path: string
Absolute path from repo root to the layer file
title?: string
Human-readable title for this layer
description?: string
Description of what this layer represents
checksum?: string
SHA-256 checksum for integrity verification
bindings?: Record<string, string>
Field bindings mapping form field names to layer target identifiers (typically for PDF)
signatures?: Record<string, SignatureSlot>
Unified signature slots keyed by slot id, each binding a party to a placement

SignatureSlot

A signature slot declares one signing field on a layer. Each slot binds a party to a placement; the seal pipeline resolves every slot to concrete PDF coordinates.

party: { role: string; index?: number }
Party this slot binds to. index is 0-based for multi-party roles and defaults to 0
type: 'signature' | 'initials' | 'date_signed' | 'capacity' | 'printed_name'
Type of signing field
placement: SignatureSlotPlacement
Where the field lands: 'auto' (marker located after conversion), a text anchor, or absolute coordinates
required?: boolean
Whether this slot must be signed. Defaults to true
label?: string
Human-readable label
type SignatureSlotPlacement =
  | 'auto'
  | { page: number; x: number; y: number; width: number; height: number }
  | {
      anchor: { text: string; offsetX?: number; offsetY?: number; occurrence?: number }
      width: number
      height: number
    }

The legacy signatureBlocks and anchorBlocks layer fields remain readable during their deprecation window; new artifacts should declare signatures.

Examples

layers:
  # Inline layer with markdown content
  markdown:
    kind: inline
    mimeType: text/markdown
    title: Markdown Version
    text: |
      # Welcome

      This is the content of the document with {{ fields.name }} placeholder.

  # File layer referencing external PDF
  pdf:
    kind: file
    mimeType: application/pdf
    path: /templates/contract.pdf
    title: PDF Version
    bindings:
      client_name: clientName
      contract_date: contractDate

Related

On this page