controller should be marked nullable
While 'SvelteComponent | null' seems to make it into the .tsx file created by svelte2tsx, the subsequent tsc call seems to discard the '| null' part when creating the .d.ts file. Hack around it with a cast for now; this may be fixed if we move to ts_project in the future.
This commit is contained in:
parent
e948544b59
commit
ddc48d8897
@ -13,7 +13,7 @@
|
|||||||
|
|
||||||
export let search: string;
|
export let search: string;
|
||||||
export let days: number;
|
export let days: number;
|
||||||
export let controller: SvelteComponent;
|
export let controller: SvelteComponent | null;
|
||||||
|
|
||||||
let active = false;
|
let active = false;
|
||||||
let sourceData: pb.BackendProto.GraphsOut | null = null;
|
let sourceData: pb.BackendProto.GraphsOut | null = null;
|
||||||
|
@ -1,6 +1,10 @@
|
|||||||
// Copyright: Ankitects Pty Ltd and contributors
|
// Copyright: Ankitects Pty Ltd and contributors
|
||||||
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
|
|
||||||
|
/* eslint
|
||||||
|
@typescript-eslint/no-explicit-any: "off",
|
||||||
|
*/
|
||||||
|
|
||||||
import type { SvelteComponent } from "svelte/internal";
|
import type { SvelteComponent } from "svelte/internal";
|
||||||
|
|
||||||
import { setupI18n } from "anki/i18n";
|
import { setupI18n } from "anki/i18n";
|
||||||
@ -24,7 +28,7 @@ export { RevlogRange } from "./graph-helpers";
|
|||||||
export function graphs(
|
export function graphs(
|
||||||
target: HTMLDivElement,
|
target: HTMLDivElement,
|
||||||
graphs: SvelteComponent[],
|
graphs: SvelteComponent[],
|
||||||
{ search = "deck:current", days = 365, controller = null } = {}
|
{ search = "deck:current", days = 365, controller = null as any } = {}
|
||||||
): void {
|
): void {
|
||||||
const nightMode = checkNightMode();
|
const nightMode = checkNightMode();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user