import Vue from "vue";

/**
 * The client configuration
 */
export interface Config {
	instanceName: string;
	maintenance: boolean;
	allowRegister: boolean;
	allowAnonymous: boolean;
	verification: boolean;
	installing: boolean;
}

/**
 * The publically available fields representing
 * a Vindigo user.
 */
export interface Profile {
	id: number
	avatar?: string
	fullName: string
	firstName: string
	email?: string
	username: string
	website: string
	bio: string
	location: string
	role: string
	createdAt: string
	lastSeenAt: string
	isAuthentic: boolean
	isVerified: boolean
	isEnabled: boolean
}

/**
 * Data representing a team
 */
export interface Team {
	id: number
	slug: string
	name: string
	description: string
	createdAt: string
	logoImage: string
	teamUrl: string
}

/**
 * Represents an item displayed in the
 * toolbar creation menu.
 */
export interface CreationProvider {
	id: string,
	order: number,
	icon: string,
	title: string,
	description: string,
	handler: (vm: Vue) => void
}

/**
 * The details for displaying a task in the task view
 */
interface ViewTask {
	id: number;
	summary: string;
	description: string;
	list?: {
		id: number;
	}
	labels: {
		id: number;
	}[]
	assignees: {
		id: number;
		avatar: string;
		fullName: string;
		profileUrl: string;
	}[]
	project: {
		id: number;
		accentColor: string;
		lists: ViewTaskList[];
		labels: ViewTaskLabel[];
	}
}

/**
 * Task list details required for the task view
 */
interface ViewTaskList {
	id: number;
	name: string;
}

/**
 * The labels available in the task view
 */
interface ViewTaskLabel {
	id: number;
	type: string;
	title: string;
	color: string;
	icon: string;
}