/**
 * TypeScript types and constraint constants for the trueref.json config file
 * (TRUEREF-0013).
 *
 * The `TrueRefConfig` interface is the canonical type. It is also exported from
 * `$lib/types` for use across the application. This module exists as the
 * single source of truth for validation constraints.
 */

// ---------------------------------------------------------------------------
// Re-export the canonical type from the shared types module
// ---------------------------------------------------------------------------

export type { TrueRefConfig } from '$lib/types';

// ---------------------------------------------------------------------------
// Validation constraints
// ---------------------------------------------------------------------------

/**
 * Constraint values used by the parser and validator.
 * All length checks are in characters (not bytes).
 */
export const CONFIG_CONSTRAINTS = {
	projectTitle: { minLength: 1, maxLength: 100 },
	description: { minLength: 10, maxLength: 500 },
	folders: { maxItems: 50, maxLength: 200 },
	excludeFolders: { maxItems: 50, maxLength: 200 },
	excludeFiles: { maxItems: 100, maxLength: 200 },
	rules: { maxItems: 20, minLength: 5, maxLength: 500 },
	previousVersions: { maxItems: 50 },
	versionTag: { pattern: /^v?\d+\.\d+(\.\d+)?(-.*)?$/ }
} as const;
