Skip to content
This repository has been archived by the owner on Feb 1, 2024. It is now read-only.

Commit

Permalink
Now importable with pure js
Browse files Browse the repository at this point in the history
  • Loading branch information
ZigTag committed Dec 5, 2020
1 parent 960dc2f commit a2079c1
Show file tree
Hide file tree
Showing 7 changed files with 77 additions and 71 deletions.
11 changes: 10 additions & 1 deletion .babelrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
{
"presets": ["@babel/preset-react", "@babel/preset-typescript"],
"presets": [
[
"@babel/preset-typescript",
{
"onlyRemoveTypeImports": true,
"isTSX": true,
"allExtensions": true
}
]
],
"plugins": ["@babel/plugin-proposal-class-properties"]
}
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@flybywiresim/efb",
"version": "0.0.2",
"version": "0.0.3",
"private": false,
"repository": {
"type": "git",
Expand Down Expand Up @@ -40,7 +40,7 @@
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject",
"prepare": "babel src/EFB --out-dir dist --extensions .tsx --copy-files && tsc --emitDeclarationOnly --declaration true --jsx react --esModuleInterop true --outDir ./dist ./src/EFB/Efb.tsx"
"prepare": "babel src/EFB --out-dir dist --extensions .tsx --copy-files"
},
"eslintConfig": {
"extends": [
Expand Down
1 change: 0 additions & 1 deletion src/EFB/Efb.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import {
} from "react-router-dom";

import {getSimbriefData, IFuel, IWeights} from './simbriefApi';
import './aewx-metar-parser.d';
import Time from "./time/Time";
import Toolbar from "./toolbar/Toolbar";
import DashboardWidget from "./dashboardWidget/DashboardWidget";
Expand Down
65 changes: 0 additions & 65 deletions src/EFB/aewx-metar-parser.d.ts

This file was deleted.

1 change: 0 additions & 1 deletion src/EFB/dashboardWidget/DashboardWidget.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React from 'react';
import {
BrowserRouter as Router,
Switch,
Route,
} from "react-router-dom";
Expand Down
66 changes: 65 additions & 1 deletion src/EFB/dashboardWidget/dashboardWidgets/WeatherWidget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,71 @@ import { formatTime, dateFormat} from "../../time/Time";
import { Metar } from '@flybywiresim/api-client';
import { weatherIconArray } from './WeatherWidgetIcons';

const MetarParserTypeWindState: Wind = {
type MetarParserType = {
raw_text: string,
raw_parts: [string],
icao: string,
observed: Date,
wind: WindType,
visibility: VisibilityType,
conditions: [ConditionCodeType],
clouds: [CloudType],
ceiling: CeilingType,
temperature: TemperatureType,
dewpoint: DewpointType,
humidity_percent: number,
barometer: BarometerType,
flight_category: string,
}

type WindType = {
degrees: number,
speed_kts: number,
speed_mps: number,
gust_kts: number,
gust_mps: number,
};

type VisibilityType = {
miles: string,
miles_float: number,
meters: string,
meters_float: number,
};

type ConditionCodeType = {
code: string,
};

type CloudType = {
code: string,
base_feet_agl: number,
base_meters_agl: number,
};

type CeilingType = {
code: string,
feet_agl: number,
meters_agl: number,
};

type TemperatureType = {
celsius: number,
fahrenheit: number,
};

type DewpointType = {
celsius: number,
fahrenheit: number,
};

type BarometerType = {
hg: number,
kpa: number,
mb: number,
};

const MetarParserTypeWindState: WindType = {
degrees: 0,
speed_kts: 0,
speed_mps: 0,
Expand Down

0 comments on commit a2079c1

Please sign in to comment.