Handle mutating promise return types in PDF.js. (#9431)

This commit is contained in:
Matthew Wilton
2016-05-26 23:14:14 +09:00
committed by Masahiro Wakame
parent c851b46f11
commit f3fb377beb
2 changed files with 8 additions and 1 deletions
+7
View File
@@ -43,3 +43,10 @@ function goNext() {
renderPage(pageNum);
}
}
//
// Test PDFPromise allows return value mutation
//
var promise: PDFPromise<string> = PDFJS.getDocument('helloworld.pdf').then(pdf => {
return "arbitrary string";
});
+1 -1
View File
@@ -32,7 +32,7 @@ interface PDFPromise<T> {
isRejected(): boolean;
resolve(value: T): void;
reject(reason: string): void;
then(onResolve: (promise: T) => void, onReject?: (reason: string) => void): PDFPromise<T>;
then<U>(onResolve: (promise: T) => U, onReject?: (reason: string) => void): PDFPromise<U>;
}
interface PDFTreeNode {