cost-claude
Version:
Claude Code cost monitoring, analytics, and optimization toolkit
64 lines • 1.88 kB
TypeScript
import { EventEmitter } from 'events';
export interface NotificationOptions {
title: string;
message: string;
subtitle?: string;
sound?: boolean | string;
icon?: string;
timeout?: number;
actions?: string[];
closeLabel?: string;
dropdownLabel?: string;
}
export interface CostNotificationData {
sessionId: string;
messageId: string;
cost: number;
duration: number;
tokens: {
input: number;
output: number;
cacheHit: number;
};
sessionTotal?: number;
dailyTotal?: number;
projectName?: string;
}
export interface NotificationConfig {
soundEnabled?: boolean;
customIcon?: string;
customSound?: string;
taskCompleteSound?: string;
sessionCompleteSound?: string;
forceDisplay?: boolean;
thresholds?: {
cost?: number;
duration?: number;
};
}
export declare class NotificationService extends EventEmitter {
private config;
private iconPath;
private soundEnabled;
private platform;
private lastNotificationTime;
private notificationThrottle;
constructor(config?: NotificationConfig);
notifyCostUpdate(data: CostNotificationData): Promise<void>;
notify(options: NotificationOptions): Promise<void>;
private formatTitle;
private formatMessage;
private formatSubtitle;
private getCostEmoji;
private resolveIconPath;
private getSound;
sendCustom(title: string, message: string, options?: Partial<NotificationOptions> & {
soundType?: 'task' | 'session' | 'default';
}): Promise<void>;
sendError(error: Error | string): Promise<void>;
sendWarning(message: string): Promise<void>;
sendSuccess(message: string): Promise<void>;
isSupported(): boolean;
updateConfig(config: Partial<NotificationConfig>): void;
}
//# sourceMappingURL=notification.d.ts.map