This commit is contained in:
Alvin-Zilverstand committed 2026-09-09 10:21:29 +02:00
commit 42ef2f9674
468 files changed
+645161

No files matched your search

@@ -0,0 +1,31 @@
import { MenuItemBase, newMenu } from './base.js';
import { invoke } from '../core.js';
// Copyright 2019-2024 Tauri Programme within The Commons Conservancy
// SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: MIT
/** A predefined (native) menu item which has a predefined behavior by the OS or by tauri. */
class PredefinedMenuItem extends MenuItemBase {
/** @ignore */
constructor(rid, id) {
super(rid, id, 'Predefined');
}
/** Create a new predefined menu item. */
static async new(opts) {
return newMenu('Predefined', opts).then(([rid, id]) => new PredefinedMenuItem(rid, id));
}
/** Returns the text of this predefined menu item. */
async text() {
return invoke('plugin:menu|text', { rid: this.rid, kind: this.kind });
}
/** Sets the text for this predefined menu item. */
async setText(text) {
return invoke('plugin:menu|set_text', {
rid: this.rid,
kind: this.kind,
text
});
}
}
export { PredefinedMenuItem };
@@ -0,0 +1,23 @@
/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
/// <reference no-default-lib="true"/>
/// <reference lib="es2015" />
/// <reference lib="dom" />
/// <reference lib="dom.iterable" />
/// <reference lib="webworker.importscripts" />
/// <reference lib="scripthost" />