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

unity-types

v6000.3.1

Published

TypeScript definitions for Unity 6000.3

Downloads

190

Readme

unity-types

TypeScript definitions for Unity, designed for use with OneJS.

Note: Only Unity 6000.3 and later versions are supported.

Installation

npm install -D unity-types@~6000.3.0

Setup

Add unity-types to your tsconfig.json:

{
  "compilerOptions": {
    "types": ["unity-types"],
    "skipLibCheck": true
  }
}

Note: skipLibCheck: true is recommended. Some C# constructs (like compiler-generated fixed buffers) produce type names that aren't valid TypeScript identifiers.

Or add a triple-slash reference in a global.d.ts file:

/// <reference types="unity-types" />

Usage

The CS namespace is globally available after setup:

// Create a GameObject
const go = new CS.UnityEngine.GameObject("MyObject")

// Access transform
const pos: CS.UnityEngine.Vector3 = go.transform.position
pos.x = 10

// UI Elements
const button = new CS.UnityEngine.UIElements.Button()
button.text = "Click me"

// Physics
const rb: CS.UnityEngine.Rigidbody = go.AddComponent($typeof(CS.UnityEngine.Rigidbody))
rb.mass = 5

// Audio
const audio: CS.UnityEngine.AudioSource = go.GetComponent($typeof(CS.UnityEngine.AudioSource))
audio.Play()

// Web requests
const request = CS.UnityEngine.Networking.UnityWebRequest.Get("https://api.example.com")

Included Assemblies

| Assembly | Size | Description | |----------|------|-------------| | UnityEngine.CoreModule | ~1 MB | GameObject, Transform, Vector3, Color, MonoBehaviour, etc. | | UnityEngine.UIElementsModule | ~350 KB | VisualElement, Button, Label, TextField, etc. | | UnityEngine.PhysicsModule | ~88 KB | Rigidbody, Collider, Physics, RaycastHit, etc. | | UnityEngine.Physics2DModule | ~262 KB | Rigidbody2D, Collider2D, Physics2D, etc. | | UnityEngine.AudioModule | ~41 KB | AudioSource, AudioClip, AudioListener, etc. | | UnityEngine.InputLegacyModule | ~9 KB | Input, KeyCode, Touch, etc. | | UnityEngine.UnityWebRequestModule | ~14 KB | UnityWebRequest, DownloadHandler, etc. | | Unity.InputSystem | ~342 KB | InputAction, InputDevice, Keyboard, Mouse, etc. |

Helper Types

The package includes helper types for C# interop:

// Reference parameters (ref keyword in C#)
declare interface $Ref<T> { __doNotAccess: T }

// Output parameters (out keyword in C#)
declare interface $Out<T> { __doNotAccess: T }

// Task/async return types
declare interface $Task<T> { __doNotAccess: T }

Versioning

Package versions match Unity versions:

| Package Version | Unity Version | |-----------------|---------------| | 6000.3.x | Unity 6000.3.x |

Use semver ranges to get compatible updates:

# Exact version
npm install -D [email protected]

# Compatible updates within Unity 6000.3
npm install -D unity-types@~6000.3.0

Generating Custom Types

If you need types for additional Unity assemblies or your own C# code, use the TypeGenerator in Unity:

// Via menu: OneJS > Type Generator

// Or programmatically:
TypeGenerator.GenerateFromAssembly("output.d.ts", "MyGame.Core");

// Or use the fluent API:
TypeGenerator.Create()
    .AddType<MyCustomClass>()
    .AddNamespace("MyGame.Systems")
    .Build()
    .WriteTo("my-types.d.ts");

License

MIT