mirror of
https://github.com/Stirling-Tools/Stirling-PDF.git
synced 2025-06-22 23:45:02 +00:00
Fix: file extenstions in imports
This commit is contained in:
parent
644e0ceae9
commit
20f027bb5a
@ -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";
|
||||||
|
@ -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);
|
||||||
|
@ -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";
|
||||||
|
|
||||||
|
@ -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> {
|
||||||
|
@ -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[]> {
|
||||||
|
@ -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 {
|
||||||
|
@ -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;
|
||||||
|
@ -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;
|
||||||
|
@ -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);
|
||||||
|
@ -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;
|
||||||
|
@ -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;
|
||||||
|
@ -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> {
|
||||||
|
@ -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,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user