UNPKG

@aidalinfo/pdf-processor

Version:

Powerful PDF data extraction library powered by AI vision models. Transform PDFs into structured, validated data using TypeScript, Zod, and AI providers like Scaleway and Ollama.

83 lines (82 loc) 2.89 kB
import { z } from 'zod'; /** * Schémas spécifiques à l'extraction de tableaux */ export declare const TableRowSchema: z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodNull]>, "many">; export declare const DetectedTableSchema: z.ZodObject<{ table_name: z.ZodOptional<z.ZodNullable<z.ZodString>>; table_type: z.ZodOptional<z.ZodNullable<z.ZodString>>; headers: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; rows: z.ZodOptional<z.ZodArray<z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodNull]>, "many">, "many">>; summary: z.ZodOptional<z.ZodNullable<z.ZodString>>; }, "strip", z.ZodTypeAny, { table_name?: string; table_type?: string; headers?: string[]; rows?: (string | number)[][]; summary?: string; }, { table_name?: string; table_type?: string; headers?: string[]; rows?: (string | number)[][]; summary?: string; }>; export declare const TablesOnlySchema: z.ZodObject<{ detected_tables: z.ZodOptional<z.ZodArray<z.ZodObject<{ table_name: z.ZodOptional<z.ZodNullable<z.ZodString>>; table_type: z.ZodOptional<z.ZodNullable<z.ZodString>>; headers: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; rows: z.ZodOptional<z.ZodArray<z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodNull]>, "many">, "many">>; summary: z.ZodOptional<z.ZodNullable<z.ZodString>>; }, "strip", z.ZodTypeAny, { table_name?: string; table_type?: string; headers?: string[]; rows?: (string | number)[][]; summary?: string; }, { table_name?: string; table_type?: string; headers?: string[]; rows?: (string | number)[][]; summary?: string; }>, "many">>; extraction_metadata: z.ZodOptional<z.ZodObject<{ tables_found: z.ZodOptional<z.ZodNullable<z.ZodNumber>>; confidence_score: z.ZodOptional<z.ZodNullable<z.ZodNumber>>; }, "strip", z.ZodTypeAny, { confidence_score?: number; tables_found?: number; }, { confidence_score?: number; tables_found?: number; }>>; }, "strip", z.ZodTypeAny, { extraction_metadata?: { confidence_score?: number; tables_found?: number; }; detected_tables?: { table_name?: string; table_type?: string; headers?: string[]; rows?: (string | number)[][]; summary?: string; }[]; }, { extraction_metadata?: { confidence_score?: number; tables_found?: number; }; detected_tables?: { table_name?: string; table_type?: string; headers?: string[]; rows?: (string | number)[][]; summary?: string; }[]; }>; export type TableRow = z.infer<typeof TableRowSchema>; export type DetectedTable = z.infer<typeof DetectedTableSchema>; export type TablesOnly = z.infer<typeof TablesOnlySchema>;