@lynx-js/lynxtron 0.0.5 → 0.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -378,14 +378,6 @@ export declare class BaseWindow extends EventEmitter {
378
378
  once(event: 'closed', listener: () => void): this;
379
379
  addListener(event: 'closed', listener: () => void): this;
380
380
  removeListener(event: 'closed', listener: () => void): this;
381
- /**
382
- * Emitted before the window enters a full-screen state.
383
- */
384
- on(event: 'will-enter-full-screen', listener: () => void): this;
385
- off(event: 'will-enter-full-screen', listener: () => void): this;
386
- once(event: 'will-enter-full-screen', listener: () => void): this;
387
- addListener(event: 'will-enter-full-screen', listener: () => void): this;
388
- removeListener(event: 'will-enter-full-screen', listener: () => void): this;
389
381
  /**
390
382
  * Emitted when the window enters a full-screen state.
391
383
  */
@@ -410,14 +402,6 @@ export declare class BaseWindow extends EventEmitter {
410
402
  once(event: 'hide', listener: () => void): this;
411
403
  addListener(event: 'hide', listener: () => void): this;
412
404
  removeListener(event: 'hide', listener: () => void): this;
413
- /**
414
- * Emitted before the window leaves a full-screen state.
415
- */
416
- on(event: 'will-leave-full-screen', listener: () => void): this;
417
- off(event: 'will-leave-full-screen', listener: () => void): this;
418
- once(event: 'will-leave-full-screen', listener: () => void): this;
419
- addListener(event: 'will-leave-full-screen', listener: () => void): this;
420
- removeListener(event: 'will-leave-full-screen', listener: () => void): this;
421
405
  /**
422
406
  * Emitted when the window leaves a full-screen state.
423
407
  */
@@ -742,10 +726,10 @@ export declare class BaseWindow extends EventEmitter {
742
726
  listener: (event: Event, direction: string) => void
743
727
  ): this;
744
728
  /**
745
- * Emitted when the system context menu is triggered on the window, this is
746
- * normally only triggered when the user right clicks on the non-client area of
747
- * your window. This is the window titlebar or any area you have declared as
748
- * `-webkit-app-region: drag` in a frameless window.
729
+ * Emitted when the system context menu is triggered on the window. This is
730
+ * normally triggered when the user right clicks the system title bar or a
731
+ * draggable region in the Lynx UI. In a frameless window, draggable regions
732
+ * must be explicitly declared using the `-x-app-region: drag` CSS property.
749
733
  *
750
734
  * Calling `event.preventDefault()` will prevent the menu from being displayed.
751
735
  *
@@ -0,0 +1,34 @@
1
+ // Copyright 2026 The Lynxtron Authors. All rights reserved.
2
+ // Licensed under the Apache License Version 2.0 that can be found in the
3
+ // LICENSE file in the root directory of this source tree.
4
+
5
+ import { LynxBridgeInvokeEvent } from './lynx-window';
6
+
7
+ export type LynxBridgeHandler = (
8
+ event: LynxBridgeInvokeEvent,
9
+ args: unknown
10
+ ) => unknown | Promise<unknown>;
11
+
12
+ export interface LynxBridge extends NodeJS.EventEmitter {
13
+ /**
14
+ * Register a handler for an invoke method. The handler will be called when
15
+ * the Lynx side calls `bridge.call(method, args)`.
16
+ *
17
+ * The return value of the handler will be sent back to the Lynx side via
18
+ * `event.sendReply()`.
19
+ */
20
+ handle(method: string, handler: LynxBridgeHandler): void;
21
+
22
+ /**
23
+ * Register a one-time handler for an invoke method. The handler will be
24
+ * removed after it is called once.
25
+ */
26
+ handleOnce(method: string, handler: LynxBridgeHandler): void;
27
+
28
+ /**
29
+ * Remove a previously registered handler for the given method.
30
+ */
31
+ removeHandler(method: string): void;
32
+ }
33
+
34
+ export declare const lynxBridge: LynxBridge;
@@ -284,11 +284,9 @@ export declare class LynxWindow extends BaseWindow {
284
284
  on(event: 'blur', listener: (event: Event) => void): this;
285
285
  on(event: 'close', listener: (event: Event) => void): this;
286
286
  on(event: 'closed', listener: () => void): this;
287
- on(event: 'will-enter-full-screen', listener: () => void): this;
288
287
  on(event: 'enter-full-screen', listener: () => void): this;
289
288
  on(event: 'focus', listener: (event: Event) => void): this;
290
289
  on(event: 'hide', listener: () => void): this;
291
- on(event: 'will-leave-full-screen', listener: () => void): this;
292
290
  on(event: 'leave-full-screen', listener: () => void): this;
293
291
  on(event: 'maximize', listener: () => void): this;
294
292
  on(event: 'minimize', listener: () => void): this;
@@ -19,6 +19,7 @@ export * from './api/base-window';
19
19
  export * from './api/clipboard';
20
20
  export * from './api/event';
21
21
  export * from './api/lynx-window';
22
+ export * from './api/lynx-bridge';
22
23
  export * from './api/lynx-library';
23
24
  export * from './api/touch-bar';
24
25
  export * from './api/screen';
package/lynxtron.js CHANGED
@@ -39,5 +39,6 @@ export const Tray = lynxtron.Tray;
39
39
  export const LynxTemplateData = lynxtron.LynxTemplateData;
40
40
  export const LynxUpdateMeta = lynxtron.LynxUpdateMeta;
41
41
  export const powerMonitor = lynxtron.powerMonitor;
42
+ export const lynxBridge = lynxtron.lynxBridge;
42
43
 
43
44
  export const lynx = Object.freeze({});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lynx-js/lynxtron",
3
- "version": "0.0.5",
3
+ "version": "0.0.7",
4
4
  "description": "lynxtron npm package test",
5
5
  "type": "module",
6
6
  "types": "./apis/lynxtron.d.ts",