Initial commit
This commit is contained in:
commit
ca0c91c299
15 changed files with 1690 additions and 0 deletions
40
src/devices.ts
Normal file
40
src/devices.ts
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
export interface DeviceModel {
|
||||
name: string;
|
||||
label: string;
|
||||
description: string;
|
||||
width: number;
|
||||
height: number;
|
||||
colors: number;
|
||||
bit_depth: number;
|
||||
scale_factor: number;
|
||||
rotation: number;
|
||||
mime_type: string;
|
||||
offset_x: number;
|
||||
offset_y: number;
|
||||
kind: string;
|
||||
palette_ids: string[];
|
||||
preview_white_point: string;
|
||||
image_size_limit: number;
|
||||
image_upload_supported: boolean;
|
||||
css: {
|
||||
classes: {
|
||||
device: string;
|
||||
size: string;
|
||||
density: string;
|
||||
};
|
||||
|
||||
variables: [string, string][];
|
||||
};
|
||||
}
|
||||
|
||||
export const devices: DeviceModel[] = (
|
||||
(await (
|
||||
await fetch(
|
||||
(globalThis as any).document
|
||||
? '/api/models'
|
||||
: 'https://trmnl.com/api/models'
|
||||
)
|
||||
).json()) as {
|
||||
data: DeviceModel[];
|
||||
}
|
||||
).data;
|
||||
Loading…
Add table
Add a link
Reference in a new issue