Fix: file extenstions in imports

This commit is contained in:
Felix Kaspar 2024-02-23 23:55:29 +01:00
parent 644e0ceae9
commit 20f027bb5a
13 changed files with 25 additions and 24 deletions

View File

@ -1,6 +1,6 @@
import { PdfFile } from "../../wrappers/PdfFile"; import { PdfFile } from "../../wrappers/PdfFile";
import { PDFPageProxy } from "pdfjs-dist/types/src/display/api.js"; import { PDFPageProxy } from "pdfjs-dist/types/src/display/api";
import { Image, ImageKind } from "image-js"; import { Image, ImageKind } from "image-js";
import { getImagesOnPage, PDFJSImage } from "./getImagesOnPage.js"; import { getImagesOnPage, PDFJSImage } from "./getImagesOnPage.js";

View File

@ -1,8 +1,8 @@
import jsQR from "jsqr"; import jsQR from "jsqr";
import { PdfFile } from "../../wrappers/PdfFile.js"; import { PdfFile } from "../../wrappers/PdfFile";
import { getImagesOnPage, PDFJSImage } from "./getImagesOnPage.js"; import { getImagesOnPage, PDFJSImage } from "./getImagesOnPage";
export async function detectQRCodePages(file: PdfFile) { export async function detectQRCodePages(file: PdfFile) {
console.log("FileInQRPrev: ", file); console.log("FileInQRPrev: ", file);

View File

@ -1,5 +1,5 @@
import { PDFPageProxy } from "pdfjs-dist/types/src/display/api.js"; import { PDFPageProxy } from "pdfjs-dist/types/src/display/api";
import * as PDFJS from "pdfjs-dist"; import * as PDFJS from "pdfjs-dist";

View File

@ -1,5 +1,5 @@
import { PdfFile, RepresentationType } from "../../wrappers/PdfFile.js"; import { PdfFile, RepresentationType } from "../../wrappers/PdfFile";
import { PDFDocument } from "pdf-lib"; import { PDFDocument } from "pdf-lib";
export async function getPages(file: PdfFile, pageIndexes: number[]): Promise<PdfFile> { export async function getPages(file: PdfFile, pageIndexes: number[]): Promise<PdfFile> {

View File

@ -1,5 +1,5 @@
import { PdfFile } from "../../wrappers/PdfFile.js"; import { PdfFile } from "../../wrappers/PdfFile";
import { getPages } from "./getPagesByIndex"; import { getPages } from "./getPagesByIndex";
export async function splitPagesByIndex(file: PdfFile, splitAfterPageIndexes: number[]): Promise<PdfFile[]> { export async function splitPagesByIndex(file: PdfFile, splitAfterPageIndexes: number[]): Promise<PdfFile[]> {

View File

@ -1,6 +1,6 @@
import { PdfFile } from "../wrappers/PdfFile.js"; import { PdfFile } from "../wrappers/PdfFile";
import { getPages } from "./common/getPagesByIndex.js"; import { getPages } from "./common/getPagesByIndex";
import { parsePageIndexSpecification } from "./common/pageIndexesUtils"; import { parsePageIndexSpecification } from "./common/pageIndexesUtils";
export interface ExtractPagesParamsType { export interface ExtractPagesParamsType {

View File

@ -1,8 +1,8 @@
import { PdfFile } from "../wrappers/PdfFile.js"; import { PdfFile } from "../wrappers/PdfFile";
import { detectEmptyPages } from "./common/detectEmptyPages.js"; import { detectEmptyPages } from "./common/detectEmptyPages";
import { getPages } from "./common/getPagesByIndex.js"; import { getPages } from "./common/getPagesByIndex";
import { invertSelection } from "./common/pageIndexesUtils.js"; import { invertSelection } from "./common/pageIndexesUtils";
export interface RemoveBlankPagesParamsType { export interface RemoveBlankPagesParamsType {
file: PdfFile; file: PdfFile;

View File

@ -1,7 +1,7 @@
import { PdfFile } from "../wrappers/PdfFile.js"; import { PdfFile } from "../wrappers/PdfFile";
import { getPages } from "./common/getPagesByIndex.js"; import { getPages } from "./common/getPagesByIndex";
import { invertSelection, parsePageIndexSpecification } from "./common/pageIndexesUtils.js"; import { invertSelection, parsePageIndexSpecification } from "./common/pageIndexesUtils";
export interface RemovePagesParamsType { export interface RemovePagesParamsType {
file: PdfFile; file: PdfFile;

View File

@ -1,7 +1,9 @@
import Joi from "@stirling-tools/joi"; import Joi from "@stirling-tools/joi";
import { PDFPage } from "pdf-lib"; import { PDFPage } from "pdf-lib";
import { PdfFile, RepresentationType, JoiPDFFileSchema } from "../wrappers/PdfFileJoi"; import { PdfFile, RepresentationType } from "../wrappers/PdfFile";
import { JoiPDFFileSchema } from "../wrappers/PdfFileJoi";
const whSchema = Joi.string().custom((value, helpers) => { const whSchema = Joi.string().custom((value, helpers) => {
console.log("value.pageSize", typeof value); console.log("value.pageSize", typeof value);

View File

@ -1,8 +1,8 @@
import { PdfFile } from "../wrappers/PdfFile.js"; import { PdfFile } from "../wrappers/PdfFile";
import { splitPagesByIndex } from "./common/splitPagesByIndex.js"; import { splitPagesByIndex } from "./common/splitPagesByIndex";
import { detectEmptyPages } from "./common/detectEmptyPages.js"; import { detectEmptyPages } from "./common/detectEmptyPages";
import { detectQRCodePages } from "./common/detectQRCodePages.js"; import { detectQRCodePages } from "./common/detectQRCodePages";
export interface SplitPageByPresetParamsType { export interface SplitPageByPresetParamsType {
file: PdfFile; file: PdfFile;

View File

@ -1,7 +1,7 @@
import { PdfFile } from "../wrappers/PdfFile.js"; import { PdfFile } from "../wrappers/PdfFile";
import { parsePageIndexSpecification } from "./common/pageIndexesUtils"; import { parsePageIndexSpecification } from "./common/pageIndexesUtils";
import { splitPagesByIndex } from "./common/splitPagesByIndex.js"; import { splitPagesByIndex } from "./common/splitPagesByIndex";
export interface SplitPdfByIndexParamsType { export interface SplitPdfByIndexParamsType {
file: PdfFile; file: PdfFile;

View File

@ -2,7 +2,7 @@ import { Operator } from "../functions";
import i18next from "i18next"; import i18next from "i18next";
function getCompileTimeOperatorList(): string[] { function getCompileTimeOperatorList(): string[] {
return import.meta.compileTime("./listOperatorsInDir.ts"); return import.meta.compileTime("./listOperatorsInDir.ts"); // The will compile to ["impose", "extractPages", etc...]
} }
export async function getOperatorByName(name: string): Promise<typeof Operator | undefined> { export async function getOperatorByName(name: string): Promise<typeof Operator | undefined> {

View File

@ -1,7 +1,6 @@
import * as PDFJS from "pdfjs-dist"; import * as PDFJS from "pdfjs-dist";
import type { PDFDocumentProxy as PDFJSDocument } from "pdfjs-dist/types/src/display/api"; import type { PDFDocumentProxy as PDFJSDocument } from "pdfjs-dist/types/src/display/api";
import { PDFDocument as PDFLibDocument } from "pdf-lib"; import { PDFDocument as PDFLibDocument } from "pdf-lib";
import Joi from "@stirling-tools/joi";
export enum RepresentationType { export enum RepresentationType {
Uint8Array, Uint8Array,