diff --git a/src/lib/data/devices.ts b/src/lib/data/devices.ts new file mode 100644 index 0000000..68a14f7 --- /dev/null +++ b/src/lib/data/devices.ts @@ -0,0 +1,111 @@ +import type { Device } from '$lib/types'; + +export const PRESET_DEVICES: readonly Device[] = [ + // Kindle + { + id: 'kindle_pw5', + brand: 'Kindle', + name: 'Paperwhite 5 (11th gen)', + width: 1236, + height: 1648, + greyLevels: 16, + outputFormat: 'png' + }, + { + id: 'kindle_pw4', + brand: 'Kindle', + name: 'Paperwhite 4 (10th gen)', + width: 1072, + height: 1448, + greyLevels: 16, + outputFormat: 'png' + }, + { + id: 'kindle_oasis3', + brand: 'Kindle', + name: 'Oasis 3', + width: 1264, + height: 1680, + greyLevels: 16, + outputFormat: 'png' + }, + { + id: 'kindle_scribe', + brand: 'Kindle', + name: 'Scribe', + width: 1860, + height: 2480, + greyLevels: 16, + outputFormat: 'png' + }, + { + id: 'kindle_basic_2022', + brand: 'Kindle', + name: 'Basic (2022)', + width: 1072, + height: 1448, + greyLevels: 16, + outputFormat: 'png' + }, + // Kobo + { + id: 'kobo_clara_2e', + brand: 'Kobo', + name: 'Clara 2E', + width: 1072, + height: 1448, + greyLevels: 16, + outputFormat: 'png' + }, + { + id: 'kobo_libra_2', + brand: 'Kobo', + name: 'Libra 2', + width: 1264, + height: 1680, + greyLevels: 16, + outputFormat: 'png' + }, + { + id: 'kobo_sage', + brand: 'Kobo', + name: 'Sage', + width: 1440, + height: 1920, + greyLevels: 16, + outputFormat: 'png' + }, + // Other + { + id: 'remarkable_2', + brand: 'reMarkable', + name: 'reMarkable 2', + width: 1404, + height: 1872, + greyLevels: 16, + outputFormat: 'png' + }, + { + id: 'boox_note_air', + brand: 'Boox', + name: 'Note Air', + width: 1404, + height: 1872, + greyLevels: 16, + outputFormat: 'png' + } +]; + +export const DEFAULT_DEVICE = PRESET_DEVICES[0]; + +export function groupDevicesByBrand(devices: readonly Device[]): Map { + const grouped = new Map(); + + for (const device of devices) { + const existing = grouped.get(device.brand) ?? []; + existing.push(device); + grouped.set(device.brand, existing); + } + + return grouped; +}