@solana/subscribable
Advanced tools
Comparing version 2.0.0-canary-20241004181751 to 2.0.0-canary-20241004194132
@@ -1,12 +0,12 @@ | ||
import { TypedEventEmitter } from './event-emitter'; | ||
import { TypedEventEmitter, TypedEventTarget } from './event-emitter'; | ||
type UnsubscribeFn = () => void; | ||
export interface DataPublisher<TDataByChannelName extends Record<string, unknown> = Record<string, unknown>> { | ||
on<const TChannelName extends keyof TDataByChannelName>(channelName: TChannelName, subscriber: (...data: TDataByChannelName[TChannelName] extends never ? [] : [data: TDataByChannelName[TChannelName]]) => void, options?: { | ||
on<const TChannelName extends keyof TDataByChannelName>(channelName: TChannelName, subscriber: (data: TDataByChannelName[TChannelName]) => void, options?: { | ||
signal: AbortSignal; | ||
}): UnsubscribeFn; | ||
} | ||
export declare function getDataPublisherFromEventEmitter<TEventMap extends Record<string, Event>>(eventEmitter: TypedEventEmitter<TEventMap>): DataPublisher<{ | ||
[TEventType in keyof TEventMap]: TEventMap[TEventType] extends CustomEvent ? TEventMap[TEventType]['detail'] : never; | ||
export declare function getDataPublisherFromEventEmitter<TEventMap extends Record<string, Event>>(eventEmitter: TypedEventEmitter<TEventMap> | TypedEventTarget<TEventMap>): DataPublisher<{ | ||
[TEventType in keyof TEventMap]: TEventMap[TEventType] extends CustomEvent ? TEventMap[TEventType]['detail'] : null; | ||
}>; | ||
export {}; | ||
//# sourceMappingURL=data-publisher.d.ts.map |
{ | ||
"name": "@solana/subscribable", | ||
"version": "2.0.0-canary-20241004181751", | ||
"version": "2.0.0-canary-20241004194132", | ||
"description": "Helpers for creating subscription-based event emitters", | ||
@@ -60,3 +60,3 @@ "exports": { | ||
"dependencies": { | ||
"@solana/errors": "2.0.0-canary-20241004181751" | ||
"@solana/errors": "2.0.0-canary-20241004194132" | ||
}, | ||
@@ -63,0 +63,0 @@ "peerDependencies": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
95735
+ Added@solana/errors@2.0.0-canary-20241004194132(transitive)
- Removed@solana/errors@2.0.0-canary-20241004181751(transitive)