fix some typescript warnings

This commit is contained in:
Damien Elmes 2020-07-22 14:11:22 +10:00
parent 4b6033e17f
commit 2635f8f980
10 changed files with 7 additions and 22 deletions

View file

@ -1,6 +1,5 @@
<script lang="typescript">
import { RevlogRange, GraphRange } from "./graphs";
import { timeSpan, MONTH, YEAR } from "../time";
import { I18n } from "../i18n";
import { HistogramData } from "./histogram-graph";
import { gatherData, buildHistogram, GraphData } from "./added";
@ -11,7 +10,6 @@
export let sourceData: pb.BackendProto.GraphsOut | null = null;
export let i18n: I18n;
let svg = null as HTMLElement | SVGElement | null;
let histogramData = null as HistogramData | null;
let graphRange: GraphRange = GraphRange.Month;

View file

@ -4,7 +4,6 @@
import { defaultGraphBounds, RevlogRange } from "./graphs";
import { GraphData, gatherData, renderCalendar } from "./calendar";
import pb from "../backend/proto";
import { timeSpan, MONTH, YEAR } from "../time";
import { I18n } from "../i18n";
export let sourceData: pb.BackendProto.GraphsOut | null = null;
@ -21,7 +20,7 @@
let svg = null as HTMLElement | SVGElement | null;
let maxYear = new Date().getFullYear();
let minYear;
let minYear = 0;
let targetYear = maxYear;
$: if (sourceData) {

View file

@ -15,7 +15,7 @@
bounds.marginRight = 20;
bounds.marginTop = 0;
let graphData: GraphData;
let graphData = (null as unknown) as GraphData;
$: {
graphData = gatherData(sourceData, i18n);
renderCards(svg as any, bounds, graphData);

View file

@ -1,6 +1,6 @@
<script lang="typescript">
import { HistogramData } from "./histogram-graph";
import { gatherData, prepareData, GraphData } from "./ease";
import { gatherData, prepareData } from "./ease";
import pb from "../backend/proto";
import HistogramGraph from "./HistogramGraph.svelte";
import { I18n } from "../i18n";
@ -8,7 +8,6 @@
export let sourceData: pb.BackendProto.GraphsOut | null = null;
export let i18n: I18n;
let svg = null as HTMLElement | SVGElement | null;
let histogramData = null as HistogramData | null;
$: if (sourceData) {

View file

@ -1,8 +1,7 @@
<script lang="typescript">
import { timeSpan, MONTH, YEAR } from "../time";
import { I18n } from "../i18n";
import { HistogramData } from "./histogram-graph";
import { defaultGraphBounds, GraphRange, RevlogRange } from "./graphs";
import { GraphRange, RevlogRange } from "./graphs";
import { gatherData, GraphData, buildHistogram } from "./future-due";
import pb from "../backend/proto";
import HistogramGraph from "./HistogramGraph.svelte";
@ -14,7 +13,6 @@
let graphData = null as GraphData | null;
let histogramData = null as HistogramData | null;
let backlog: boolean = true;
let svg = null as HTMLElement | SVGElement | null;
let graphRange: GraphRange = GraphRange.Month;
$: if (sourceData) {

View file

@ -1,11 +1,9 @@
<script context="module">
import style from "./graphs.scss";
import _ from "./graphs.scss";
</script>
<script lang="typescript">
import { timeSpan, MONTH, YEAR } from "../time";
import { I18n } from "../i18n";
import { assertUnreachable } from "../typing";
import pb from "../backend/proto";
import { getGraphData, RevlogRange } from "./graphs";
import IntervalsGraph from "./IntervalsGraph.svelte";
@ -87,7 +85,6 @@
}
};
const month = timeSpan(i18n, 3 * MONTH);
const year = i18n.tr(i18n.TR.STATISTICS_RANGE_1_YEAR_HISTORY);
const deck = i18n.tr(i18n.TR.STATISTICS_RANGE_DECK);
const collection = i18n.tr(i18n.TR.STATISTICS_RANGE_COLLECTION);

View file

@ -1,5 +1,4 @@
<script lang="typescript">
import { timeSpan, MONTH, YEAR } from "../time";
import { defaultGraphBounds, RevlogRange, GraphRange } from "./graphs";
import AxisTicks from "./AxisTicks.svelte";
import { renderHours } from "./hours";

View file

@ -1,5 +1,5 @@
<script lang="typescript">
import { timeSpan, MONTH, YEAR } from "../time";
import { timeSpan, MONTH } from "../time";
import { I18n } from "../i18n";
import { HistogramData } from "./histogram-graph";
import {
@ -16,8 +16,6 @@
let intervalData: IntervalGraphData | null = null;
let histogramData = null as HistogramData | null;
let svg = null as HTMLElement | SVGElement | null;
let range = IntervalRange.Percentile95;
$: if (sourceData) {

View file

@ -1,10 +1,8 @@
<script lang="typescript">
import { HistogramData, histogramGraph } from "./histogram-graph";
import AxisTicks from "./AxisTicks.svelte";
import { defaultGraphBounds, RevlogRange, GraphRange } from "./graphs";
import { GraphData, gatherData, renderReviews } from "./reviews";
import pb from "../backend/proto";
import { timeSpan, MONTH, YEAR } from "../time";
import { I18n } from "../i18n";
import NoDataOverlay from "./NoDataOverlay.svelte";
import GraphRangeRadios from "./GraphRangeRadios.svelte";
@ -31,7 +29,7 @@
const title = i18n.tr(i18n.TR.STATISTICS_REVIEWS_TITLE);
const time = i18n.tr(i18n.TR.STATISTICS_REVIEWS_TIME_CHECKBOX);
let subtitle: string;
let subtitle = "";
$: if (showTime) {
subtitle = i18n.tr(i18n.TR.STATISTICS_REVIEWS_TIME_SUBTITLE);
} else {

View file

@ -1,6 +1,5 @@
<script lang="typescript">
import { gatherData, TodayData } from "./today";
import { studiedToday } from "../time";
import pb from "../backend/proto";
import { I18n } from "../i18n";