Problem Statement
Error-first callback typing:
Explanation
Classic Node style is error-first: the first arg is an error or null, and the second is the result. This matches many fs and net APIs.
Code Solution
SolutionRead Only
type NodeCallback<T> = (err: NodeJS.ErrnoException | null, result: T) => void;