The compiler error that I expected to see when using this function does not actually occur. The function body is capable of returning undefined, yet the type signature does not mention this possibility.
async function chat(_: at.ChatLine): Promise<Array<tot.PlayStateAction>> {
return lastMover?.chat(_);
}
tsconfig.json
{
"compilerOptions": {
"target": "es2019",
"module": "commonjs",
"outDir": "./lib",
"sourceMap": true,
"declaration": true,
"strict": true,
"incremental": true,
"esModuleInterop": true
},
"include": ["src"],
"exclude": ["**/node_modules", "**/.*/"]
}