@qiwi/substrate-types
Advanced tools
Comparing version
@@ -0,1 +1,8 @@ | ||
# [@qiwi/substrate-types-v1.11.2](https://github.com/qiwi/substrate/compare/v1.11.1...v1.11.2) (2019-05-17) | ||
### Bug Fixes | ||
* **IPromise:** handle TS1055 error ([1619fb8](https://github.com/qiwi/substrate/commit/1619fb8)) | ||
# [@qiwi/substrate-types-v1.11.1](https://github.com/qiwi/substrate/compare/v1.11.0...v1.11.1) (2019-05-17) | ||
@@ -2,0 +9,0 @@ |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var IPromise_1 = require("./IPromise"); | ||
exports.IPromise = IPromise_1.IPromise; | ||
//# sourceMappingURL=index.js.map |
@@ -1,10 +0,14 @@ | ||
import * as Bluebird from 'bluebird'; | ||
export declare type IPromise<T> = Bluebird<T> | Promise<T>; | ||
export declare type TPromiseExecutor<TValue = any, TReason = any> = (resolve: (value: TValue) => void, reject: (reason: TReason) => void) => void; | ||
export interface IPromiseConstructor<TValue = any, TReason = any> { | ||
new (executor: TPromiseExecutor<TValue>): IPromise<TValue>; | ||
all: (values: Array<IPromise<TValue>>) => IPromise<TValue[]>; | ||
race: (values: Array<IPromise<TValue>>) => IPromise<TValue>; | ||
reject: (reason?: TReason) => IPromise<TValue>; | ||
resolve: (value?: TValue) => IPromise<TValue>; | ||
new (executor: TPromiseExecutor<TValue>): IPromise<TValue, TReason>; | ||
all: (values: Array<IPromise<TValue, TReason>>) => IPromise<TValue[], TReason>; | ||
race: (values: Array<IPromise<TValue, TReason>>) => IPromise<TValue, TReason>; | ||
reject: (reason?: TReason) => IPromise<TValue, TReason>; | ||
resolve: (value?: TValue) => IPromise<TValue, TReason>; | ||
} | ||
export interface IPromise<TValue = any, TReason = any> { | ||
then: (onSuccess?: (value: TValue) => any, onReject?: (reason: TReason) => any) => IPromise; | ||
catch: (onReject: (reason: TReason) => any) => IPromise; | ||
finally?: (onFinally: () => any) => IPromise; | ||
} | ||
export declare const IPromise: PromiseConstructor; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
// https://stackoverflow.com/questions/45902881/ts1055-when-using-async-await-using-a-type-alias | ||
exports.IPromise = Promise; | ||
//# sourceMappingURL=IPromise.js.map |
@@ -0,1 +1,2 @@ | ||
export { IPromise } from './IPromise'; | ||
//# sourceMappingURL=index.js.map |
@@ -1,10 +0,14 @@ | ||
import * as Bluebird from 'bluebird'; | ||
export declare type IPromise<T> = Bluebird<T> | Promise<T>; | ||
export declare type TPromiseExecutor<TValue = any, TReason = any> = (resolve: (value: TValue) => void, reject: (reason: TReason) => void) => void; | ||
export interface IPromiseConstructor<TValue = any, TReason = any> { | ||
new (executor: TPromiseExecutor<TValue>): IPromise<TValue>; | ||
all: (values: Array<IPromise<TValue>>) => IPromise<TValue[]>; | ||
race: (values: Array<IPromise<TValue>>) => IPromise<TValue>; | ||
reject: (reason?: TReason) => IPromise<TValue>; | ||
resolve: (value?: TValue) => IPromise<TValue>; | ||
new (executor: TPromiseExecutor<TValue>): IPromise<TValue, TReason>; | ||
all: (values: Array<IPromise<TValue, TReason>>) => IPromise<TValue[], TReason>; | ||
race: (values: Array<IPromise<TValue, TReason>>) => IPromise<TValue, TReason>; | ||
reject: (reason?: TReason) => IPromise<TValue, TReason>; | ||
resolve: (value?: TValue) => IPromise<TValue, TReason>; | ||
} | ||
export interface IPromise<TValue = any, TReason = any> { | ||
then: (onSuccess?: (value: TValue) => any, onReject?: (reason: TReason) => any) => IPromise; | ||
catch: (onReject: (reason: TReason) => any) => IPromise; | ||
finally?: (onFinally: () => any) => IPromise; | ||
} | ||
export declare const IPromise: PromiseConstructor; |
@@ -0,1 +1,3 @@ | ||
// https://stackoverflow.com/questions/45902881/ts1055-when-using-async-await-using-a-type-alias | ||
export const IPromise = Promise; | ||
//# sourceMappingURL=IPromise.js.map |
@@ -1,13 +0,18 @@ | ||
import * as Bluebird from 'bluebird' | ||
export type IPromise<T> = Bluebird<T> | Promise<T> | ||
export type TPromiseExecutor<TValue = any, TReason = any> = (resolve: (value: TValue) => void, reject: (reason: TReason) => void) => void | ||
export interface IPromiseConstructor<TValue = any, TReason = any> { | ||
new(executor: TPromiseExecutor<TValue>): IPromise<TValue> | ||
all: (values: Array<IPromise<TValue>>) => IPromise<TValue[]> | ||
race: (values: Array<IPromise<TValue>>) => IPromise<TValue> | ||
reject: (reason?: TReason) => IPromise<TValue> | ||
resolve: (value?: TValue) => IPromise<TValue> | ||
new(executor: TPromiseExecutor<TValue>): IPromise<TValue, TReason> | ||
all: (values: Array<IPromise<TValue, TReason>>) => IPromise<TValue[], TReason> | ||
race: (values: Array<IPromise<TValue, TReason>>) => IPromise<TValue, TReason> | ||
reject: (reason?: TReason) => IPromise<TValue, TReason> | ||
resolve: (value?: TValue) => IPromise<TValue, TReason> | ||
} | ||
export interface IPromise<TValue = any, TReason = any> { | ||
then: (onSuccess?: (value: TValue) => any, onReject?: (reason: TReason) => any) => IPromise | ||
catch: (onReject: (reason: TReason) => any) => IPromise | ||
finally?: (onFinally: () => any) => IPromise | ||
} | ||
// https://stackoverflow.com/questions/45902881/ts1055-when-using-async-await-using-a-type-alias | ||
export const IPromise = Promise |
{ | ||
"name": "@qiwi/substrate-types", | ||
"version": "1.11.1", | ||
"version": "1.11.2", | ||
"main": "lib/es5/index.js", | ||
@@ -5,0 +5,0 @@ "types": "typings/index.d.ts", |
@@ -50,12 +50,16 @@ declare module '@qiwi/substrate-types/lib/es5/IAnyMap' { | ||
declare module '@qiwi/substrate-types/lib/es5/IPromise' { | ||
import * as Bluebird from '@qiwi/substrate-types/lib/es5/bluebird'; | ||
type IPromise<T> = Bluebird<T> | Promise<T>; | ||
type TPromiseExecutor<TValue = any, TReason = any> = (resolve: (value: TValue) => void, reject: (reason: TReason) => void) => void; | ||
interface IPromiseConstructor<TValue = any, TReason = any> { | ||
new (executor: TPromiseExecutor<TValue>): IPromise<TValue>; | ||
all: (values: Array<IPromise<TValue>>) => IPromise<TValue[]>; | ||
race: (values: Array<IPromise<TValue>>) => IPromise<TValue>; | ||
reject: (reason?: TReason) => IPromise<TValue>; | ||
resolve: (value?: TValue) => IPromise<TValue>; | ||
new (executor: TPromiseExecutor<TValue>): IPromise<TValue, TReason>; | ||
all: (values: Array<IPromise<TValue, TReason>>) => IPromise<TValue[], TReason>; | ||
race: (values: Array<IPromise<TValue, TReason>>) => IPromise<TValue, TReason>; | ||
reject: (reason?: TReason) => IPromise<TValue, TReason>; | ||
resolve: (value?: TValue) => IPromise<TValue, TReason>; | ||
} | ||
interface IPromise<TValue = any, TReason = any> { | ||
then: (onSuccess?: (value: TValue) => any, onReject?: (reason: TReason) => any) => IPromise; | ||
catch: (onReject: (reason: TReason) => any) => IPromise; | ||
finally?: (onFinally: () => any) => IPromise; | ||
} | ||
const IPromise: PromiseConstructor; | ||
} | ||
@@ -62,0 +66,0 @@ declare module '@qiwi/substrate-types/lib/es5/IStorage' { |
@@ -62,5 +62,2 @@ /** | ||
declare module "@qiwi/substrate-types/lib/es5/IPromise" { | ||
import typeof * as Bluebird from "@qiwi/substrate-types/lib/es5/bluebird"; | ||
declare type IPromise<T> = Bluebird<T> | Promise<T>; | ||
declare type TPromiseExecutor<TValue = any, TReason = any> = ( | ||
@@ -71,8 +68,21 @@ resolve: (value: TValue) => void, | ||
declare interface IPromiseConstructor<TValue = any, TReason = any> { | ||
new(executor: TPromiseExecutor<TValue>): IPromise<TValue>; | ||
all: (values: Array<IPromise<TValue>>) => IPromise<TValue[]>; | ||
race: (values: Array<IPromise<TValue>>) => IPromise<TValue>; | ||
reject: (reason?: TReason) => IPromise<TValue>; | ||
resolve: (value?: TValue) => IPromise<TValue>; | ||
new(executor: TPromiseExecutor<TValue>): IPromise<TValue, TReason>; | ||
all: ( | ||
values: Array<IPromise<TValue, TReason>> | ||
) => IPromise<TValue[], TReason>; | ||
race: ( | ||
values: Array<IPromise<TValue, TReason>> | ||
) => IPromise<TValue, TReason>; | ||
reject: (reason?: TReason) => IPromise<TValue, TReason>; | ||
resolve: (value?: TValue) => IPromise<TValue, TReason>; | ||
} | ||
declare interface IPromise<TValue = any, TReason = any> { | ||
then: ( | ||
onSuccess?: (value: TValue) => any, | ||
onReject?: (reason: TReason) => any | ||
) => IPromise<>; | ||
catch: (onReject: (reason: TReason) => any) => IPromise<>; | ||
finally?: (onFinally: () => any) => IPromise<>; | ||
} | ||
declare var IPromise: PromiseConstructor; | ||
} | ||
@@ -79,0 +89,0 @@ declare module "@qiwi/substrate-types/lib/es5/IStorage" { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
35609
6.72%626
5.92%