@konemono/nostr-login 1.11.5 → 1.11.6

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.
@@ -1,12 +1,14 @@
1
+ /// <reference types="node" />
1
2
  import NDK, { NDKEvent, NDKFilter, NDKNip46Signer, NDKNostrRpc, NDKRpcRequest, NDKRpcResponse, NDKSubscription, NDKUser, NostrEvent } from '@nostr-dev-kit/ndk';
2
3
  import { PrivateKeySigner } from './Signer';
4
+ import { EventEmitter } from 'events';
3
5
  declare class NostrRpc extends NDKNostrRpc {
4
6
  protected _ndk: NDK;
5
7
  protected _signer: PrivateKeySigner;
6
8
  protected requests: Set<string>;
7
9
  private sub?;
8
10
  protected _useNip44: boolean;
9
- private eventEmitter;
11
+ protected eventEmitter: EventEmitter;
10
12
  constructor(ndk: NDK, signer: PrivateKeySigner);
11
13
  subscribe(filter: NDKFilter): Promise<NDKSubscription>;
12
14
  stop(): void;
@@ -24,6 +26,7 @@ declare class NostrRpc extends NDKNostrRpc {
24
26
  protected setResponseHandler(id: string, cb?: (res: NDKRpcResponse) => void): Promise<NDKRpcResponse>;
25
27
  protected createRequestEvent(id: string, remotePubkey: string, method: string, params?: string[], kind?: number): Promise<NDKEvent>;
26
28
  on: <EventKey extends string | symbol = string>(event: EventKey, listener: (...args: any[]) => void) => this;
29
+ once: <EventKey extends string | symbol = string>(event: EventKey, listener: (...args: any[]) => void) => this;
27
30
  emit: <EventKey extends string | symbol = string>(event: EventKey, ...args: any[]) => boolean;
28
31
  }
29
32
  export declare class IframeNostrRpc extends NostrRpc {
@@ -67,6 +70,8 @@ export declare class Nip46Signer extends NDKNip46Signer {
67
70
  domain: string;
68
71
  perms?: string;
69
72
  }): Promise<string>;
73
+ on: <EventKey extends string | symbol = string>(event: EventKey, listener: (...args: any[]) => void) => this;
74
+ once: <EventKey extends string | symbol = string>(event: EventKey, listener: (...args: any[]) => void) => this;
70
75
  emit: <EventKey extends string | symbol = string>(event: EventKey, ...args: any[]) => boolean;
71
76
  }
72
77
  export {};