-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: Switch to promises-a-plus for cache promise definition
- Loading branch information
1 parent
5651467
commit 6bc3587
Showing
5 changed files
with
25 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
export interface Cache { | ||
set<T>(key: string, value: T): void; | ||
get<T>(key: string): Thenable<T>; | ||
get<T>(key: string): PromisesAPlus.Thenable<T>; | ||
clear(key: string): void; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
export interface Cache { | ||
set<T>(key: string, value: T): void; | ||
get<T>(key: string): Thenable<T>; | ||
get<T>(key: string): PromisesAPlus.Thenable<T>; | ||
clear(key: string): void | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// Generated by typings | ||
// Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/7de6c3dd94feaeb21f20054b9f30d5dabc5efabd/promises-a-plus/promises-a-plus.d.ts | ||
// Type definitions for promises-a-plus | ||
// Project: http://promisesaplus.com/ | ||
// Definitions by: Igor Oleinikov <https://github.com/Igorbek> | ||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped | ||
|
||
declare namespace PromisesAPlus { | ||
interface PromiseCtor { | ||
<T>(resolver: (resolvePromise: (value: T) => void, rejectPromise: (reason: any) => void) => void): Thenable<T>; | ||
} | ||
|
||
interface PromiseImpl { | ||
new <T>(resolver: (resolvePromise: (value: T) => void, rejectPromise: (reason: any) => void) => void): Thenable<T>; | ||
} | ||
|
||
interface Thenable<T> { | ||
then<R>(onFulfill?: (value: T) => Thenable<R>|R, onReject?: (error: any) => Thenable<R>|R): Thenable<R>; | ||
} | ||
} |