Fix ppt
This commit is contained in:
parent
fa2ac3bdfd
commit
e301d9d1eb
2 changed files with 24 additions and 8 deletions
|
|
@ -1,8 +1,8 @@
|
|||
import officeParser from 'officeparser';
|
||||
import WordExtractor from 'word-extractor';
|
||||
import * as XLSX from 'xlsx';
|
||||
import * as PPT from 'ppt';
|
||||
import * as CFB from 'cfb';
|
||||
import PPT from 'ppt';
|
||||
import CFB from 'cfb';
|
||||
|
||||
export const GEMINI_NATIVE_TYPES = [
|
||||
'application/pdf',
|
||||
|
|
|
|||
28
server/src/types/legacy-office.d.ts
vendored
28
server/src/types/legacy-office.d.ts
vendored
|
|
@ -20,9 +20,15 @@ declare module 'ppt' {
|
|||
to_text(pres: PPTPresentation): string[];
|
||||
}
|
||||
|
||||
export function readFile(filename: string, opts?: { WTF?: number; dump?: number }): PPTPresentation;
|
||||
export function parse_pptcfb(cfb: CFB.Container, opts?: object): PPTPresentation;
|
||||
export const utils: PPTUtils;
|
||||
interface PPTModule {
|
||||
version: string;
|
||||
readFile(filename: string, opts?: { WTF?: number; dump?: number }): PPTPresentation;
|
||||
parse_pptcfb(cfb: CFBContainer, opts?: object): PPTPresentation;
|
||||
utils: PPTUtils;
|
||||
}
|
||||
|
||||
const PPT: PPTModule;
|
||||
export default PPT;
|
||||
}
|
||||
|
||||
declare module 'cfb' {
|
||||
|
|
@ -32,7 +38,7 @@ declare module 'cfb' {
|
|||
content?: Buffer;
|
||||
}
|
||||
|
||||
interface Container {
|
||||
interface CFBContainer {
|
||||
FileIndex: CFBEntry[];
|
||||
FullPaths: string[];
|
||||
}
|
||||
|
|
@ -41,6 +47,16 @@ declare module 'cfb' {
|
|||
type?: 'file' | 'buffer' | 'base64' | 'binary' | 'array';
|
||||
}
|
||||
|
||||
export function read(data: Buffer | string | ArrayBuffer, opts?: ReadOptions): Container;
|
||||
export function parse(data: Buffer | number[]): Container;
|
||||
interface CFBModule {
|
||||
read(data: Buffer | string | ArrayBuffer, opts?: ReadOptions): CFBContainer;
|
||||
parse(data: Buffer | number[]): CFBContainer;
|
||||
}
|
||||
|
||||
const CFB: CFBModule;
|
||||
export default CFB;
|
||||
}
|
||||
|
||||
// Re-export for global use
|
||||
declare global {
|
||||
type CFBContainer = import('cfb').CFBContainer;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue