mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-17 03:24:15 +08:00
Merge pull request #9853 from nielsboogaard/master
Added new type defintion for PDFObject
This commit is contained in:
25
pdfobject/pdfobject-tests.ts
Normal file
25
pdfobject/pdfobject-tests.ts
Normal 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
16
pdfobject/pdfobject.d.ts
vendored
Normal 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;
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user