Skip to content

Commit

Permalink
Add type annotations for OSGUI menu definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
1j01 committed Jun 27, 2024
1 parent 66acb74 commit 3a0c059
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions programs/calculator/menus.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/** @type {OSGUITopLevelMenus} */
var menus = {
"&Edit": [
{
Expand Down
2 changes: 2 additions & 0 deletions programs/explorer/menus.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@

// This menu is shared between the View menu and the Views toolbar button dropdown
/** @type {OSGUIMenuFragment[]} */
var views_dropdown_menu_items = [
// @TODO: make this option unavailable for the Desktop folder
{
Expand Down Expand Up @@ -64,6 +65,7 @@ var views_dropdown_menu_items = [
},
];

/** @type {OSGUITopLevelMenus} */
var menus = {
"&File": [
// @TODO: os-gui should support descriptions for top level menus,
Expand Down
1 change: 1 addition & 0 deletions programs/js-solitaire/src/menus.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/** @type {OSGUITopLevelMenus} */
var menus = {
"&Game": [
{
Expand Down
2 changes: 2 additions & 0 deletions programs/minesweeper/menus.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ var is_at_difficulty = function(difficulty){
minesweeper_.number_mines === difficulty[2]
);
};
/** @type {OSGUICheckbox} */
var checkbox_for_difficulty = function(index){
return {
check: function(){
Expand All @@ -36,6 +37,7 @@ var checkbox_for_difficulty = function(index){
};
};

/** @type {OSGUITopLevelMenus} */
var menus = {
"&Game": [
{
Expand Down
2 changes: 1 addition & 1 deletion programs/notepad/src/menus.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@

/** @type {OSGUITopLevelMenus} */
var menus = {
"&File": [
// NOTE: Notepad in Windows 98 doesn't actually have shortcuts for anything in the File menu
Expand Down
1 change: 1 addition & 0 deletions programs/pinball/space-cadet-menus.js
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,7 @@ async function handle_menu_item(top_level_menu_index, item_index, submenu_item_i
triggering_menus = false;
}

/** @type {OSGUITopLevelMenus} */
var menus = {
"&Game": [
{
Expand Down
2 changes: 1 addition & 1 deletion programs/sound-recorder/src/menus.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@

/** @type {OSGUITopLevelMenus} */
var menus = {
"&File": [
{
Expand Down

0 comments on commit 3a0c059

Please sign in to comment.