/**
 * Canvas Event Types
 *
 * Type definitions for configurable canvas events.
 *
 * Extracted from settings-types.ts in v1.9.0.
 *
 * @since 1.9.0
 */

// =============================================================================
// Canvas Events
// =============================================================================

/**
 * All configurable canvas events that can trigger actions.
 */
export enum CanvasEventType {
	// Node events
	NodeClick = 'node:click',
	NodeDoubleClick = 'node:double-click',
	NodeTripleClick = 'node:triple-click',
	NodeRightClick = 'node:right-click',
	NodeLongPress = 'node:long-press',

	// Edge events
	EdgeClick = 'edge:click',
	EdgeDoubleClick = 'edge:double-click',
	EdgeRightClick = 'edge:right-click',

	// Background events
	BackgroundClick = 'background:click',
	BackgroundDoubleClick = 'background:double-click',
	BackgroundRightClick = 'background:right-click',
	BackgroundLongPress = 'background:long-press',
}

/**
 * Metadata for each event type (for UI display).
 */
export interface EventTypeInfo {
	type: CanvasEventType;
	label: string;
	description: string;
	category: 'node' | 'edge' | 'background';
}

/**
 * Registry of all event type metadata.
 */
export const EVENT_TYPE_INFO: Record<CanvasEventType, EventTypeInfo> = {
	[CanvasEventType.NodeClick]: {
		type: CanvasEventType.NodeClick,
		label: 'Click Node',
		description: 'Triggered when clicking on a node',
		category: 'node',
	},
	[CanvasEventType.NodeDoubleClick]: {
		type: CanvasEventType.NodeDoubleClick,
		label: 'Double-click Node',
		description: 'Triggered when double-clicking on a node',
		category: 'node',
	},
	[CanvasEventType.NodeTripleClick]: {
		type: CanvasEventType.NodeTripleClick,
		label: 'Triple-click Node',
		description: 'Triggered when triple-clicking on a node',
		category: 'node',
	},
	[CanvasEventType.NodeRightClick]: {
		type: CanvasEventType.NodeRightClick,
		label: 'Right-click Node',
		description: 'Triggered when right-clicking on a node',
		category: 'node',
	},
	[CanvasEventType.NodeLongPress]: {
		type: CanvasEventType.NodeLongPress,
		label: 'Long-press Node',
		description: 'Triggered when long-pressing on a node (mobile/touch)',
		category: 'node',
	},
	[CanvasEventType.EdgeClick]: {
		type: CanvasEventType.EdgeClick,
		label: 'Click Edge',
		description: 'Triggered when clicking on an edge',
		category: 'edge',
	},
	[CanvasEventType.EdgeDoubleClick]: {
		type: CanvasEventType.EdgeDoubleClick,
		label: 'Double-click Edge',
		description: 'Triggered when double-clicking on an edge',
		category: 'edge',
	},
	[CanvasEventType.EdgeRightClick]: {
		type: CanvasEventType.EdgeRightClick,
		label: 'Right-click Edge',
		description: 'Triggered when right-clicking on an edge',
		category: 'edge',
	},
	[CanvasEventType.BackgroundClick]: {
		type: CanvasEventType.BackgroundClick,
		label: 'Click Background',
		description: 'Triggered when clicking on the canvas background',
		category: 'background',
	},
	[CanvasEventType.BackgroundDoubleClick]: {
		type: CanvasEventType.BackgroundDoubleClick,
		label: 'Double-click Background',
		description: 'Triggered when double-clicking on the canvas background',
		category: 'background',
	},
	[CanvasEventType.BackgroundRightClick]: {
		type: CanvasEventType.BackgroundRightClick,
		label: 'Right-click Background',
		description: 'Triggered when right-clicking on the canvas background',
		category: 'background',
	},
	[CanvasEventType.BackgroundLongPress]: {
		type: CanvasEventType.BackgroundLongPress,
		label: 'Long-press Background',
		description: 'Triggered when long-pressing on the canvas background (mobile/touch)',
		category: 'background',
	},
};
