mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 14:02:21 -04:00

The API extractor integration isn't set up properly yet, so I had to manually generate the d.ts bundle and copy it into the add-on: cd ts/runtime bazel run extract_api cp ../../.bazel/bin/ts/runtime/extract_api.sh.runfiles/ankidesktop/ts/runtime/dist/anki.d.ts \ $c/anki_new_format_pack/ts/anki-dts/runtime.d.ts
27 lines
719 B
TypeScript
27 lines
719 B
TypeScript
// Copyright: Ankitects Pty Ltd and contributors
|
|
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
|
|
|
import { globalExport } from "../lib/globals";
|
|
import { setupI18n } from "../lib/i18n";
|
|
import { uiResolve } from "../lib/ui";
|
|
import { editorModules } from "./base";
|
|
import NoteCreator from "./NoteCreator.svelte";
|
|
|
|
async function setupNoteCreator(): Promise<void> {
|
|
await setupI18n({ modules: editorModules });
|
|
|
|
new NoteCreator({
|
|
target: document.body,
|
|
props: { uiResolve },
|
|
});
|
|
}
|
|
|
|
setupNoteCreator();
|
|
|
|
import * as base from "./base";
|
|
|
|
globalExport(base);
|
|
|
|
// We could put this into a shared file like runtime-require.ts
|
|
// in the future.
|
|
import "../runtime";
|