|
| 1 | +/** |
| 2 | + * This library wraps functionality of Applied Energistics 2. |
| 3 | + * @see https://ocdoc.cil.li/component:applied_energistics |
| 4 | + * @noSelfInFile |
| 5 | + */ |
| 6 | +declare namespace ME { |
| 7 | + /** |
| 8 | + * Common is the base network API functionality for all AE2 interfaces. |
| 9 | + * @noSelf |
| 10 | + */ |
| 11 | + interface Common { |
| 12 | + /** |
| 13 | + * Get a list of tables representing the available CPUs in the network. |
| 14 | + */ |
| 15 | + getCpus(): Cpu[]; |
| 16 | + |
| 17 | + /** |
| 18 | + * Get a list of known item recipes. These can be used to issue crafting requests.. |
| 19 | + */ |
| 20 | + getCraftables(filter?: any): Craftable[]; |
| 21 | + |
| 22 | + /** |
| 23 | + * Get a list of the stored items in the network. |
| 24 | + */ |
| 25 | + getItemsInNetwork(filter?: ItemStack): ItemStack[]; |
| 26 | + |
| 27 | + /** |
| 28 | + * Store items in the network matching the specified filter in the database with the specified address. |
| 29 | + */ |
| 30 | + store(filter?: any, dbAddress?: string, startSlot?: number, count?: number): boolean; |
| 31 | + |
| 32 | + /** |
| 33 | + * Get a list of the stored fluids in the network. |
| 34 | + */ |
| 35 | + getFluidsInNetwork(): Fluid[]; |
| 36 | + |
| 37 | + /** |
| 38 | + * Get the average power injection into the network. |
| 39 | + */ |
| 40 | + getAvgPowerInjection(): number; |
| 41 | + |
| 42 | + /** |
| 43 | + * Get the average power usage of the network. |
| 44 | + */ |
| 45 | + getAvgPowerUsage(): number; |
| 46 | + |
| 47 | + /** |
| 48 | + * Get the idle power usage of the network. |
| 49 | + */ |
| 50 | + getIdlePowerUsage(): number; |
| 51 | + |
| 52 | + /** |
| 53 | + * Get the maximum stored power in the network. |
| 54 | + */ |
| 55 | + getMaxStoredPower(): number; |
| 56 | + |
| 57 | + /** |
| 58 | + * Get the stored power in the network. |
| 59 | + */ |
| 60 | + getStoredPower(): number; |
| 61 | + } |
| 62 | + |
| 63 | + /** |
| 64 | + * Controller interface for the AE2 controller. Referred as "me_controller" in ocdocs |
| 65 | + * @noSelf |
| 66 | + */ |
| 67 | + interface Controller extends Common { |
| 68 | + /** |
| 69 | + * Returns the amount of stored energy on the connected side. |
| 70 | + */ |
| 71 | + getEnergyStored(): number; |
| 72 | + |
| 73 | + /** |
| 74 | + * Returns the maximum amount of stored energy on the connected side. |
| 75 | + */ |
| 76 | + getMaxEnergyStored(): number; |
| 77 | + |
| 78 | + /** |
| 79 | + * Returns whether this component can have energy extracted from the connected side. |
| 80 | + */ |
| 81 | + canExtract(): number; |
| 82 | + |
| 83 | + /** |
| 84 | + * Returns whether this component can receive energy on the connected side. |
| 85 | + */ |
| 86 | + canReceive(): number; |
| 87 | + } |
| 88 | + |
| 89 | + /** |
| 90 | + * Interface interface for the AE2 interface blocks. Referred as "me_interface" in ocdocs |
| 91 | + * @noSelf |
| 92 | + */ |
| 93 | + interface Interface extends Common { |
| 94 | + /** |
| 95 | + * Get the configuration of the interface. |
| 96 | + */ |
| 97 | + getInterfaceConfiguration(slot?: number): ItemStack[]; |
| 98 | + |
| 99 | + /** |
| 100 | + * Configure the interface. |
| 101 | + */ |
| 102 | + setInterfaceConfiguration(slot?: number, database?: string, entry?: number, size?: number): boolean; |
| 103 | + } |
| 104 | + |
| 105 | + /** |
| 106 | + * ImportBus interface for the AE2 Importbus blocks. Referred as "me_importbus" in ocdocs |
| 107 | + * @noSelf |
| 108 | + */ |
| 109 | + interface ImportBus extends Common { |
| 110 | + /** |
| 111 | + * Get the configuration of the import bus pointing in the specified direction. |
| 112 | + */ |
| 113 | + getImportConfiguration(side: number, slot?: number): boolean; |
| 114 | + |
| 115 | + /** |
| 116 | + * Configure the import bus pointing in the specified direction to import item stacks matching the specified descriptor. |
| 117 | + */ |
| 118 | + setImportConfiguration(side: number, slot?: number, database?: string, entry?: number): boolean; |
| 119 | + } |
| 120 | + |
| 121 | + /** |
| 122 | + * ExportBus interface for the AE2 Exportbus blocks. Referred as "me_exportbus" in ocdocs |
| 123 | + * @noSelf |
| 124 | + */ |
| 125 | + interface ExportBus extends Common { |
| 126 | + /** |
| 127 | + * Get the configuration of the export bus pointing in the specified direction. |
| 128 | + */ |
| 129 | + getExportConfiguration(side: number, slot?: number): boolean; |
| 130 | + |
| 131 | + /** |
| 132 | + * Configure the export bus pointing in the specified direction to export item stacks matching the specified descriptor. |
| 133 | + */ |
| 134 | + setExportConfiguration(side: number, slot?: number, database?: string, entry?: number): boolean; |
| 135 | + |
| 136 | + /** |
| 137 | + * Make the export bus facing the specified direction perform a single export operation into the specified slot. |
| 138 | + */ |
| 139 | + exportIntoSlot(side: number, slot: number): boolean; |
| 140 | + } |
| 141 | + |
| 142 | + /** |
| 143 | + * @noSelf |
| 144 | + */ |
| 145 | + interface Craftable { |
| 146 | + /** |
| 147 | + * Returns the item stack representation of the crafting result. |
| 148 | + */ |
| 149 | + getItemStack(): ItemStack; |
| 150 | + |
| 151 | + /** |
| 152 | + * Requests the item to be crafted, returning an object that allows tracking the crafting status. |
| 153 | + */ |
| 154 | + request(amount: number, prioritizePower?: boolean, cpuName?: string): CraftingStatus; |
| 155 | + } |
| 156 | + |
| 157 | + /** |
| 158 | + * @noSelf |
| 159 | + */ |
| 160 | + interface CraftingStatus { |
| 161 | + /** |
| 162 | + * Get whether the crafting request has been canceled. |
| 163 | + */ |
| 164 | + isCanceled(): boolean; |
| 165 | + |
| 166 | + /** |
| 167 | + * Get whether the crafting request is done. |
| 168 | + */ |
| 169 | + isDone(): boolean; |
| 170 | + } |
| 171 | + |
| 172 | + interface ItemStack { |
| 173 | + damage?: number; |
| 174 | + hasTag?: boolean; |
| 175 | + isCraftable?: boolean; |
| 176 | + label?: string; |
| 177 | + maxDamage?: number; |
| 178 | + maxSize?: number; |
| 179 | + name?: string; |
| 180 | + size?: number; |
| 181 | + } |
| 182 | + |
| 183 | + interface Fluid { |
| 184 | + amount?: number; |
| 185 | + hasTag?: boolean; |
| 186 | + label?: string; |
| 187 | + name?: string; |
| 188 | + } |
| 189 | + |
| 190 | + interface Cpu { |
| 191 | + busy?: boolean; |
| 192 | + coprocessors?: number; |
| 193 | + name?: string; |
| 194 | + storage?: number; |
| 195 | + } |
| 196 | +} |
0 commit comments