mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-21 21:31:12 +08:00
21 lines
444 B
TypeScript
21 lines
444 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';
|
|
|
|
const promise = move('/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!
|
|
});
|