Skip to content

Commit

Permalink
#200 Exported PDFDocumentProxy, PDFProgressData and other types
Browse files Browse the repository at this point in the history
  • Loading branch information
VadimDez committed Jan 5, 2018
1 parent dec6392 commit 71e77b9
Show file tree
Hide file tree
Showing 10 changed files with 16 additions and 20 deletions.
2 changes: 1 addition & 1 deletion build/app/app.component.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion build/app/app.component.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion build/pdf-viewer/index.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 1 addition & 4 deletions build/pdf-viewer/pdf-viewer.component.d.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
/// <reference types="pdfjs-dist" />
import { ElementRef, EventEmitter, OnChanges, SimpleChanges, OnInit } from '@angular/core';
import { PDFJSStatic, PDFDocumentProxy, PDFSource, PDFProgressData } from 'pdfjs-dist';
declare global {
const PDFJS: PDFJSStatic;
}
import { PDFDocumentProxy, PDFSource, PDFProgressData } from 'pdfjs-dist';
export declare class PdfViewerComponent implements OnChanges, OnInit {
private element;
static CSS_UNITS: number;
Expand Down
2 changes: 1 addition & 1 deletion build/pdf-viewer/pdf-viewer.component.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/index.metadata.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[{"__symbolic":"module","version":3,"metadata":{"PdfViewerModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule"},"arguments":[{"declarations":[{"__symbolic":"reference","module":"./pdf-viewer.component","name":"PdfViewerComponent"}],"exports":[{"__symbolic":"reference","module":"./pdf-viewer.component","name":"PdfViewerComponent"}]}]}]}}},{"__symbolic":"module","version":1,"metadata":{"PdfViewerModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule"},"arguments":[{"declarations":[{"__symbolic":"reference","module":"./pdf-viewer.component","name":"PdfViewerComponent"}],"exports":[{"__symbolic":"reference","module":"./pdf-viewer.component","name":"PdfViewerComponent"}]}]}]}}}]
[{"__symbolic":"module","version":3,"metadata":{"PdfViewerModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule"},"arguments":[{"declarations":[{"__symbolic":"reference","module":"./pdf-viewer.component","name":"PdfViewerComponent"}],"exports":[{"__symbolic":"reference","module":"./pdf-viewer.component","name":"PdfViewerComponent"}]}]}]}},"exports":[{"from":"pdfjs-dist","export":["PDFJSStatic","PDFDocumentProxy","PDFViewerParams","PDFPageProxy","PDFSource","PDFProgressData","PDFPromise"]}]},{"__symbolic":"module","version":1,"metadata":{"PdfViewerModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule"},"arguments":[{"declarations":[{"__symbolic":"reference","module":"./pdf-viewer.component","name":"PdfViewerComponent"}],"exports":[{"__symbolic":"reference","module":"./pdf-viewer.component","name":"PdfViewerComponent"}]}]}]}},"exports":[{"from":"pdfjs-dist","export":["PDFJSStatic","PDFDocumentProxy","PDFViewerParams","PDFPageProxy","PDFSource","PDFProgressData","PDFPromise"]}]}]
5 changes: 1 addition & 4 deletions dist/pdf-viewer.component.d.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
/// <reference types="pdfjs-dist" />
import { ElementRef, EventEmitter, OnChanges, SimpleChanges, OnInit } from '@angular/core';
import { PDFJSStatic, PDFDocumentProxy, PDFSource, PDFProgressData } from 'pdfjs-dist';
declare global {
const PDFJS: PDFJSStatic;
}
import { PDFDocumentProxy, PDFSource, PDFProgressData } from 'pdfjs-dist';
export declare class PdfViewerComponent implements OnChanges, OnInit {
private element;
static CSS_UNITS: number;
Expand Down
2 changes: 1 addition & 1 deletion src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export class AppComponent {
* Set custom path to pdf worker
*/
setCustomWorkerPath() {
PDFJS.workerSrc = '/lib/pdfjs-dist/build/pdf.worker.js';
(<any>window).PDFJS.workerSrc = '/lib/pdfjs-dist/build/pdf.worker.js';
}

incrementPage(amount: number) {
Expand Down
7 changes: 7 additions & 0 deletions src/pdf-viewer/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@
import { NgModule } from '@angular/core';

import { PdfViewerComponent } from './pdf-viewer.component';
import { PDFJSStatic } from "pdfjs-dist";

declare global {
const PDFJS: PDFJSStatic;
}

export { PDFJSStatic, PDFDocumentProxy, PDFViewerParams, PDFPageProxy, PDFSource, PDFProgressData, PDFPromise } from 'pdfjs-dist';

@NgModule({
declarations: [PdfViewerComponent],
Expand Down
7 changes: 1 addition & 6 deletions src/pdf-viewer/pdf-viewer.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,7 @@
import {
Component, Input, Output, ElementRef, EventEmitter, OnChanges, SimpleChanges, OnInit, HostListener
} from '@angular/core';
import { PDFJSStatic, PDFDocumentProxy, PDFViewerParams, PDFPageProxy, PDFSource, PDFProgressData, PDFPromise } from 'pdfjs-dist';

declare global {
const PDFJS: PDFJSStatic;
}
import { PDFDocumentProxy, PDFViewerParams, PDFPageProxy, PDFSource, PDFProgressData, PDFPromise } from 'pdfjs-dist';

function isSSR() {
return typeof window === 'undefined';
Expand All @@ -22,7 +18,6 @@ if (!isSSR()) {
PDFJS.verbosity = (<any>PDFJS).VERBOSITY_LEVELS.errors;
}


@Component({
selector: 'pdf-viewer',
template: `<div class="ng2-pdf-viewer-container"><div class="pdfViewer"></div></div>`,
Expand Down

0 comments on commit 71e77b9

Please sign in to comment.