Skip to content

Commit

Permalink
♻️ refactor(lib/pdf): Abstract pdfjs-dist usage completely.
Browse files Browse the repository at this point in the history
  • Loading branch information
make-github-pseudonymous-again committed May 11, 2024
1 parent a1ecaef commit 377dde0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 3 additions & 0 deletions imports/lib/pdf/pdf.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import {type DocumentInitParameters} from 'pdfjs-dist/types/src/display/api';

export {type DocumentInitParameters} from 'pdfjs-dist/types/src/display/api';
export {type PageViewport} from 'pdfjs-dist/types/src/display/display_utils';

export const WORKER_URL = Meteor.isClient
? '/pdfjs-dist/build/pdf.worker.min.js'
: 'pdfjs-dist/legacy/build/pdf.worker.js';
Expand Down
4 changes: 1 addition & 3 deletions imports/lib/pdf/pdfthumbnails.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,10 @@ import {
type PngConfig,
} from 'canvas/types';
import addDays from 'date-fns/addDays';
import {type DocumentInitParameters} from 'pdfjs-dist/types/src/display/api';
import {type PageViewport} from 'pdfjs-dist/types/src/display/display_utils';

import {cache as lru, type IndexedDBPersistedLRUCache} from '../cache/lru';

import {fetchPDF} from './pdf';
import {type DocumentInitParameters, type PageViewport, fetchPDF} from './pdf';

let cache: IndexedDBPersistedLRUCache<string, string>;
if (Meteor.isClient) {
Expand Down

0 comments on commit 377dde0

Please sign in to comment.