Skip to content
Mog is in active development. The GitHub repo, SDK packages, and community channels are not yet available. Follow for launch updates

ws.objects

WorksheetObjectCollection

16 methods

get

Promise<FloatingObjectHandle | null>
get(id: string): Promise<FloatingObjectHandle | null>;
ParameterTypeRequired
idstringrequired

Get a floating object handle by ID. Returns null if not found.

getInfo

Promise<FloatingObjectInfo | null>
getInfo(id: string): Promise<FloatingObjectInfo | null>;
ParameterTypeRequired
idstringrequired

Get summary info (with spatial fields) for a floating object. Returns null if not found.

list

Promise<FloatingObjectHandle[]>
list(): Promise<FloatingObjectHandle[]>;

List all floating objects on the sheet.

deleteMany

Promise<number>
deleteMany(ids: string[]): Promise<number>;
ParameterTypeRequired
idsstring[]required

Delete multiple floating objects. Returns count of successfully deleted.

delete

Promise<boolean>
delete(id: string): Promise<boolean>;
ParameterTypeRequired
idstringrequired

Delete a single floating object by ID. Returns true if deleted.

bringToFront

Promise<void>
bringToFront(id: string): Promise<void>;
ParameterTypeRequired
idstringrequired

Bring a floating object to the front (highest z-order).

sendToBack

Promise<void>
sendToBack(id: string): Promise<void>;
ParameterTypeRequired
idstringrequired

Send a floating object to the back (lowest z-order).

bringForward

Promise<void>
bringForward(id: string): Promise<void>;
ParameterTypeRequired
idstringrequired

Bring a floating object forward by one layer.

sendBackward

Promise<void>
sendBackward(id: string): Promise<void>;
ParameterTypeRequired
idstringrequired

Send a floating object backward by one layer.

update

Promise<void>
update(objectId: string, updates: Record<string, unknown>): Promise<void>;
ParameterTypeRequired
objectIdstringrequired
updatesRecord<string, unknown>required

Update arbitrary properties of a floating object.

convertToWordArt

Promise<void>
convertToWordArt(objectId: string, presetId?: string): Promise<void>;
ParameterTypeRequired
objectIdstringrequired
presetIdstringoptional

Convert a text box to WordArt by applying WordArt styling.

convertToTextBox

Promise<void>
convertToTextBox(objectId: string): Promise<void>;
ParameterTypeRequired
objectIdstringrequired

Convert WordArt back to a regular text box by removing WordArt styling.

computeObjectBounds

Promise<ObjectBounds | null>
computeObjectBounds(objectId: string): Promise<ObjectBounds | null>;
ParameterTypeRequired
objectIdstringrequired

Compute pixel bounding box for a floating object (async — uses ComputeBridge).

computeAllObjectBounds

Promise<Map<string, ObjectBounds>>
computeAllObjectBounds(): Promise<Map<string, ObjectBounds>>;

Batch-compute pixel bounds for all floating objects on this sheet.

group

Promise<string>
group(ids: string[]): Promise<string>;
ParameterTypeRequired
idsstring[]required

Group multiple floating objects. Returns the group ID.

ungroup

Promise<void>
ungroup(groupId: string): Promise<void>;
ParameterTypeRequired
groupIdstringrequired

Ungroup a floating object group.