diff --git a/types/co/co-tests.ts b/types/co/co-tests.ts index b610b280aa..7348f77394 100644 --- a/types/co/co-tests.ts +++ b/types/co/co-tests.ts @@ -1,21 +1,21 @@ import co = require('co'); -function* gen(num: number, str: string, arr: number[], obj: object, fun: () => void){ +function* gen(num: number, str: string, arr: number[], obj: object, fun: () => void) { return num; } -co(gen, 42, 'forty-two', [42], { value: 42 }, function () {}) +co(gen, 42, 'forty-two', [42], { value: 42 }, () => {}) .then((num: number) => {}, (err: Error) => {}) .catch((err: Error) => {}); -co.default(gen, 42, 'forty-two', [42], { value: 42 }, function () {}) +co.default(gen, 42, 'forty-two', [42], { value: 42 }, () => {}) .then((num: number) => {}, (err: Error) => {}) .catch((err: Error) => {}); -co.co(gen, 42, 'forty-two', [42], { value: 42 }, function () {}) +co.co(gen, 42, 'forty-two', [42], { value: 42 }, () => {}) .then((num: number) => {}, (err: Error) => {}) .catch((err: Error) => {}); -co.wrap(gen)(42, 'forty-two', [42], { value: 42 }, function () {}) +co.wrap(gen)(42, 'forty-two', [42], { value: 42 }, () => {}) .then((num: number) => {}, (err: Error) => {}) .catch((err: Error) => {}); diff --git a/types/co/index.d.ts b/types/co/index.d.ts index 0be8976a5f..59fafd2495 100644 --- a/types/co/index.d.ts +++ b/types/co/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/tj/co#readme // Definitions by: My Self // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 3.1 type ExtractType = T extends IterableIterator ? R : never;