Explicitly specify argument lists for compat methods.

This commit is contained in:
flash 2024-01-22 13:19:04 +00:00
parent 1c797565b7
commit 5514c8fdc6

View file

@ -24,9 +24,9 @@ const MamiCompat = (current, path, handler) => {
// Backwards compat for scripts
// Keep in sync with <https://fii.moe/fp/13176> for as long as possible
MamiCompat(Umi, 'Server.SendMessage', Umi.Server.sendMessage.bind(Umi.Server));
MamiCompat(Umi, 'Protocol.SockLegacy.Protocol.Instance.SendMessage', Umi.Server.sendMessage.bind(Umi.Server));
MamiCompat(Umi, 'Parser.SockChatBBcode.EmbedStub', function() {}); // intentionally a no-op
MamiCompat(Umi, 'UI.View.SetText', function() { console.log('Umi.UI.View.SetText called'); });
MamiCompat(Umi, 'UI.Menus.Add', function() { console.log('Umi.UI.Menus.Add called'); });
MamiCompat(Umi, 'UI.Menus.Get', function() { console.log('Umi.UI.Menus.Get called'); });
MamiCompat(Umi, 'Server.SendMessage', text => Umi.Server.sendMessage(text));
MamiCompat(Umi, 'Protocol.SockLegacy.Protocol.Instance.SendMessage', text => Umi.Server.sendMessage(text));
MamiCompat(Umi, 'Parser.SockChatBBcode.EmbedStub', () => {}); // intentionally a no-op
MamiCompat(Umi, 'UI.View.SetText', text => console.log(`Umi.UI.View.SetText(text: ${text})`));
MamiCompat(Umi, 'UI.Menus.Add', (baseId, title, initiallyHidden) => console.log(`Umi.UI.Menus.Add(baseId: ${baseId}, title: ${title}, initiallyHidden: ${initiallyHidden})`));
MamiCompat(Umi, 'UI.Menus.Get', (baseId, icon) => console.log(`Umi.UI.Menus.Get(baseId: ${baseId}, icon: ${icon})`));