mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-18 18:11:24 +01:00
refactor: fix ts errors
This commit is contained in:
parent
98ae3292fc
commit
3018d94618
17 changed files with 83 additions and 54 deletions
2
src/types/common.d.ts
vendored
2
src/types/common.d.ts
vendored
|
|
@ -6,5 +6,7 @@ interface Dict<T> {
|
|||
[key: string]: T;
|
||||
}
|
||||
|
||||
type IntArray = Uint8Array | Uint16Array | Uint32Array;
|
||||
|
||||
type RGB = `rgb(${number}, ${number}, ${number})`;
|
||||
type Hex = `#${string}`;
|
||||
|
|
|
|||
18
src/types/grid.d.ts
vendored
18
src/types/grid.d.ts
vendored
|
|
@ -1,7 +1,21 @@
|
|||
interface IGrid {
|
||||
spacing: number;
|
||||
boundary: TPoints;
|
||||
points: TPoints;
|
||||
features: IFeature[];
|
||||
cells: {
|
||||
h: TypedArray;
|
||||
prec: number[];
|
||||
i: IntArray;
|
||||
b: IntArray;
|
||||
c: number[][];
|
||||
h: IntArray;
|
||||
t: IntArray;
|
||||
f: IntArray;
|
||||
prec: IntArray;
|
||||
};
|
||||
}
|
||||
interface IFeature {
|
||||
i: number;
|
||||
land: boolean;
|
||||
border: boolean;
|
||||
type: "ocean" | "lake" | "island";
|
||||
}
|
||||
|
|
|
|||
20
src/types/pack.d.ts
vendored
20
src/types/pack.d.ts
vendored
|
|
@ -1,10 +1,20 @@
|
|||
interface IPack {
|
||||
vertices: {
|
||||
p: TPoints;
|
||||
v: number[][];
|
||||
c: number[][];
|
||||
};
|
||||
cells: {
|
||||
i: number[];
|
||||
g: number[];
|
||||
h: number[];
|
||||
pop: number[];
|
||||
burg: number[];
|
||||
i: IntArray;
|
||||
p: TPoints;
|
||||
v: number[][];
|
||||
c: number[][];
|
||||
g: IntArray;
|
||||
h: IntArray;
|
||||
pop: Float32Array;
|
||||
burg: IntArray;
|
||||
area: IntArray;
|
||||
q: d3.Quadtree<number[]>;
|
||||
};
|
||||
states: IState[];
|
||||
cultures: ICulture[];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue