Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@types/pdfkit

Package Overview
Dependencies
Maintainers
1
Versions
48
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@types/pdfkit - npm Package Compare versions

Comparing version 0.7.36 to 0.10.0

124

pdfkit/index.d.ts

@@ -1,4 +0,5 @@

// Type definitions for Pdfkit v0.7.2
// Type definitions for Pdfkit v0.10.0
// Project: http://pdfkit.org
// Definitions by: Eric Hillah <https://github.com/erichillah>
// Erik Berreßem <https://github.com/she11sh0cked>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped

@@ -10,4 +11,4 @@

interface PDFGradient {
new(document: any): PDFGradient ;
stop(pos: number, color?: string|PDFKit.PDFGradient, opacity?: number): PDFGradient;
new (document: any): PDFGradient;
stop(pos: number, color?: string | PDFKit.PDFGradient, opacity?: number): PDFGradient;
embed(): void;

@@ -18,3 +19,3 @@ apply(): void;

interface PDFLinearGradient extends PDFGradient {
new(document: any, x1: number, y1: number, x2: number, y2: number): PDFLinearGradient;
new (document: any, x1: number, y1: number, x2: number, y2: number): PDFLinearGradient;
shader(fn: () => any): any;

@@ -25,3 +26,3 @@ opacityGradient(): PDFLinearGradient;

interface PDFRadialGradient extends PDFGradient {
new(document: any, x1: number, y1: number, x2: number, y2: number): PDFRadialGradient;
new (document: any, x1: number, y1: number, x2: number, y2: number): PDFRadialGradient;
shader(fn: () => any): any;

@@ -33,3 +34,2 @@ opacityGradient(): PDFRadialGradient;

declare namespace PDFKit.Mixins {
interface AnnotationOption {

@@ -55,2 +55,3 @@ Type?: string;

note(x: number, y: number, w: number, h: number, content: string, option?: AnnotationOption): TDocument;
goTo(x: number, y: number, w: number, h: number, name: string, options?: AnnotationOption): TDocument;
link(x: number, y: number, w: number, h: number, url: string, option?: AnnotationOption): TDocument;

@@ -71,3 +72,3 @@ highlight(x: number, y: number, w: number, h: number, option?: AnnotationOption): TDocument;

// The winding / filling rule accepted by PDFKit:
type RuleValue = "even-odd" | "evenodd" | "non-zero" | "nonzero";
type RuleValue = 'even-odd' | 'evenodd' | 'non-zero' | 'nonzero';

@@ -98,3 +99,9 @@ interface PDFColor<TDocument> {

/** Two elements array specifying dimensions(w,h) */
fit?: number[];
fit?: [number, number];
cover?: [number, number];
align?: 'center' | 'right';
valign?: 'center' | 'bottom';
link?: AnnotationOption;
goTo?: AnnotationOption;
destination?: string;
}

@@ -118,3 +125,3 @@

/** The character to display at the end of the text when it is too long. Set to true to use the default character. */
ellipsis?: boolean|string;
ellipsis?: boolean | string;
/** the number of columns to flow the text into */

@@ -148,3 +155,4 @@ columns?: number;

/** the alignment of the text (center, justify, left, right) */
align?: string;
//TODO check this
align?: 'center' | 'justify' | 'left' | 'right' | string;
}

@@ -160,8 +168,7 @@

heightOfString(text: string, options?: TextOptions): number;
list(list: Array<string|any>, x?: number, y?: number, options?: TextOptions): TDocument;
list(list: Array<string|any>, options?: TextOptions): TDocument;
list(list: Array<string | any>, x?: number, y?: number, options?: TextOptions): TDocument;
list(list: Array<string | any>, options?: TextOptions): TDocument;
}
interface PDFVector<TDocument> {
save(): TDocument;

@@ -202,4 +209,4 @@ restore(): TDocument;

/**
* PDFKit data
*/
* PDFKit data
*/
interface PDFData {

@@ -235,3 +242,3 @@ new (data: any[]): PDFData;

declare module "pdfkit/js/data" {
declare module 'pdfkit/js/data' {
var PDFKitData: PDFKit.PDFData;

@@ -256,6 +263,6 @@ export = PDFKitData;

autoFirstPage?: boolean;
size?: number[]|string;
size?: number[] | string;
margin?: number;
margins?: { top: number; left: number; bottom: number; right: number };
layout?: "portrait" | "landscape";
layout?: 'portrait' | 'landscape';

@@ -265,24 +272,29 @@ bufferPages?: boolean;

interface PDFDocument extends NodeJS.ReadableStream,
Mixins.PDFAnnotation<PDFDocument>, Mixins.PDFColor<PDFDocument>, Mixins.PDFImage<PDFDocument>,
Mixins.PDFText<PDFDocument>, Mixins.PDFVector<PDFDocument>, Mixins.PDFFont<PDFDocument> {
interface PDFDocument
extends NodeJS.ReadableStream,
Mixins.PDFAnnotation<PDFDocument>,
Mixins.PDFColor<PDFDocument>,
Mixins.PDFImage<PDFDocument>,
Mixins.PDFText<PDFDocument>,
Mixins.PDFVector<PDFDocument>,
Mixins.PDFFont<PDFDocument> {
/**
* PDF Version
*/
* PDF Version
*/
version: number;
/**
* Wheter streams should be compressed
*/
* Wheter streams should be compressed
*/
compress: boolean;
/**
* PDF document Metadata
*/
* PDF document Metadata
*/
info: DocumentInfo;
/**
* Options for the document
*/
* Options for the document
*/
options: PDFDocumentOptions;
/**
* Represent the current page.
*/
* Represent the current page.
*/
page: PDFPage;

@@ -300,10 +312,10 @@

ref(data: {}): PDFKitReference;
addContent(data: any): PDFDocument
addContent(data: any): PDFDocument;
/**
* Deprecated
*/
* Deprecated
*/
write(fileName: string, fn: any): void;
/**
* Deprecated. Throws exception
*/
* Deprecated. Throws exception
*/
output(fn: any): void;

@@ -315,3 +327,3 @@ end(): void;

declare module "pdfkit" {
declare module 'pdfkit' {
var doc: PDFKit.PDFDocument;

@@ -321,8 +333,8 @@ export = doc;

declare module "pdfkit/js/gradient" {
var gradient : {
declare module 'pdfkit/js/gradient' {
var gradient: {
PDFGradient: PDFKit.PDFGradient;
PDFLinearGradient: PDFKit.PDFLinearGradient;
PDFRadialGradiant: PDFKit.PDFRadialGradient;
}
};

@@ -334,4 +346,4 @@ export = gradient;

/**
* Represent a single page in the PDF document
*/
* Represent a single page in the PDF document
*/
interface PDFPage {

@@ -346,5 +358,5 @@ size: string;

/**
* The page dictionnary
*/
/**
* The page dictionnary
*/
dictionary: PDFKitReference;

@@ -364,6 +376,6 @@

declare module "pdfkit/js/page" {
var PDFKitPage: PDFKit.PDFPage
declare module 'pdfkit/js/page' {
var PDFKitPage: PDFKit.PDFPage;
export = PDFKitPage
export = PDFKitPage;
}

@@ -376,3 +388,3 @@

gen: number;
deflate:any;
deflate: any;
compress: boolean;

@@ -393,3 +405,3 @@ uncompressedLength: number;

declare module "pdfkit/js/reference" {
declare module 'pdfkit/js/reference' {
var PDFKitReference: PDFKit.PDFKitReference;

@@ -400,3 +412,3 @@

declare module "pdfkit/js/mixins/annotations" {
declare module 'pdfkit/js/mixins/annotations' {
var PDFKitAnnotation: PDFKit.Mixins.PDFAnnotation<void>;

@@ -406,3 +418,3 @@ export = PDFKitAnnotation;

declare module "pdfkit/js/mixins/color" {
declare module 'pdfkit/js/mixins/color' {
var PDFKitColor: PDFKit.Mixins.PDFColor<void>;

@@ -412,3 +424,3 @@ export = PDFKitColor;

declare module "pdfkit/js/mixins/fonts" {
declare module 'pdfkit/js/mixins/fonts' {
var PDFKitFont: PDFKit.Mixins.PDFFont<void>;

@@ -418,3 +430,3 @@ export = PDFKitFont;

declare module "pdfkit/js/mixins/images" {
declare module 'pdfkit/js/mixins/images' {
var PDFKitImage: PDFKit.Mixins.PDFImage<void>;

@@ -424,3 +436,3 @@ export = PDFKitImage;

declare module "pdfkit/js/mixins/text" {
declare module 'pdfkit/js/mixins/text' {
var PDFKitText: PDFKit.Mixins.PDFText<void>;

@@ -430,5 +442,5 @@ export = PDFKitText;

declare module "pdfkit/js/mixins/vector" {
declare module 'pdfkit/js/mixins/vector' {
var PDFKitVector: PDFKit.Mixins.PDFVector<void>;
export = PDFKitVector;
}
{
"name": "@types/pdfkit",
"version": "0.7.36",
"version": "0.10.0",
"description": "TypeScript definitions for Pdfkit",

@@ -11,8 +11,15 @@ "license": "MIT",

"githubUsername": "erichillah"
},
{
"name": "Erik Berreßem",
"url": "https://github.com/she11sh0cked",
"githubUsername": "she11sh0cked"
}
],
"main": "",
"types": "index",
"repository": {
"type": "git",
"url": "https://www.github.com/DefinitelyTyped/DefinitelyTyped.git"
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
"directory": "types/pdfkit"
},

@@ -23,4 +30,4 @@ "scripts": {},

},
"typesPublisherContentHash": "7a5fe68390494365dceb018ed5a3a00dbb4cf95f929247d659eaa57e8281e465",
"typesPublisherContentHash": "cf979384581198142e7120e8f984963ecc8c4074d0f4844c2a80bac9c1e8928d",
"typeScriptVersion": "2.0"
}

@@ -8,10 +8,10 @@ # Installation

# Details
Files were exported from https://www.github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/pdfkit
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/pdfkit
Additional Details
* Last updated: Tue, 03 Oct 2017 13:52:13 GMT
* Dependencies: node
* Last updated: Mon, 22 Jul 2019 19:52:32 GMT
* Dependencies: @types/node
* Global values: PDFKit
# Credits
These definitions were written by Eric Hillah <https://github.com/erichillah>.
These definitions were written by Eric Hillah <https://github.com/erichillah>, and Erik Berreßem <https://github.com/she11sh0cked>.
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc