```typescript
import { apiRequest } from './queryClient';

interface SendNotificationOptions {
  title: string;
  message: string;
  type?: 'info' | 'success' | 'warning' | 'error';
  userId?: number;
  url?: string;
  sessionId?: number;
  isLiveStream?: boolean;
}

export async function sendNotification(options: SendNotificationOptions) {
  try {
    const response = await apiRequest('POST', '/api/notifications/send', options);
    return response.json();
  } catch (error) {
    console.error('Failed to send notification:', error);
    throw error;
  }
}

export async function sendNewsNotification(newsId: number, userId?: number) {
  try {
    const response = await apiRequest('POST', `/api/notifications/news/${newsId}`, {
      userId,
    });
    return response.json();
  } catch (error) {
    console.error('Failed to send news notification:', error);
    throw error;
  }
}

// Example usage:
/*
// Send a generic notification
await sendNotification({
  title: "New Message",
  message: "You have a new message",
  type: "info",
  userId: 123 // optional: send to specific user
});

// Send a news notification
await sendNewsNotification(newsId, userId); // userId is optional
*/
```
