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 officeParser from 'officeparser';
|
||||||
import WordExtractor from 'word-extractor';
|
import WordExtractor from 'word-extractor';
|
||||||
import * as XLSX from 'xlsx';
|
import * as XLSX from 'xlsx';
|
||||||
import * as PPT from 'ppt';
|
import PPT from 'ppt';
|
||||||
import * as CFB from 'cfb';
|
import CFB from 'cfb';
|
||||||
|
|
||||||
export const GEMINI_NATIVE_TYPES = [
|
export const GEMINI_NATIVE_TYPES = [
|
||||||
'application/pdf',
|
'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[];
|
to_text(pres: PPTPresentation): string[];
|
||||||
}
|
}
|
||||||
|
|
||||||
export function readFile(filename: string, opts?: { WTF?: number; dump?: number }): PPTPresentation;
|
interface PPTModule {
|
||||||
export function parse_pptcfb(cfb: CFB.Container, opts?: object): PPTPresentation;
|
version: string;
|
||||||
export const utils: PPTUtils;
|
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' {
|
declare module 'cfb' {
|
||||||
|
|
@ -32,7 +38,7 @@ declare module 'cfb' {
|
||||||
content?: Buffer;
|
content?: Buffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface Container {
|
interface CFBContainer {
|
||||||
FileIndex: CFBEntry[];
|
FileIndex: CFBEntry[];
|
||||||
FullPaths: string[];
|
FullPaths: string[];
|
||||||
}
|
}
|
||||||
|
|
@ -41,6 +47,16 @@ declare module 'cfb' {
|
||||||
type?: 'file' | 'buffer' | 'base64' | 'binary' | 'array';
|
type?: 'file' | 'buffer' | 'base64' | 'binary' | 'array';
|
||||||
}
|
}
|
||||||
|
|
||||||
export function read(data: Buffer | string | ArrayBuffer, opts?: ReadOptions): Container;
|
interface CFBModule {
|
||||||
export function parse(data: Buffer | number[]): Container;
|
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