Skip to content

Commit

Permalink
Clean-up types file
Browse files Browse the repository at this point in the history
  • Loading branch information
Marak committed Feb 1, 2024
1 parent 4ff161d commit f5e0a43
Showing 1 changed file with 5 additions and 19 deletions.
24 changes: 5 additions & 19 deletions types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,10 @@ declare class TileMap {
//
// TileSet
//

// Interface for Tile objects
interface Tile {
id: number;
name: string;
// Add other properties here as needed, such as 'properties' if they have a specific structure
}

// Interface for the constructor options
Expand All @@ -74,7 +72,6 @@ declare class TileSet {
//
// LSystem
//

// Interface for the constructor options of LSystem
interface LSystemOptions {
tileset: TileSet;
Expand Down Expand Up @@ -108,9 +105,7 @@ declare class LSystem {
axiom: string;
rules: { [tileName: string]: string | ((context: RuleContext) => string) };
generations: number;

constructor(options: LSystemOptions);

getTileId(tileName: string): number | null;
applyRule(tileId: number, tileMap: TileMap): number;
applyTo(tileMap: TileMap): void;
Expand All @@ -119,7 +114,6 @@ declare class LSystem {
//
// Biome
//

// Interface for the constructor options of Biome
interface BiomeOptions {
name: string;
Expand All @@ -140,11 +134,9 @@ declare class Biome {
//
// labyrinthos
//

// Define a generic type for maze generation functions
export type MazeGeneratorFunction = (tileMap: TileMap, options: any) => void; // Replace 'any' with a more specific type if you have a shared options structure


interface mazes {
AldousBroder: MazeGeneratorFunction;
AldousBroder3D: MazeGeneratorFunction;
Expand All @@ -170,15 +162,13 @@ interface shapes {
interface terrains {
FaultLine: MazeGeneratorFunction;
PerlinNoise: MazeGeneratorFunction;
// Define terrain generators here if they have a similar signature
// Define additional terrain generators here if they have a similar signature
}

interface Utils {
// If the utilities have different signatures, define them individually
// Otherwise, you can use a similar approach as with the mazes
interface utils {
// Define utility functions here
}


interface labyrinthos {
TileMap: typeof TileMap;
TileSet: typeof TileSet;
Expand All @@ -187,7 +177,7 @@ interface labyrinthos {
mazes: mazes;
shapes: shapes;
terrains: terrains;
utils: Utils;
utils: utils;
}

export {
Expand All @@ -197,8 +187,4 @@ export {
LSystem,
mazes,
labyrinthos
}

// import labyrinthos from './lib/labyrinthos';

//export default labyrinthos as Labyrinthos;
}

0 comments on commit f5e0a43

Please sign in to comment.