nano-ai-pdf
Version:
This package helps you summarize pdfs using Gemini nano on edge or on browser, making it compliant safe, faster and free
29 lines (28 loc) • 1.07 kB
TypeScript
import { ChromeSummarizer, ModelAvailability, PdfSummarizerOptions } from "./types";
/**
* Allows consumer to get the latest download progress value.
*/
export declare function getDownloadProgress(): number;
/**
* Allows consumer to set a callback function to receive real-time progress updates.
*/
export declare function onDownloadProgressUpdate(callback: (progress: number) => void): void;
/**
* Checks if Chrome's built-in Summarizer API is available
*
* @returns boolean indicating if the API is available
*/
export declare function isSummarizerSupported(): boolean;
/**
* Checks the availability status of the Chrome Summarizer model
*/
export declare function checkModelAvailability(): Promise<ModelAvailability>;
/**
* Validates user activation requirement for Chrome AI APIs
*/
export declare function validateUserActivation(): void;
/**
* Creates a Chrome Summarizer instance with the specified configuration
* and tracks download progress.
*/
export declare function createSummarizer(options: PdfSummarizerOptions): Promise<ChromeSummarizer>;