Typing the Err generic of Result to be empty

Sorry if this is a basic Typescript question! Is it possible to type a function's output so that I can return Result.err() without any parameters? f.e.
function myFunction(): Result<true, ???> {
if (condition)
return Result.ok(true)
else
return Result.err()
}
function myFunction(): Result<true, ???> {
if (condition)
return Result.ok(true)
else
return Result.err()
}
2 Replies
piemot
piemot•2y ago
thanks 💜