forked from microsoft/pxt
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpxtpackage.d.ts
More file actions
148 lines (133 loc) · 4.23 KB
/
pxtpackage.d.ts
File metadata and controls
148 lines (133 loc) · 4.23 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
declare namespace pxt {
interface Map<T> {
[index: string]: T;
}
interface TargetVersions {
target: string;
pxt?: string;
pxtCrowdinBranch?: string;
targetCrowdinBranch?: string;
tag?: string;
branch?: string;
commits?: string; // URL
}
interface Size {
width: number;
height: number;
}
/**
* The schema for the pxt.json package files
*/
interface PackageConfig {
name: string;
version?: string;
installedVersion?: string;
// url to icon -- support for built-in packages only
icon?: string;
// semver description for support target version
documentation?: string; // doc page to open when loading project
targetVersions?: TargetVersions; // versions of the target/pxt the package was compiled against
description?: string;
dependencies: Map<string>;
license?: string;
authors?: string[];
files: string[];
simFiles?: string[];
testFiles?: string[];
testDependencies?: pxt.Map<string>;
public?: boolean;
binaryonly?: boolean;
platformio?: PlatformIOConfig;
compileServiceVariant?: string;
palette?: string[];
screenSize?: Size;
yotta?: YottaConfig;
npmDependencies?: Map<string>;
card?: CodeCard;
additionalFilePath?: string;
additionalFilePaths?: string[];
core?: boolean;
gistId?: string;
extension?: PackageExtension; // describe the associated extension if any
dalDTS?: {
includeDirs: string[];
excludePrefix?: string[];
};
}
interface PackageExtension {
namespace?: string; // Namespace to add the button under, defaults to package name
label?: string; // Label for the flyout button, defaults to `Editor`
color?: string; // for new category, category color
advanced?: boolean; // for new category, is category advanced
localUrl?: string; // local debugging URL used when served through pxt serve and debugExtensions=1 mode
}
interface PlatformIOConfig {
dependencies?: Map<string>;
}
interface CompilationConfig {
description: string;
config: any;
}
interface YottaConfig {
dependencies?: Map<string>;
config?: any;
/**
* Overridable config flags
*/
optionalConfig?: any;
userConfigs?: CompilationConfig[];
/* deprecated */
configIsJustDefaults?: boolean;
/* deprecated */
ignoreConflicts?: boolean;
}
interface CodeCard {
name?: string;
shortName?: string;
title?: string;
role?: string;
ariaLabel?: string;
label?: string;
labelClass?: string;
tags?: CodeCardTag[]; // tags shown in home screen, eg: [{ "label": "Beginner", "color": "blue" }]
tabIndex?: number;
color?: string; // one of semantic ui colors
description?: string;
extracontent?: string;
blocksXml?: string;
typeScript?: string;
imageUrl?: string;
largeImageUrl?: string;
youTubeId?: string;
time?: number;
url?: string;
learnMoreUrl?: string;
buyUrl?: string;
responsive?: boolean;
cardType?: "file" | "example" | "codeExample" | "tutorial" | "side" | "template" | "package" | "hw";
header?: string;
any?: number;
hardware?: number;
software?: number;
blocks?: number;
javascript?: number;
icon?: string;
iconContent?: string; // Text instead of icon name
iconColor?: string;
onClick?: (e: any) => void; // React event
target?: string;
className?: string;
}
interface CodeCardTag {
label: string;
color?: string;
}
interface JRes {
id: string; // something like "sounds.bark"
data: string;
dataEncoding?: string; // must be "base64" or missing (meaning the same)
icon?: string; // URL (usually data-URI) for the icon
namespace?: string; // used to construct id
mimeType: string;
}
}