mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-12 19:59:02 +08:00
Using `?` in this situation would mean that you may, *or may not*, pass the `done` parameter to the callback. It does not mean that the callback can use it or not. You probably always pass the `done` parameter to the callback. See https://www.typescriptlang.org/docs/handbook/declaration-files/do-s-and-don-ts.html#optional-parameters-in-callbacks Having `?` here is annoying for the caller when they use --strictNullChecks because they have to use `!` (the non-null assertion) whenever they use `done` to tell the compiler that it actually will never be null.