IRegistry
Bun

interface

bundle.Registry

interface Registry

Registry for type-safe feature flags.

Augment this interface to get autocomplete and type checking for your feature flags:

// env.d.ts
declare module "bun:bundle" {
  interface Registry {
    features: "DEBUG" | "PREMIUM" | "BETA";
  }
}

Now feature() only accepts "DEBUG", "PREMIUM", or "BETA":

feature("DEBUG");    // OK
feature("TYPO");     // Type error