Alpha: Document API is currently alpha and subject to breaking changes.
Summary
Set or clear thefitText inline run property on the target text range.
- Operation ID:
format.fitText - API member path:
editor.doc.format.fitText(...) - Mutates document:
yes - Idempotency:
conditional - Supports tracked mode:
no - Supports dry run:
yes - Deterministic target resolution:
yes
Expected result
Returns a TextMutationReceipt confirming the inline run property patch was applied to the target range.Input fields
| Field | Type | Required | Description | |
|---|---|---|---|---|
target | TextAddress | yes | TextAddress | |
target.blockId | string | yes | ||
target.kind | "text" | yes | Constant: "text" | |
target.range | Range | yes | Range | |
target.range.end | integer | yes | ||
target.range.start | integer | yes | ||
value | object \ | null | yes | One of: object, null |
Example request
Output fields
Variant 1 (resolution.requestedTarget.kind=“text”)
| Field | Type | Required | Description |
|---|---|---|---|
inserted | EntityAddress[] | no | |
removed | EntityAddress[] | no | |
resolution | TextMutationResolution | yes | TextMutationResolution |
resolution.range | TextMutationRange | yes | TextMutationRange |
resolution.range.from | integer | yes | |
resolution.range.to | integer | yes | |
resolution.requestedTarget | TextAddress | no | TextAddress |
resolution.requestedTarget.blockId | string | no | |
resolution.requestedTarget.kind | "text" | no | Constant: "text" |
resolution.requestedTarget.range | Range | no | Range |
resolution.requestedTarget.range.end | integer | no | |
resolution.requestedTarget.range.start | integer | no | |
resolution.target | TextAddress | yes | TextAddress |
resolution.target.blockId | string | yes | |
resolution.target.kind | "text" | yes | Constant: "text" |
resolution.target.range | Range | yes | Range |
resolution.target.range.end | integer | yes | |
resolution.target.range.start | integer | yes | |
resolution.text | string | yes | |
success | true | yes | Constant: true |
updated | EntityAddress[] | no |
Variant 2 (resolution.requestedTarget.kind=“text”)
| Field | Type | Required | Description |
|---|---|---|---|
failure | object | yes | |
failure.code | enum | yes | "INVALID_TARGET" |
failure.details | any | no | |
failure.message | string | yes | |
resolution | TextMutationResolution | yes | TextMutationResolution |
resolution.range | TextMutationRange | yes | TextMutationRange |
resolution.range.from | integer | yes | |
resolution.range.to | integer | yes | |
resolution.requestedTarget | TextAddress | no | TextAddress |
resolution.requestedTarget.blockId | string | no | |
resolution.requestedTarget.kind | "text" | no | Constant: "text" |
resolution.requestedTarget.range | Range | no | Range |
resolution.requestedTarget.range.end | integer | no | |
resolution.requestedTarget.range.start | integer | no | |
resolution.target | TextAddress | yes | TextAddress |
resolution.target.blockId | string | yes | |
resolution.target.kind | "text" | yes | Constant: "text" |
resolution.target.range | Range | yes | Range |
resolution.target.range.end | integer | yes | |
resolution.target.range.start | integer | yes | |
resolution.text | string | yes | |
success | false | yes | Constant: false |
Example response
Pre-apply throws
TARGET_NOT_FOUNDCAPABILITY_UNAVAILABLEINVALID_TARGETINVALID_INPUT
Non-applied failure codes
INVALID_TARGET
Raw schemas
Raw input schema
Raw input schema
Raw output schema
Raw output schema
Raw success schema
Raw success schema
Raw failure schema
Raw failure schema

