@juspay/neurolink
Version:
The pipe layer of an AI nervous system: one interface connecting provider neurons to your application, across three inference types — generate, stream and decide. `decide` returns typed, calibrated judgements from a non-generative model (~400ms, ~$0.00002
374 lines (373 loc) • 12.5 kB
TypeScript
/**
* MIME Type Constants
* Centralized MIME type definitions organized by category for file processing
*
* @module processors/config/mimeTypes
*/
/**
* Image format MIME types supported by the platform
*/
export declare const IMAGE_MIME_TYPES: {
/** JPEG image format */
readonly JPEG: "image/jpeg";
/** PNG image format */
readonly PNG: "image/png";
/** GIF image format */
readonly GIF: "image/gif";
/** WebP image format */
readonly WEBP: "image/webp";
/** SVG vector image format */
readonly SVG: "image/svg+xml";
/** BMP bitmap format */
readonly BMP: "image/bmp";
/** TIFF image format */
readonly TIFF: "image/tiff";
/** AVIF image format */
readonly AVIF: "image/avif";
/** HEIC image format (Apple) */
readonly HEIC: "image/heic";
/** HEIF image format */
readonly HEIF: "image/heif";
/** ICO icon format */
readonly ICO: "image/x-icon";
/** Microsoft ICO format */
readonly ICO_MS: "image/vnd.microsoft.icon";
};
/**
* Document format MIME types for office documents and PDFs
*/
export declare const DOCUMENT_MIME_TYPES: {
/** PDF document format */
readonly PDF: "application/pdf";
/** Microsoft Word (DOCX) */
readonly DOCX: "application/vnd.openxmlformats-officedocument.wordprocessingml.document";
/** Legacy Microsoft Word (DOC) */
readonly DOC: "application/msword";
/** Microsoft Excel (XLSX) */
readonly XLSX: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
/** Legacy Microsoft Excel (XLS) */
readonly XLS: "application/vnd.ms-excel";
/** Microsoft PowerPoint (PPTX) */
readonly PPTX: "application/vnd.openxmlformats-officedocument.presentationml.presentation";
/** Legacy Microsoft PowerPoint (PPT) */
readonly PPT: "application/vnd.ms-powerpoint";
/** OpenDocument Text */
readonly ODT: "application/vnd.oasis.opendocument.text";
/** OpenDocument Spreadsheet */
readonly ODS: "application/vnd.oasis.opendocument.spreadsheet";
/** OpenDocument Presentation */
readonly ODP: "application/vnd.oasis.opendocument.presentation";
/** Rich Text Format */
readonly RTF: "application/rtf";
/** RTF as text type */
readonly RTF_TEXT: "text/rtf";
};
/**
* Data interchange format MIME types
*/
export declare const DATA_MIME_TYPES: {
/** JSON data format */
readonly JSON: "application/json";
/** XML data format */
readonly XML: "application/xml";
/** XML as text type */
readonly XML_TEXT: "text/xml";
/** CSV data format */
readonly CSV: "text/csv";
/** YAML data format */
readonly YAML: "text/yaml";
/** YAML as application type */
readonly YAML_APP: "application/x-yaml";
};
/**
* Text format MIME types for plain text and markup
*/
export declare const TEXT_MIME_TYPES: {
/** Plain text */
readonly PLAIN: "text/plain";
/** HTML markup */
readonly HTML: "text/html";
/** XHTML markup */
readonly XHTML: "application/xhtml+xml";
/** Markdown text */
readonly MARKDOWN: "text/markdown";
/** Markdown text (alternative MIME type) */
readonly MARKDOWN_ALT: "text/x-markdown";
/** CSS stylesheet */
readonly CSS: "text/css";
/** JavaScript code */
readonly JAVASCRIPT: "text/javascript";
/** JavaScript as application type */
readonly JAVASCRIPT_APP: "application/javascript";
};
/**
* Programming language source code MIME types
*/
export declare const SOURCE_CODE_MIME_TYPES: {
/** TypeScript code */
readonly TYPESCRIPT: "text/typescript";
/** Python code */
readonly PYTHON: "text/x-python";
/** Java code */
readonly JAVA: "text/x-java-source";
/** Go code */
readonly GO: "text/x-go";
/** Rust code */
readonly RUST: "text/x-rustsrc";
/** C code */
readonly C: "text/x-c";
/** C++ code */
readonly CPP: "text/x-c++";
/** C# code */
readonly CSHARP: "text/x-csharp";
/** Ruby code */
readonly RUBY: "text/x-ruby";
/** PHP code */
readonly PHP: "text/x-php";
/** Shell script */
readonly SHELL: "text/x-shellscript";
/** SQL query */
readonly SQL: "text/x-sql";
};
/**
* Archive and compressed file MIME types
*/
export declare const ARCHIVE_MIME_TYPES: {
/** ZIP archive */
readonly ZIP: "application/zip";
/** ZIP compressed variant */
readonly ZIP_COMPRESSED: "application/x-zip-compressed";
/** GZIP compressed */
readonly GZIP: "application/gzip";
/** TAR archive */
readonly TAR: "application/x-tar";
/** RAR archive */
readonly RAR: "application/x-rar-compressed";
/** RAR vendor type */
readonly RAR_VND: "application/vnd.rar";
/** 7-Zip archive */
readonly SEVEN_ZIP: "application/x-7z-compressed";
/** Generic binary stream */
readonly OCTET_STREAM: "application/octet-stream";
};
/**
* Video format MIME types
*/
export declare const VIDEO_MIME_TYPES: {
/** MP4 video */
readonly MP4: "video/mp4";
/** AVI video */
readonly AVI: "video/avi";
/** QuickTime video */
readonly MOV: "video/quicktime";
/** Matroska video */
readonly MKV: "video/x-matroska";
/** WebM video */
readonly WEBM: "video/webm";
/** Flash video */
readonly FLV: "video/x-flv";
/** Windows Media Video */
readonly WMV: "video/x-ms-wmv";
};
/**
* Audio format MIME types
*/
export declare const AUDIO_MIME_TYPES: {
/** MP3 audio */
readonly MP3: "audio/mpeg";
/** WAV audio */
readonly WAV: "audio/wav";
/** AAC audio */
readonly AAC: "audio/aac";
/** FLAC audio */
readonly FLAC: "audio/flac";
/** OGG audio */
readonly OGG: "audio/ogg";
/** M4A audio */
readonly M4A: "audio/mp4";
/** WMA audio */
readonly WMA: "audio/x-ms-wma";
};
/**
* All MIME types combined into a single object for convenience
*/
export declare const MIME_TYPES: {
/** MP3 audio */
readonly MP3: "audio/mpeg";
/** WAV audio */
readonly WAV: "audio/wav";
/** AAC audio */
readonly AAC: "audio/aac";
/** FLAC audio */
readonly FLAC: "audio/flac";
/** OGG audio */
readonly OGG: "audio/ogg";
/** M4A audio */
readonly M4A: "audio/mp4";
/** WMA audio */
readonly WMA: "audio/x-ms-wma";
/** MP4 video */
readonly MP4: "video/mp4";
/** AVI video */
readonly AVI: "video/avi";
/** QuickTime video */
readonly MOV: "video/quicktime";
/** Matroska video */
readonly MKV: "video/x-matroska";
/** WebM video */
readonly WEBM: "video/webm";
/** Flash video */
readonly FLV: "video/x-flv";
/** Windows Media Video */
readonly WMV: "video/x-ms-wmv";
/** ZIP archive */
readonly ZIP: "application/zip";
/** ZIP compressed variant */
readonly ZIP_COMPRESSED: "application/x-zip-compressed";
/** GZIP compressed */
readonly GZIP: "application/gzip";
/** TAR archive */
readonly TAR: "application/x-tar";
/** RAR archive */
readonly RAR: "application/x-rar-compressed";
/** RAR vendor type */
readonly RAR_VND: "application/vnd.rar";
/** 7-Zip archive */
readonly SEVEN_ZIP: "application/x-7z-compressed";
/** Generic binary stream */
readonly OCTET_STREAM: "application/octet-stream";
/** TypeScript code */
readonly TYPESCRIPT: "text/typescript";
/** Python code */
readonly PYTHON: "text/x-python";
/** Java code */
readonly JAVA: "text/x-java-source";
/** Go code */
readonly GO: "text/x-go";
/** Rust code */
readonly RUST: "text/x-rustsrc";
/** C code */
readonly C: "text/x-c";
/** C++ code */
readonly CPP: "text/x-c++";
/** C# code */
readonly CSHARP: "text/x-csharp";
/** Ruby code */
readonly RUBY: "text/x-ruby";
/** PHP code */
readonly PHP: "text/x-php";
/** Shell script */
readonly SHELL: "text/x-shellscript";
/** SQL query */
readonly SQL: "text/x-sql";
/** Plain text */
readonly PLAIN: "text/plain";
/** HTML markup */
readonly HTML: "text/html";
/** XHTML markup */
readonly XHTML: "application/xhtml+xml";
/** Markdown text */
readonly MARKDOWN: "text/markdown";
/** Markdown text (alternative MIME type) */
readonly MARKDOWN_ALT: "text/x-markdown";
/** CSS stylesheet */
readonly CSS: "text/css";
/** JavaScript code */
readonly JAVASCRIPT: "text/javascript";
/** JavaScript as application type */
readonly JAVASCRIPT_APP: "application/javascript";
/** JSON data format */
readonly JSON: "application/json";
/** XML data format */
readonly XML: "application/xml";
/** XML as text type */
readonly XML_TEXT: "text/xml";
/** CSV data format */
readonly CSV: "text/csv";
/** YAML data format */
readonly YAML: "text/yaml";
/** YAML as application type */
readonly YAML_APP: "application/x-yaml";
/** PDF document format */
readonly PDF: "application/pdf";
/** Microsoft Word (DOCX) */
readonly DOCX: "application/vnd.openxmlformats-officedocument.wordprocessingml.document";
/** Legacy Microsoft Word (DOC) */
readonly DOC: "application/msword";
/** Microsoft Excel (XLSX) */
readonly XLSX: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
/** Legacy Microsoft Excel (XLS) */
readonly XLS: "application/vnd.ms-excel";
/** Microsoft PowerPoint (PPTX) */
readonly PPTX: "application/vnd.openxmlformats-officedocument.presentationml.presentation";
/** Legacy Microsoft PowerPoint (PPT) */
readonly PPT: "application/vnd.ms-powerpoint";
/** OpenDocument Text */
readonly ODT: "application/vnd.oasis.opendocument.text";
/** OpenDocument Spreadsheet */
readonly ODS: "application/vnd.oasis.opendocument.spreadsheet";
/** OpenDocument Presentation */
readonly ODP: "application/vnd.oasis.opendocument.presentation";
/** Rich Text Format */
readonly RTF: "application/rtf";
/** RTF as text type */
readonly RTF_TEXT: "text/rtf";
/** JPEG image format */
readonly JPEG: "image/jpeg";
/** PNG image format */
readonly PNG: "image/png";
/** GIF image format */
readonly GIF: "image/gif";
/** WebP image format */
readonly WEBP: "image/webp";
/** SVG vector image format */
readonly SVG: "image/svg+xml";
/** BMP bitmap format */
readonly BMP: "image/bmp";
/** TIFF image format */
readonly TIFF: "image/tiff";
/** AVIF image format */
readonly AVIF: "image/avif";
/** HEIC image format (Apple) */
readonly HEIC: "image/heic";
/** HEIF image format */
readonly HEIF: "image/heif";
/** ICO icon format */
readonly ICO: "image/x-icon";
/** Microsoft ICO format */
readonly ICO_MS: "image/vnd.microsoft.icon";
};
/**
* Extension → MIME for text, markup, source-code and config files.
*
* These are the formats that carry no modality of their own — they are inlined
* into the prompt as text. Binary and structured formats (image, audio, video,
* document, data, archive) are NOT listed here; they come from
* {@link FILE_TYPE_REGISTRY}, which is the single source of truth for
* everything multimodal. See `fileTypeRegistry.ts` for why.
*/
export declare const TEXT_EXTENSION_MIME_MAP: Record<string, string>;
/**
* Centralized mapping of file extensions (with leading dot) to MIME types.
*
* Assembled from two sources so there is exactly one place to edit per kind of
* format: every image / audio / video / document / data / archive entry is
* derived from {@link FILE_TYPE_REGISTRY}, and the text, markup, source-code
* and config entries come from {@link TEXT_EXTENSION_MIME_MAP}.
*
* Registry entries are spread last so that a format which appears in both wins
* from the registry — the registry is the authority for anything with a
* modality.
*/
export declare const EXTENSION_MIME_MAP: Record<string, string>;
/**
* Get MIME type from file extension using the centralized map.
*
* Accepts a bare extension (`"pdf"`), a dotted extension (`".pdf"`), a filename
* or a full path — `normalizeExtension` handles all four, including compound
* suffixes like `.tar.gz`.
*
* @param ext - File extension, filename or path
* @returns MIME type string, or "application/octet-stream" if unknown
*/
export declare function getMimeTypeForExtension(ext: string): string;