@lorestudios/craftlib-types
v1.0.198
Published
TypeScript definitions for CraftLib - Minecraft Bedrock addon development library
Downloads
160
Readme
@lorestudios/craftlib-types
TypeScript type definitions for CraftLib, a comprehensive library for Minecraft Bedrock addon development.
Installation
# Using npm
npm install --save-dev @lorestudios/craftlib-types
# Using yarn
yarn add -D @lorestudios/craftlib-types
# Using pnpm
pnpm add -D @lorestudios/craftlib-typesUsage
Basic Setup
Once installed, the types will be automatically available in your TypeScript project. You can import and use CraftLib with full type support:
import { craftlib } from 'craftlib';
import { ILogController, LogLevel } from 'craftlib';
// Use with full IntelliSense and type checking
craftlib.log.info('Hello from CraftLib!');
craftlib.math.lerp(0, 100, 0.5);Configuration in tsconfig.json
Add the types to your tsconfig.json:
{
"compilerOptions": {
"types": [
"@lorestudios/craftlib-types",
"@minecraft/server",
"@minecraft/server-ui"
]
}
}Using Triple-Slash Directives
If you prefer, you can also use triple-slash directives:
/// <reference types="@lorestudios/craftlib-types" />
import { craftlib } from 'craftlib';Available Modules
CraftLib provides the following modules with full type definitions:
Core Modules
- log - Logging system with multiple levels and formatting
- math - Mathematical utilities and vector operations
- array - Array manipulation and utilities
- color - Minecraft color formatting and manipulation
- uid - Unique identifier generation
- property - Dynamic property management
- motion - Motion and movement utilities
- title - Title and subtitle display management
- measure - Distance and position measurements
- velocity - Physics and velocity calculations
- transition - Scene and state transitions
- loop - Game loop and tick management
- player - Player management and utilities
Game Modules
- camera - Camera control and animations
- database - Data persistence and storage
- event - Event system and handlers
- index - Entity indexing and management
- inventory - Inventory manipulation and management
- task - Task system management
World Modules
- knowledge - Knowledge/discovery system
- ui - User interface utilities
- dialogue - NPC dialogue system
Type Exports
All types are exported and can be imported directly:
import {
ILogController,
LogLevel,
ITaskController,
Task,
TaskStatus,
IInventoryController,
SavedInventory,
// ... and many more
} from '@lorestudios/craftlib-types';Dependencies
This type definition package requires:
@minecraft/server: ^2.1.0@minecraft/server-ui: ^2.0.0
These should be installed in your project for the types to work correctly.
Contributing
If you find any issues with the type definitions, please report them at: https://github.com/lorestudios/craftlib/issues
License
ISC
Version
This package version corresponds to the CraftLib library version for compatibility.
