[ts] Allow skeleton.setAttachment to accept null as attachmentName.

This commit is contained in:
Davide Tantillo 2025-11-05 15:27:28 +01:00
parent 7f5502233f
commit 279e083baa

View File

@ -407,7 +407,7 @@ export class Skeleton {
/** A convenience method to set an attachment by finding the slot with {@link findSlot()}, finding the attachment with
* {@link getAttachment()}, then setting the slot's {@link Slot.attachment}.
* @param attachmentName May be null to clear the slot's attachment. */
setAttachment (slotName: string, attachmentName: string) {
setAttachment (slotName: string, attachmentName: string | null) {
if (!slotName) throw new Error("slotName cannot be null.");
const slot = this.findSlot(slotName);
if (!slot) throw new Error(`Slot not found: ${slotName}`);