I have a TypeScript function that looks like this:
set parameter(value: string) {
this._paremeter = value;
}
It works perfectly fine. For the sake of completeness, I tried to add a type that specifies this function does not return anything. I experimented with different types but none seem to work:
set parameter(vale: string): void {}
set parameter(vale: string): never {}
I also tested these just to be thorough, but unsurprisingly, they didn't work either:
set parameter(vale: string): undefined {}
set parameter(vale: string): null {}
Is there a correct type for this or should a set
function simply have no type at all?