format.readSelection
Read inline formatting across a selection or caret, reporting each property as uniform, mixed, unset or unresolvable.
doc.format.readSelection(…)Expected result
Returns per-property states whose uniform values use the same shape format.apply accepts, without changing the document.
Inputs
target
targetSelectionTargetrequiredFields
kind"selection"requiredstartSelectionPointrequiredA point in the document. Use {kind:'text', blockId, offset} for character positions or {kind:'nodeEdge', node:{kind:'block', nodeType, nodeId}, edge:'before'|'after'} for block boundaries.
text
kind"text"requiredblockIdstringrequiredoffsetintegerrequiredstoryStoryLocatorStory scope. Defaults to document body when omitted. Use {kind:'story', storyType:'body'} for body, or other storyType values for headers, footers, footnotes, endnotes.
body
kind"story"requiredstoryType"body"requiredheaderFooterSlot
kind"story"requiredstoryType"headerFooterSlot"requiredsectionSectionAddressrequiredheaderFooterKind"header" | "footer"requiredvariant"default" | "first" | "even"requiredresolution"effective" | "explicit"onWrite"materializeIfInherited" | "editResolvedPart" | "error"headerFooterPart
kind"story"requiredstoryType"headerFooterPart"requiredrefIdstringrequiredfootnote
kind"story"requiredstoryType"footnote"requirednoteIdstringrequiredendnote
kind"story"requiredstoryType"endnote"requirednoteIdstringrequiredtextbox
kind"story"requiredstoryType"textbox"requiredtextboxIdstringrequirednodeEdge
kind"nodeEdge"requirednodeSelectionEdgeNodeAddressrequirededge"before" | "after"requiredendSelectionPointrequiredA point in the document. Use {kind:'text', blockId, offset} for character positions or {kind:'nodeEdge', node:{kind:'block', nodeType, nodeId}, edge:'before'|'after'} for block boundaries.
text
kind"text"requiredblockIdstringrequiredoffsetintegerrequiredstoryStoryLocatorStory scope. Defaults to document body when omitted. Use {kind:'story', storyType:'body'} for body, or other storyType values for headers, footers, footnotes, endnotes.
body
kind"story"requiredstoryType"body"requiredheaderFooterSlot
kind"story"requiredstoryType"headerFooterSlot"requiredsectionSectionAddressrequiredheaderFooterKind"header" | "footer"requiredvariant"default" | "first" | "even"requiredresolution"effective" | "explicit"onWrite"materializeIfInherited" | "editResolvedPart" | "error"headerFooterPart
kind"story"requiredstoryType"headerFooterPart"requiredrefIdstringrequiredfootnote
kind"story"requiredstoryType"footnote"requirednoteIdstringrequiredendnote
kind"story"requiredstoryType"endnote"requirednoteIdstringrequiredtextbox
kind"story"requiredstoryType"textbox"requiredtextboxIdstringrequirednodeEdge
kind"nodeEdge"requirednodeSelectionEdgeNodeAddressrequirededge"before" | "after"requiredstoryStoryLocatorStory scope. Defaults to document body when omitted. Use {kind:'story', storyType:'body'} for body, or other storyType values for headers, footers, footnotes, endnotes.
body
kind"story"requiredstoryType"body"requiredheaderFooterSlot
kind"story"requiredstoryType"headerFooterSlot"requiredsectionSectionAddressrequiredheaderFooterKind"header" | "footer"requiredvariant"default" | "first" | "even"requiredresolution"effective" | "explicit"onWrite"materializeIfInherited" | "editResolvedPart" | "error"headerFooterPart
kind"story"requiredstoryType"headerFooterPart"requiredrefIdstringrequiredfootnote
kind"story"requiredstoryType"footnote"requirednoteIdstringrequiredendnote
kind"story"requiredstoryType"endnote"requirednoteIdstringrequiredtextbox
kind"story"requiredstoryType"textbox"requiredtextboxIdstringrequiredcoordinateSpaceTextCoordinateSpacekeys"bold" | "italic" | "strike" | "underline" | "highlight" | "color" | "fontSize" | "fontFamily" | "letterSpacing" | "vertAlign" | "position" | "dstrike" | "smallCaps" | "caps" | "shading" | "border" | "outline" | "shadow" | "emboss" | "imprint" | "charScale" | "kerning" | "vanish" | "webHidden" | "specVanish" | "rtl" | "cs" | "bCs" | "iCs" | "eastAsianLayout" | "em" | "fitText" | "snapToGrid" | "lang" | "oMath" | "rStyle" | "rFonts" | "fontSizeCs" | "ligatures" | "numForm" | "numSpacing" | "stylisticSets" | "contextualAlternates"[]Inline properties to read. Defaults to every format.apply property.
view"effective" | "direct"'effective' (default) resolves the style cascade; 'direct' reads run-level formatting only.
inStoryLocatorStory scope. Defaults to document body when omitted. Use {kind:'story', storyType:'body'} for body, or other storyType values for headers, footers, footnotes, endnotes.
body
kind"story"requiredstoryType"body"requiredheaderFooterSlot
kind"story"requiredstoryType"headerFooterSlot"requiredsectionSectionAddressrequiredFields
kind"section"requiredsectionIdstringrequiredheaderFooterKind"header" | "footer"requiredvariant"default" | "first" | "even"requiredresolution"effective" | "explicit"onWrite"materializeIfInherited" | "editResolvedPart" | "error"headerFooterPart
kind"story"requiredstoryType"headerFooterPart"requiredrefIdstringrequiredfootnote
kind"story"requiredstoryType"footnote"requirednoteIdstringrequiredendnote
kind"story"requiredstoryType"endnote"requirednoteIdstringrequiredtextbox
kind"story"requiredstoryType"textbox"requiredtextboxIdstringrequiredref
refstringrequiredHandle ref string from a search result.
keys"bold" | "italic" | "strike" | "underline" | "highlight" | "color" | "fontSize" | "fontFamily" | "letterSpacing" | "vertAlign" | "position" | "dstrike" | "smallCaps" | "caps" | "shading" | "border" | "outline" | "shadow" | "emboss" | "imprint" | "charScale" | "kerning" | "vanish" | "webHidden" | "specVanish" | "rtl" | "cs" | "bCs" | "iCs" | "eastAsianLayout" | "em" | "fitText" | "snapToGrid" | "lang" | "oMath" | "rStyle" | "rFonts" | "fontSizeCs" | "ligatures" | "numForm" | "numSpacing" | "stylisticSets" | "contextualAlternates"[]Inline properties to read. Defaults to every format.apply property.
view"effective" | "direct"'effective' (default) resolves the style cascade; 'direct' reads run-level formatting only.
inStoryLocatorStory scope. Defaults to document body when omitted. Use {kind:'story', storyType:'body'} for body, or other storyType values for headers, footers, footnotes, endnotes.
body
kind"story"requiredstoryType"body"requiredheaderFooterSlot
kind"story"requiredstoryType"headerFooterSlot"requiredsectionSectionAddressrequiredFields
kind"section"requiredsectionIdstringrequiredheaderFooterKind"header" | "footer"requiredvariant"default" | "first" | "even"requiredresolution"effective" | "explicit"onWrite"materializeIfInherited" | "editResolvedPart" | "error"headerFooterPart
kind"story"requiredstoryType"headerFooterPart"requiredrefIdstringrequiredfootnote
kind"story"requiredstoryType"footnote"requirednoteIdstringrequiredendnote
kind"story"requiredstoryType"endnote"requirednoteIdstringrequiredtextbox
kind"story"requiredstoryType"textbox"requiredtextboxIdstringrequiredselection
selection"current"requiredRead the live editor selection, including pending caret formatting.
keys"bold" | "italic" | "strike" | "underline" | "highlight" | "color" | "fontSize" | "fontFamily" | "letterSpacing" | "vertAlign" | "position" | "dstrike" | "smallCaps" | "caps" | "shading" | "border" | "outline" | "shadow" | "emboss" | "imprint" | "charScale" | "kerning" | "vanish" | "webHidden" | "specVanish" | "rtl" | "cs" | "bCs" | "iCs" | "eastAsianLayout" | "em" | "fitText" | "snapToGrid" | "lang" | "oMath" | "rStyle" | "rFonts" | "fontSizeCs" | "ligatures" | "numForm" | "numSpacing" | "stylisticSets" | "contextualAlternates"[]Inline properties to read. Defaults to every format.apply property.
view"effective" | "direct"'effective' (default) resolves the style cascade; 'direct' reads run-level formatting only.
inStoryLocatorStory scope. Defaults to document body when omitted. Use {kind:'story', storyType:'body'} for body, or other storyType values for headers, footers, footnotes, endnotes.
body
kind"story"requiredstoryType"body"requiredheaderFooterSlot
kind"story"requiredstoryType"headerFooterSlot"requiredsectionSectionAddressrequiredFields
kind"section"requiredsectionIdstringrequiredheaderFooterKind"header" | "footer"requiredvariant"default" | "first" | "even"requiredresolution"effective" | "explicit"onWrite"materializeIfInherited" | "editResolvedPart" | "error"headerFooterPart
kind"story"requiredstoryType"headerFooterPart"requiredrefIdstringrequiredfootnote
kind"story"requiredstoryType"footnote"requirednoteIdstringrequiredendnote
kind"story"requiredstoryType"endnote"requirednoteIdstringrequiredtextbox
kind"story"requiredstoryType"textbox"requiredtextboxIdstringrequiredResult
The top-level fields are shown here. Use the raw schema artifact for the complete capability matrix.
Output fields
collapsedbooleanrequiredpendingAppliedbooleanpropertiesobjectrequiredFailures
Pre-apply throws
TARGET_NOT_FOUNDCAPABILITY_UNAVAILABLEINVALID_TARGET
7 more codes
INVALID_INPUTREVISION_MISMATCHSTORY_NOT_FOUNDSTORY_MISMATCHSTORY_NOT_SUPPORTEDCROSS_STORY_PLANMATERIALIZATION_FAILED
Raw schemas
Open the generated JSON artifact for the exact input, output, success, and failure schemas represented by this contract version.
View raw JSON schemas