npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@entityseven/fivem-rpc-shared-types

v1.0.0

Published

Event and command declarations for @entityseven/fivem-rpc, for typed events

Readme

FiveM RPC Shared Types

Event and command declarations for @entityseven/fivem-rpc. With nothing declared, every rpc method accepts any event name, any arguments and any result. Declare your events once and every on* and emit* call gets checked names, arguments and results

Installation

See the main readme. The declaration file below imports this package, so it must resolve from that file (in a workspace: install it in the root)

Usage

  1. Create one declaration file shared by server, client and webview code, e.g. shared/rpc.d.ts:

    import '@entityseven/fivem-rpc-shared-types'
    
    declare module '@entityseven/fivem-rpc-shared-types' {
        interface RPCEvents_ClientServer {
            // event name(arguments): value returned by the listener
            buyItem(item: string, amount: number): boolean
        }
        interface RPCCommands_Server {
            ban: true
        }
    }

    The import line makes the file a module, so declare module adds to the package's interfaces instead of replacing them

  2. Add the file to include in the tsconfig.json of every environment:

    {
        "include": ["src", "../shared/rpc.d.ts"]
    }
  3. Calls are checked from now on:

    // server
    rpc.onClient('buyItem', (player, item, amount) => {
        // item: string, amount: number, must return boolean
        return true
    })
    
    // client
    const bought = await rpc.emitServer('buyItem', 'water', 2) // boolean
    await rpc.emitServer('buyItem', 'water') // error: missing `amount`
    await rpc.emitServer('buyItme', 'water', 2) // error: unknown event

Interfaces

Each interface types one direction, see the direction table for which emit* and on* methods use it. RPCCommands_Server and RPCCommands_Client type onCommand. An interface you leave empty stays loose (any name, arguments and result), so you can declare them one at a time

  • events: the member name is the event name, its parameters are the arguments, its return type is what emit* resolves with. Server onClient and onWebview listeners get the player id before the declared arguments. Names that are not identifiers work too: 'buy-item'(item: string): boolean
  • commands: the key is the command name, the value is not used (true)

License

Licensed under the Custom Attribution-NoDerivs Software License