-
Type: Build Failure
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
Sample of errors:
src/admin.ts(82,41): error TS2322: Type 'Callback<Document> | (CommandOperationOptions & Function)' is not assignable to type 'Callback<Document> | undefined'. src/admin.ts(106,41): error TS2322: Type 'Callback<Document> | (CommandOperationOptions & Function)' is not assignable to type 'Callback<Document> | undefined'. src/admin.ts(125,41): error TS2322: Type 'Callback<Document> | (CommandOperationOptions & Function)' is not assignable to type 'Callback<Document> | undefined'.
Typescript's next version appears to add an intersection with Function instead of narrowing our function argument overloading to Callback when we use typeof x === 'function'.
Update: This ticket was filed when TS 4.8 was in beta, this issue was resolved before the official release.