Registry / testing / reaper-lua-types

reaper-lua-types

JSON →
library7.72.1jsnpmunverified

TypeScript type definitions for the REAPER DAW Lua API, enabling type-safe scripting with TypeScript when using the TypeScriptToLua transpiler. Current stable version is 7.72.1. Primarily updated to match REAPER API changes. Key differentiator: provides full type coverage for REAPER-specific functions (reaper.*, gfx.*) and integrates seamlessly with TypeScriptToLua's compilation pipeline. Requires TypeScript >=4.1.0 and TypeScriptToLua >=1.10.0 as peer dependencies.

npm install reaper-lua-types
INSTALL
IMPORT
SIG · REAPER-LUA-TYPES
R
reaper-lua-types
testingjavascriptv7.72.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

reaper
import reaper from 'reaper-lua-types'
const reaper = require('reaper-lua-types')
ESM-only; types are automatically available via tsconfig 'types' field, explicit import is not always needed.
Named types
import { Track, MediaItem } from 'reaper-lua-types'
Type-only imports work as this is a types package.
Global types (via tsconfig)
In tsconfig: "types": ["reaper-lua-types"]
Forgetting to add to tsconfig types array
Global types for functions like reaper.* become available without explicit import.

Shows basic usage: tsconfig setup with required types, then a simple script using global reaper API and explicit type import.

// tsconfig.json { "compilerOptions": { "types": ["reaper-lua-types"] }, "tstl": { "luaTarget": "5.3", "noHeader": true } } // script.ts // No explicit import needed; types are global. const track = reaper.GetSelectedTrack(0, 0); if (track) { console.log(reaper.GetTrackName(track)); } // Also possible to import types explicitly: import { Track } from 'reaper-lua-types'; function getName(track: Track): string { return reaper.GetTrackName(track); }
Debug
Known issues
breakingMajor version updates may align REAPER API changes. Check REAPER changelog for breaking changes to lua API before upgrading this package.
fix
Review REAPER API release notes and adjust scripts accordingly.
affects: >=7.0.0
gotchaTypes are global; do not import 'reaper' as a value if you just need the global definitions — it may cause conflicts.
fix
Use tsconfig types field to enable global types without import.
affects: *
deprecatedSome functions may be deprecated in future REAPER versions. Always check the REAPER API documentation.
fix
Use the latest REAPER API and TypeScript types to avoid deprecated functions.
affects: >=7.0.0
gotchaThis package is only for TypeScript-to-Lua (tstl) compilation. It does not work with plain JavaScript or other Lua transpilers.
fix
Ensure you have typescript-to-lua >=1.10.0 installed and configured.
affects: *
Errors
Common errors & fixes
Cannot find name 'reaper'. Do you need to install type definitions?
Missing 'reaper-lua-types' in tsconfig types array.
fix
Add "types": ["reaper-lua-types"] to tsconfig compilerOptions.
Module '"reaper-lua-types"' has no exported member 'Track'. Did you mean to use 'import Track from ...' instead?
Attempting named import from a default-export-only type declaration file.
fix
Use import type { Track } from 'reaper-lua-types' or rely on global types.
Cannot use import statement outside a module (when using tstl).
Missing 'module' setting in tsconfig or using wrong Lua target.
fix
Ensure tsconfig includes "module": "CommonJS" or set tstl.luaTarget appropriately.
Upgrade
Version history
7.72.1latest on npm
Audit
Dependencies
typescriptrequiredpeer dependency required for type checking and compilation
typescript-to-luarequiredpeer dependency for transpiling TypeScript to Lua for use in REAPER
Agent activity
8 hits · last 30 days
node
8
Resources
reaper-lua-types — npm install reaper-lua-types · libregistry