Skip to content

Commit

Permalink
Merge pull request #15 from justinbrick/master
Browse files Browse the repository at this point in the history
add explicit typings, add file-based package resolution
  • Loading branch information
MCJack123 authored Feb 23, 2025
2 parents ba27b1c + 28f49b1 commit 12bcde0
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 18 deletions.
32 changes: 20 additions & 12 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
"typescript": "^5.1.0",
"@jackmacwindows/lua-types": "^2.13.2",
"@jackmacwindows/typescript-to-lua": "^1.22.0",
"@jackmacwindows/craftos-types": "^1.1.1",
"@jackmacwindows/cc-types": "^1.0.0"
"@jackmacwindows/craftos-types": "file:types/craftos",
"@jackmacwindows/cc-types": "file:types/cc"
},
"author": "JackMacWindows",
"license": "MIT"
}
}
9 changes: 6 additions & 3 deletions types/craftos/craftos.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -509,10 +509,13 @@ declare class FluidStoragePeripheral implements IPeripheral {
pullFluid(from: string, limit?: number, name?: string): number;
}

declare type ItemDetail = {
declare type SlotDetail = {
name: string;
count: string;
count: number;
nbt?: string;
}

declare type ItemDetail = SlotDetail & {
displayName: string;
maxCount: number;
damage?: number;
Expand All @@ -527,7 +530,7 @@ declare type ItemDetail = {
/** @noSelf */
declare class InventoryPeripheral implements IPeripheral {
size(): number;
list(): {[index: number]: {name: string, count: number, nbt?: string}};
list(): {[index: number]: SlotDetail};
getItemDetail(slot: number): ItemDetail|undefined;
getItemLimit(slot: number): number;
pushItems(to: string, slot: number, limit?: number, toSlot?: number): number;
Expand Down

0 comments on commit 12bcde0

Please sign in to comment.