/** * Preset factory functions for testing * * Provides functions to create mock presets, preset rows, and submissions. * * @example * ```typescript * // Create a mock preset * const preset = createMockPreset({ name: 'Custom Name' }); * * // Create a database row * const row = createMockPresetRow({ status: 'pending' }); * * // Create a submission * const submission = createMockSubmission({ dyes: [1, 2, 3, 4, 5] }); * ``` */ import type { CommunityPreset, PresetSubmission, PresetStatus } from '@xivdyetools/types/preset'; /** * Preset database row type (as stored in D1) * Note: dyes and tags are JSON strings, is_curated is 0 or 1 */ export interface PresetRow { id: string; name: string; description: string; category_id: string; dyes: string; tags: string; author_discord_id: string | null; author_name: string | null; vote_count: number; status: string; is_curated: number; created_at: string; updated_at: string; dye_signature: string | null; previous_values: string | null; } export type { CommunityPreset, PresetSubmission, PresetStatus }; /** * Creates a mock preset submission * * @param overrides - Optional overrides for the default values * @returns A PresetSubmission object */ export declare function createMockSubmission(overrides?: Partial): PresetSubmission; /** * Creates a mock preset row (as returned from database) * * Note: In the database, `dyes` and `tags` are JSON strings, * and `is_curated` is a number (0 or 1). * * @param overrides - Optional overrides for the default values * @returns A PresetRow object */ export declare function createMockPresetRow(overrides?: Partial): PresetRow; /** * Creates a mock CommunityPreset (domain object) * * Note: In domain objects, `dyes` and `tags` are arrays, * and `is_curated` is a boolean. * * @param overrides - Optional overrides for the default values * @returns A CommunityPreset object */ export declare function createMockPreset(overrides?: Partial): CommunityPreset; /** * Creates multiple mock presets * * @param count - Number of presets to create * @param overrides - Optional overrides to apply to all presets * @returns Array of CommunityPreset objects */ export declare function createMockPresets(count: number, overrides?: Partial): CommunityPreset[]; /** * Creates a preset with specific status * * @param status - The preset status * @param overrides - Optional additional overrides * @returns A CommunityPreset object */ export declare function createPresetWithStatus(status: PresetStatus, overrides?: Partial): CommunityPreset; /** * Creates a curated preset * * @param overrides - Optional overrides * @returns A curated CommunityPreset object */ export declare function createCuratedPreset(overrides?: Partial): CommunityPreset; /** * Converts a CommunityPreset to a PresetRow (for database mocking) * * @param preset - The CommunityPreset to convert * @returns A PresetRow object */ export declare function presetToRow(preset: CommunityPreset): PresetRow; /** * Converts a PresetRow to a CommunityPreset (for domain logic) * * @param row - The PresetRow to convert * @returns A CommunityPreset object */ export declare function rowToPreset(row: PresetRow): CommunityPreset; //# sourceMappingURL=preset.d.ts.map