Test mod
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
// types every side of a mod shares. these are the api mods see, not the engine's own classes:
|
||||
// items are { id, count, data } here, like on the network
|
||||
|
||||
export type Id = string;
|
||||
|
||||
export interface ItemStack {
|
||||
readonly id: Id;
|
||||
count: number;
|
||||
// any json value, set by server scripts
|
||||
data?: unknown;
|
||||
}
|
||||
|
||||
export interface ModInfo {
|
||||
readonly id: string;
|
||||
readonly version: string;
|
||||
}
|
||||
|
||||
export interface Position {
|
||||
x: number;
|
||||
y: number;
|
||||
z: number;
|
||||
}
|
||||
|
||||
export type Face = "west" | "east" | "bottom" | "top" | "north" | "south";
|
||||
|
||||
// KeyboardEvent.code values, like "KeyE" or "Digit1"
|
||||
export type KeyCode = string;
|
||||
|
||||
export type Unsubscribe = () => void;
|
||||
|
||||
export interface EventSignal<T> {
|
||||
subscribe(handler: (event: T) => void): Unsubscribe;
|
||||
}
|
||||
Reference in New Issue
Block a user