Skip to content

Commit 9c2bb0c

Browse files
js_sdk: bump major version
1 parent 7c18759 commit 9c2bb0c

File tree

12 files changed

+39
-18
lines changed

12 files changed

+39
-18
lines changed

applications/debug/unit_tests/resources/unit_tests/js/basic.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@ tests.assert_eq(true, doesSdkSupport(["baseline"]));
1111
tests.assert_eq(false, doesSdkSupport(["abobus", "other-nonexistent-feature"]));
1212

1313
tests.assert_eq("flipperdevices", flipper.firmwareVendor);
14-
tests.assert_eq(0, flipper.jsSdkVersion[0]);
15-
tests.assert_eq(3, flipper.jsSdkVersion[1]);
14+
tests.assert_eq(1, flipper.jsSdkVersion[0]);
15+
tests.assert_eq(0, flipper.jsSdkVersion[1]);

applications/system/js_app/js_modules.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -272,10 +272,6 @@ void js_check_sdk_compatibility(struct mjs* mjs) {
272272

273273
static const char* extra_features[] = {
274274
"baseline", // dummy "feature"
275-
"gpio-pwm",
276-
"gui-widget",
277-
"serial-framing",
278-
"gui-widget-extras",
279275
};
280276

281277
/**

applications/system/js_app/js_modules.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ extern "C" {
1515
#define PLUGIN_API_VERSION 1
1616

1717
#define JS_SDK_VENDOR "flipperdevices"
18-
#define JS_SDK_MAJOR 0
19-
#define JS_SDK_MINOR 3
18+
#define JS_SDK_MAJOR 1
19+
#define JS_SDK_MINOR 0
2020

2121
/**
2222
* @brief Returns the foreign pointer in `obj["_"]`

applications/system/js_app/packages/create-fz-app/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@flipperdevices/create-fz-app",
3-
"version": "0.1.1",
3+
"version": "0.1.2",
44
"description": "Template package for JS apps Flipper Zero",
55
"bin": "index.js",
66
"type": "module",

applications/system/js_app/packages/create-fz-app/template/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"start": "npm run build && node node_modules/@flipperdevices/fz-sdk/sdk.js upload"
77
},
88
"devDependencies": {
9-
"@flipperdevices/fz-sdk": "^0.3",
9+
"@flipperdevices/fz-sdk": "^1.0",
1010
"typescript": "^5.6.3"
1111
}
1212
}

applications/system/js_app/packages/fz-sdk/global.d.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
* @brief Checks compatibility between the script and the JS SDK that the
7373
* firmware provides
7474
*
75-
* @note You're looking at JS SDK v0.3
75+
* @note You're looking at JS SDK v1.0
7676
*
7777
* @param expectedMajor JS SDK major version expected by the script
7878
* @param expectedMinor JS SDK minor version expected by the script
@@ -92,7 +92,7 @@ declare function sdkCompatibilityStatus(expectedMajor: number, expectedMinor: nu
9292
* @brief Checks compatibility between the script and the JS SDK that the
9393
* firmware provides in a boolean fashion
9494
*
95-
* @note You're looking at JS SDK v0.3
95+
* @note You're looking at JS SDK v1.0
9696
*
9797
* @param expectedMajor JS SDK major version expected by the script
9898
* @param expectedMinor JS SDK minor version expected by the script
@@ -105,7 +105,7 @@ declare function isSdkCompatible(expectedMajor: number, expectedMinor: number):
105105
* @brief Asks the user whether to continue executing the script if the versions
106106
* are not compatible. Does nothing if they are.
107107
*
108-
* @note You're looking at JS SDK v0.3
108+
* @note You're looking at JS SDK v1.0
109109
*
110110
* @param expectedMajor JS SDK major version expected by the script
111111
* @param expectedMinor JS SDK minor version expected by the script

applications/system/js_app/packages/fz-sdk/gpio/index.d.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ export interface Pin {
8080
* PWM-related methods on this pin will throw an error when called.
8181
* @note On Flipper Zero only pins PA4 and PA7 support PWM
8282
* @version Added in JS SDK 0.2, extra feature `"gpio-pwm"`
83+
* @version Baseline since JS SDK 1.0
8384
*/
8485
isPwmSupported(): boolean;
8586
/**
@@ -89,18 +90,21 @@ export interface Pin {
8990
* @param freq Frequency in Hz
9091
* @param duty Duty cycle in %
9192
* @version Added in JS SDK 0.2, extra feature `"gpio-pwm"`
93+
* @version Baseline since JS SDK 1.0
9294
*/
9395
pwmWrite(freq: number, duty: number): void;
9496
/**
9597
* Determines whether PWM is running. Throws an error if PWM is not
9698
* supported on this pin.
9799
* @version Added in JS SDK 0.2, extra feature `"gpio-pwm"`
100+
* @version Baseline since JS SDK 1.0
98101
*/
99102
isPwmRunning(): boolean;
100103
/**
101104
* Stops PWM. Does not restore previous pin configuration. Throws an error
102105
* if PWM is not supported on this pin.
103106
* @version Added in JS SDK 0.2, extra feature `"gpio-pwm"`
107+
* @version Baseline since JS SDK 1.0
104108
*/
105109
pwmStop(): void;
106110
}

applications/system/js_app/packages/fz-sdk/gui/icon.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,14 @@ export type IconData = symbol & { "__tag__": "icon" };
77
* Gets a built-in firmware icon for use in GUI
88
* @param icon Name of the icon
99
* @version Added in JS SDK 0.2, extra feature `"gui-widget"`
10+
* @version Baseline since JS SDK 1.0
1011
*/
1112
export declare function getBuiltin(icon: BuiltinIcon): IconData;
1213

1314
/**
1415
* Loads a .fxbm icon (XBM Flipper sprite, from flipperzero-game-engine) for use in GUI
1516
* @param path Path to the .fxbm file
1617
* @version Added in JS SDK 0.3, extra feature `"gui-widget-extras"`
18+
* @version Baseline since JS SDK 1.0
1719
*/
1820
export declare function loadFxbm(path: string): IconData;

applications/system/js_app/packages/fz-sdk/gui/index.d.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,17 +133,20 @@ export declare class View<Props extends Properties, Child> {
133133
* Adds a child to the View
134134
* @param child Child to add
135135
* @version Added in JS SDK 0.2, extra feature `"gui-widget"`
136+
* @version Baseline since JS SDK 1.0
136137
*/
137138
addChild<C extends Child>(child: C): void;
138139
/**
139140
* Removes all children from the View
140141
* @version Added in JS SDK 0.2, extra feature `"gui-widget"`
142+
* @version Baseline since JS SDK 1.0
141143
*/
142144
resetChildren(): void;
143145
/**
144146
* Removes all previous children from the View and assigns new children
145147
* @param children The list of children to assign
146148
* @version Added in JS SDK 0.2, extra feature `"gui-widget"`
149+
* @version Baseline since JS SDK 1.0
147150
*/
148151
setChildren(children: Child[]): void;
149152
}
@@ -158,7 +161,9 @@ export declare class ViewFactory<Props extends Properties, Child, V extends View
158161
* Create view instance with custom values, can be changed later with set()
159162
* @param initial Dictionary of property names to values
160163
* @param children Optional list of children to add to the view
161-
* @version Added in JS SDK 0.1; amended in JS SDK 0.2, extra feature `"gui-widget"`
164+
* @version Added in JS SDK 0.1
165+
* @version Amended in JS SDK 0.2, extra feature `"gui-widget"`
166+
* @version Baseline since JS SDK 1.0
162167
*/
163168
makeWith(initial: Partial<Props>, children?: Child[]): V;
164169
}

applications/system/js_app/packages/fz-sdk/gui/widget.d.ts

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
* This view has the elements as its children.
2424
*
2525
* @version Added in JS SDK 0.2, extra feature `"gui-widget"`
26+
* @version Baseline since JS SDK 1.0
2627
* @module
2728
*/
2829

@@ -42,9 +43,21 @@ type TextBoxElement = { element: "text_box", stripToDots: boolean } & Position &
4243
type TextScrollElement = { element: "text_scroll" } & Position & Size & Text;
4344
type ButtonElement = { element: "button", button: "left" | "center" | "right" } & Text;
4445
type IconElement = { element: "icon", iconData: IconData } & Position;
45-
type RectElement = { element: "rect", radius: number, fill: boolean } & Position & Size; /** @version Amended in JS SDK 0.3, extra feature `"gui-widget-extras"` */
46-
type CircleElement = { element: "circle", radius: number, fill: boolean } & Position; /** @version Added in JS SDK 0.3, extra feature `"gui-widget-extras"` */
47-
type LineElement = { element: "line", x1: number, y1: number, x2: number, y2: number }; /** @version Added in JS SDK 0.3, extra feature `"gui-widget-extras"` */
46+
/**
47+
* @version Amended in JS SDK 0.3, extra feature `"gui-widget-extras"`
48+
* @version Baseline since JS SDK 1.0
49+
* */
50+
type RectElement = { element: "rect", radius: number, fill: boolean } & Position & Size;
51+
/**
52+
* @version Added in JS SDK 0.3, extra feature `"gui-widget-extras"`
53+
* @version Baseline since JS SDK 1.0
54+
* */
55+
type CircleElement = { element: "circle", radius: number, fill: boolean } & Position;
56+
/**
57+
* @version Added in JS SDK 0.3, extra feature `"gui-widget-extras"`
58+
* @version Baseline since JS SDK 1.0
59+
* */
60+
type LineElement = { element: "line", x1: number, y1: number, x2: number, y2: number };
4861

4962
type Element = StringMultilineElement
5063
| StringElement

0 commit comments

Comments
 (0)