/** * Device frame definitions ported from Fastlane's `frameit/device_types.rb`. * * Each device mirrors Fastlane's `Device.new(id, name, priority, resolutions, * ppi, color, platform)` declaration. Frame canvas dimensions and screen * offsets are computed from the primary screen resolution, because Fastlane * resolves those at runtime from the downloaded `offsets.json` in its frames * repository — which is not bundled here. * * For modern edge-to-edge devices (post-2017 iPhones, Pixel 3+, recent Samsung), * the frame adds a small 4–7% horizontal bezel. For bezeled devices, padding * roughly follows the real chassis (~10% X, ~18% Y). These estimates mean * `frameScreenshots` still composites sensibly, but they are not pixel-perfect * reproductions of the real frame PNGs. * * Device names follow Fastlane's `formatted_name_without_apple`: the "Apple " * prefix is stripped, as are parenthesised suffixes (e.g. "(3rd generation)"). */ interface DeviceFrame { /** Fastlane device id (slug). Used for filename detection. */ id: string; /** Human-readable device name (matches Fastlane's `formatted_name_without_apple`). */ name: string; /** Priority (from Fastlane). Higher wins when multiple devices match. */ priority: number; /** Frame canvas dimensions (computed). */ width: number; height: number; /** Primary screen resolution used for detection and compositing. */ screenWidth: number; screenHeight: number; /** All supported screen resolutions [width, height] for detection. */ screenResolutions: Array<[number, number]>; /** Screen-within-frame offset in pixels. */ screenOffsetX: number; screenOffsetY: number; platform: "ios" | "android" | "mac"; /** Optional PPI from Fastlane. */ ppi?: number; /** Default color from Fastlane. */ color?: string; } /** * All devices from Fastlane's `frameit/device_types.rb` (66 entries) plus * iPhone 15/16 models that Apple released after Fastlane's last update, and * a couple of Samsung Galaxy S21 entries carried over from fastnode's * pre-port list. Ordered descending by priority so `detectDevice*` picks the * newest/highest priority device when multiple match. */ declare const DEVICE_FRAMES: DeviceFrame[]; /** * Match a device by screenshot pixel dimensions. Returns the highest-priority * device whose resolution list contains `(width, height)` in either orientation. */ declare function detectDeviceFromDimensions(width: number, height: number): DeviceFrame | null; /** * Match a device by filename substring. Mirrors Fastlane's * `Device.detect_device`: a device matches if the filename contains either * the formatted name or the slug id. Token separators `-`, `_`, and spaces * are treated as equivalent, and `.` inside numeric suffixes (e.g. `12.9`) * is optional. Returns the highest-priority match. */ declare function detectDeviceFromFilename(filename: string): DeviceFrame | null; interface FrameitOptions { screenshotsPath: string; outputPath?: string; forceDeviceType?: string; useDeviceOuterShadow?: boolean; whiteBackground?: boolean; } declare function frameScreenshots(options: FrameitOptions): Promise; declare const index_DEVICE_FRAMES: typeof DEVICE_FRAMES; type index_DeviceFrame = DeviceFrame; type index_FrameitOptions = FrameitOptions; declare const index_detectDeviceFromDimensions: typeof detectDeviceFromDimensions; declare const index_detectDeviceFromFilename: typeof detectDeviceFromFilename; declare const index_frameScreenshots: typeof frameScreenshots; declare namespace index { export { index_DEVICE_FRAMES as DEVICE_FRAMES, type index_DeviceFrame as DeviceFrame, type index_FrameitOptions as FrameitOptions, index_detectDeviceFromDimensions as detectDeviceFromDimensions, index_detectDeviceFromFilename as detectDeviceFromFilename, index_frameScreenshots as frameScreenshots }; } export { DEVICE_FRAMES as D, type FrameitOptions as F, detectDeviceFromFilename as a, type DeviceFrame as b, detectDeviceFromDimensions as d, frameScreenshots as f, index as i };