UNPKG

@squidcloud/client

Version:

A typescript implementation of the Squid client

33 lines (32 loc) 1.72 kB
import { CreatePdfRequest, CreatePdfResponse, ExtractDataFromDocumentOptions, ExtractDataFromDocumentResponse } from '../../internal-common/src/public-types/extraction.public-types'; /** * ExtractionClient provides methods for extracting structured data * from document files using AI-driven processing. * @category Platform */ export declare class ExtractionClient { private readonly rpcManager; /** * Extracts structured text data from a document file using AI. * * @param file - The document file to extract data from. * @param options - (Optional) Extraction options such as parsing hints or preprocessing flags. * @returns A promise that resolves with the extracted document data. */ extractDataFromDocumentFile(file: File, options?: ExtractDataFromDocumentOptions): Promise<ExtractDataFromDocumentResponse>; /** * Extracts structured text data from a document at a remote URL using AI. * * @param url - The URL of the document to extract data from. * @param options - (Optional) Extraction options such as parsing hints or preprocessing flags. * @returns A promise that resolves with the extracted document data. */ extractDataFromDocumentUrl(url: string, options?: ExtractDataFromDocumentOptions): Promise<ExtractDataFromDocumentResponse>; /** * Creates a PDF document from the provided request parameters. * @param request - The request containing details for PDF creation, such as content or url. * @return A promise that resolves with the response containing the URL of the created PDF. The url will expire after * 1 hour. */ createPdf(request: CreatePdfRequest): Promise<CreatePdfResponse>; }