Merge commit 'd803bfe2b1fe7f5e219e50ac20d6801a0a58ac75' as 'vendor/ruvector'
This commit is contained in:
64
vendor/ruvector/npm/packages/scipix/src/index.ts
vendored
Normal file
64
vendor/ruvector/npm/packages/scipix/src/index.ts
vendored
Normal file
@@ -0,0 +1,64 @@
|
||||
/**
|
||||
* @ruvector/scipix - OCR Client for Scientific Documents
|
||||
*
|
||||
* A TypeScript client for the SciPix OCR API, enabling extraction of
|
||||
* LaTeX, MathML, and text from scientific images, equations, and documents.
|
||||
*
|
||||
* @example
|
||||
* ```typescript
|
||||
* import { SciPixClient, OutputFormat } from '@ruvector/scipix';
|
||||
*
|
||||
* // Create client
|
||||
* const client = new SciPixClient({
|
||||
* baseUrl: 'http://localhost:8080',
|
||||
* apiKey: 'your-api-key',
|
||||
* });
|
||||
*
|
||||
* // OCR an image file
|
||||
* const result = await client.ocrFile('./equation.png', {
|
||||
* formats: [OutputFormat.LaTeX, OutputFormat.MathML],
|
||||
* detectEquations: true,
|
||||
* });
|
||||
*
|
||||
* console.log('LaTeX:', result.latex);
|
||||
* console.log('Confidence:', result.confidence);
|
||||
*
|
||||
* // Quick LaTeX extraction
|
||||
* const latex = await client.extractLatex('./math.png');
|
||||
* console.log('Extracted LaTeX:', latex);
|
||||
*
|
||||
* // Batch processing
|
||||
* const batchResult = await client.batchOcr({
|
||||
* images: [
|
||||
* { source: 'base64...', id: 'eq1' },
|
||||
* { source: 'base64...', id: 'eq2' },
|
||||
* ],
|
||||
* defaultOptions: { formats: [OutputFormat.LaTeX] },
|
||||
* });
|
||||
*
|
||||
* console.log(`Processed ${batchResult.successful}/${batchResult.totalImages} images`);
|
||||
* ```
|
||||
*
|
||||
* @packageDocumentation
|
||||
*/
|
||||
|
||||
// Types
|
||||
export {
|
||||
OutputFormat,
|
||||
ImageType,
|
||||
ConfidenceLevel,
|
||||
ContentType,
|
||||
BoundingBox,
|
||||
OCRRegion,
|
||||
OCRResult,
|
||||
OCROptions,
|
||||
BatchOCRRequest,
|
||||
BatchOCRResult,
|
||||
SciPixConfig,
|
||||
HealthStatus,
|
||||
SciPixError,
|
||||
SciPixErrorCode,
|
||||
} from './types.js';
|
||||
|
||||
// Client
|
||||
export { SciPixClient, createClient } from './client.js';
|
||||
Reference in New Issue
Block a user