Capability presets

Capability flags declare which optional Slack block types the destination surface supports. They are consumed through the capabilities and capabilityOverrides options of convert(); this page documents the underlying exports. For guidance on choosing a profile, see Slack compatibility.

CapabilityFlags

interface CapabilityFlags {
  readonly markdownBlock: boolean;
  readonly tableBlock: boolean;
  readonly preformattedLanguage: boolean;
  readonly headerLevel: boolean;
  readonly dataTable: boolean;
  readonly dataVisualization: boolean;
  readonly containerBlock: boolean;
}
FlagGates
markdownBlockmarkdown blocks: task-list checkboxes, wide-table fallback, markdown-block strategy
tableBlockNative table blocks
preformattedLanguagelanguage field on code blocks (syntax highlighting)
headerLevellevel field on header blocks
dataTablePaginated data_table blocks for large tables
dataVisualizationNative chart blocks from mermaid fences
containerBlockCollapsible container blocks from <details> HTML

CAPABILITY_PRESETS

A frozen map of preset name → full CapabilityFlags. Presets are cumulative and keyed to Slack changelog dates:

PresetmarkdownBlocktableBlockpreformattedLanguageheaderLeveldataTabledataVisualizationcontainerBlock
conservative
2025-02
2025-08
2026-03
2026-05
2026-06
latest

CapabilityPresetName is the union of the names above, also available as a runtime constant object:

import { CAPABILITY_PRESETS, CapabilityPresetName } from "slackmark";

CAPABILITY_PRESETS[CapabilityPresetName.Conservative]; // all flags false

resolveCapabilities()

function resolveCapabilities(
  input: CapabilityPresetName | CapabilityFlags | CapabilityFlagsPartial | undefined,
  overrides?: CapabilityFlagsPartial,
): CapabilityFlags;

The same resolution convert() applies internally, exported for code that needs the effective flags:

  • undefinedlatest.
  • A preset name → that preset. Unknown names throw ConfigurationError (a typo must not silently enable every capability).
  • A full flags object → used as-is.
  • A partial flags object → merged over latest.
  • overrides → merged over the resolved base, flag by flag.

The result is a frozen object.

import { resolveCapabilities } from "slackmark";

const flags = resolveCapabilities("2025-08", { markdownBlock: false });
// { markdownBlock: false, tableBlock: true, ...rest false }