diff --git a/index.d.ts b/index.d.ts index 429b081..06f8455 100644 --- a/index.d.ts +++ b/index.d.ts @@ -151,8 +151,11 @@ interface FsPackage { * read a file relative to config dir and return its content * * @param path relative file path + * @param options optional options */ - readFile(path: string): string + readFile(path: string, options?: { + bytes: boolean // if true return []byte instead of string + }): string /** * stat file or directory @@ -430,6 +433,8 @@ interface PdfPackage { * * @param html html string * @param options options + * + * @returns []byte of pdf data */ fromHTML( html: string, @@ -471,6 +476,24 @@ interface PdfPackage { headerHtml?: string // URL to header html } ): any + + /** + * process existing pdf data + * + * @param command pdfcpu command + * @param pdfData []byte of pdf data + * @param options options + * + * @returns []byte of new pdf data + */ + cpu( + command: "watermark", + pdfData: any, + options: { + mode: "image" + bytes: any // []byte of watermark image + } + ): any } export interface HookContext