diff --git a/projects/typed-peripheral-unlimitedperipheralworks/.gitignore b/projects/typed-peripheral-unlimitedperipheralworks/.gitignore index 764059b9..79707304 100644 --- a/projects/typed-peripheral-unlimitedperipheralworks/.gitignore +++ b/projects/typed-peripheral-unlimitedperipheralworks/.gitignore @@ -1,2 +1,3 @@ *.lua -node_modules \ No newline at end of file +*.d.ts +node_modules diff --git a/projects/typed-peripheral-unlimitedperipheralworks/displayPedestal.ts b/projects/typed-peripheral-unlimitedperipheralworks/displayPedestal.ts new file mode 100644 index 00000000..f286f000 --- /dev/null +++ b/projects/typed-peripheral-unlimitedperipheralworks/displayPedestal.ts @@ -0,0 +1,15 @@ +import { IPeripheralProvider } from "@siredvin/typed-peripheral-base"; + +/** @noSelf **/ +export interface DisplayPedestal extends IPeripheral { + getItem(): ItemDetail | null; + setItem(id: string, name?: string, nbtData?: string): Result; + isLabelRendered(): boolean; + setLabelRendered(value: boolean): void; + isItemRendered(): boolean; + setItemRendered(value: boolean): void; +} + +export const displayPedestalProvider = new IPeripheralProvider( + "display_pedestal" +); diff --git a/projects/typed-peripheral-unlimitedperipheralworks/entityLink.ts b/projects/typed-peripheral-unlimitedperipheralworks/entityLink.ts new file mode 100644 index 00000000..5e413c4f --- /dev/null +++ b/projects/typed-peripheral-unlimitedperipheralworks/entityLink.ts @@ -0,0 +1,25 @@ +import { IPeripheralProvider } from "@siredvin/typed-peripheral-base"; +import { ExtendedInventoryAPI } from "@siredvin/typed-peripheral-api/inventory_extended"; +import { FluidStorageAPI } from "@siredvin/typed-peripheral-api/fluid_storage"; +import { ItemStorageAPI } from "@siredvin/typed-peripheral-api/item_storage"; +import { EntityDetail } from "./types"; +import { + AutomobilityAutomobileAPI, + ManaAndArtificeConstructAPI, +} from "./integrations/entityLink"; + +/** @noSelf **/ +export interface EntityLink + extends IPeripheral, + Partial, + Partial, + Partial, + Partial, + Partial { + isEntityFound(): boolean; + inspect(): EntityDetail | null; +} + +export const entityLinkProvider = new IPeripheralProvider( + "entity_link" +); diff --git a/projects/typed-peripheral-unlimitedperipheralworks/events/networkManagerGroupChange.d.ts b/projects/typed-peripheral-unlimitedperipheralworks/events/networkManagerGroupChange.d.ts deleted file mode 100644 index 16f8623e..00000000 --- a/projects/typed-peripheral-unlimitedperipheralworks/events/networkManagerGroupChange.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import * as events from "@siredvin/cc-events"; -export declare const NETWORK_MANAGER_GROUP_CHANGE = "network_manager_group_change"; -export declare class NetworkManagerGroupChangeEvent extends events.BaseEvent<[ - string, - "added" | "removed", - string -]> { - getGroup(): string; - getAction(): "added" | "removed"; - getPeripheral(): string; -} diff --git a/projects/typed-peripheral-unlimitedperipheralworks/hologramProjector.ts b/projects/typed-peripheral-unlimitedperipheralworks/hologramProjector.ts new file mode 100644 index 00000000..1bdd1bd8 --- /dev/null +++ b/projects/typed-peripheral-unlimitedperipheralworks/hologramProjector.ts @@ -0,0 +1,52 @@ +import { ConfigurationAPI } from "@siredvin/typed-peripheral-api/configuration"; +import { IPeripheralProvider } from "@siredvin/typed-peripheral-base"; +import { BlockState, Fallible, Position } from "./types"; + +export type Vector3 = [number, number, number]; +export type Quaternion = [number, number, number, number]; +export type DisplayOptions = { + brightness?: number; + glow_color_override?: number; + interpolation_duration?: number; + start_interpolation?: number; + height?: number; + width?: number; + shadow_radius?: number; + shadow_strength?: number; + view_range?: number; + billboard?: string; + transformation?: { + scale?: Vector3; + translation?: Vector3; + left_rotation?: Quaternion; + right_rotation?: Quaternion; + }; +}; +export type TextDisplayOptions = DisplayOptions & { + line_width?: number; + background?: number; + shadow?: boolean; + see_through?: boolean; + default_background?: boolean; + text_opacity?: number; + alignment?: string; +}; +export type ItemDisplayOptions = DisplayOptions & { item_display?: string }; + +/** @noSelf **/ +export interface HologramProjector + extends ConfigurationAPI<{ entityLimit: number; distanceLimit: number }> { + item(item: object, options?: ItemDisplayOptions): Fallible; + block(blockState: BlockState, options?: DisplayOptions): Fallible; + text(text: object, options?: TextDisplayOptions): Fallible; + destroy(uuid: string): Result; + move(uuid: string, position: Position): Result; + rotate(uuid: string, xRot?: number, yRot?: number): Result; + list(mode: "owned" | "around"): Fallible>; + update(uuid: string, content?: object, options?: DisplayOptions): Result; + ride(riderUUID: string, mountUUID: string): Result; + unmount(riderUUID: string): Result; +} + +export const hologramProjectorProvider = + new IPeripheralProvider("hologram_projector"); diff --git a/projects/typed-peripheral-unlimitedperipheralworks/informativeRegistry.d.ts b/projects/typed-peripheral-unlimitedperipheralworks/informativeRegistry.d.ts deleted file mode 100644 index 406113ad..00000000 --- a/projects/typed-peripheral-unlimitedperipheralworks/informativeRegistry.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { ConfigurationAPI } from "@siredvin/typed-peripheral-api/configuration"; -import { FluidDetail, IPeripheralProvider } from "@siredvin/typed-peripheral-base"; -/** @noSelf **/ -export interface InformativeRegistry extends ConfigurationAPI { - list(listName: "list" | "item" | "fluid" | "block" | "itemTags" | "fluidTags" | "blockTags"): string[]; - describe(listName: "itemTags" | "blockTags" | "fluidTags", tag: string): string[]; - describe(listName: "item", id: string): ItemDetail; - describe(listName: "fluid", id: string): FluidDetail; - describe(listName: "list" | "block", id: string): LuaTable; -} -export declare const informativeRegistryProvider: IPeripheralProvider; diff --git a/projects/typed-peripheral-unlimitedperipheralworks/informativeRegistry.ts b/projects/typed-peripheral-unlimitedperipheralworks/informativeRegistry.ts index de47b423..a2d4eab1 100644 --- a/projects/typed-peripheral-unlimitedperipheralworks/informativeRegistry.ts +++ b/projects/typed-peripheral-unlimitedperipheralworks/informativeRegistry.ts @@ -1,5 +1,5 @@ import { ConfigurationAPI } from "@siredvin/typed-peripheral-api/configuration"; -import { FluidDetail, IPeripheralProvider } from "@siredvin/typed-peripheral-base"; +import { IPeripheralProvider } from "@siredvin/typed-peripheral-base"; /** @noSelf **/ export interface InformativeRegistry extends ConfigurationAPI { @@ -12,14 +12,27 @@ export interface InformativeRegistry extends ConfigurationAPI { | "itemTags" | "fluidTags" | "blockTags" + | "entityTypeTags" + | "mods" + | "entity" ): string[]; describe( - listName: "itemTags" | "blockTags" | "fluidTags", + listName: "itemTags" | "blockTags" | "fluidTags" | "entityTypeTags", tag: string - ): string[]; - describe(listName: "item", id: string): ItemDetail; - describe(listName: "fluid", id: string): FluidDetail; - describe(listName: "list" | "block", id: string): LuaTable; + ): string[] | null; + describe( + listName: "item", + id: string + ): (Omit & { registryID: string }) | null; + describe( + listName: "fluid", + id: string + ): { name: string; registryID: string } | null; + describe(listName: "list", id: string): string | null; + describe( + listName: "block" | "mods" | "entity", + id: string + ): LuaTable | null; } export const informativeRegistryProvider = diff --git a/projects/typed-peripheral-unlimitedperipheralworks/integrations/ae2.ts b/projects/typed-peripheral-unlimitedperipheralworks/integrations/ae2.ts new file mode 100644 index 00000000..d587c5a8 --- /dev/null +++ b/projects/typed-peripheral-unlimitedperipheralworks/integrations/ae2.ts @@ -0,0 +1,38 @@ +import { Fallible } from "../types"; + +export type AE2CraftingCPU = { + name?: string; + capacity: number; + storage: number; + isBusy: boolean; +}; +export type AE2Pattern = { inputs: object[]; outputs: object[] }; +export type AE2Crafting = { + target: object; + amount: number; + progress: number; + CPU?: string; +}; + +/** @noSelf **/ +export interface AE2NetworkAPI extends IPeripheral { + getAverageEnergyDemand(): number; + getAverageEnergyIncome(): number; + getChannelEnergyDemand(): number; + getChannelInformation(): { maxChannels?: number; usedChannels?: number }; + getCraftingCPUs(): AE2CraftingCPU[]; + getCraftableItems(): (Omit & { registryID: string })[]; + getCraftableFluids(): { name: string }[]; + getPatternsFor(mode: "item" | "fluid", id: string): AE2Pattern[]; + getActiveCraftings(): Fallible; + scheduleCrafting( + mode: "item" | "fluid", + id: string, + amount?: number, + targetCPU?: string + ): LuaMultiReturn< + | [true] + | [null, string] + | [false, string, LuaTable] + >; +} diff --git a/projects/typed-peripheral-unlimitedperipheralworks/integrations/arsNouveau.ts b/projects/typed-peripheral-unlimitedperipheralworks/integrations/arsNouveau.ts new file mode 100644 index 00000000..c0790b81 --- /dev/null +++ b/projects/typed-peripheral-unlimitedperipheralworks/integrations/arsNouveau.ts @@ -0,0 +1,6 @@ +import { EntityDetail } from "../types"; + +/** @noSelf **/ +export interface ArsNouveauMobJar extends IPeripheral { + inspect(): { entity: EntityDetail } | object; +} diff --git a/projects/typed-peripheral-unlimitedperipheralworks/integrations/create/api.ts b/projects/typed-peripheral-unlimitedperipheralworks/integrations/create/api.ts new file mode 100644 index 00000000..5fab113d --- /dev/null +++ b/projects/typed-peripheral-unlimitedperipheralworks/integrations/create/api.ts @@ -0,0 +1,15 @@ +/** @noSelf **/ +export interface CreateScrollOptionAPI extends IPeripheral { + getScrollValue(): number; + setScrollValue(value: number): void; +} + +/** @noSelf **/ +export interface CreateLinearActuatorAPI extends IPeripheral { + inspect(): { movementSpeed: number; isRunning: boolean }; +} + +/** @noSelf **/ +export interface CreateBlazeBurnerAPI extends IPeripheral { + inspect(): { fuelType: string | null; remainingBurnTime: number }; +} diff --git a/projects/typed-peripheral-unlimitedperipheralworks/integrations/create/basin.d.ts b/projects/typed-peripheral-unlimitedperipheralworks/integrations/create/basin.d.ts deleted file mode 100644 index 33455f09..00000000 --- a/projects/typed-peripheral-unlimitedperipheralworks/integrations/create/basin.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { FluidStorageAPI } from "@siredvin/typed-peripheral-api/fluid_storage"; -import { ExtendedInventoryAPI } from "@siredvin/typed-peripheral-api/inventory_extended"; -import { IPeripheralProvider } from "@siredvin/typed-peripheral-base"; -import { CreateFilterableAPI } from "./filterable_api"; -/** @noSelf **/ -export interface CreateBasin extends ExtendedInventoryAPI, CreateFilterableAPI, FluidStorageAPI { -} -export declare const basinProvider: IPeripheralProvider; diff --git a/projects/typed-peripheral-unlimitedperipheralworks/integrations/create/filterable_api.d.ts b/projects/typed-peripheral-unlimitedperipheralworks/integrations/create/filterable_api.d.ts deleted file mode 100644 index 7792f897..00000000 --- a/projects/typed-peripheral-unlimitedperipheralworks/integrations/create/filterable_api.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -/** @noSelf **/ -export declare interface CreateFilterableAPI extends IPeripheral { - getFilterName(): string; - setFilterItem(id: string): any; - clearFilterItem(): any; -} diff --git a/projects/typed-peripheral-unlimitedperipheralworks/integrations/create/filterable_api.ts b/projects/typed-peripheral-unlimitedperipheralworks/integrations/create/filterable_api.ts index 13f71768..3658288f 100644 --- a/projects/typed-peripheral-unlimitedperipheralworks/integrations/create/filterable_api.ts +++ b/projects/typed-peripheral-unlimitedperipheralworks/integrations/create/filterable_api.ts @@ -1,6 +1,6 @@ /** @noSelf **/ export declare interface CreateFilterableAPI extends IPeripheral { - getFilterName(): string; - setFilterItem(id: string); - clearFilterItem(); + getFilterName(): string | null; + setFilterItem(id: string): Result; + clearFilterItem(): Result; } diff --git a/projects/typed-peripheral-unlimitedperipheralworks/integrations/create/mechanical_saw.d.ts b/projects/typed-peripheral-unlimitedperipheralworks/integrations/create/mechanical_saw.d.ts deleted file mode 100644 index e3c0b4a2..00000000 --- a/projects/typed-peripheral-unlimitedperipheralworks/integrations/create/mechanical_saw.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { ExtendedInventoryAPI } from "@siredvin/typed-peripheral-api/inventory_extended"; -import { IPeripheralProvider } from "@siredvin/typed-peripheral-base"; -import { CreateFilterableAPI } from "./filterable_api"; -/** @noSelf **/ -export interface CreateMechanicalSaw extends ExtendedInventoryAPI, CreateFilterableAPI { -} -export declare const mechanicalSawProvider: IPeripheralProvider; diff --git a/projects/typed-peripheral-unlimitedperipheralworks/integrations/deepResonance.ts b/projects/typed-peripheral-unlimitedperipheralworks/integrations/deepResonance.ts new file mode 100644 index 00000000..3ee9ca05 --- /dev/null +++ b/projects/typed-peripheral-unlimitedperipheralworks/integrations/deepResonance.ts @@ -0,0 +1,15 @@ +/** @noSelf **/ +export interface DeepResonanceCrystal extends IPeripheral { + inspect(): { + strength: number; + efficiency: number; + power: number; + purity: number; + glowing: boolean; + }; +} + +/** @noSelf **/ +export interface DeepResonanceGenerator extends IPeripheral { + inspect(): { energy: number; lastRfPerTick: number; isActive: boolean }; +} diff --git a/projects/typed-peripheral-unlimitedperipheralworks/integrations/easyVillagers.ts b/projects/typed-peripheral-unlimitedperipheralworks/integrations/easyVillagers.ts new file mode 100644 index 00000000..bf16dbf2 --- /dev/null +++ b/projects/typed-peripheral-unlimitedperipheralworks/integrations/easyVillagers.ts @@ -0,0 +1,21 @@ +import { IPeripheralProvider } from "@siredvin/typed-peripheral-base"; +import { EntityDetail } from "../types"; + +/** @noSelf **/ +export interface EasyTrader extends IPeripheral { + hasVillager(): boolean; + inspect(): EntityDetail | null; +} + +/** @noSelf **/ +export interface EasyAutoTrader extends EasyTrader { + getSelectedOffer(): number; + setSelectedOffer(index: number): Result; +} + +export const easyTraderProvider = new IPeripheralProvider( + "easy_trader" +); +export const easyAutoTraderProvider = new IPeripheralProvider( + "easy_auto_trader" +); diff --git a/projects/typed-peripheral-unlimitedperipheralworks/integrations/emi/base.d.ts b/projects/typed-peripheral-unlimitedperipheralworks/integrations/emi/base.d.ts deleted file mode 100644 index 3e7fa69e..00000000 --- a/projects/typed-peripheral-unlimitedperipheralworks/integrations/emi/base.d.ts +++ /dev/null @@ -1,28 +0,0 @@ -export declare interface EmiEmptyIngredient { - type: "empty"; -} -export declare interface EMIMultiIngredient { - candidates: EMIIngredient[]; - amount: number; -} -export declare interface EmiTagIngredient { - type: "tag"; - key: string; - tag_type: "item" | "fluid" | "unknown"; - amount: number; -} -export declare interface EMIItemIngredient { - name: string; - count: number; - chance: number; - type: "item"; - [key: string]: any; -} -export declare interface EMIFluidIngredient { - name: string; - displayName: string; - amount: number; - chance: number; - type: "fluid"; -} -export declare type EMIIngredient = EMIItemIngredient | EMIFluidIngredient | EmiEmptyIngredient | EMIMultiIngredient | EmiTagIngredient; diff --git a/projects/typed-peripheral-unlimitedperipheralworks/integrations/emi/emiIngredientPaste.d.ts b/projects/typed-peripheral-unlimitedperipheralworks/integrations/emi/emiIngredientPaste.d.ts deleted file mode 100644 index c21b58e0..00000000 --- a/projects/typed-peripheral-unlimitedperipheralworks/integrations/emi/emiIngredientPaste.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import * as events from "@siredvin/cc-events"; -import { EMIFluidIngredient, EMIItemIngredient } from "./base"; -export declare const EMI_INGREDIENT_PASTE = "emi_ingredient_paste"; -export declare class EmiIngredientPasteEvent extends events.BaseEvent<[ - EMIItemIngredient | EMIFluidIngredient -]> { - getIngridient(): EMIItemIngredient | EMIFluidIngredient; - static create(ingredient: EMIItemIngredient | EMIFluidIngredient): EmiIngredientPasteEvent; -} diff --git a/projects/typed-peripheral-unlimitedperipheralworks/integrations/emi/emiRecipePaste.d.ts b/projects/typed-peripheral-unlimitedperipheralworks/integrations/emi/emiRecipePaste.d.ts deleted file mode 100644 index d44ab374..00000000 --- a/projects/typed-peripheral-unlimitedperipheralworks/integrations/emi/emiRecipePaste.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -import * as events from "@siredvin/cc-events"; -import { EMIIngredient } from "./base"; -export declare const EMI_RECIPE_PASTE = "emi_recipe_paste"; -export declare interface EmiRecipe { - inputs: EMIIngredient[]; - outputs: EMIIngredient[]; - catalysts: EMIIngredient[]; - category: string; - extra?: object; - id: string; -} -export declare class EMIRecipePasteEvent extends events.BaseEvent<[EmiRecipe]> { - getRecipe(): EmiRecipe; - static create(recipe: EmiRecipe): EMIRecipePasteEvent; -} diff --git a/projects/typed-peripheral-unlimitedperipheralworks/integrations/entityLink.ts b/projects/typed-peripheral-unlimitedperipheralworks/integrations/entityLink.ts new file mode 100644 index 00000000..9547c69b --- /dev/null +++ b/projects/typed-peripheral-unlimitedperipheralworks/integrations/entityLink.ts @@ -0,0 +1,28 @@ +import { Position } from "../types"; + +/** @noSelf **/ +export interface ManaAndArtificeConstructAPI extends IPeripheral { + move(ignored: any, position: Position): void; + store(ignored: any, position: Position, direction?: string): void; + take( + ignored: any, + position: Position, + direction: string | undefined, + item: string, + amount?: number + ): void; + listCommands(): LuaTable; + diagnose(): string[]; + getCommand(): { + name: string; + isFinished: boolean; + isSuccess: boolean; + isStart: boolean; + }; +} + +/** @noSelf **/ +export interface AutomobilityAutomobileAPI extends IPeripheral { + rotate(delta: number): void; + boost(power: number, time: number): void; +} diff --git a/projects/typed-peripheral-unlimitedperipheralworks/integrations/fluxController.ts b/projects/typed-peripheral-unlimitedperipheralworks/integrations/fluxController.ts new file mode 100644 index 00000000..f6b031e4 --- /dev/null +++ b/projects/typed-peripheral-unlimitedperipheralworks/integrations/fluxController.ts @@ -0,0 +1,40 @@ +import { EnergyStorageAPI } from "@siredvin/typed-peripheral-api/energy_storage"; +import { IPeripheralProvider } from "@siredvin/typed-peripheral-base"; + +export type FluxConnection = { + customName: string; + maxTransferLimit: number; + transferBuffer: number; + transferChange: number; + surgeMode: boolean; + deviceType: string; + isChunkLoaded: boolean; +}; +export type FluxNetwork = { + name: string; + id: number; + color: number; + securityLevel: string; +}; +export type FluxStatistics = { + controllerCount: number; + pointCount: number; + plugCount: number; + storageCount: number; + totalBuffer: number; + totalEnergy: number; + energyInput: number; + energyOutput: number; + averageTick: number; +}; + +/** @noSelf **/ +export interface FluxController extends EnergyStorageAPI { + getConnections(): FluxConnection[]; + getNetwork(): FluxNetwork; + getStatistic(): FluxStatistics; +} + +export const fluxControllerProvider = new IPeripheralProvider( + "flux_controller" +); diff --git a/projects/typed-peripheral-unlimitedperipheralworks/integrations/gtceu/controllable.d.ts b/projects/typed-peripheral-unlimitedperipheralworks/integrations/gtceu/controllable.d.ts deleted file mode 100644 index 86b06f0c..00000000 --- a/projects/typed-peripheral-unlimitedperipheralworks/integrations/gtceu/controllable.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { ConfigurationAPI } from "@siredvin/typed-peripheral-api/configuration"; -import { IPeripheralProvider } from "@siredvin/typed-peripheral-base"; -/** @noSelf **/ -export interface ControllableMachine extends ConfigurationAPI { - isWorkingEnabled(): boolean; - setWorkingEnabled(value: boolean): any; -} -export declare const workableProvider: IPeripheralProvider; diff --git a/projects/typed-peripheral-unlimitedperipheralworks/integrations/gtceu/controllable.ts b/projects/typed-peripheral-unlimitedperipheralworks/integrations/gtceu/controllable.ts index 63507682..e6391e77 100644 --- a/projects/typed-peripheral-unlimitedperipheralworks/integrations/gtceu/controllable.ts +++ b/projects/typed-peripheral-unlimitedperipheralworks/integrations/gtceu/controllable.ts @@ -1,13 +1,8 @@ import { ConfigurationAPI } from "@siredvin/typed-peripheral-api/configuration"; -import { IPeripheralProvider } from "@siredvin/typed-peripheral-base"; /** @noSelf **/ export interface ControllableMachine extends ConfigurationAPI { isWorkingEnabled(): boolean; - setWorkingEnabled(value: boolean); + setWorkingEnabled(value: boolean): void; + setSuspendAfterFinish(value: boolean): void; } - -export const workableProvider = new IPeripheralProvider( - "gtceu:controllable", - () => null -); diff --git a/projects/typed-peripheral-unlimitedperipheralworks/integrations/gtceu/machine.d.ts b/projects/typed-peripheral-unlimitedperipheralworks/integrations/gtceu/machine.d.ts deleted file mode 100644 index 0332d551..00000000 --- a/projects/typed-peripheral-unlimitedperipheralworks/integrations/gtceu/machine.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { ConfigurationAPI } from "@siredvin/typed-peripheral-api/configuration"; -import { IPeripheralProvider } from "@siredvin/typed-peripheral-base"; -/** @noSelf **/ -export interface Machine extends ConfigurationAPI { - getRecipeTypes(): string[]; -} -export declare const machineProvider: IPeripheralProvider; diff --git a/projects/typed-peripheral-unlimitedperipheralworks/integrations/gtceu/multiblock_machine.d.ts b/projects/typed-peripheral-unlimitedperipheralworks/integrations/gtceu/multiblock_machine.d.ts deleted file mode 100644 index 2b8cc342..00000000 --- a/projects/typed-peripheral-unlimitedperipheralworks/integrations/gtceu/multiblock_machine.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { IPeripheralProvider } from "@siredvin/typed-peripheral-base"; -import { Machine } from "./machine"; -/** @noSelf **/ -export interface MultiblockMachine extends Machine { - getPartNames(): string[]; -} -export declare const multiblockMachineProvider: IPeripheralProvider; diff --git a/projects/typed-peripheral-unlimitedperipheralworks/integrations/gtceu/multiblock_machine.ts b/projects/typed-peripheral-unlimitedperipheralworks/integrations/gtceu/multiblock_machine.ts index c42d1668..7b9e4a6a 100644 --- a/projects/typed-peripheral-unlimitedperipheralworks/integrations/gtceu/multiblock_machine.ts +++ b/projects/typed-peripheral-unlimitedperipheralworks/integrations/gtceu/multiblock_machine.ts @@ -1,9 +1,10 @@ import { IPeripheralProvider } from "@siredvin/typed-peripheral-base"; import { Machine } from "./machine"; +import { Fallible } from "../../types"; /** @noSelf **/ export interface MultiblockMachine extends Machine { - getPartNames(): string[]; + getPartNames(): Fallible; } export const multiblockMachineProvider = new IPeripheralProvider( diff --git a/projects/typed-peripheral-unlimitedperipheralworks/integrations/gtceu/workable.d.ts b/projects/typed-peripheral-unlimitedperipheralworks/integrations/gtceu/workable.d.ts deleted file mode 100644 index 7fa4fcda..00000000 --- a/projects/typed-peripheral-unlimitedperipheralworks/integrations/gtceu/workable.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { ConfigurationAPI } from "@siredvin/typed-peripheral-api/configuration"; -import { IPeripheralProvider } from "@siredvin/typed-peripheral-base"; -/** @noSelf **/ -export interface WorkableMachine extends ConfigurationAPI { - isActive(): boolean; -} -export declare const workableProvider: IPeripheralProvider; diff --git a/projects/typed-peripheral-unlimitedperipheralworks/integrations/gtceu/workable.ts b/projects/typed-peripheral-unlimitedperipheralworks/integrations/gtceu/workable.ts index e98308a9..7bd03a3c 100644 --- a/projects/typed-peripheral-unlimitedperipheralworks/integrations/gtceu/workable.ts +++ b/projects/typed-peripheral-unlimitedperipheralworks/integrations/gtceu/workable.ts @@ -3,6 +3,8 @@ import { IPeripheralProvider } from "@siredvin/typed-peripheral-base"; /** @noSelf **/ export interface WorkableMachine extends ConfigurationAPI { + getProgress(): number; + getMaxProgress(): number; isActive(): boolean; } diff --git a/projects/typed-peripheral-unlimitedperipheralworks/integrations/lantern.ts b/projects/typed-peripheral-unlimitedperipheralworks/integrations/lantern.ts new file mode 100644 index 00000000..cd51cd62 --- /dev/null +++ b/projects/typed-peripheral-unlimitedperipheralworks/integrations/lantern.ts @@ -0,0 +1,9 @@ +import { IPeripheralProvider } from "@siredvin/typed-peripheral-base"; + +/** @noSelf **/ +export interface Lantern extends IPeripheral { + isEnabled(): boolean; + toggle(): Result; +} + +export const lanternProvider = new IPeripheralProvider("lantern"); diff --git a/projects/typed-peripheral-unlimitedperipheralworks/integrations/magicTome.ts b/projects/typed-peripheral-unlimitedperipheralworks/integrations/magicTome.ts new file mode 100644 index 00000000..15df18c6 --- /dev/null +++ b/projects/typed-peripheral-unlimitedperipheralworks/integrations/magicTome.ts @@ -0,0 +1,30 @@ +import { IPeripheralProvider } from "@siredvin/typed-peripheral-base"; + +export type SpellDetail = { + name: string; + display: string; + color: number; + sound?: string; + cost: number; +}; +export type ManaDetail = { + current: number; + max: number; + bookTier: number; + glyphBonus: number; +}; + +/** @noSelf **/ +export interface MagicTome extends IPeripheral { + getSpells(): LuaTable; + getSelectedSlot(): number; + size(): number; + getSelectedSpell(): SpellDetail; + select(slot: number): void; + getMana(): ManaDetail; + cast(): void; +} + +export const magicTomeProvider = new IPeripheralProvider( + "magic_tome" +); diff --git a/projects/typed-peripheral-unlimitedperipheralworks/integrations/naturesCompass.ts b/projects/typed-peripheral-unlimitedperipheralworks/integrations/naturesCompass.ts new file mode 100644 index 00000000..2d79fb3c --- /dev/null +++ b/projects/typed-peripheral-unlimitedperipheralworks/integrations/naturesCompass.ts @@ -0,0 +1,21 @@ +import { ConfigurationAPI } from "@siredvin/typed-peripheral-api/configuration"; +import { IPeripheralProvider } from "@siredvin/typed-peripheral-base"; + +export type NatureCompassResult = { + x: number; + z: number; + distance: number; + biome: string; +}; + +/** @noSelf **/ +export interface NaturesCompass extends ConfigurationAPI { + getBiomes(): string[]; + scheduleSearch(biome: string): Result; + getState(): string; + getResult(): NatureCompassResult | null; +} + +export const naturesCompassProvider = new IPeripheralProvider( + "natures_compass" +); diff --git a/projects/typed-peripheral-unlimitedperipheralworks/integrations/occultism.ts b/projects/typed-peripheral-unlimitedperipheralworks/integrations/occultism.ts new file mode 100644 index 00000000..9ad88a16 --- /dev/null +++ b/projects/typed-peripheral-unlimitedperipheralworks/integrations/occultism.ts @@ -0,0 +1,20 @@ +import { ItemStorageAPI } from "@siredvin/typed-peripheral-api/item_storage"; + +/** @noSelf **/ +export interface OccultismStorage extends ItemStorageAPI { + getMaxSlots(): number; + getUsedSlots(): number; + isBlacklisted(itemID: string): boolean; +} + +/** @noSelf **/ +export interface OccultismGoldenBowl extends IPeripheral { + isBusy(): boolean; + getCraftingInformation(): { + pentacle: string; + ritual: string; + itemUseFulfilled: boolean; + sacrificeFulfilled: boolean; + leftTime: number; + } | null; +} diff --git a/projects/typed-peripheral-unlimitedperipheralworks/integrations/powah.ts b/projects/typed-peripheral-unlimitedperipheralworks/integrations/powah.ts new file mode 100644 index 00000000..d169448c --- /dev/null +++ b/projects/typed-peripheral-unlimitedperipheralworks/integrations/powah.ts @@ -0,0 +1,44 @@ +/** @noSelf **/ +export interface PowahEnergyStorageAPI extends IPeripheral { + getEnergyTransfer(): number; +} + +/** @noSelf **/ +export interface PowahGeneratorAPI extends PowahEnergyStorageAPI { + getEnergyGeneration(): number; +} + +/** @noSelf **/ +export interface PowahReactorAPI extends PowahGeneratorAPI { + inspect(): { + autoMode: boolean; + currentCarbon: number; + maxCarbon: number; + currentRedstone: number; + maxRedstone: number; + currentUranium: number; + maxUranium: number; + uraniumConsumption: number; + energyProduction: number; + currentSolidCoolant: number; + maxSolidCoolant: number; + coolantTemp: number; + solidCoolantTemp: number; + currentTemp: number; + maxTemp: number; + }; + toggleAutoMode(): void; +} + +/** @noSelf **/ +export interface PowahEnderCellAPI extends PowahEnergyStorageAPI { + getChannel(): number; + setChannel(channel: number): void; + getMaxChannel(): number; +} + +/** @noSelf **/ +export interface PowahRedstoneControlAPI extends IPeripheral { + getRedstoneMode(): string; + setRedstoneMode(mode: string): void; +} diff --git a/projects/typed-peripheral-unlimitedperipheralworks/integrations/specializedMachines.ts b/projects/typed-peripheral-unlimitedperipheralworks/integrations/specializedMachines.ts new file mode 100644 index 00000000..31abbca3 --- /dev/null +++ b/projects/typed-peripheral-unlimitedperipheralworks/integrations/specializedMachines.ts @@ -0,0 +1,29 @@ +import { IPeripheralProvider } from "@siredvin/typed-peripheral-base"; + +/** @noSelf **/ +export interface ModernIndustrializationCrafter extends IPeripheral { + isBusy(): boolean; + getCraftingInformation(): + | { + progress: number; + currentEfficiency: number; + maxEfficiency: number; + baseRecipeCost: number; + currentRecipeCost: number; + } + | object; +} + +/** @noSelf **/ +export interface AlloyForgeryController extends IPeripheral { + inspect(): { + fuel: number; + currentSmeltTime: number; + smeltProgress: number; + }; +} + +export const miCrafterProvider = + new IPeripheralProvider("mi_crafter"); +export const alloyForgeryProvider = + new IPeripheralProvider("alloy_forgery"); diff --git a/projects/typed-peripheral-unlimitedperipheralworks/integrations/transmutation_table.d.ts b/projects/typed-peripheral-unlimitedperipheralworks/integrations/transmutation_table.d.ts deleted file mode 100644 index ec14adea..00000000 --- a/projects/typed-peripheral-unlimitedperipheralworks/integrations/transmutation_table.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { ConfigurationAPI } from "@siredvin/typed-peripheral-api/configuration"; -import { InventoryViewAPI } from "@siredvin/typed-peripheral-api/inventory_view"; -import { IPeripheralProvider } from "@siredvin/typed-peripheral-base"; -/** @noSelf **/ -export interface TransmutationTable extends ConfigurationAPI, InventoryViewAPI { - getAvailableItems(): (ItemDetail & { - EMC: number; - })[]; - getEMC(): number; - syntize(id: string, amount: number): Result; - transmute(slot: number): Result; -} -export declare const transmutationTableProvider: IPeripheralProvider; diff --git a/projects/typed-peripheral-unlimitedperipheralworks/integrations/universalShop.ts b/projects/typed-peripheral-unlimitedperipheralworks/integrations/universalShop.ts new file mode 100644 index 00000000..27e93216 --- /dev/null +++ b/projects/typed-peripheral-unlimitedperipheralworks/integrations/universalShop.ts @@ -0,0 +1,17 @@ +import { IPeripheralProvider } from "@siredvin/typed-peripheral-base"; + +export type ShopItemSetting = { type: string; price?: ItemDetail }; + +/** @noSelf **/ +export interface UniversalShop extends IPeripheral { + getHologramMode(): string; + setHologramMode(mode: string): void; + getPrice(): ShopItemSetting; + setPrice(type: "free" | "single_item", itemHint?: object): Result; + getStock(): ShopItemSetting; + setStock(type: "selected_item" | "single_item", itemHint?: object): Result; +} + +export const universalShopProvider = new IPeripheralProvider( + "universal_shop" +); diff --git a/projects/typed-peripheral-unlimitedperipheralworks/integrations/vanilla.ts b/projects/typed-peripheral-unlimitedperipheralworks/integrations/vanilla.ts new file mode 100644 index 00000000..73b7f3b1 --- /dev/null +++ b/projects/typed-peripheral-unlimitedperipheralworks/integrations/vanilla.ts @@ -0,0 +1,70 @@ +import { ExtendedInventoryAPI } from "@siredvin/typed-peripheral-api/inventory_extended"; +import { IPeripheralProvider } from "@siredvin/typed-peripheral-base"; +import { EntityDetail } from "../types"; + +/** @noSelf **/ +export interface Lectern extends IPeripheral { + hasBook(): boolean; + getPageCount(): number; + getActivePage(): number; + setActivePage(page: number): void; + getText(): string[]; + isBookEditable(): boolean; + addPage(text?: string): Result; + removePage(page: number): Result; + editPage(page: number, text: string): Result; + ejectBook(toName: string): Result; + injectBook(fromName: string, query?: string | object): Result; +} + +/** @noSelf **/ +export interface Beacon extends IPeripheral { + getLevel(): number; + getPossiblePowers(): string[]; + getPowers(): object[]; + configure( + primaryPower: string, + fromInventory: string, + paymentQuery: string | object, + regenerationSecondary?: boolean + ): Result; +} + +/** @noSelf **/ +export interface NoteBlock extends IPeripheral { + getNote(): number; + setNote(note: number): void; + getInstrument(): string; + setInstrument(instrument: string): void; + play(): void; +} + +/** @noSelf **/ +export interface PoweredRail extends ExtendedInventoryAPI { + isPowered(): boolean; + pushMinecarts(reverse?: boolean): void; + getMinecarts(): EntityDetail[]; +} + +/** @noSelf **/ +export interface Jukebox extends IPeripheral { + getDisc(): ItemDetail | null; + replay(): void; + stop(): void; + ejectDisc(toName: string): Result; + injectDisc(fromName: string, query?: string | object): Result; +} + +export const lecternProvider = new IPeripheralProvider( + "minecraft:lectern" +); +export const beaconProvider = new IPeripheralProvider("minecraft:beacon"); +export const noteBlockProvider = new IPeripheralProvider( + "minecraft:note_block" +); +export const poweredRailProvider = new IPeripheralProvider( + "minecraft:powered_rail" +); +export const jukeboxProvider = new IPeripheralProvider( + "minecraft:jukebox" +); diff --git a/projects/typed-peripheral-unlimitedperipheralworks/itemPedestal.ts b/projects/typed-peripheral-unlimitedperipheralworks/itemPedestal.ts new file mode 100644 index 00000000..e5979262 --- /dev/null +++ b/projects/typed-peripheral-unlimitedperipheralworks/itemPedestal.ts @@ -0,0 +1,9 @@ +import { ExtendedInventoryAPI } from "@siredvin/typed-peripheral-api/inventory_extended"; +import { IPeripheralProvider } from "@siredvin/typed-peripheral-base"; + +/** @noSelf **/ +export interface ItemPedestal extends ExtendedInventoryAPI {} + +export const itemPedestalProvider = new IPeripheralProvider( + "item_pedestal" +); diff --git a/projects/typed-peripheral-unlimitedperipheralworks/mapPedestal.ts b/projects/typed-peripheral-unlimitedperipheralworks/mapPedestal.ts new file mode 100644 index 00000000..fd2c2ce1 --- /dev/null +++ b/projects/typed-peripheral-unlimitedperipheralworks/mapPedestal.ts @@ -0,0 +1,20 @@ +import { ExtendedInventoryAPI } from "@siredvin/typed-peripheral-api/inventory_extended"; +import { OperationApi } from "@siredvin/typed-peripheral-api/operations"; +import { IPeripheralProvider } from "@siredvin/typed-peripheral-base"; +import { Fallible, Position } from "./types"; + +export type MapData = { + colors: number[]; + scale: number; + banners: { name?: string; pos: Position; color: string }[]; +}; + +/** @noSelf **/ +export interface MapPedestal extends ExtendedInventoryAPI, OperationApi { + getData(): Fallible; + updateData(): Result; +} + +export const mapPedestalProvider = new IPeripheralProvider( + "map_pedestal" +); diff --git a/projects/typed-peripheral-unlimitedperipheralworks/networkManager.d.ts b/projects/typed-peripheral-unlimitedperipheralworks/networkManager.d.ts deleted file mode 100644 index 2c2a2d05..00000000 --- a/projects/typed-peripheral-unlimitedperipheralworks/networkManager.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { ConfigurationAPI } from "@siredvin/typed-peripheral-api/configuration"; -import { IPeripheralProvider } from "@siredvin/typed-peripheral-base"; -/** @noSelf **/ -export interface NetworkManager extends ConfigurationAPI { - getGroups(): string[]; - addGroup(group: string): Result; - removeGroup(group: string): Result; - add(group: string, peripheral: string): Result; - remove(group: string, peripheral: string): Result; - setGroupColor(group: string, color: number): Result; - get(group: string): LuaMultiReturn; - getDistanceBetween(first: string, second: string): { - x: number; - y: number; - z: number; - }; -} -export declare const networkManagerProvider: IPeripheralProvider; diff --git a/projects/typed-peripheral-unlimitedperipheralworks/networkManager.ts b/projects/typed-peripheral-unlimitedperipheralworks/networkManager.ts index 0297aeea..5d01be51 100644 --- a/projects/typed-peripheral-unlimitedperipheralworks/networkManager.ts +++ b/projects/typed-peripheral-unlimitedperipheralworks/networkManager.ts @@ -1,19 +1,24 @@ import { ConfigurationAPI } from "@siredvin/typed-peripheral-api/configuration"; import { IPeripheralProvider } from "@siredvin/typed-peripheral-base"; +import { Fallible } from "./types"; /** @noSelf **/ -export interface NetworkManager extends ConfigurationAPI { +export interface NetworkManager + extends ConfigurationAPI<{ delimiter: string; range: number }> { getGroups(): string[]; addGroup(group: string): Result; removeGroup(group: string): Result; add(group: string, peripheral: string): Result; remove(group: string, peripheral: string): Result; setGroupColor(group: string, color: number): Result; + getGroupColor(group: string): Fallible; + setDelimiter(delimiter: string): Result; + setRange(range: number): Result; get(group: string): LuaMultiReturn; getDistanceBetween( first: string, second: string - ): { x: number; y: number; z: number }; + ): Fallible<{ x: number; y: number; z: number }>; } export const networkManagerProvider = new IPeripheralProvider( diff --git a/projects/typed-peripheral-unlimitedperipheralworks/package-lock.json b/projects/typed-peripheral-unlimitedperipheralworks/package-lock.json index d6285bbf..7b69ac84 100644 --- a/projects/typed-peripheral-unlimitedperipheralworks/package-lock.json +++ b/projects/typed-peripheral-unlimitedperipheralworks/package-lock.json @@ -1,12 +1,12 @@ { "name": "@siredvin/typed-peripheral-unlimitedperipheralworks", - "version": "0.1.0", + "version": "0.5.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@siredvin/typed-peripheral-unlimitedperipheralworks", - "version": "0.1.0", + "version": "0.5.0", "license": "MIT", "dependencies": { "@jackmacwindows/lua-types": "^2.13.1", diff --git a/projects/typed-peripheral-unlimitedperipheralworks/package.json b/projects/typed-peripheral-unlimitedperipheralworks/package.json index 6f98bc47..00daee02 100644 --- a/projects/typed-peripheral-unlimitedperipheralworks/package.json +++ b/projects/typed-peripheral-unlimitedperipheralworks/package.json @@ -1,6 +1,6 @@ { "name": "@siredvin/typed-peripheral-unlimitedperipheralworks", - "version": "0.4.1", + "version": "0.5.0", "description": "Typed peripheral library for UnlimitedPeripheralWorks peripherals", "files": [ "./*.d.ts", diff --git a/projects/typed-peripheral-unlimitedperipheralworks/peripheralHub.ts b/projects/typed-peripheral-unlimitedperipheralworks/peripheralHub.ts new file mode 100644 index 00000000..7fae112b --- /dev/null +++ b/projects/typed-peripheral-unlimitedperipheralworks/peripheralHub.ts @@ -0,0 +1,36 @@ +import { IPeripheralProvider } from "@siredvin/typed-peripheral-base"; + +/** @noSelf **/ +export interface PeripheralHub extends IPeripheral { + getNamesRemote(): string[]; + isPresentRemote(name: string): boolean; + getTypeRemote(name: string): string | null; + hasTypeRemote(name: string, type: string): boolean; + getMethodsRemote(name: string): string[] | null; + callRemote(name: string, method: string, ...args: any[]): LuaMultiReturn; +} + +/** @noSelf **/ +export interface PeripheralProxy extends PeripheralHub { + setTextStyle(value: string): Result; + setBoxStyle(value: string): Result; +} + +/** @noSelf **/ +export interface PeripheraliumHub extends PeripheralHub { + isUpgrade(slot: number): boolean; + equip(slot: number): Result; + unequip(upgradeID: string): Result; + getUpgrades(): string[]; +} + +export const peripheralProxyProvider = new IPeripheralProvider( + "peripheral_proxy" +); +export const peripheralHubProvider = new IPeripheralProvider( + "peripheral_hub" +); +export const peripheraliumHubProvider = + new IPeripheralProvider("peripheralium_hub"); +export const netheritePeripheraliumHubProvider = + new IPeripheralProvider("netherite_peripheralium_hub"); diff --git a/projects/typed-peripheral-unlimitedperipheralworks/realityForger.ts b/projects/typed-peripheral-unlimitedperipheralworks/realityForger.ts new file mode 100644 index 00000000..6530f20c --- /dev/null +++ b/projects/typed-peripheral-unlimitedperipheralworks/realityForger.ts @@ -0,0 +1,31 @@ +import { ConfigurationAPI } from "@siredvin/typed-peripheral-api/configuration"; +import { IPeripheralProvider } from "@siredvin/typed-peripheral-base"; +import { BlockState, Position } from "./types"; + +export type RealityFlags = { + playerPassable?: boolean; + lightPassable?: boolean; + skyLightPassable?: boolean; + invisible?: boolean; + lightLevel?: number; +}; + +export type RealityBatch = [Position[], BlockState, RealityFlags?]; + +/** @noSelf **/ +export interface RealityForger + extends ConfigurationAPI<{ interactionRadius: number }> { + detectAnchors(): Position[]; + clearAnchors(positions?: Position[]): Result; + forgeReality(blockState: BlockState, flags?: RealityFlags): Result; + forgeRealityPieces( + positions: Position[], + blockState: BlockState, + flags?: RealityFlags + ): Result; + batchForgeRealityPieces(batch: RealityBatch[]): Result; +} + +export const realityForgerProvider = new IPeripheralProvider( + "reality_forger" +); diff --git a/projects/typed-peripheral-unlimitedperipheralworks/recipeRegistry.d.ts b/projects/typed-peripheral-unlimitedperipheralworks/recipeRegistry.d.ts deleted file mode 100644 index 90c5768b..00000000 --- a/projects/typed-peripheral-unlimitedperipheralworks/recipeRegistry.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { ConfigurationAPI } from "@siredvin/typed-peripheral-api/configuration"; -import { IPeripheralProvider } from "@siredvin/typed-peripheral-base"; -import { EmiRecipe } from "./integrations/emi/emiRecipePaste"; -/** @noSelf **/ -export interface RecipeRegistry extends ConfigurationAPI { - get(recipeID: string): LuaTable | null; - getEMI(recipeID: string): EmiRecipe | null; - getRaw(recipeID: string): LuaTable | null; -} -export declare const recipeRegistryProvider: IPeripheralProvider; diff --git a/projects/typed-peripheral-unlimitedperipheralworks/recipeRegistry.ts b/projects/typed-peripheral-unlimitedperipheralworks/recipeRegistry.ts index 5f4572f9..93e4dfd0 100644 --- a/projects/typed-peripheral-unlimitedperipheralworks/recipeRegistry.ts +++ b/projects/typed-peripheral-unlimitedperipheralworks/recipeRegistry.ts @@ -4,9 +4,12 @@ import { EmiRecipe } from "./integrations/emi/emiRecipePaste"; /** @noSelf **/ export interface RecipeRegistry extends ConfigurationAPI { + getTypes(): string[]; get(recipeID: string): LuaTable | null; getEMI(recipeID: string): EmiRecipe | null; getRaw(recipeID: string): LuaTable | null; + list(types: string | string[]): string[]; + search(itemID: string, types: string | string[]): LuaTable[]; } export const recipeRegistryProvider = new IPeripheralProvider( diff --git a/projects/typed-peripheral-unlimitedperipheralworks/remoteObserver.ts b/projects/typed-peripheral-unlimitedperipheralworks/remoteObserver.ts new file mode 100644 index 00000000..94ae4eaa --- /dev/null +++ b/projects/typed-peripheral-unlimitedperipheralworks/remoteObserver.ts @@ -0,0 +1,23 @@ +import { ConfigurationAPI } from "@siredvin/typed-peripheral-api/configuration"; +import { IPeripheralProvider } from "@siredvin/typed-peripheral-base"; +import { Position } from "./types"; + +export type RemoteObserverConfiguration = { + maxRange: number; + textStyle: string; + boxStyle: string; +}; + +/** @noSelf **/ +export interface RemoteObserver + extends ConfigurationAPI { + setTextStyle(value: string): Result; + setBoxStyle(value: string): Result; + addPosition(position: Position): Result; + removePosition(position: Position): Result; + getPositions(): Position[]; +} + +export const remoteObserverProvider = new IPeripheralProvider( + "remote_observer" +); diff --git a/projects/typed-peripheral-unlimitedperipheralworks/statueWorkbench.d.ts b/projects/typed-peripheral-unlimitedperipheralworks/statueWorkbench.d.ts deleted file mode 100644 index dd2c0767..00000000 --- a/projects/typed-peripheral-unlimitedperipheralworks/statueWorkbench.d.ts +++ /dev/null @@ -1,28 +0,0 @@ -import { IPeripheralProvider } from "@siredvin/typed-peripheral-base"; -/** @noSelf **/ -export interface StatueWorkbench extends IPeripheral { - isPresent(): Boolean; - setStatueName(name: string): any; - getStatueName(): string; - setAuthor(author: string): any; - getAuthor(): string; - setLightLevel(level: number): any; - getLightLevel(): number; - setCubes(cubes: Array): any; - getCubes(): Array; - reset(): any; -} -/** @noSelf **/ -export declare class DummyStatueWorkbench implements StatueWorkbench { - isPresent(): Boolean; - setStatueName(name: string): void; - getStatueName(): string; - setAuthor(author: string): void; - getAuthor(): string; - setLightLevel(level: number): void; - getLightLevel(): number; - setCubes(cubes: Cube[]): void; - getCubes(): Cube[]; - reset(): void; -} -export declare const statueWorkbenchProvider: IPeripheralProvider; diff --git a/projects/typed-peripheral-unlimitedperipheralworks/statueWorkbench.ts b/projects/typed-peripheral-unlimitedperipheralworks/statueWorkbench.ts index 72c510cf..9583222c 100644 --- a/projects/typed-peripheral-unlimitedperipheralworks/statueWorkbench.ts +++ b/projects/typed-peripheral-unlimitedperipheralworks/statueWorkbench.ts @@ -7,21 +7,21 @@ let DUMMY_CUBES = []; /** @noSelf **/ export interface StatueWorkbench extends IPeripheral { - isPresent(): Boolean; - setStatueName(name: string); + isPresent(): boolean; + setStatueName(name: string): void; getStatueName(): string; - setAuthor(author: string); + setAuthor(author: string): void; getAuthor(): string; - setLightLevel(level: number); + setLightLevel(level: number): void; getLightLevel(): number; - setCubes(cubes: Array); + setCubes(cubes: Array): void; getCubes(): Array; - reset(); + reset(): void; } /** @noSelf **/ export class DummyStatueWorkbench implements StatueWorkbench { - isPresent(): Boolean { + isPresent(): boolean { return true; } setStatueName(name: string) { diff --git a/projects/typed-peripheral-unlimitedperipheralworks/turtle.ts b/projects/typed-peripheral-unlimitedperipheralworks/turtle.ts new file mode 100644 index 00000000..86842474 --- /dev/null +++ b/projects/typed-peripheral-unlimitedperipheralworks/turtle.ts @@ -0,0 +1,17 @@ +import { EnergyStorageAPI } from "@siredvin/typed-peripheral-api/energy_storage"; +import { ExtendedInventoryAPI } from "@siredvin/typed-peripheral-api/inventory_extended"; +import { IPeripheralProvider } from "@siredvin/typed-peripheral-base"; + +/** @noSelf **/ +export interface TweakedTurtle extends ExtendedInventoryAPI, EnergyStorageAPI { + turnOn(): void; + shutdown(): void; + reboot(): void; + getID(): number; + isOn(): boolean; + getLabel(): string | null; +} + +export const tweakedTurtleProvider = new IPeripheralProvider( + "turtle" +); diff --git a/projects/typed-peripheral-unlimitedperipheralworks/types.ts b/projects/typed-peripheral-unlimitedperipheralworks/types.ts new file mode 100644 index 00000000..dae5e3a6 --- /dev/null +++ b/projects/typed-peripheral-unlimitedperipheralworks/types.ts @@ -0,0 +1,10 @@ +export type Position = { x: number; y: number; z: number }; + +export type BlockState = { + name: string; + state?: LuaTable; +}; + +export type EntityDetail = LuaTable & Position; + +export type Fallible = LuaMultiReturn<[T] | [F, string]>; diff --git a/projects/typed-peripheral-unlimitedperipheralworks/ultimateSensor.ts b/projects/typed-peripheral-unlimitedperipheralworks/ultimateSensor.ts new file mode 100644 index 00000000..cf40d038 --- /dev/null +++ b/projects/typed-peripheral-unlimitedperipheralworks/ultimateSensor.ts @@ -0,0 +1,25 @@ +import { ConfigurationAPI } from "@siredvin/typed-peripheral-api/configuration"; +import { OperationApi } from "@siredvin/typed-peripheral-api/operations"; +import { IPeripheralProvider } from "@siredvin/typed-peripheral-base"; + +export type SensorInspector = + | "dimension" + | "biome" + | "weather" + | "orientation" + | "time" + | "light" + | "calendar" + | "chunk"; + +/** @noSelf **/ +export interface UltimateSensor extends OperationApi, ConfigurationAPI { + listAnalyzers(): string[]; + listInspectors(): SensorInspector[]; + analyze(name: "dimension"): string[]; + inspect(name: SensorInspector): any; +} + +export const ultimateSensorProvider = new IPeripheralProvider( + "ultimate_sensor" +); diff --git a/projects/typed-peripheral-unlimitedperipheralworks/universalScanner.d.ts b/projects/typed-peripheral-unlimitedperipheralworks/universalScanner.d.ts deleted file mode 100644 index 890a338d..00000000 --- a/projects/typed-peripheral-unlimitedperipheralworks/universalScanner.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { ConfigurationAPI } from "@siredvin/typed-peripheral-api/configuration"; -import { OperationApi } from "@siredvin/typed-peripheral-api/operations"; -import { ScanApi } from "@siredvin/typed-peripheral-api/scan"; -import { IPeripheralProvider } from "@siredvin/typed-peripheral-base"; -/** @noSelf **/ -export interface UniversalScanner extends ScanApi, OperationApi, ConfigurationAPI { -} -export declare const universalScannerProvider: IPeripheralProvider;