@vibrant/types
Advanced tools
Comparing version 3.0.0 to 3.1.0-0
@@ -1,15 +0,14 @@ | ||
/// <reference types="bluebird" /> | ||
import * as Bluebird from 'bluebird'; | ||
export interface Callback<T> { | ||
(err?: Error, result?: T): void; | ||
} | ||
export declare type Resolvable<T> = T | Bluebird<T>; | ||
export declare type Resolvable<T> = T | Promise<T>; | ||
export interface IndexedObject { | ||
[key: string]: any; | ||
} | ||
export interface DeferredBluebird<R> { | ||
resolve: (thenableOrResult: R | Bluebird.Thenable<R>) => void; | ||
export declare class Defer<R> { | ||
resolve: (thenableOrResult: R | Promise<R>) => void; | ||
reject: (error: any) => void; | ||
promise: Bluebird<R>; | ||
promise: Promise<R>; | ||
constructor(); | ||
} | ||
export declare function defer<R>(): DeferredBluebird<R>; | ||
export declare function defer<R>(): Defer<R>; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var Bluebird = require("bluebird"); | ||
var Defer = /** @class */ (function () { | ||
function Defer() { | ||
var _this = this; | ||
this.promise = new Promise(function (_resolve, _reject) { | ||
_this.resolve = _resolve; | ||
_this.reject = _reject; | ||
}); | ||
} | ||
return Defer; | ||
}()); | ||
exports.Defer = Defer; | ||
function defer() { | ||
var resolve; | ||
var reject; | ||
var promise = new Bluebird(function (_resolve, _reject) { | ||
resolve = _resolve; | ||
reject = _reject; | ||
}); | ||
return { resolve: resolve, reject: reject, promise: promise }; | ||
return new Defer(); | ||
} | ||
exports.defer = defer; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@vibrant/types", | ||
"version": "3.0.0", | ||
"version": "3.1.0-0", | ||
"description": "Common typings for vibrant", | ||
"scripts": { | ||
"build:module": "tsc", | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
@@ -11,10 +10,13 @@ }, | ||
"types": "lib/index.d.ts", | ||
"author": "", | ||
"license": "ISC", | ||
"dependencies": { | ||
"bluebird": "^3.5.1" | ||
"author": { | ||
"name": "akfish", | ||
"email": "akfish@gmail.com" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/akfish/node-vibrant/issues" | ||
}, | ||
"homepage": "https://github.com/akfish/node-vibrant", | ||
"license": "MIT", | ||
"devDependencies": { | ||
"@types/bluebird": "^3.5.18", | ||
"typescript": "latest" | ||
"typescript": "^3.2.2" | ||
}, | ||
@@ -21,0 +23,0 @@ "publishConfig": { |
@@ -1,27 +0,25 @@ | ||
import * as Bluebird from 'bluebird' | ||
export interface Callback<T> { | ||
(err?: Error, result?: T): void | ||
(err?: Error, result?: T): void | ||
} | ||
export type Resolvable<T> = T | Bluebird<T> | ||
export type Resolvable<T> = T | Promise<T> | ||
export interface IndexedObject { | ||
[key: string]: any | ||
[key: string]: any | ||
} | ||
export interface DeferredBluebird<R> { | ||
resolve: (thenableOrResult: R | Bluebird.Thenable<R>) => void | ||
reject: (error: any) => void | ||
promise: Bluebird<R> | ||
export class Defer<R> { | ||
resolve: (thenableOrResult: R | Promise<R>) => void | ||
reject: (error: any) => void | ||
promise: Promise<R> | ||
constructor () { | ||
this.promise = new Promise<R>((_resolve, _reject) => { | ||
this.resolve = _resolve | ||
this.reject = _reject | ||
}) | ||
} | ||
} | ||
export function defer<R>(): DeferredBluebird<R> { | ||
let resolve: (thenableOrResult: R | Bluebird.Thenable<R>) => void | ||
let reject: (error: any) => void | ||
let promise = new Bluebird<R>((_resolve, _reject) => { | ||
resolve = _resolve | ||
reject = _reject | ||
}) | ||
return { resolve, reject, promise } | ||
} | ||
export function defer<R> (): Defer<R> { | ||
return new Defer<R>() | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
No contributors or author data
MaintenancePackage does not specify a list of contributors or an author in package.json.
Found 1 instance in 1 package
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
0
1
0
2773
7
52
- Removedbluebird@^3.5.1
- Removedbluebird@3.7.2(transitive)