mirror of
https://github.com/ankitects/anki.git
synced 2025-09-19 06:22:22 -04:00
Satisfy ./script/svelte-check
This commit is contained in:
parent
7d32d909ba
commit
4a8a051999
4 changed files with 11 additions and 5 deletions
|
@ -7,7 +7,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
import { getContext } from "svelte";
|
import { getContext } from "svelte";
|
||||||
import { nightModeKey } from "./contextKeys";
|
import { nightModeKey } from "./contextKeys";
|
||||||
|
|
||||||
export let id: string;
|
export let id: string | undefined = undefined;
|
||||||
export let className = "";
|
export let className = "";
|
||||||
export let buttons: ToolbarItem[];
|
export let buttons: ToolbarItem[];
|
||||||
|
|
||||||
|
|
|
@ -56,7 +56,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
updateButton(command);
|
updateButton(command);
|
||||||
|
|
||||||
commandMap.subscribe((map: Map<string, boolean>): (() => void) => {
|
commandMap.subscribe((map: Map<string, boolean>): (() => void) => {
|
||||||
active = map.get(command);
|
active = Boolean(map.get(command));
|
||||||
return () => map.delete(command);
|
return () => map.delete(command);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,8 +24,11 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
import { disabledKey, nightModeKey } from "./contextKeys";
|
import { disabledKey, nightModeKey } from "./contextKeys";
|
||||||
|
|
||||||
import ButtonGroup from "./ButtonGroup.svelte";
|
import ButtonGroup from "./ButtonGroup.svelte";
|
||||||
|
import type { ButtonGroupProps } from "./ButtonGroup";
|
||||||
|
|
||||||
export let buttons: Readable<ToolbarItem[]>;
|
export let buttons: Readable<
|
||||||
|
(ToolbarItem<typeof ButtonGroup> & ButtonGroupProps)[]
|
||||||
|
>;
|
||||||
export let menus: Readable<ToolbarItem[]>;
|
export let menus: Readable<ToolbarItem[]>;
|
||||||
|
|
||||||
$: _buttons = $buttons;
|
$: _buttons = $buttons;
|
||||||
|
|
|
@ -4,7 +4,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
-->
|
-->
|
||||||
<script lang="typescript">
|
<script lang="typescript">
|
||||||
import type { Writable } from "svelte/store";
|
import type { Writable } from "svelte/store";
|
||||||
import type { PreferencePayload } from "sveltelib/preferences";
|
import type { PreferenceRaw, PreferencePayload } from "sveltelib/preferences";
|
||||||
|
|
||||||
import pb from "anki/backend_proto";
|
import pb from "anki/backend_proto";
|
||||||
import { postRequest } from "anki/postrequest";
|
import { postRequest } from "anki/postrequest";
|
||||||
|
@ -60,7 +60,10 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
setGraphPreferences,
|
setGraphPreferences,
|
||||||
pb.BackendProto.GraphPreferences.toObject.bind(
|
pb.BackendProto.GraphPreferences.toObject.bind(
|
||||||
pb.BackendProto.GraphPreferences
|
pb.BackendProto.GraphPreferences
|
||||||
)
|
) as (
|
||||||
|
preferences: pb.BackendProto.GraphPreferences,
|
||||||
|
options: { defaults: boolean }
|
||||||
|
) => PreferenceRaw<pb.BackendProto.GraphPreferences>
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue