There is no TypeScript definition for defineFunction and no custom functions can be created in TypeScript context using the approach demonstrated in this Custom functions article.
Try defining a new function using:
kendo.spreadsheet.defineFunction("Mask",mask).args(maskArgs)
The following error appears:
Propery "defineFunction" does not exist on type 'typeof spreadsheet'
There shouldn't be any errors