I had the same issue.
Yes, the documentation did not mention much except the keys [https://docs.sheetjs.com/docs/csf/sheet][1]
From the code in their [github][2] and after testing it as well:
ws['!protect']
requires an object.
The schema of the object is as follows(in typescript):
{
password?: string,
selectLockedCells?: boolean,
selectUnlockedCells?: boolean,
formatCells?: boolean,
formatColumns?: boolean,
formatRows?: boolean,
insertColumns?: boolean,
insertRows?: boolean,
insertHyperlinks?: boolean,
deleteColumns?: boolean,
deleteRows?: boolean,
sort?: boolean,
autoFilter?: boolean,
pivotTables?: boolean,
objects?: boolean,
scenarios?: boolean,
}
All keys are optional
[1]: https://docs.sheetjs.com/docs/csf/sheet
[2]: https://github.com/SheetJS/sheetjs/blob/5b4806bff01a9f4289b4c04e8a60a6c4c52fe93a/xlsx.js#L15292