mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-18 18:11:24 +01:00
refactor: layers basic typization
This commit is contained in:
parent
7c2c624417
commit
1847772d74
15 changed files with 337 additions and 194 deletions
60
src/types/globals.d.ts
vendored
60
src/types/globals.d.ts
vendored
|
|
@ -34,16 +34,54 @@ declare let distanceScale: number;
|
|||
declare let urbanDensity: number;
|
||||
declare let statesNeutral: number;
|
||||
|
||||
declare let scaleBar: Selection<HTMLElement>;
|
||||
declare let legend: Selection<HTMLElement>;
|
||||
|
||||
declare const defineSvg: (graphWidth: number, graphHeight: number) => void;
|
||||
|
||||
// old modules
|
||||
declare const Biomes: {
|
||||
getDefault: () => IBiomesData;
|
||||
};
|
||||
|
||||
declare const Names: {
|
||||
getNameBases: () => INamebase[];
|
||||
};
|
||||
let svg: Selection<SVGGElement>;
|
||||
let defs: Selection<SVGDefsElement>;
|
||||
let viewbox: Selection<SVGGElement>;
|
||||
let scaleBar: Selection<SVGGElement>;
|
||||
let legend: Selection<SVGGElement>;
|
||||
let ocean: Selection<SVGGElement>;
|
||||
let oceanLayers: Selection<SVGGElement>;
|
||||
let oceanPattern: Selection<SVGPatternElement>;
|
||||
let lakes: Selection<SVGGElement>;
|
||||
let landmass: Selection<SVGGElement>;
|
||||
let texture: Selection<SVGGElement>;
|
||||
let terrs: Selection<SVGGElement>;
|
||||
let biomes: Selection<SVGGElement>;
|
||||
let cells: Selection<SVGGElement>;
|
||||
let gridOverlay: Selection<SVGGElement>;
|
||||
let coordinates: Selection<SVGGElement>;
|
||||
let compass: Selection<SVGGElement>;
|
||||
let rivers: Selection<SVGGElement>;
|
||||
let terrain: Selection<SVGGElement>;
|
||||
let relig: Selection<SVGGElement>;
|
||||
let cults: Selection<SVGGElement>;
|
||||
let regions: Selection<SVGGElement>;
|
||||
let statesBody: Selection<SVGGElement>;
|
||||
let statesHalo: Selection<SVGGElement>;
|
||||
let provs: Selection<SVGGElement>;
|
||||
let zones: Selection<SVGGElement>;
|
||||
let borders: Selection<SVGGElement>;
|
||||
let stateBorders: Selection<SVGGElement>;
|
||||
let provinceBorders: Selection<SVGGElement>;
|
||||
let routes: Selection<SVGGElement>;
|
||||
let roads: Selection<SVGGElement>;
|
||||
let trails: Selection<SVGGElement>;
|
||||
let searoutes: Selection<SVGGElement>;
|
||||
let temperature: Selection<SVGGElement>;
|
||||
let coastline: Selection<SVGGElement>;
|
||||
let ice: Selection<SVGGElement>;
|
||||
let prec: Selection<SVGGElement>;
|
||||
let population: Selection<SVGGElement>;
|
||||
let emblems: Selection<SVGGElement>;
|
||||
let labels: Selection<SVGGElement>;
|
||||
let icons: Selection<SVGGElement>;
|
||||
let burgLabels: Selection<SVGGElement>;
|
||||
let burgIcons: Selection<SVGGElement>;
|
||||
let anchors: Selection<SVGGElement>;
|
||||
let armies: Selection<SVGGElement>;
|
||||
let markers: Selection<SVGGElement>;
|
||||
let fogging: Selection<SVGGElement>;
|
||||
let ruler: Selection<SVGGElement>;
|
||||
let debug: Selection<SVGGElement>;
|
||||
|
|
|
|||
10
src/types/overrides.d.ts
vendored
10
src/types/overrides.d.ts
vendored
|
|
@ -10,9 +10,15 @@ interface Window {
|
|||
[key: string]: boolean;
|
||||
};
|
||||
};
|
||||
d3: typeof d3;
|
||||
$: typeof $;
|
||||
mapCoordinates: IMapCoordinates;
|
||||
// untyped IIFE modules
|
||||
$: typeof $;
|
||||
d3: typeof d3;
|
||||
Biomes: typeof Biomes;
|
||||
Names: typeof Names;
|
||||
ThreeD: typeof ThreeD;
|
||||
ReliefIcons: typeof ReliefIcons;
|
||||
Zoom: typeof Zoom;
|
||||
}
|
||||
|
||||
interface Node {
|
||||
|
|
|
|||
33
src/types/pack.d.ts
vendored
33
src/types/pack.d.ts
vendored
|
|
@ -6,11 +6,29 @@ interface IPack {
|
|||
pop: number[];
|
||||
burg: number[];
|
||||
};
|
||||
states: [];
|
||||
cultures: [];
|
||||
provinces: [];
|
||||
states: IState[];
|
||||
cultures: ICulture[];
|
||||
provinces: IProvince[];
|
||||
burgs: IBurg[];
|
||||
religions: [];
|
||||
religions: IReligion[];
|
||||
}
|
||||
|
||||
interface IState {
|
||||
i: number;
|
||||
name: string;
|
||||
removed?: boolean;
|
||||
}
|
||||
|
||||
interface ICulture {
|
||||
i: number;
|
||||
name: string;
|
||||
removed?: boolean;
|
||||
}
|
||||
|
||||
interface IProvince {
|
||||
i: number;
|
||||
name: string;
|
||||
removed?: boolean;
|
||||
}
|
||||
|
||||
interface IBurg {
|
||||
|
|
@ -20,4 +38,11 @@ interface IBurg {
|
|||
x: number;
|
||||
y: number;
|
||||
population: number;
|
||||
removed?: boolean;
|
||||
}
|
||||
|
||||
interface IReligion {
|
||||
i: number;
|
||||
name: string;
|
||||
removed?: boolean;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue