constants.ts 944 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /**
  2. * PDF Provider Constants
  3. * Separated from pdf-providers.ts to avoid importing sharp in client components
  4. */
  5. import type { PDFProviderId, PDFProviderConfig } from './types';
  6. /**
  7. * PDF Provider Registry
  8. */
  9. export const PDF_PROVIDERS: Record<PDFProviderId, PDFProviderConfig> = {
  10. unpdf: {
  11. id: 'unpdf',
  12. name: 'unpdf',
  13. requiresApiKey: false,
  14. icon: '/logos/unpdf.svg',
  15. features: ['text', 'images', 'metadata'],
  16. },
  17. mineru: {
  18. id: 'mineru',
  19. name: 'MinerU',
  20. requiresApiKey: false,
  21. icon: '/logos/mineru.png',
  22. features: ['text', 'images', 'tables', 'formulas', 'layout-analysis'],
  23. },
  24. };
  25. /**
  26. * Get all available PDF providers
  27. */
  28. export function getAllPDFProviders(): PDFProviderConfig[] {
  29. return Object.values(PDF_PROVIDERS);
  30. }
  31. /**
  32. * Get PDF provider by ID
  33. */
  34. export function getPDFProvider(providerId: PDFProviderId): PDFProviderConfig | undefined {
  35. return PDF_PROVIDERS[providerId];
  36. }