Merge pull request #9853 from nielsboogaard/master

Added new type defintion for PDFObject
This commit is contained in:
Mohamed Hegazy
2016-06-28 00:46:27 -07:00
committed by GitHub
2 changed files with 41 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
/// <reference path="pdfobject.d.ts" />
import * as PDFObject from "pdfobject";
function test_embedding_with_url_only() {
var el:HTMLElement = PDFObject.embed("url");
}
function test_embedding_with_url_and_target() {
var el:HTMLElement = PDFObject.embed("url", ".css-selector");
}
function test_embedding_with_all_parameters() {
var el:HTMLElement = PDFObject.embed("url", ".css-selector", {
"height": "200px"
});
}
function test_pdf_object_version() {
var version:string = PDFObject.pdfobjectversion;
}
function test_supports_pdfs() {
var supportsPDFs:boolean = PDFObject.supportsPDFs;
}

16
pdfobject/pdfobject.d.ts vendored Normal file
View File

@@ -0,0 +1,16 @@
// Type definitions for PDFObject v2.0.201604172
// Project: https://github.com/pipwerks/PDFObject
// Definitions by: Niels Boogaard <http://github.com/nielsboogaard>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module "pdfobject" {
interface PDFObject {
embed(url:string, target?:any, options?:any): HTMLElement;
pdfobjectversion: string;
supportsPDFs: boolean;
}
var pdfObject: PDFObject;
export = pdfObject;
}