Skip to content

API reference / Common / Engine types / TextDrawingCommand

Type Alias: TextDrawingCommand ​

ts
type TextDrawingCommand = 
  | {
  setPlacement: {
     placement: TextDrawingPlacement;
  };
}
  | {
  setExtents: {
     extents: ShapeExtents;
  };
}
  | {
  setWrapDistance: {
     distance: TextDrawingWrapDistance;
  };
}
  | {
  setLocks: {
     locks: ShapeGraphicFrameLocks;
  };
}
  | {
  editShape: {
     command: ShapeCommand;
  };
};

An edit intent for one TextDrawing — the w:drawing at a slot in a story.

A level of its own because a drawing is a wrapper with state, not a bare hole in the flow: how it meets the text, the box the line reserves for it, how far text keeps clear, and what it refuses all belong to the embedding rather than to the shape inside it. So this enum holds the wrapper's own edits and the descent into that shape, exactly as [ShapeCommand] holds a node's own SetShapeTransform beside its EditNode* descents.

One field per intent, rather than one command replacing the whole wrapper: the CRDT stores each on its own entry, so a peer's resize and a peer's wrap change merge instead of one clobbering the other — the reason [ShapeCommand::SetShapeTransform] writes only the placement leaf.

The drawing's character properties (w:rPr) are not here: a drawing is a span, so SetCharacterProperties over its slot already writes them. Neither is wp:effectExtent, which no gesture sets — we do not compute effect spread, so it is carried as written and nothing may invent a value for it.