move types to shared, add first stuff

This commit is contained in:
2023-05-04 20:40:10 +02:00
parent 1ed359f602
commit df097ab4f6
23 changed files with 1118 additions and 214 deletions

31
shared/.eslintrc.json Normal file
View File

@@ -0,0 +1,31 @@
{
"env": {
"es2021": true,
"node": true
},
"extends": [
"airbnb-typescript/base",
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended"
],
"root": true,
"parser": "@typescript-eslint/parser",
"plugins": [
"@typescript-eslint",
"import",
"promise"
],
"overrides": [],
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module",
"project": "./tsconfig.json"
},
"rules": {
"eol-last": [
"error",
"always"
]
}
}

10
shared/package.json Normal file
View File

@@ -0,0 +1,10 @@
{
"devDependencies": {
"@types/node": "^18.6.2",
"eslint": "^8.23.1",
"eslint-config-airbnb-typescript": "^17.0.0",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-n": "^15.2.5",
"eslint-plugin-promise": "^6.0.1"
}
}

View File

@@ -0,0 +1,14 @@
export interface WxConfig {
regions: WxRegion[];
}
export interface WxRegion {
identifier: string;
fixes: WxFix[];
}
export interface WxFix {
name: string;
lat: number;
lon: number;
}

View File

@@ -0,0 +1,27 @@
export interface WxLevelData {
'T(K)': string;
windspeed: string;
windhdg: string;
}
export interface WxFixData {
coords: {
lat: string;
long: string;
};
levels: {
[key: string]: WxLevelData;
}
}
export interface WxData {
info: {
date: string;
datestring: string;
legal: string;
};
data: {
[key: string]: WxFixData;
}
}

16
shared/tsconfig.json Normal file
View File

@@ -0,0 +1,16 @@
{
"compileOnSave": false,
"compilerOptions": {
"outDir": "dist",
"baseUrl": "./src",
"module": "ES2022",
"target": "ES2022",
"lib": ["ES2022"],
"sourceMap": true,
"strictNullChecks": true,
"noImplicitAny": false,
"preserveConstEnums": true,
"removeComments": true,
"forceConsistentCasingInFileNames": true
}
}