Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@todesktop/client-util

Package Overview
Dependencies
Maintainers
0
Versions
35
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@todesktop/client-util - npm Package Compare versions

Comparing version 1.0.4 to 1.1.0

6

CHANGELOG.md
# @todesktop/client-util
## 1.1.0
### Minor Changes
- a202b4a: feat: add `session.setDisplayMediaRequestHandler` support
## 1.0.4

@@ -4,0 +10,0 @@

9

index.d.ts
/**
* Barebones EventEmitter implementation for API namespaces.
*/
import type { BrowserWindow, WebContents, Tray, NativeImage, nativeImage, NativeTheme, Menu, MenuItem, BrowserView, Notification, App, Screen, Session, session, SafeStorage, Clipboard } from "@todesktop/client-electron-types";
import type { BrowserWindow, WebContents, Tray, NativeImage, nativeImage, NativeTheme, Menu, MenuItem, BrowserView, WebContentsView, Notification, App, Screen, Session, session, SafeStorage, Clipboard } from "@todesktop/client-electron-types";
import type AutoUpdater from "@todesktop/client-todesktop-runtime-types/dist/AutoUpdater.js";

@@ -14,2 +14,5 @@ import type { AppUpdater } from "@todesktop/client-electron-updater-types";

}>(eventMappings: E) => (event: keyof E | "*", callback: (...any: any[]) => void) => Promise<() => Promise<void>>;
export declare const typedSetupAddEventListener: <E extends {
[key: string]: string;
}, C extends { [K in keyof E]: (...any: any[]) => void; }>(eventMappings: E) => (event: keyof E | "*", callback: C[keyof E]) => Promise<() => Promise<void>>;
/**

@@ -38,4 +41,5 @@ * Setup the ability to unregister an event handler for the given `eventMappings`.

BrowserView: BrowserView;
WebContentsView: WebContentsView;
process: NodeJS.Process;
Session: Session;
session: Session;
safeStorage: SafeStorage;

@@ -50,2 +54,3 @@ clipboard: Clipboard;

BrowserView: typeof BrowserView;
WebContentsView: typeof WebContentsView;
Notification: typeof Notification;

@@ -52,0 +57,0 @@ electronUpdater: AppUpdater;

@@ -22,2 +22,12 @@ /**

};
export const typedSetupAddEventListener = (eventMappings) => async (event, callback) => {
const eventId = nanoid();
const eventsToListenFor = event === "*" ? Object.keys(eventMappings) : [event];
for (const eventName of eventsToListenFor) {
const legacyName = eventMappings[eventName];
safeWindowToDesktop === null || safeWindowToDesktop === void 0 ? void 0 : safeWindowToDesktop.on(legacyName, callback, eventId);
}
const off = setupRemoveEventListener(eventMappings);
return async () => off(event, callback, eventId);
};
// TODO: Remove legacy event support in 2.0

@@ -24,0 +34,0 @@ /**

{
"name": "@todesktop/client-util",
"version": "1.0.4",
"version": "1.1.0",
"description": "Utility functions for ToDesktop client libraries",

@@ -5,0 +5,0 @@ "main": "index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc