mirror of
https://github.com/CharaChorder/DeviceManager.git
synced 2026-01-10 03:52:57 +00:00
refactor: update dependencies
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
<script lang="ts">
|
||||
import { KEYMAP_CATEGORIES, KEYMAP_CODES } from "$lib/serial/keymap-codes";
|
||||
import type { KeyInfo } from "$lib/serial/keymap-codes";
|
||||
import Index from "flexsearch";
|
||||
import flexsearch from "flexsearch";
|
||||
import { createEventDispatcher } from "svelte";
|
||||
import ActionListItem from "$lib/components/ActionListItem.svelte";
|
||||
import LL from "../../../i18n/i18n-svelte";
|
||||
@@ -10,7 +10,7 @@
|
||||
export let currentAction: number | undefined = undefined;
|
||||
export let nextAction: number | undefined = undefined;
|
||||
|
||||
const index = new Index({ tokenize: "full" });
|
||||
const index = new flexsearch.Index({ tokenize: "full" });
|
||||
for (const action of Object.values(KEYMAP_CODES)) {
|
||||
index?.add(
|
||||
action.code,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<script lang="ts">
|
||||
import { KEYMAP_CODES } from "$lib/serial/keymap-codes";
|
||||
import Index from "flexsearch";
|
||||
import flexsearch from "flexsearch";
|
||||
import LL from "../../../i18n/i18n-svelte";
|
||||
import { action } from "$lib/title";
|
||||
import { onDestroy, onMount, setContext } from "svelte";
|
||||
@@ -30,8 +30,8 @@
|
||||
|
||||
$: searchIndex = $chords?.length > 0 ? buildIndex($chords) : undefined;
|
||||
|
||||
function buildIndex(chords: ChordInfo[]): Index {
|
||||
const index = new Index({ tokenize: "full" });
|
||||
function buildIndex(chords: ChordInfo[]): flexsearch.Index {
|
||||
const index = new flexsearch.Index({ tokenize: "full" });
|
||||
chords.forEach((chord, i) => {
|
||||
if ("phrase" in chord) {
|
||||
index.add(
|
||||
|
||||
Reference in New Issue
Block a user