Skip to content

Commit

Permalink
fix(*): fix export types
Browse files Browse the repository at this point in the history
  • Loading branch information
neki-dev committed Sep 12, 2024
1 parent 5b4427e commit accbbf5
Show file tree
Hide file tree
Showing 25 changed files with 43 additions and 165 deletions.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions dist/generator/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import type { WorldGenerationParams } from "./types";
import { World } from "../world";
import { WorldBiome } from "../world/biome";
import { WorldBiome } from "../biome";
import type { WorldConfig } from "../world/types";
import type { WorldBiomeConfig } from "../world/biome/types";
import type { WorldBiomeConfig } from "../biome/types";
export declare class WorldGenerator<T extends object> {
readonly config: WorldConfig;
private biomes;
Expand Down
15 changes: 7 additions & 8 deletions dist/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
export * from './generator';
export * from './generator/types';
export * from './world';
export * from './world/types';
export * from './world/biome';
export * from './world/biome/types';
export * from './utils/perlin';
export * from './utils/seed';
export { WorldGenerator } from "./generator";
export { World } from "./world";
export { WorldBiome } from "./biome";
import type { WorldConfig, WorldPoint } from "./world/types";
import type { WorldGenerationParams } from "./generator/types";
import type { WorldBiomeConfig } from "./biome/types";
export type { WorldConfig, WorldPoint, WorldGenerationParams, WorldBiomeConfig, };
2 changes: 1 addition & 1 deletion dist/index.js

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

64 changes: 0 additions & 64 deletions dist/types.d.ts

This file was deleted.

1 change: 0 additions & 1 deletion dist/utils/clamp.d.ts

This file was deleted.

11 changes: 0 additions & 11 deletions dist/utils/perlin.d.ts

This file was deleted.

10 changes: 1 addition & 9 deletions dist/utils/perlin/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1 @@
import type { PerlinParameters } from "./types";
export declare class Perlin {
static generate({ x, y, seed, config }: PerlinParameters): number;
private static clamp;
private static scaledCosine;
private static smootherStep;
private static heightFalloff;
private static normalizeConfig;
}
export {};
8 changes: 1 addition & 7 deletions dist/utils/perlin/types.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1 @@
import type { WorldConfig } from "../../world/types";
export type PerlinParameters = {
seed: number[];
config: WorldConfig;
x: number;
y: number;
};
export {};
1 change: 0 additions & 1 deletion dist/utils/seed.d.ts

This file was deleted.

4 changes: 1 addition & 3 deletions dist/utils/seed/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
export declare class Seed {
static generate(size?: number): number[];
}
export {};
7 changes: 0 additions & 7 deletions dist/world-biome.d.ts

This file was deleted.

14 changes: 0 additions & 14 deletions dist/world-generator.d.ts

This file was deleted.

11 changes: 0 additions & 11 deletions dist/world-layer.d.ts

This file was deleted.

12 changes: 0 additions & 12 deletions dist/world.d.ts

This file was deleted.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "gen-biome",
"description": "Procedural generation of 2D maps with distinct biomes",
"version": "3.0.3",
"version": "3.0.4",
"keywords": [
"map",
"generation",
Expand Down
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions src/generator/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import type { WorldGenerationParams } from "./types";
import { Perlin } from "../utils/perlin";
import { Seed } from "../utils/seed";
import { World } from "../world";
import { WorldBiome } from "../world/biome";
import { WorldBiome } from "../biome";
import type { WorldConfig } from "../world/types";
import type { WorldBiomeConfig } from "../world/biome/types";
import type { WorldBiomeConfig } from "../biome/types";

export class WorldGenerator<T extends object> {
readonly config: WorldConfig;
Expand Down
22 changes: 14 additions & 8 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
export * from './generator';
export * from './generator/types';
export * from './world';
export * from './world/types';
export * from './world/biome';
export * from './world/biome/types';
export * from './utils/perlin';
export * from './utils/seed';
export { WorldGenerator } from "./generator";
export { World } from "./world";
export { WorldBiome } from "./biome";

import type { WorldConfig, WorldPoint } from "./world/types";
import type { WorldGenerationParams } from "./generator/types";
import type { WorldBiomeConfig } from "./biome/types";

export type {
WorldConfig,
WorldPoint,
WorldGenerationParams,
WorldBiomeConfig,
};
3 changes: 3 additions & 0 deletions src/utils/perlin/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ import {
} from "./const";
import type { PerlinParameters } from "./types";

/**
* @internal
*/
export class Perlin {
public static generate({ x, y, seed, config }: PerlinParameters): number {
const {
Expand Down
3 changes: 3 additions & 0 deletions src/utils/perlin/types.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import type { WorldConfig } from "../../world/types";

/**
* @internal
*/
export type PerlinParameters = {
seed: number[]
config: WorldConfig
Expand Down
9 changes: 6 additions & 3 deletions src/utils/seed/index.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
/**
* @internal
*/
export class Seed {
public static generate(size: number = 512) {
const seed: number[] = [];

for (let i = 0; i < size; i++) {
seed.push(Math.random());
}

return seed;
}
}
}
1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"target": "es6",
"esModuleInterop": true,
"declaration": true,
"stripInternal": true,
"strict": true
},
"include": ["./src/**/*"]
Expand Down

0 comments on commit accbbf5

Please sign in to comment.