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

bf6-portal-mod-types

v3.1.0

Published

TypeScript definitions for Battlefield 6 Portal mod namespace

Readme

bf6-portal-mod-types

TypeScript definitions for the Battlefield 6 Portal mod namespace. Use this package in your Portal experience project for type-safe access to the global mod API (players, rules, UI, events, etc.) with improved JSDoc where available.

Installation

Install as a dev dependency:

npm install -D bf6-portal-mod-types

Configuring your project

Point TypeScript at this package's types via tsconfig.json. The mod namespace is declared globally, so you do not import it; you only need to include the types.

{
    "compilerOptions": {
        "types": ["bf6-portal-mod-types"]
    }
}

Ensure your include (or default) covers the folders where you reference mod (e.g. src/**/*.ts). No /// <reference /> or imports are required for mod; once the package is in types, the global namespace is available everywhere TypeScript compiles.

Usage

After installation and tsconfig setup, the global mod namespace is available in your editor with editor completion, hover docs (where JSDoc has been added), and type checking for mod APIs. The package ships only .d.ts files; there is no runtime code.

Version semantics

The official BF6 Portal SDK uses a four-part version (e.g. 1.3.1.0) for the mod namespace and does not follow semver. This package maps that to three-part semver by dropping the first segment, and replacing the last segment with an internal increment to track patch changes to the package (i.e. for added documentation or usability improvements).

| Official SDK (mod namespace) | This package | | ---------------------------- | ------------ | | a.b.c.d (template) | b.c.x | | 1.2.3.0 (past) | 2.3.x | | 1.3.1.0 (current) | 3.1.x | | 1.3.2.0 (future example) | 3.2.x |

  • Minor version changes (e.g. 3.1.03.2.0) align with a new official SDK release and may add or change APIs.
  • Patch versions (e.g. 3.1.03.1.1) keep the same underlying SDK version and only add or improve documentation and usability (no API surface change).

When you upgrade patch versions, you can expect the same mod API with more or better JSDoc and no breaking changes.

What's inside

The types are derived from the SDK package provided at portal.battlefield.com, with the following improvements:

  • Split layout — The single official index.d.ts is split into multiple files (e.g. enums.d.ts, types.d.ts, event-handler-signatures.d.ts, per-map runtime-spawn-enums/*.d.ts) to keep editor and tooling context manageable.
  • Extra JSDoc — A growing subset of the mod namespace is documented with parameter descriptions, return types, examples, and usage notes. The rest of the API remains fully typed with the same signatures as the official SDK.

The published entry point is index.d.ts, which references the rest of the declaration files. Your project only needs to list bf6-portal-mod-types in compilerOptions.types; resolution is handled by Node and TypeScript.

Documentation site

The full API reference (generated from these type definitions and their JSDoc) is published as GitHub Pages for this repo:

https://deluca-mike.github.io/bf6-portal-mod-types/

Use it to browse the mod namespace, see which symbols are documented, and copy examples.

Summary

| Step | Action | | --------- | ----------------------------------------------------------------------------------------------------------- | | Install | npm install -D bf6-portal-mod-types | | Configure | Add "types": ["bf6-portal-mod-types"] (and any other type packages) to tsconfig.json compilerOptions. | | Use | Use the global mod namespace in your Portal scripts (no imports). | | Upgrade | Patch = docs/usability only; minor = new SDK version. |

For contribution, build, and verification details, see CONTRIBUTING.md in the repository.