mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-23 21:00:01 +08:00
* Cleanup part of lint error "no-unnecessary-generics" * Cleanup lint error: adjacent-overload-signatures * Arguments Array to Iterable(Bluebird not support ArrayLike) * Delete already resolved TODO * [WIP] cleanup lint-errors: void-return * cleanup lint error: no-unnecessary-callback-wrapper * cleanup ignore lint error: no-void-expression * clean self * Enable noImplicitThis * Enable strictFunctionTypes * Fix error dependent on tsc version(tsc version: 20171024) * Cleanup lint error: void-return * Apply https://github.com/DefinitelyTyped/DefinitelyTyped/pull/20945#discussion_r146791411
23 lines
523 B
TypeScript
23 lines
523 B
TypeScript
import * as move from 'move-concurrently';
|
|
|
|
move('/path/to/thing', '/new/path/thing').then(() => {
|
|
// thing is now moved!
|
|
}).catch((err: any) => {
|
|
// oh no!
|
|
});
|
|
|
|
import * as Bluebird from 'bluebird';
|
|
|
|
// tsc version: 2.7.0-dev.20171024
|
|
// required type arguments!
|
|
const promise = move<Bluebird<void>>('/path/to/thing', '/new/path/thing', { Promise: Bluebird })
|
|
.then(() => {
|
|
// thing is now moved!
|
|
})
|
|
.error((err: any) => {
|
|
// this is a Bluebird promise!
|
|
})
|
|
.catch((err: any) => {
|
|
// oh no!
|
|
});
|