-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtypes.ts
More file actions
60 lines (53 loc) · 1.67 KB
/
types.ts
File metadata and controls
60 lines (53 loc) · 1.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
export enum PlatformKey {
iPhone = 'iPhone',
iPad = 'iPad',
iOSMarketing = 'App Store', // For the 1024x1024 App Store icon
macOS = 'macOS',
watchOS = 'watchOS',
Android = 'Android',
}
export interface PlatformOption {
id: PlatformKey;
label: string;
icon: React.ReactElement<{ className?: string }>; // For displaying an icon next to the checkbox
}
// Defines the properties of each icon to be generated
export interface IconAttributes {
width: number;
height: number;
pathInZip: string; // Full path within the ZIP, e.g., "Apple/Assets.xcassets/AppIcon.appiconset/icon-20@2x.png"
platformKey: PlatformKey; // The primary platform this icon definition is for
// Optional metadata for iOS Contents.json
iosMeta?: {
size: string; // e.g., "20x20"
idiom: string; // e.g., "iphone", "ipad", "watch", "ios-marketing", "mac"
scale: string; // e.g., "1x", "2x", "3x"
role?: string; // For watchOS, e.g., "notificationCenter"
subtype?: string; // For watchOS, e.g., "38mm"
filenameForContentsJson: string; // Filename as it appears in Contents.json
};
}
// Represents a generated icon with its data URL
export interface GeneratedImageData extends IconAttributes {
dataUrl: string;
}
// Grouping generated icons by platform for display
export interface GroupedGeneratedIcons {
[key: string]: GeneratedImageData[]; // Key is PlatformKey as string
}
// For Contents.json structure
export interface IOSContentsJsonImage {
size: string;
idiom: string;
filename: string;
scale: string;
role?: string;
subtype?: string;
}
export interface IOSContentsJson {
images: IOSContentsJsonImage[];
info: {
version: number;
author: string;
};
}