strongly typed AnkiConnect
This commit is contained in:
1 parent
9516f287c8
commit
a144c7fd74
3 files changed
+265
-57
No files matched your search
@@ -0,0 +1,27 @@
|
||||
import { AnkiConnect } from '@/ankiconnect';
|
||||
|
||||
async function main() {
|
||||
const anki = new AnkiConnect();
|
||||
console.log(
|
||||
await anki.multi<['findNotes', 'getTags']>({
|
||||
actions: [
|
||||
{
|
||||
action: 'findNotes',
|
||||
params: {
|
||||
query: 'added:1',
|
||||
},
|
||||
},
|
||||
{ action: 'getTags' },
|
||||
],
|
||||
}),
|
||||
);
|
||||
console.log(
|
||||
await anki.api('findNotes', {
|
||||
query: 'deck:Takoboto',
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
if (require.main === module) {
|
||||
main();
|
||||
}
|
||||
Reference in new issue
Block a user