papi-dts
    Preparing search index...
    interface PapiNetworkService {
        createBufferedNetworkEventEmitter: <
            EventType extends keyof NetworkEvents,
        >(
            eventType: EventType,
            documentation?: SingleNotificationDocumentation,
            options?: {
                bufferStrategy?: NetworkEventBufferStrategy<NetworkEvents[EventType]>;
            },
        ) => {
            dispose: () => void;
            emit: (event: NetworkEvents[EventType]) => void;
            registeredEmitter: Promise<PlatformEventEmitter<NetworkEvents[EventType]>>;
        };
        createNetworkEventEmitter: <T>(
            eventType: string,
        ) => PlatformEventEmitter<T>;
        createNetworkEventEmitterAsync: <EventType extends keyof NetworkEvents>(
            eventType: EventType,
            documentation?: SingleNotificationDocumentation,
        ) => Promise<PlatformEventEmitter<NetworkEvents[EventType]>>;
        getNetworkEvent: {
            <EventType extends keyof NetworkEvents>(
                eventType: EventType,
            ): PlatformEvent<NetworkEvents[EventType]>;
            <T>(eventType: string): PlatformEvent<T>;
        };
    }
    Index

    Properties

    createBufferedNetworkEventEmitter: <EventType extends keyof NetworkEvents>(
        eventType: EventType,
        documentation?: SingleNotificationDocumentation,
        options?: {
            bufferStrategy?: NetworkEventBufferStrategy<NetworkEvents[EventType]>;
        },
    ) => {
        dispose: () => void;
        emit: (event: NetworkEvents[EventType]) => void;
        registeredEmitter: Promise<PlatformEventEmitter<NetworkEvents[EventType]>>;
    }

    Type declaration

      • <EventType extends keyof NetworkEvents>(
            eventType: EventType,
            documentation?: SingleNotificationDocumentation,
            options?: {
                bufferStrategy?: NetworkEventBufferStrategy<NetworkEvents[EventType]>;
            },
        ): {
            dispose: () => void;
            emit: (event: NetworkEvents[EventType]) => void;
            registeredEmitter: Promise<PlatformEventEmitter<NetworkEvents[EventType]>>;
        }
      • Experimental

        Synchronously create a buffered emitter for a single-source network event. Use this for events that may be emitted before the network emitter finishes registering — e.g. from a UI handler or a command that can fire during extension activation, where the eager createNetworkEventEmitterAsync would leave a module-level emitter undefined.

        The returned emit is usable immediately. Emits made before central registration completes are buffered per options.bufferStrategy and flushed once registration succeeds; after that emit passes straight through. If registration fails, buffered events are dropped (with a warning) and registeredEmitter rejects so the caller can respond.

        Type Parameters

        Parameters

        Returns {
            dispose: () => void;
            emit: (event: NetworkEvents[EventType]) => void;
            registeredEmitter: Promise<PlatformEventEmitter<NetworkEvents[EventType]>>;
        }

        emit (usable immediately), registeredEmitter (resolves to the underlying emitter, or rejects if registration failed), and dispose.

    createNetworkEventEmitter: <T>(eventType: string) => PlatformEventEmitter<T>

    Type declaration

      • <T>(eventType: string): PlatformEventEmitter<T>
      • Creates an event emitter that works properly over the network.

        Type Parameters

        • T

        Parameters

        • eventType: string

          Unique network event type for coordinating between connections

        Returns PlatformEventEmitter<T>

        Event emitter whose event works between connections

        8 June 2026. Use createNetworkEventEmitterAsync. Events created via the sync API are not centrally registered and do not appear in the OpenRPC document. The async version restricts central registration of an event name to a single source (unless the event is declared in MultiSourceNetworkEvents, in which case it accepts multiple registrants by design). Note this restricts central registration, not emission: the registry does not block emits today, but it warns when an event is announced without a matching registration or from a process that did not register it. That tolerance is transitional — announcing an unregistered or cross-process single-source event is deprecated and is expected to become an error (with the registry gating emission) in a future release, so treat the warning as something to fix, not as the permanent behavior.

        WARNING: You can only create a network event emitter once per eventType to prevent hijacked event emitters.

    createNetworkEventEmitterAsync: <EventType extends keyof NetworkEvents>(
        eventType: EventType,
        documentation?: SingleNotificationDocumentation,
    ) => Promise<PlatformEventEmitter<NetworkEvents[EventType]>>

    Type declaration

      • <EventType extends keyof NetworkEvents>(
            eventType: EventType,
            documentation?: SingleNotificationDocumentation,
        ): Promise<PlatformEventEmitter<NetworkEvents[EventType]>>
      • Create a network event emitter that participates in central registration. Every centrally registered event appears in the OpenRPC document; providing documentation fills in its summary, params, and x-experimental flag, otherwise it is surfaced with placeholder docs.

        If the event name is in MultiSourceNetworkEvents, the central registry uses multi-source semantics: multiple processes may register the same name (each process registers once); all corresponding emitters are valid sources.

        Otherwise the registry uses single-source semantics: only one process may register a given name; subsequent registrations from any process are rejected.

        Intra-process duplicate registration is always rejected regardless of the event's domain.

        See MultiSourceNetworkEvents for multi-source vs single-source semantics.

        Type Parameters

        Parameters

        Returns Promise<PlatformEventEmitter<NetworkEvents[EventType]>>

    getNetworkEvent: {
        <EventType extends keyof NetworkEvents>(
            eventType: EventType,
        ): PlatformEvent<NetworkEvents[EventType]>;
        <T>(eventType: string): PlatformEvent<T>;
    }

    Type declaration

      • <EventType extends keyof NetworkEvents>(
            eventType: EventType,
        ): PlatformEvent<NetworkEvents[EventType]>
      • Subscribe to a typed network event. The payload type is inferred from the event's declaration in NetworkEvents.

        Type Parameters

        Parameters

        Returns PlatformEvent<NetworkEvents[EventType]>

        Event for the event type that runs the callback provided when the event is emitted

      • <T>(eventType: string): PlatformEvent<T>
      • Subscribe to a network event with an explicit payload type.

        Type Parameters

        • T

        Parameters

        • eventType: string

          Unique network event type for coordinating between connections

        Returns PlatformEvent<T>

        Event for the event type that runs the callback provided when the event is emitted

        8 June 2026. Use the typed signature: declare the event in NetworkEvents and call getNetworkEvent('your.event.name') without an explicit type parameter.