82 lines
1.5 KiB
TypeScript
82 lines
1.5 KiB
TypeScript
import { contextBridge } from 'electron';
|
|
|
|
// Mock pour les types de base
|
|
type User = {
|
|
id: string;
|
|
username: string;
|
|
email: string;
|
|
avatar?: string;
|
|
};
|
|
|
|
type Message = {
|
|
id: string;
|
|
content: string;
|
|
sender_id: string;
|
|
sender?: User;
|
|
created_at: string;
|
|
};
|
|
|
|
type Conversation = {
|
|
id: string;
|
|
name: string;
|
|
last_message?: string;
|
|
updated_at: string;
|
|
};
|
|
|
|
type Track = {
|
|
id: string;
|
|
title: string;
|
|
artist: string;
|
|
duration: number;
|
|
file_path: string;
|
|
};
|
|
|
|
// Mock pour les hooks
|
|
export function useAuth() {
|
|
return {
|
|
user: { id: '1', username: 'testuser', email: 'test@example.com' } as User,
|
|
login: () => {},
|
|
logout: () => {},
|
|
register: () => {},
|
|
isAuthenticated: true,
|
|
isLoading: false,
|
|
};
|
|
}
|
|
|
|
export function useChat() {
|
|
return {
|
|
messages: [] as Message[],
|
|
sendMessage: () => {},
|
|
conversations: [] as Conversation[],
|
|
currentConversation: null,
|
|
setCurrentConversation: () => {},
|
|
isLoading: false,
|
|
};
|
|
}
|
|
|
|
export function useLibrary() {
|
|
return {
|
|
tracks: [] as Track[],
|
|
uploadTrack: () => {},
|
|
deleteTrack: () => {},
|
|
playTrack: () => {},
|
|
isLoading: false,
|
|
};
|
|
}
|
|
|
|
// Mock pour useWebSocket
|
|
export function useWebSocket() {
|
|
return {
|
|
sendMessage: () => {},
|
|
isConnected: true,
|
|
lastMessage: null,
|
|
};
|
|
}
|
|
|
|
// Mock pour les services API
|
|
export const api = {
|
|
get: () => Promise.resolve({ data: {} }),
|
|
post: () => Promise.resolve({ data: {} }),
|
|
put: () => Promise.resolve({ data: {} }),
|
|
delete: () => Promise.resolve({ data: {} }),
|
|
};
|