Setting the Index Buffer with an Attribute Array

This code doesn’t work

const indexBuffer = TSL.attributeArray(6, 'uint');
geometry.setIndex(indexBuffer.value);

But this code does

const positionBuffer = TSL.attributeArray(4, 'vec3');
geometry.setAttribute( 'position', positionBuffer.value);

How could I get the setIndex() working also and accepting the attribute Array?

I have done testing further testing
This even works but u have to define full vertices meaning 6 per face.

const positionBuffer = TSL.attributeArray(36, 'vec3');
const normalBuffer = TSL.attributeArray(36, 'vec3');
geometry.setAttribute('position', positionBuffer.value);
geometry.setAttribute('normal', normalBuffer.value);

Its so close to what I need but I would like to be able to use the setIndex() like setAttribute().