Linking cels via script

How do I create linked cels/make cels continuous using a Lua script?

I know that app.command.LinkCels exists, but that would require me to modify the user’s selection, and is clunky.

I’m looking for something akin to sprite:newLinkedCel(layer, frame, oldCel) or the like (that’s just an example function; it doesn’t exist).

Does the API have this?