export interface LanyardPresence {
	listening_to_spotify: boolean;
	spotify: {
		track_id: string;
		timestamps: {
			start: number;
			end: number;
		};
		song: string;
		artist: string;
		album_art_url: string;
		album: string;
	};
	discord_status: string;
	activities: {
		type: number;
		timestamps: {
			start: number;
			end: number;
		};
		state: string;
		name: string;
		id: string;
		details: string;
		assets: {
			small_text: string;
			small_image: string;
			large_text: string;
			large_image: string;
		};
		application_id: string;
	}[];
}

export interface AnyLanyardPayload {
	op: 0 | 1 | 2 | 3;
	d?: object;
}

export interface LanyardHelloPayload {
	op: 1;
	d: {
		heartbeat_interval: number;
	};
}

export interface LanyardInitStatePayload {
	op: 0;
	t: "INIT_STATE";
	d: {
		[user_id: string]: LanyardPresence;
	};
}

export interface LanyardPresenceUpdatePayload {
	op: 0;
	t: "PRESENCE_UPDATE";
	d: LanyardPresence;
}

export type LanyardPayload =
	| LanyardHelloPayload
	| LanyardInitStatePayload
	| LanyardPresenceUpdatePayload
	| AnyLanyardPayload;
