@copilotkit/react-ui
Version:
<img src="https://github.com/user-attachments/assets/0a6b64d9-e193-4940-a3f6-60334ac34084" alt="banner" style="border-radius: 12px; border: 2px solid #d6d4fa;" />
33 lines (29 loc) • 913 B
text/typescript
// Re-export utilities from shared
export {
getModalityFromMimeType,
formatFileSize,
exceedsMaxSize,
readFileAsBase64,
generateVideoThumbnail,
matchesAcceptFilter,
} from "@copilotkit/shared";
// Deprecation warning helpers — react-ui specific
const suppressedWarnings = new Set<string>();
let globalSuppress = false;
/**
* Issue a deprecation warning once per key per session.
* Suppressed entirely if the user calls suppressDeprecationWarnings().
*/
export function deprecationWarning(key: string, message: string) {
if (globalSuppress || suppressedWarnings.has(key)) return;
if (typeof process !== "undefined" && process.env?.NODE_ENV === "production")
return;
suppressedWarnings.add(key);
console.warn(`[CopilotKit] Deprecation: ${message}`);
}
/**
* Suppress all CopilotKit deprecation warnings.
*/
export function suppressDeprecationWarnings() {
globalSuppress = true;
}