yomitan-core 1.5.0 → 1.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{anki-connect-DGx7Gr0H.cjs → anki-connect-CRilVEWJ.cjs} +6 -34
- package/dist/anki-connect-CRilVEWJ.cjs.map +1 -0
- package/dist/{anki-connect-Dau8nAXZ.js → anki-connect-EreHKbGG.js} +6 -22
- package/dist/anki-connect-EreHKbGG.js.map +1 -0
- package/dist/anki-connect-Lxc0ezif.cjs +7 -0
- package/dist/anki-connect-VG61oJyq.js +7 -0
- package/dist/anki-note-service-BEzTEDPY.d.ts +860 -0
- package/dist/anki-note-service-BEzTEDPY.d.ts.map +1 -0
- package/dist/anki-note-service-C4DrghzW.cjs +2626 -0
- package/dist/anki-note-service-C4DrghzW.cjs.map +1 -0
- package/dist/anki-note-service-D9J02WC6.d.cts +860 -0
- package/dist/anki-note-service-D9J02WC6.d.cts.map +1 -0
- package/dist/anki-note-service-DFfCiz9O.js +2536 -0
- package/dist/anki-note-service-DFfCiz9O.js.map +1 -0
- package/dist/anki-util-BJAjmIjI.cjs +32 -0
- package/dist/anki-util-BJAjmIjI.cjs.map +1 -0
- package/dist/anki-util-DGNY03WE.js +19 -0
- package/dist/anki-util-DGNY03WE.js.map +1 -0
- package/dist/anki.cjs +28 -2544
- package/dist/anki.d.cts +5 -705
- package/dist/anki.d.cts.map +1 -1
- package/dist/anki.d.ts +5 -705
- package/dist/anki.d.ts.map +1 -1
- package/dist/anki.js +15 -2531
- package/dist/{audio-DGGWaBI-.d.ts → audio-70qQ35Z0.d.ts} +1 -1
- package/dist/{audio-DGGWaBI-.d.ts.map → audio-70qQ35Z0.d.ts.map} +1 -1
- package/dist/{audio-url-generator-Ca-mSUkC.cjs → audio-url-generator-B0a8n6w2.cjs} +2 -2
- package/dist/{audio-url-generator-Ca-mSUkC.cjs.map → audio-url-generator-B0a8n6w2.cjs.map} +1 -1
- package/dist/{audio-url-generator-CMk_IkiS.js → audio-url-generator-Bovg3Dk9.js} +2 -2
- package/dist/{audio-url-generator-BLuQVkZt.js → audio-url-generator-DGboLzSc.js} +2 -2
- package/dist/{audio-url-generator-BLuQVkZt.js.map → audio-url-generator-DGboLzSc.js.map} +1 -1
- package/dist/{audio-url-generator-BXsug11L.cjs → audio-url-generator-DJK0W1Cm.cjs} +2 -2
- package/dist/audio.cjs +2 -2
- package/dist/audio.d.ts +2 -2
- package/dist/audio.js +2 -2
- package/dist/backend-07mdJJW2.d.ts +34 -0
- package/dist/backend-07mdJJW2.d.ts.map +1 -0
- package/dist/backend-B8h0EWrF.d.cts +34 -0
- package/dist/backend-B8h0EWrF.d.cts.map +1 -0
- package/dist/{batch-processor-BR-gB3H3.js → batch-processor-CNCjal9E.js} +1 -1
- package/dist/{batch-processor-BR-gB3H3.js.map → batch-processor-CNCjal9E.js.map} +1 -1
- package/dist/{batch-processor-DFqM_L-_.cjs → batch-processor-D9xhlTno.cjs} +1 -1
- package/dist/{batch-processor-DFqM_L-_.cjs.map → batch-processor-D9xhlTno.cjs.map} +1 -1
- package/dist/batch-processor-DwKIbilD.cjs +3 -0
- package/dist/batch-processor-NeXHEbsF.js +3 -0
- package/dist/{cjk-util-Dp0ZU0sh.cjs → cjk-util-BSaxnHiG.cjs} +1 -1
- package/dist/{cjk-util-Dp0ZU0sh.cjs.map → cjk-util-BSaxnHiG.cjs.map} +1 -1
- package/dist/{cjk-util-DubXBGDG.js → cjk-util-D4YFXtbA.js} +1 -1
- package/dist/{cjk-util-DubXBGDG.js.map → cjk-util-D4YFXtbA.js.map} +1 -1
- package/dist/{content-manager-BF1w7O_T.cjs → css-util-CWVKxtnP.cjs} +42 -16
- package/dist/css-util-CWVKxtnP.cjs.map +1 -0
- package/dist/{content-manager-N3C_dYMa.js → css-util-Cvm1Rdpp.js} +42 -16
- package/dist/css-util-Cvm1Rdpp.js.map +1 -0
- package/dist/database/node-sqlite.cjs +504 -0
- package/dist/database/node-sqlite.cjs.map +1 -0
- package/dist/database/node-sqlite.d.cts +51 -0
- package/dist/database/node-sqlite.d.cts.map +1 -0
- package/dist/database/node-sqlite.d.ts +51 -0
- package/dist/database/node-sqlite.d.ts.map +1 -0
- package/dist/database/node-sqlite.js +501 -0
- package/dist/database/node-sqlite.js.map +1 -0
- package/dist/database.cjs +3 -3
- package/dist/database.d.cts +5 -4
- package/dist/database.d.ts +5 -4
- package/dist/database.js +3 -3
- package/dist/{debug-I2dyAd2e.cjs → debug-DsxOLdQ6.cjs} +1 -1
- package/dist/{debug-I2dyAd2e.cjs.map → debug-DsxOLdQ6.cjs.map} +1 -1
- package/dist/{debug-hF63AFkq.js → debug-GKN7L50t.js} +1 -1
- package/dist/{debug-hF63AFkq.js.map → debug-GKN7L50t.js.map} +1 -1
- package/dist/{dictionary-Dalj9Ow7.d.ts → dictionary-C3FUjHaZ.d.cts} +2 -2
- package/dist/{dictionary-6Gj8AfGC.d.cts.map → dictionary-C3FUjHaZ.d.cts.map} +1 -1
- package/dist/{dictionary-data-util-gUUD9ElK.js → dictionary-data-util-B2jUzJZX.js} +1 -1
- package/dist/{dictionary-data-util-gUUD9ElK.js.map → dictionary-data-util-B2jUzJZX.js.map} +1 -1
- package/dist/{dictionary-data-util-DmLJMtGc.cjs → dictionary-data-util-QaQCeLNJ.cjs} +1 -1
- package/dist/{dictionary-data-util-DmLJMtGc.cjs.map → dictionary-data-util-QaQCeLNJ.cjs.map} +1 -1
- package/dist/{dictionary-database-CU4TsvCC.js → dictionary-database-BcGJ3l6w.js} +3 -3
- package/dist/dictionary-database-BcGJ3l6w.js.map +1 -0
- package/dist/{dictionary-database-lvFvftnO.cjs → dictionary-database-C7c08nXT.cjs} +3 -3
- package/dist/dictionary-database-C7c08nXT.cjs.map +1 -0
- package/dist/{dictionary-database-BGAaPDVT.d.cts → dictionary-database-DGIXks-8.d.cts} +4 -3
- package/dist/dictionary-database-DGIXks-8.d.cts.map +1 -0
- package/dist/{dictionary-database-Bu8vYgxF.d.ts → dictionary-database-VKx3UEgB.d.ts} +4 -3
- package/dist/dictionary-database-VKx3UEgB.d.ts.map +1 -0
- package/dist/dictionary-importer-BIbDILMX.js +8 -0
- package/dist/{dictionary-importer-BFsVKL9H.d.cts → dictionary-importer-BUhx1hez.d.ts} +3 -3
- package/dist/{dictionary-importer-CwR3Lanr.d.ts.map → dictionary-importer-BUhx1hez.d.ts.map} +1 -1
- package/dist/{dictionary-importer-CwR3Lanr.d.ts → dictionary-importer-CRUzc3YR.d.cts} +3 -3
- package/dist/{dictionary-importer-BFsVKL9H.d.cts.map → dictionary-importer-CRUzc3YR.d.cts.map} +1 -1
- package/dist/{dictionary-importer-BPlLeF5R.js → dictionary-importer-CtS5tiL3.js} +6 -6
- package/dist/dictionary-importer-CtS5tiL3.js.map +1 -0
- package/dist/dictionary-importer-CvnH48vJ.cjs +8 -0
- package/dist/{dictionary-importer-BvgP1Fs9.cjs → dictionary-importer-DWMTH8fo.cjs} +6 -6
- package/dist/dictionary-importer-DWMTH8fo.cjs.map +1 -0
- package/dist/{dictionary-6Gj8AfGC.d.cts → dictionary-o42ErAc-.d.ts} +2 -2
- package/dist/{dictionary-Dalj9Ow7.d.ts.map → dictionary-o42ErAc-.d.ts.map} +1 -1
- package/dist/{dictionary-update-checker-DmiIUoKw.cjs → dictionary-update-checker-B7RAjO4W.cjs} +2 -2
- package/dist/dictionary-update-checker-B7RAjO4W.cjs.map +1 -0
- package/dist/dictionary-update-checker-DvanAfCc.js +4 -0
- package/dist/{dictionary-update-checker-CLbtQ48X.js → dictionary-update-checker-FftmgW-j.js} +2 -2
- package/dist/dictionary-update-checker-FftmgW-j.js.map +1 -0
- package/dist/{dictionary-update-checker-DgjPsURI.cjs → dictionary-update-checker-N9Hy5_qs.cjs} +2 -2
- package/dist/display-generator-Ca2Jl4vd.cjs +10 -0
- package/dist/{display-generator-DfphHlWC.cjs → display-generator-Cr9sc5eH.cjs} +9 -9
- package/dist/{display-generator-DfphHlWC.cjs.map → display-generator-Cr9sc5eH.cjs.map} +1 -1
- package/dist/display-generator-DLKHZGCp.js +10 -0
- package/dist/{display-generator--enH95g2.js → display-generator-DSWDUlLo.js} +6 -6
- package/dist/{display-generator--enH95g2.js.map → display-generator-DSWDUlLo.js.map} +1 -1
- package/dist/{errors-DvKlMRXC.js → errors-Cx73qB8H.js} +1 -1
- package/dist/{errors-DvKlMRXC.js.map → errors-Cx73qB8H.js.map} +1 -1
- package/dist/{errors-0pIJI6N2.cjs → errors-DWsRJXzm.cjs} +1 -1
- package/dist/{errors-0pIJI6N2.cjs.map → errors-DWsRJXzm.cjs.map} +1 -1
- package/dist/{frequency-ranking-DEJMTMdg.js → frequency-ranking-BshxWSpt.js} +1 -1
- package/dist/frequency-ranking-BshxWSpt.js.map +1 -0
- package/dist/{frequency-ranking-DVYxTXN-.cjs → frequency-ranking-CgEOUabZ.cjs} +1 -1
- package/dist/frequency-ranking-CgEOUabZ.cjs.map +1 -0
- package/dist/frequency-ranking-DGbHhxhZ.cjs +3 -0
- package/dist/frequency-ranking-DzjILnii.js +3 -0
- package/dist/{furigana-DlrEyvIH.cjs → furigana-Cagjg53_.cjs} +2 -2
- package/dist/{furigana-DlrEyvIH.cjs.map → furigana-Cagjg53_.cjs.map} +1 -1
- package/dist/furigana-D-mrmKWu.js +5 -0
- package/dist/furigana-DI357F6D.cjs +5 -0
- package/dist/{furigana-JMFDYOlM.js → furigana-RwtSF-gP.js} +2 -2
- package/dist/{furigana-JMFDYOlM.js.map → furigana-RwtSF-gP.js.map} +1 -1
- package/dist/import.cjs +7 -7
- package/dist/import.d.cts +5 -5
- package/dist/import.d.cts.map +1 -1
- package/dist/import.d.ts +5 -5
- package/dist/import.d.ts.map +1 -1
- package/dist/import.js +7 -7
- package/dist/index.cjs +43 -23
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +22 -8
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.ts +24 -10
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +43 -23
- package/dist/index.js.map +1 -1
- package/dist/{japanese-DmGlY0rp.cjs → japanese-Kil-z4yh.cjs} +9 -9
- package/dist/{japanese-DmGlY0rp.cjs.map → japanese-Kil-z4yh.cjs.map} +1 -1
- package/dist/{japanese-CKPyY5k_.js → japanese-yAHTjQ1R.js} +2 -2
- package/dist/{japanese-CKPyY5k_.js.map → japanese-yAHTjQ1R.js.map} +1 -1
- package/dist/{json-Cdj6aIOQ.cjs → json-D0gpux1o.cjs} +1 -1
- package/dist/{json-Cdj6aIOQ.cjs.map → json-D0gpux1o.cjs.map} +1 -1
- package/dist/{json-rIgOFqVY.js → json-xK8kGf0v.js} +1 -1
- package/dist/{json-rIgOFqVY.js.map → json-xK8kGf0v.js.map} +1 -1
- package/dist/{language-C39UEHX_.d.ts → language-CtXuF5rj.d.ts} +1 -1
- package/dist/{language-C39UEHX_.d.ts.map → language-CtXuF5rj.d.ts.map} +1 -1
- package/dist/language.cjs +14 -14
- package/dist/language.d.cts +2 -2
- package/dist/language.d.ts +3 -3
- package/dist/language.js +7 -7
- package/dist/{log-hgSll-dS.js → log-C6n0pevi.js} +1 -1
- package/dist/{log-hgSll-dS.js.map → log-C6n0pevi.js.map} +1 -1
- package/dist/{log-D8KtR3aP.cjs → log-Ot8OECt3.cjs} +1 -1
- package/dist/{log-D8KtR3aP.cjs.map → log-Ot8OECt3.cjs.map} +1 -1
- package/dist/lookup.cjs +9 -9
- package/dist/lookup.d.cts +5 -5
- package/dist/lookup.d.cts.map +1 -1
- package/dist/lookup.d.ts +5 -5
- package/dist/lookup.d.ts.map +1 -1
- package/dist/lookup.js +9 -9
- package/dist/{media-loader-C1WZVVaA.js → media-loader-BARFsJlc.js} +1 -1
- package/dist/{media-loader-C1WZVVaA.js.map → media-loader-BARFsJlc.js.map} +1 -1
- package/dist/media-loader-B_fGM5iv.js +3 -0
- package/dist/{media-loader-RE32nGs3.cjs → media-loader-BokjBno1.cjs} +1 -1
- package/dist/{media-loader-RE32nGs3.cjs.map → media-loader-BokjBno1.cjs.map} +1 -1
- package/dist/media-loader-DP_FOegT.cjs +3 -0
- package/dist/{multi-language-transformer-BXLoH3f2.d.ts → multi-language-transformer-CM6OxCAj.d.ts} +3 -3
- package/dist/{multi-language-transformer-BXLoH3f2.d.ts.map → multi-language-transformer-CM6OxCAj.d.ts.map} +1 -1
- package/dist/{multi-language-transformer-BkcWIfx7.cjs → multi-language-transformer-DUn7bpiO.cjs} +2132 -2132
- package/dist/{multi-language-transformer-BkcWIfx7.cjs.map → multi-language-transformer-DUn7bpiO.cjs.map} +1 -1
- package/dist/{multi-language-transformer-BzlxqxWY.d.cts → multi-language-transformer-cchZk_nI.d.cts} +2 -2
- package/dist/{multi-language-transformer-BzlxqxWY.d.cts.map → multi-language-transformer-cchZk_nI.d.cts.map} +1 -1
- package/dist/{multi-language-transformer-DvjBcuyp.js → multi-language-transformer-ud4aSIiO.js} +2132 -2132
- package/dist/{multi-language-transformer-DvjBcuyp.js.map → multi-language-transformer-ud4aSIiO.js.map} +1 -1
- package/dist/pronunciation-generator-4wOYy1DW.js +4 -0
- package/dist/{pronunciation-generator-DXgeL9Rj.cjs → pronunciation-generator-BVDtkXCl.cjs} +2 -2
- package/dist/{pronunciation-generator-DvLFLmt6.cjs → pronunciation-generator-C-PlGMHq.cjs} +9 -9
- package/dist/{pronunciation-generator-DvLFLmt6.cjs.map → pronunciation-generator-C-PlGMHq.cjs.map} +1 -1
- package/dist/{pronunciation-generator-5Yl93jb8.js → pronunciation-generator-ieUXk-ak.js} +2 -2
- package/dist/{pronunciation-generator-5Yl93jb8.js.map → pronunciation-generator-ieUXk-ak.js.map} +1 -1
- package/dist/render.cjs +14 -14
- package/dist/render.cjs.map +1 -1
- package/dist/render.d.cts +2 -2
- package/dist/render.d.cts.map +1 -1
- package/dist/render.d.ts +2 -2
- package/dist/render.d.ts.map +1 -1
- package/dist/render.js +9 -9
- package/dist/{sentence-parser-Cx98mLAP.cjs → sentence-parser-BLKrC5Cd.cjs} +3 -3
- package/dist/sentence-parser-BLKrC5Cd.cjs.map +1 -0
- package/dist/{sentence-parser-DnE0Q8N3.d.cts → sentence-parser-CBthVfqB.d.cts} +4 -4
- package/dist/sentence-parser-CBthVfqB.d.cts.map +1 -0
- package/dist/sentence-parser-CUbHj3Wj.cjs +6 -0
- package/dist/sentence-parser-CW6O9E7m.js +6 -0
- package/dist/{sentence-parser-EFf9w3IS.js → sentence-parser-Dw-yAsAf.js} +3 -3
- package/dist/sentence-parser-Dw-yAsAf.js.map +1 -0
- package/dist/{sentence-parser-CgisSkL5.d.ts → sentence-parser-qfM_cvid.d.ts} +4 -4
- package/dist/sentence-parser-qfM_cvid.d.ts.map +1 -0
- package/dist/{structured-content-generator-DOgn0FYP.cjs → structured-content-generator-1RVSF6lb.cjs} +2 -2
- package/dist/{structured-content-generator-D3WOq_vz.cjs → structured-content-generator-BRZeo9l6.cjs} +2 -2
- package/dist/{structured-content-generator-D3WOq_vz.cjs.map → structured-content-generator-BRZeo9l6.cjs.map} +1 -1
- package/dist/{structured-content-generator-CoIq3j_l.js → structured-content-generator-CBwC687x.js} +2 -2
- package/dist/{structured-content-generator-CoIq3j_l.js.map → structured-content-generator-CBwC687x.js.map} +1 -1
- package/dist/structured-content-generator-DGb_KAZW.js +4 -0
- package/dist/{text-utilities-DjLdStjv.js → text-utilities-3xEPRhXM.js} +1 -1
- package/dist/{text-utilities-DjLdStjv.js.map → text-utilities-3xEPRhXM.js.map} +1 -1
- package/dist/{text-utilities-CTsN1Bq8.cjs → text-utilities-DfBVf9Py.cjs} +1 -1
- package/dist/{text-utilities-CTsN1Bq8.cjs.map → text-utilities-DfBVf9Py.cjs.map} +1 -1
- package/dist/translator-B-HF5sof.cjs +7 -0
- package/dist/{translator-Cs9tZAko.cjs → translator-CwFgb6-j.cjs} +3 -3
- package/dist/translator-CwFgb6-j.cjs.map +1 -0
- package/dist/{translator-CucPBaJ6.js → translator-SBsF5K1s.js} +3 -3
- package/dist/{translator-Cs9tZAko.cjs.map → translator-SBsF5K1s.js.map} +1 -1
- package/dist/translator-sdQ1lwP8.js +7 -0
- package/dist/{utilities-bi3EF-q5.js → utilities-CcvCnZvO.js} +1 -1
- package/dist/{utilities-bi3EF-q5.js.map → utilities-CcvCnZvO.js.map} +1 -1
- package/dist/{utilities-C-lbZaJE.cjs → utilities-vqyVBahS.cjs} +1 -1
- package/dist/{utilities-C-lbZaJE.cjs.map → utilities-vqyVBahS.cjs.map} +1 -1
- package/package.json +10 -9
- package/dist/anki-connect-B2UXtiUS.js +0 -6
- package/dist/anki-connect-BXvjYYm0.cjs +0 -6
- package/dist/anki-connect-DGx7Gr0H.cjs.map +0 -1
- package/dist/anki-connect-Dau8nAXZ.js.map +0 -1
- package/dist/anki.cjs.map +0 -1
- package/dist/anki.js.map +0 -1
- package/dist/batch-processor-CSF1acTw.cjs +0 -3
- package/dist/batch-processor-Quo9jUyf.js +0 -3
- package/dist/content-manager-BF1w7O_T.cjs.map +0 -1
- package/dist/content-manager-N3C_dYMa.js.map +0 -1
- package/dist/dictionary-database-BGAaPDVT.d.cts.map +0 -1
- package/dist/dictionary-database-Bu8vYgxF.d.ts.map +0 -1
- package/dist/dictionary-database-CU4TsvCC.js.map +0 -1
- package/dist/dictionary-database-lvFvftnO.cjs.map +0 -1
- package/dist/dictionary-importer-BPlLeF5R.js.map +0 -1
- package/dist/dictionary-importer-BvgP1Fs9.cjs.map +0 -1
- package/dist/dictionary-importer-DEMVqTjR.js +0 -8
- package/dist/dictionary-importer-Luz6usUQ.cjs +0 -8
- package/dist/dictionary-update-checker-CLbtQ48X.js.map +0 -1
- package/dist/dictionary-update-checker-CsS7MxK_.js +0 -4
- package/dist/dictionary-update-checker-DmiIUoKw.cjs.map +0 -1
- package/dist/display-generator-BIo7C55x.js +0 -10
- package/dist/display-generator-sJtVAXnq.cjs +0 -10
- package/dist/frequency-ranking-BXjfhhUQ.js +0 -3
- package/dist/frequency-ranking-Cx1kkIrw.cjs +0 -3
- package/dist/frequency-ranking-DEJMTMdg.js.map +0 -1
- package/dist/frequency-ranking-DVYxTXN-.cjs.map +0 -1
- package/dist/furigana-BI7XcDSq.js +0 -5
- package/dist/furigana-DAkrfa5G.cjs +0 -5
- package/dist/media-loader-CWNb22gc.cjs +0 -3
- package/dist/media-loader-CrQnDnSp.js +0 -3
- package/dist/pronunciation-generator-DE8ni1J4.js +0 -4
- package/dist/sentence-parser-1EDiTqnV.cjs +0 -6
- package/dist/sentence-parser-CWymIi_f.js +0 -6
- package/dist/sentence-parser-CgisSkL5.d.ts.map +0 -1
- package/dist/sentence-parser-Cx98mLAP.cjs.map +0 -1
- package/dist/sentence-parser-DnE0Q8N3.d.cts.map +0 -1
- package/dist/sentence-parser-EFf9w3IS.js.map +0 -1
- package/dist/settings-DIcKLlgX.d.ts +0 -143
- package/dist/settings-DIcKLlgX.d.ts.map +0 -1
- package/dist/settings-joBAbK3e.d.cts +0 -143
- package/dist/settings-joBAbK3e.d.cts.map +0 -1
- package/dist/structured-content-generator-DzV-kHxa.js +0 -4
- package/dist/translator-B9LfJ83c.cjs +0 -7
- package/dist/translator-CucPBaJ6.js.map +0 -1
- package/dist/translator-DPYiUIP6.js +0 -7
|
@@ -0,0 +1,860 @@
|
|
|
1
|
+
import { DictionaryEntry, DictionaryEntryType, InflectionRuleChainCandidate, KanjiDictionaryEntry, Tag$1 as Tag, TermDictionaryEntry, TermGlossaryContent } from "./dictionary-o42ErAc-.js";
|
|
2
|
+
import { Summary } from "./dictionary-importer-BUhx1hez.js";
|
|
3
|
+
|
|
4
|
+
//#region src/types/anki.d.ts
|
|
5
|
+
type NoteId = number;
|
|
6
|
+
type CardId = number;
|
|
7
|
+
type NoteWithId = Note & {
|
|
8
|
+
id: NoteId;
|
|
9
|
+
};
|
|
10
|
+
type Note = {
|
|
11
|
+
fields: NoteFields;
|
|
12
|
+
tags: string[];
|
|
13
|
+
deckName: string;
|
|
14
|
+
modelName: string;
|
|
15
|
+
options: {
|
|
16
|
+
allowDuplicate: boolean;
|
|
17
|
+
duplicateScope: string;
|
|
18
|
+
duplicateScopeOptions: {
|
|
19
|
+
deckName: string | null;
|
|
20
|
+
checkChildren: boolean;
|
|
21
|
+
checkAllModels: boolean;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
type NoteFields = {
|
|
26
|
+
[field: string]: string;
|
|
27
|
+
};
|
|
28
|
+
type NoteInfoWrapper = {
|
|
29
|
+
canAdd: boolean;
|
|
30
|
+
valid: boolean;
|
|
31
|
+
noteIds: NoteId[] | null;
|
|
32
|
+
noteInfos?: (NoteInfo | null)[];
|
|
33
|
+
};
|
|
34
|
+
type NoteInfo = {
|
|
35
|
+
noteId: NoteId;
|
|
36
|
+
tags: string[];
|
|
37
|
+
fields: {
|
|
38
|
+
[key: string]: NoteFieldInfo;
|
|
39
|
+
};
|
|
40
|
+
modelName: string;
|
|
41
|
+
cards: CardId[];
|
|
42
|
+
cardsInfo: CardInfo[];
|
|
43
|
+
};
|
|
44
|
+
type NoteFieldInfo = {
|
|
45
|
+
value: string;
|
|
46
|
+
order: number;
|
|
47
|
+
};
|
|
48
|
+
type CardInfo = {
|
|
49
|
+
noteId: NoteId;
|
|
50
|
+
cardId: CardId;
|
|
51
|
+
flags: number;
|
|
52
|
+
cardState: number;
|
|
53
|
+
};
|
|
54
|
+
type ApiReflectResult = {
|
|
55
|
+
scopes: string[];
|
|
56
|
+
actions: string[];
|
|
57
|
+
};
|
|
58
|
+
type MessageBody = {
|
|
59
|
+
action: string;
|
|
60
|
+
params: {
|
|
61
|
+
[key: string]: unknown;
|
|
62
|
+
};
|
|
63
|
+
version: number;
|
|
64
|
+
key?: string;
|
|
65
|
+
};
|
|
66
|
+
type CanAddNotesDetail = {
|
|
67
|
+
canAdd: boolean;
|
|
68
|
+
error: string | null;
|
|
69
|
+
}; //#endregion
|
|
70
|
+
//#region src/anki/anki-note-builder.d.ts
|
|
71
|
+
|
|
72
|
+
//# sourceMappingURL=anki.d.ts.map
|
|
73
|
+
/**
|
|
74
|
+
* Represents a template rendering result.
|
|
75
|
+
*/
|
|
76
|
+
type RenderResult$1 = {
|
|
77
|
+
result: string;
|
|
78
|
+
requirements: Requirement[];
|
|
79
|
+
};
|
|
80
|
+
/**
|
|
81
|
+
* Represents a rendering response from renderMulti.
|
|
82
|
+
*/
|
|
83
|
+
type RenderMultiResponse$1 = {
|
|
84
|
+
result?: RenderResult$1;
|
|
85
|
+
error?: SerializedError;
|
|
86
|
+
};
|
|
87
|
+
type SerializedError = {
|
|
88
|
+
name?: string;
|
|
89
|
+
message?: string;
|
|
90
|
+
stack?: string;
|
|
91
|
+
data?: unknown;
|
|
92
|
+
};
|
|
93
|
+
/**
|
|
94
|
+
* Interface for a template renderer that can be injected into AnkiNoteBuilder.
|
|
95
|
+
*/
|
|
96
|
+
interface TemplateRenderer {
|
|
97
|
+
getModifiedData(data: {
|
|
98
|
+
marker: string;
|
|
99
|
+
commonData: CommonData;
|
|
100
|
+
}, type: string): Promise<NoteData$1>;
|
|
101
|
+
renderMulti(items: RenderMultiItem$1[]): Promise<RenderMultiResponse$1[]>;
|
|
102
|
+
}
|
|
103
|
+
type RenderMultiItem$1 = {
|
|
104
|
+
template: string;
|
|
105
|
+
templateItems: RenderMultiTemplateItem$1[];
|
|
106
|
+
};
|
|
107
|
+
type RenderMultiTemplateItem$1 = {
|
|
108
|
+
type: string;
|
|
109
|
+
commonData: CommonData;
|
|
110
|
+
datas: PartialRenderData$1[];
|
|
111
|
+
};
|
|
112
|
+
type PartialRenderData$1 = {
|
|
113
|
+
marker: string;
|
|
114
|
+
};
|
|
115
|
+
/**
|
|
116
|
+
* Common data passed through the template rendering process.
|
|
117
|
+
*/
|
|
118
|
+
type CommonData = {
|
|
119
|
+
dictionaryEntry: DictionaryEntry;
|
|
120
|
+
cardFormat: AnkiCardFormat;
|
|
121
|
+
context: Context;
|
|
122
|
+
resultOutputMode: ResultOutputMode;
|
|
123
|
+
glossaryLayoutMode: GlossaryLayoutMode;
|
|
124
|
+
compactTags: boolean;
|
|
125
|
+
media?: Media;
|
|
126
|
+
dictionaryStylesMap: Map<string, string>;
|
|
127
|
+
};
|
|
128
|
+
type AnkiCardFormat = {
|
|
129
|
+
deck: string;
|
|
130
|
+
model: string;
|
|
131
|
+
fields: {
|
|
132
|
+
[fieldName: string]: {
|
|
133
|
+
value: string;
|
|
134
|
+
};
|
|
135
|
+
};
|
|
136
|
+
};
|
|
137
|
+
type Context = {
|
|
138
|
+
url: string;
|
|
139
|
+
sentence?: {
|
|
140
|
+
text: string;
|
|
141
|
+
offset: number;
|
|
142
|
+
};
|
|
143
|
+
query: string;
|
|
144
|
+
fullQuery: string;
|
|
145
|
+
documentTitle?: string;
|
|
146
|
+
};
|
|
147
|
+
type ResultOutputMode = 'group' | 'merge' | 'split';
|
|
148
|
+
type GlossaryLayoutMode = 'default' | 'compact' | 'compact-popup-anki';
|
|
149
|
+
type MediaObject = {
|
|
150
|
+
value: string;
|
|
151
|
+
};
|
|
152
|
+
type Media = {
|
|
153
|
+
audio?: MediaObject;
|
|
154
|
+
screenshot?: MediaObject;
|
|
155
|
+
clipboardImage?: MediaObject;
|
|
156
|
+
clipboardText?: MediaObject;
|
|
157
|
+
popupSelectionText?: MediaObject;
|
|
158
|
+
textFurigana: TextFuriganaSegment[];
|
|
159
|
+
dictionaryMedia: DictionaryMedia;
|
|
160
|
+
};
|
|
161
|
+
type TextFuriganaSegment = {
|
|
162
|
+
text: string;
|
|
163
|
+
readingMode: TextFuriganaReadingMode | null;
|
|
164
|
+
detailsHtml: MediaObject;
|
|
165
|
+
detailsPlain: MediaObject;
|
|
166
|
+
};
|
|
167
|
+
type TextFuriganaReadingMode = 'hiragana' | 'katakana';
|
|
168
|
+
type DictionaryMedia = {
|
|
169
|
+
[dictionary: string]: {
|
|
170
|
+
[path: string]: MediaObject;
|
|
171
|
+
};
|
|
172
|
+
};
|
|
173
|
+
type NoteData$1 = Record<string, unknown>;
|
|
174
|
+
type Requirement = {
|
|
175
|
+
type: 'audio';
|
|
176
|
+
} | {
|
|
177
|
+
type: 'screenshot';
|
|
178
|
+
} | {
|
|
179
|
+
type: 'clipboardImage';
|
|
180
|
+
} | {
|
|
181
|
+
type: 'clipboardText';
|
|
182
|
+
} | {
|
|
183
|
+
type: 'popupSelectionText';
|
|
184
|
+
} | {
|
|
185
|
+
type: 'textFurigana';
|
|
186
|
+
text: string;
|
|
187
|
+
readingMode: TextFuriganaReadingMode | null;
|
|
188
|
+
} | {
|
|
189
|
+
type: 'dictionaryMedia';
|
|
190
|
+
dictionary: string;
|
|
191
|
+
path: string;
|
|
192
|
+
};
|
|
193
|
+
type CreateNoteDetails = {
|
|
194
|
+
dictionaryEntry: DictionaryEntry;
|
|
195
|
+
cardFormat: AnkiCardFormat;
|
|
196
|
+
context: Context;
|
|
197
|
+
template: string;
|
|
198
|
+
tags?: string[];
|
|
199
|
+
requirements?: Requirement[];
|
|
200
|
+
duplicateScope?: string;
|
|
201
|
+
duplicateScopeCheckAllModels?: boolean;
|
|
202
|
+
resultOutputMode?: ResultOutputMode;
|
|
203
|
+
glossaryLayoutMode?: GlossaryLayoutMode;
|
|
204
|
+
compactTags?: boolean;
|
|
205
|
+
mediaOptions?: MediaOptions | null;
|
|
206
|
+
dictionaryStylesMap?: Map<string, string>;
|
|
207
|
+
};
|
|
208
|
+
type MediaOptions = {
|
|
209
|
+
audio?: {
|
|
210
|
+
sources: {
|
|
211
|
+
type: string;
|
|
212
|
+
url: string;
|
|
213
|
+
voice: string;
|
|
214
|
+
}[];
|
|
215
|
+
preferredAudioIndex: number | null;
|
|
216
|
+
idleTimeout: number | null;
|
|
217
|
+
languageSummary: unknown;
|
|
218
|
+
enableDefaultAudioSources: boolean;
|
|
219
|
+
};
|
|
220
|
+
screenshot?: {
|
|
221
|
+
format: string;
|
|
222
|
+
quality: number;
|
|
223
|
+
contentOrigin: {
|
|
224
|
+
tabId: number;
|
|
225
|
+
frameId: number;
|
|
226
|
+
};
|
|
227
|
+
};
|
|
228
|
+
textParsing?: {
|
|
229
|
+
optionsContext: unknown;
|
|
230
|
+
scanLength: number;
|
|
231
|
+
};
|
|
232
|
+
};
|
|
233
|
+
type CreateNoteResult = {
|
|
234
|
+
note: Note;
|
|
235
|
+
errors: Error[];
|
|
236
|
+
requirements: Requirement[];
|
|
237
|
+
};
|
|
238
|
+
type InjectAnkiNoteMediaDefinitionDetails = {
|
|
239
|
+
type: 'kanji';
|
|
240
|
+
character: string;
|
|
241
|
+
} | {
|
|
242
|
+
type: 'term';
|
|
243
|
+
term: string;
|
|
244
|
+
reading: string;
|
|
245
|
+
};
|
|
246
|
+
/**
|
|
247
|
+
* Minimal API interface needed by AnkiNoteBuilder for media injection.
|
|
248
|
+
*/
|
|
249
|
+
interface MinimalApi {
|
|
250
|
+
injectAnkiNoteMedia(timestamp: number, dictionaryEntryDetails: InjectAnkiNoteMediaDefinitionDetails, audioDetails: unknown, screenshotDetails: unknown, clipboardDetails: {
|
|
251
|
+
image: boolean;
|
|
252
|
+
text: boolean;
|
|
253
|
+
}, dictionaryMediaDetails: {
|
|
254
|
+
dictionary: string;
|
|
255
|
+
path: string;
|
|
256
|
+
}[]): Promise<{
|
|
257
|
+
audioFileName: string | null;
|
|
258
|
+
screenshotFileName: string | null;
|
|
259
|
+
clipboardImageFileName: string | null;
|
|
260
|
+
clipboardText: string | null;
|
|
261
|
+
dictionaryMedia: {
|
|
262
|
+
dictionary: string;
|
|
263
|
+
path: string;
|
|
264
|
+
fileName: string | null;
|
|
265
|
+
}[];
|
|
266
|
+
errors: SerializedError[];
|
|
267
|
+
}>;
|
|
268
|
+
parseText(text: string, optionsContext: unknown, scanLength: number, useInternalParser: boolean, useMecabParser: boolean): Promise<{
|
|
269
|
+
source: string;
|
|
270
|
+
content: unknown;
|
|
271
|
+
}[]>;
|
|
272
|
+
}
|
|
273
|
+
/**
|
|
274
|
+
* Builds Anki notes from dictionary entries using template rendering.
|
|
275
|
+
*/
|
|
276
|
+
declare class AnkiNoteBuilder {
|
|
277
|
+
private _api;
|
|
278
|
+
private _markerPattern;
|
|
279
|
+
private _templateRenderer;
|
|
280
|
+
private _batchedRequests;
|
|
281
|
+
private _batchedRequestsQueued;
|
|
282
|
+
constructor(templateRenderer: TemplateRenderer, api?: MinimalApi);
|
|
283
|
+
createNote({
|
|
284
|
+
dictionaryEntry,
|
|
285
|
+
cardFormat,
|
|
286
|
+
context,
|
|
287
|
+
template,
|
|
288
|
+
tags,
|
|
289
|
+
requirements,
|
|
290
|
+
duplicateScope,
|
|
291
|
+
duplicateScopeCheckAllModels,
|
|
292
|
+
resultOutputMode,
|
|
293
|
+
glossaryLayoutMode,
|
|
294
|
+
compactTags,
|
|
295
|
+
mediaOptions,
|
|
296
|
+
dictionaryStylesMap
|
|
297
|
+
}: CreateNoteDetails): Promise<CreateNoteResult>;
|
|
298
|
+
getRenderingData({
|
|
299
|
+
dictionaryEntry,
|
|
300
|
+
cardFormat,
|
|
301
|
+
context,
|
|
302
|
+
resultOutputMode,
|
|
303
|
+
glossaryLayoutMode,
|
|
304
|
+
compactTags,
|
|
305
|
+
marker,
|
|
306
|
+
dictionaryStylesMap
|
|
307
|
+
}: {
|
|
308
|
+
dictionaryEntry: DictionaryEntry;
|
|
309
|
+
cardFormat: AnkiCardFormat;
|
|
310
|
+
context: Context;
|
|
311
|
+
resultOutputMode?: ResultOutputMode;
|
|
312
|
+
glossaryLayoutMode?: GlossaryLayoutMode;
|
|
313
|
+
compactTags?: boolean;
|
|
314
|
+
marker: string;
|
|
315
|
+
dictionaryStylesMap: Map<string, string>;
|
|
316
|
+
}): Promise<NoteData$1>;
|
|
317
|
+
getDictionaryEntryDetailsForNote(dictionaryEntry: DictionaryEntry): InjectAnkiNoteMediaDefinitionDetails;
|
|
318
|
+
private _createData;
|
|
319
|
+
private _formatField;
|
|
320
|
+
private _stringReplaceAsync;
|
|
321
|
+
private _getBatchedTemplateGroup;
|
|
322
|
+
private _renderTemplateBatched;
|
|
323
|
+
private _runBatchedRequestsDelayed;
|
|
324
|
+
private _runBatchedRequests;
|
|
325
|
+
private _resolveBatchedRequests;
|
|
326
|
+
private _injectMedia;
|
|
327
|
+
private _deserializeError;
|
|
328
|
+
} //#endregion
|
|
329
|
+
//#region src/anki/anki-note-data-creator.d.ts
|
|
330
|
+
|
|
331
|
+
//# sourceMappingURL=anki-note-builder.d.ts.map
|
|
332
|
+
type NoteData = {
|
|
333
|
+
marker: string;
|
|
334
|
+
definition: AnkiDictionaryEntry;
|
|
335
|
+
glossaryLayoutMode: GlossaryLayoutMode;
|
|
336
|
+
compactTags: boolean;
|
|
337
|
+
group: boolean;
|
|
338
|
+
merge: boolean;
|
|
339
|
+
compactGlossaries: boolean;
|
|
340
|
+
uniqueExpressions: string[];
|
|
341
|
+
uniqueReadings: string[];
|
|
342
|
+
pitches: PitchGroup[];
|
|
343
|
+
pitchCount: number;
|
|
344
|
+
phoneticTranscriptions: TranscriptionGroup[];
|
|
345
|
+
context: PublicContext;
|
|
346
|
+
media: Media;
|
|
347
|
+
dictionaryEntry: DictionaryEntry;
|
|
348
|
+
};
|
|
349
|
+
type PublicContext = {
|
|
350
|
+
query: string;
|
|
351
|
+
fullQuery: string;
|
|
352
|
+
document: {
|
|
353
|
+
title: string;
|
|
354
|
+
};
|
|
355
|
+
};
|
|
356
|
+
type AnkiDictionaryEntry = AnkiTermDictionaryEntry | AnkiKanjiDictionaryEntry | Record<string, never>;
|
|
357
|
+
type TermDictionaryEntryType = 'term' | 'termGrouped' | 'termMerged';
|
|
358
|
+
type Tag$1 = {
|
|
359
|
+
name: string;
|
|
360
|
+
category: string;
|
|
361
|
+
notes: string;
|
|
362
|
+
order: number;
|
|
363
|
+
score: number;
|
|
364
|
+
dictionary: string;
|
|
365
|
+
redundant: boolean;
|
|
366
|
+
};
|
|
367
|
+
type PitchTag = {
|
|
368
|
+
name: string;
|
|
369
|
+
category: string;
|
|
370
|
+
order: number;
|
|
371
|
+
score: number;
|
|
372
|
+
content: string[];
|
|
373
|
+
dictionaries: string[];
|
|
374
|
+
redundant: boolean;
|
|
375
|
+
};
|
|
376
|
+
type Pitch = {
|
|
377
|
+
expressions: string[];
|
|
378
|
+
reading: string;
|
|
379
|
+
positions: number | string;
|
|
380
|
+
nasalPositions: number[];
|
|
381
|
+
devoicePositions: number[];
|
|
382
|
+
tags: PitchTag[];
|
|
383
|
+
exclusiveExpressions: string[];
|
|
384
|
+
exclusiveReadings: string[];
|
|
385
|
+
};
|
|
386
|
+
type PitchGroup = {
|
|
387
|
+
dictionary: string;
|
|
388
|
+
pitches: Pitch[];
|
|
389
|
+
};
|
|
390
|
+
type Transcription = {
|
|
391
|
+
expressions: string[];
|
|
392
|
+
reading: string;
|
|
393
|
+
ipa: string;
|
|
394
|
+
tags: Tag[];
|
|
395
|
+
exclusiveExpressions: string[];
|
|
396
|
+
exclusiveReadings: string[];
|
|
397
|
+
};
|
|
398
|
+
type TranscriptionGroup = {
|
|
399
|
+
dictionary: string;
|
|
400
|
+
phoneticTranscriptions: Transcription[];
|
|
401
|
+
};
|
|
402
|
+
type FuriganaSegment = {
|
|
403
|
+
text: string;
|
|
404
|
+
furigana: string;
|
|
405
|
+
};
|
|
406
|
+
type Cloze = {
|
|
407
|
+
sentence: string;
|
|
408
|
+
prefix: string;
|
|
409
|
+
body: string;
|
|
410
|
+
bodyKana: string;
|
|
411
|
+
suffix: string;
|
|
412
|
+
};
|
|
413
|
+
type FrequencyNumber = {
|
|
414
|
+
dictionary: string;
|
|
415
|
+
frequency: number;
|
|
416
|
+
};
|
|
417
|
+
type TermFrequencyEntry = {
|
|
418
|
+
index: number;
|
|
419
|
+
expressionIndex: number;
|
|
420
|
+
dictionary: string;
|
|
421
|
+
dictionaryAlias: string;
|
|
422
|
+
dictionaryOrder: {
|
|
423
|
+
index: number;
|
|
424
|
+
};
|
|
425
|
+
expression: string;
|
|
426
|
+
reading: string;
|
|
427
|
+
hasReading: boolean;
|
|
428
|
+
frequency: number | string;
|
|
429
|
+
};
|
|
430
|
+
type TermPitchAccent = {
|
|
431
|
+
index: number;
|
|
432
|
+
expressionIndex: number;
|
|
433
|
+
dictionary: string;
|
|
434
|
+
dictionaryAlias: string;
|
|
435
|
+
dictionaryOrder: {
|
|
436
|
+
index: number;
|
|
437
|
+
};
|
|
438
|
+
expression: string;
|
|
439
|
+
reading: string;
|
|
440
|
+
pitches: {
|
|
441
|
+
positions: number | string;
|
|
442
|
+
tags: Tag$1[];
|
|
443
|
+
}[];
|
|
444
|
+
};
|
|
445
|
+
type TermPhoneticTranscription = {
|
|
446
|
+
index: number;
|
|
447
|
+
expressionIndex: number;
|
|
448
|
+
dictionary: string;
|
|
449
|
+
dictionaryAlias: string;
|
|
450
|
+
dictionaryOrder: {
|
|
451
|
+
index: number;
|
|
452
|
+
};
|
|
453
|
+
expression: string;
|
|
454
|
+
reading: string;
|
|
455
|
+
phoneticTranscriptions: {
|
|
456
|
+
ipa: string;
|
|
457
|
+
tags: Tag$1[];
|
|
458
|
+
}[];
|
|
459
|
+
};
|
|
460
|
+
type TermHeadword = {
|
|
461
|
+
sourceTerm: string;
|
|
462
|
+
expression: string;
|
|
463
|
+
reading: string;
|
|
464
|
+
termTags: Tag$1[];
|
|
465
|
+
frequencies: TermFrequencyEntry[];
|
|
466
|
+
pitches: TermPitchAccent[];
|
|
467
|
+
furiganaSegments: FuriganaSegment[];
|
|
468
|
+
termFrequency: 'popular' | 'rare' | 'normal';
|
|
469
|
+
wordClasses: string[];
|
|
470
|
+
};
|
|
471
|
+
type TermDefinition = {
|
|
472
|
+
sequence: number;
|
|
473
|
+
dictionary: string;
|
|
474
|
+
dictionaryAlias: string;
|
|
475
|
+
glossaryScopedStyles: string;
|
|
476
|
+
dictScopedStyles: string;
|
|
477
|
+
glossary: TermGlossaryContent[];
|
|
478
|
+
definitionTags: Tag$1[];
|
|
479
|
+
only?: string[];
|
|
480
|
+
};
|
|
481
|
+
type KanjiStat = {
|
|
482
|
+
name: string;
|
|
483
|
+
category: string;
|
|
484
|
+
notes: string;
|
|
485
|
+
order: number;
|
|
486
|
+
score: number;
|
|
487
|
+
dictionary: string;
|
|
488
|
+
value: number | string;
|
|
489
|
+
};
|
|
490
|
+
type KanjiStatGroups = {
|
|
491
|
+
[key: string]: KanjiStat[];
|
|
492
|
+
};
|
|
493
|
+
type KanjiFrequencyEntry = {
|
|
494
|
+
index: number;
|
|
495
|
+
dictionary: string;
|
|
496
|
+
dictionaryAlias: string;
|
|
497
|
+
dictionaryOrder: {
|
|
498
|
+
index: number;
|
|
499
|
+
};
|
|
500
|
+
character: string;
|
|
501
|
+
frequency: number | string;
|
|
502
|
+
};
|
|
503
|
+
type AnkiTermDictionaryEntry = {
|
|
504
|
+
type: TermDictionaryEntryType;
|
|
505
|
+
id?: number;
|
|
506
|
+
source: string | null;
|
|
507
|
+
rawSource: string | null;
|
|
508
|
+
sourceTerm?: string | null;
|
|
509
|
+
inflectionRuleChainCandidates: InflectionRuleChainCandidate[];
|
|
510
|
+
score: number;
|
|
511
|
+
isPrimary?: boolean;
|
|
512
|
+
sequence: number;
|
|
513
|
+
dictionary: string;
|
|
514
|
+
dictionaryAlias: string;
|
|
515
|
+
dictionaryOrder: {
|
|
516
|
+
index: number;
|
|
517
|
+
};
|
|
518
|
+
dictionaryNames: string[];
|
|
519
|
+
expression: string | string[];
|
|
520
|
+
reading: string | string[];
|
|
521
|
+
expressions: TermHeadword[];
|
|
522
|
+
glossary?: TermGlossaryContent[];
|
|
523
|
+
glossaryScopedStyles?: string;
|
|
524
|
+
dictScopedStyles?: string;
|
|
525
|
+
definitionTags?: Tag$1[];
|
|
526
|
+
termTags?: Tag$1[];
|
|
527
|
+
definitions?: TermDefinition[];
|
|
528
|
+
frequencies: TermFrequencyEntry[];
|
|
529
|
+
frequencyNumbers: FrequencyNumber[];
|
|
530
|
+
frequencyHarmonic: number;
|
|
531
|
+
frequencyAverage: number;
|
|
532
|
+
pitches: TermPitchAccent[];
|
|
533
|
+
phoneticTranscriptions: TermPhoneticTranscription[];
|
|
534
|
+
sourceTermExactMatchCount: number;
|
|
535
|
+
url: string;
|
|
536
|
+
cloze: Cloze;
|
|
537
|
+
furiganaSegments?: FuriganaSegment[];
|
|
538
|
+
};
|
|
539
|
+
type AnkiKanjiDictionaryEntry = {
|
|
540
|
+
type: 'kanji';
|
|
541
|
+
character: string;
|
|
542
|
+
dictionary: string;
|
|
543
|
+
dictionaryAlias: string;
|
|
544
|
+
onyomi: string[];
|
|
545
|
+
kunyomi: string[];
|
|
546
|
+
glossary: string[];
|
|
547
|
+
tags: Tag$1[];
|
|
548
|
+
stats: KanjiStatGroups;
|
|
549
|
+
frequencies: KanjiFrequencyEntry[];
|
|
550
|
+
frequencyHarmonic: number;
|
|
551
|
+
frequencyAverage: number;
|
|
552
|
+
url: string;
|
|
553
|
+
cloze: Cloze;
|
|
554
|
+
};
|
|
555
|
+
type CachedValue<T> = {
|
|
556
|
+
getter: () => T;
|
|
557
|
+
hasValue: boolean;
|
|
558
|
+
value: T | undefined;
|
|
559
|
+
};
|
|
560
|
+
declare function createCachedValue<T>(getter: () => T): CachedValue<T>;
|
|
561
|
+
declare function getCachedValue<T>(item: CachedValue<T>): T;
|
|
562
|
+
/**
|
|
563
|
+
* Creates a compatibility representation of the specified data for Anki template rendering.
|
|
564
|
+
*/
|
|
565
|
+
declare function createAnkiNoteData(marker: string, details: CommonData): NoteData;
|
|
566
|
+
declare function getFrequencyHarmonic(dictionaryEntry: TermDictionaryEntry | KanjiDictionaryEntry, headwordIndex: number | null): number;
|
|
567
|
+
|
|
568
|
+
//#endregion
|
|
569
|
+
//#region src/types/core.d.ts
|
|
570
|
+
type TypeofResult = 'string' | 'number' | 'bigint' | 'boolean' | 'symbol' | 'undefined' | 'object' | 'function';
|
|
571
|
+
type SafeAny = any;
|
|
572
|
+
type RejectionReason = SafeAny;
|
|
573
|
+
type SerializableObject = {
|
|
574
|
+
[key: string]: unknown;
|
|
575
|
+
};
|
|
576
|
+
type UnknownObject = {
|
|
577
|
+
[key: string | symbol]: unknown;
|
|
578
|
+
};
|
|
579
|
+
type TokenString = string;
|
|
580
|
+
type TokenObject = Record<string, never>;
|
|
581
|
+
type DeferredPromiseDetails<T = unknown> = {
|
|
582
|
+
promise: Promise<T>;
|
|
583
|
+
resolve: (value: T) => void;
|
|
584
|
+
reject: (reason?: RejectionReason) => void;
|
|
585
|
+
};
|
|
586
|
+
type EventSurface = {
|
|
587
|
+
[name: string]: unknown;
|
|
588
|
+
};
|
|
589
|
+
type EventNames<TSurface extends EventSurface> = keyof TSurface & string;
|
|
590
|
+
type EventArgument<TSurface extends EventSurface, TName extends EventNames<TSurface>> = TSurface[TName];
|
|
591
|
+
type EventHandler<TSurface extends EventSurface, TName extends EventNames<TSurface>> = (details: EventArgument<TSurface, TName>) => void;
|
|
592
|
+
type EventHandlerAny = (details: SafeAny) => void;
|
|
593
|
+
type EventDispatcherOffGeneric = {
|
|
594
|
+
off(eventName: string, callback: (...args: SafeAny) => void): boolean;
|
|
595
|
+
};
|
|
596
|
+
type Timeout = number | ReturnType<typeof setTimeout>;
|
|
597
|
+
|
|
598
|
+
//#endregion
|
|
599
|
+
//#region src/anki/anki-template-renderer.d.ts
|
|
600
|
+
//# sourceMappingURL=core.d.ts.map
|
|
601
|
+
type HelperOptions = {
|
|
602
|
+
fn?: (context: unknown) => string;
|
|
603
|
+
inverse?: (context: unknown) => string;
|
|
604
|
+
hash: SerializableObject;
|
|
605
|
+
data: {
|
|
606
|
+
root: NoteData;
|
|
607
|
+
};
|
|
608
|
+
};
|
|
609
|
+
type HelperFunction<T = unknown> = (args: unknown[], context: unknown, options: HelperOptions) => T;
|
|
610
|
+
type DataType = {
|
|
611
|
+
modifier: (data: CompositeRenderData) => NoteData;
|
|
612
|
+
composeData: (data: PartialRenderData, commonData: CommonData) => CompositeRenderData;
|
|
613
|
+
};
|
|
614
|
+
type PartialRenderData = {
|
|
615
|
+
marker: string;
|
|
616
|
+
commonData?: CommonData;
|
|
617
|
+
};
|
|
618
|
+
type CompositeRenderData = {
|
|
619
|
+
marker: string;
|
|
620
|
+
commonData: CommonData;
|
|
621
|
+
};
|
|
622
|
+
type RenderResult = {
|
|
623
|
+
result: string;
|
|
624
|
+
requirements: Requirement[];
|
|
625
|
+
};
|
|
626
|
+
type RenderMultiItem = {
|
|
627
|
+
template: string;
|
|
628
|
+
templateItems: RenderMultiTemplateItem[];
|
|
629
|
+
};
|
|
630
|
+
type RenderMultiTemplateItem = {
|
|
631
|
+
type: string;
|
|
632
|
+
commonData: CommonData;
|
|
633
|
+
datas: PartialRenderData[];
|
|
634
|
+
};
|
|
635
|
+
type RenderMultiResponse = {
|
|
636
|
+
result?: RenderResult;
|
|
637
|
+
error?: {
|
|
638
|
+
name?: string;
|
|
639
|
+
message?: string;
|
|
640
|
+
stack?: string;
|
|
641
|
+
data?: unknown;
|
|
642
|
+
};
|
|
643
|
+
};
|
|
644
|
+
/**
|
|
645
|
+
* Interface for a Handlebars-compatible template engine.
|
|
646
|
+
* Consumers should provide an implementation that wraps their Handlebars instance.
|
|
647
|
+
*/
|
|
648
|
+
interface HandlebarsInstance {
|
|
649
|
+
compileAST(template: string): (data: NoteData) => string;
|
|
650
|
+
registerHelper(name: string, helper: (...args: unknown[]) => unknown): void;
|
|
651
|
+
SafeString: new (value: string) => unknown;
|
|
652
|
+
Utils: {
|
|
653
|
+
escapeExpression(value: string): string;
|
|
654
|
+
};
|
|
655
|
+
}
|
|
656
|
+
declare class TemplateRendererCore {
|
|
657
|
+
private _cache;
|
|
658
|
+
private _cacheMaxSize;
|
|
659
|
+
private _dataTypes;
|
|
660
|
+
private _renderSetup;
|
|
661
|
+
private _renderCleanup;
|
|
662
|
+
private _handlebars;
|
|
663
|
+
constructor(handlebars: HandlebarsInstance);
|
|
664
|
+
registerHelpers(helpers: [string, HelperFunction][]): void;
|
|
665
|
+
registerDataType(name: string, details: DataType): void;
|
|
666
|
+
setRenderCallbacks(setup: ((data: NoteData) => {
|
|
667
|
+
requirements: Requirement[];
|
|
668
|
+
}) | null, cleanup: ((data: NoteData) => void) | null): void;
|
|
669
|
+
render(template: string, data: PartialRenderData, type: string): RenderResult;
|
|
670
|
+
renderMulti(items: RenderMultiItem[]): RenderMultiResponse[];
|
|
671
|
+
getModifiedData(data: CompositeRenderData, type: string): NoteData;
|
|
672
|
+
private _getTemplateInstance;
|
|
673
|
+
private _renderTemplate;
|
|
674
|
+
private _getModifiedData;
|
|
675
|
+
private _updateCacheSize;
|
|
676
|
+
private _registerHelper;
|
|
677
|
+
}
|
|
678
|
+
/**
|
|
679
|
+
* This class contains all Anki-specific template rendering functionality.
|
|
680
|
+
* It registers all 25+ Handlebars helpers and provides template rendering.
|
|
681
|
+
*
|
|
682
|
+
* Requires a Handlebars-compatible engine to be injected via the constructor.
|
|
683
|
+
*/
|
|
684
|
+
declare class AnkiTemplateRenderer {
|
|
685
|
+
private _templateRenderer;
|
|
686
|
+
private _mediaProvider;
|
|
687
|
+
private _stateStack;
|
|
688
|
+
private _requirements;
|
|
689
|
+
private _cleanupCallbacks;
|
|
690
|
+
private _document;
|
|
691
|
+
private _handlebars;
|
|
692
|
+
constructor(handlebars: HandlebarsInstance);
|
|
693
|
+
/**
|
|
694
|
+
* Gets the core TemplateRenderer instance.
|
|
695
|
+
*/
|
|
696
|
+
get templateRenderer(): TemplateRendererCore;
|
|
697
|
+
/**
|
|
698
|
+
* Prepares the renderer by registering all Handlebars helpers and data types.
|
|
699
|
+
*/
|
|
700
|
+
prepare(): Promise<void>;
|
|
701
|
+
/**
|
|
702
|
+
* Renders a single template with given data.
|
|
703
|
+
*/
|
|
704
|
+
render(template: string, data: PartialRenderData, type: string): RenderResult;
|
|
705
|
+
/**
|
|
706
|
+
* Renders multiple templates with given data.
|
|
707
|
+
*/
|
|
708
|
+
renderMulti(items: RenderMultiItem[]): RenderMultiResponse[];
|
|
709
|
+
/**
|
|
710
|
+
* Gets modified data for a given type.
|
|
711
|
+
*/
|
|
712
|
+
getModifiedData(data: CompositeRenderData, type: string): NoteData;
|
|
713
|
+
private _onRenderSetup;
|
|
714
|
+
private _onRenderCleanup;
|
|
715
|
+
private _safeString;
|
|
716
|
+
private _dumpObject;
|
|
717
|
+
private _furigana;
|
|
718
|
+
private _furiganaPlain;
|
|
719
|
+
private _getFuriganaExpressionAndReading;
|
|
720
|
+
private _stringToMultiLineHtml;
|
|
721
|
+
private _multiLine;
|
|
722
|
+
private _regexReplace;
|
|
723
|
+
private _regexMatch;
|
|
724
|
+
private _mergeTags;
|
|
725
|
+
private _eachUpTo;
|
|
726
|
+
private _spread;
|
|
727
|
+
private _op;
|
|
728
|
+
private _evaluateUnaryExpression;
|
|
729
|
+
private _evaluateBinaryExpression;
|
|
730
|
+
private _evaluateTernaryExpression;
|
|
731
|
+
private _get;
|
|
732
|
+
private _set;
|
|
733
|
+
private _scope;
|
|
734
|
+
private _property;
|
|
735
|
+
private _noop;
|
|
736
|
+
private _isMoraPitchHigh;
|
|
737
|
+
private _getKanaMorae;
|
|
738
|
+
private _getTypeof;
|
|
739
|
+
private _join;
|
|
740
|
+
private _concat;
|
|
741
|
+
private _pitchCategories;
|
|
742
|
+
private _formatGlossary;
|
|
743
|
+
private _formatGlossaryPlain;
|
|
744
|
+
private _formatStructuredContent;
|
|
745
|
+
private _createStructuredContentNode;
|
|
746
|
+
private _getNodeHtml;
|
|
747
|
+
private _extractStructuredContentText;
|
|
748
|
+
private _extractStructuredContentTextParts;
|
|
749
|
+
private _hasMedia;
|
|
750
|
+
private _getMedia;
|
|
751
|
+
private _hiragana;
|
|
752
|
+
private _katakana;
|
|
753
|
+
private _getNoteDataFromOptions;
|
|
754
|
+
private _asString;
|
|
755
|
+
private _computeValue;
|
|
756
|
+
private _computeValueString;
|
|
757
|
+
private _computeInverse;
|
|
758
|
+
private _computeInverseString;
|
|
759
|
+
}
|
|
760
|
+
|
|
761
|
+
//#endregion
|
|
762
|
+
//#region src/types/settings.d.ts
|
|
763
|
+
type AnkiDuplicateScope = 'collection' | 'deck' | 'deck-root';
|
|
764
|
+
type ProfileOptions = {
|
|
765
|
+
general: GeneralOptions;
|
|
766
|
+
audio: AudioOptions;
|
|
767
|
+
anki: AnkiOptions;
|
|
768
|
+
translation: TranslationOptions;
|
|
769
|
+
};
|
|
770
|
+
type GeneralOptions = {
|
|
771
|
+
language: string;
|
|
772
|
+
resultOutputMode: 'group' | 'merge' | 'split';
|
|
773
|
+
mainDictionary: string;
|
|
774
|
+
sortFrequencyDictionary: string | null;
|
|
775
|
+
sortFrequencyDictionaryOrder: 'ascending' | 'descending';
|
|
776
|
+
};
|
|
777
|
+
type AudioOptions = {
|
|
778
|
+
enabled: boolean;
|
|
779
|
+
sources: AudioSourceOptions[];
|
|
780
|
+
volume: number;
|
|
781
|
+
};
|
|
782
|
+
type AudioSourceOptions = {
|
|
783
|
+
type: string;
|
|
784
|
+
url: string;
|
|
785
|
+
voice: string;
|
|
786
|
+
};
|
|
787
|
+
type AnkiOptions = {
|
|
788
|
+
enable: boolean;
|
|
789
|
+
server: string;
|
|
790
|
+
apiKey: string;
|
|
791
|
+
duplicateScope: AnkiDuplicateScope;
|
|
792
|
+
};
|
|
793
|
+
type TranslationOptions = {
|
|
794
|
+
searchResolution: 'letter' | 'word';
|
|
795
|
+
textReplacements: {
|
|
796
|
+
searchOriginal: string;
|
|
797
|
+
searchReplacement: string;
|
|
798
|
+
}[];
|
|
799
|
+
};
|
|
800
|
+
|
|
801
|
+
//#endregion
|
|
802
|
+
//#region src/anki/anki-template-util.d.ts
|
|
803
|
+
//# sourceMappingURL=settings.d.ts.map
|
|
804
|
+
type DictionaryMarkerSource = {
|
|
805
|
+
name: string;
|
|
806
|
+
enabled: boolean;
|
|
807
|
+
};
|
|
808
|
+
/**
|
|
809
|
+
* Gets the standard marker names available for a given entry type.
|
|
810
|
+
*/
|
|
811
|
+
declare function getStandardFieldMarkers(type: DictionaryEntryType, language?: string): string[];
|
|
812
|
+
/**
|
|
813
|
+
* Returns dynamic marker names derived from enabled dictionaries.
|
|
814
|
+
*/
|
|
815
|
+
declare function getDynamicFieldMarkers(dictionaries: DictionaryMarkerSource[], dictionaryInfo: Summary[]): string[];
|
|
816
|
+
/**
|
|
817
|
+
* Returns dynamic inline template partials derived from enabled dictionaries.
|
|
818
|
+
*/
|
|
819
|
+
declare function getDynamicTemplates(dictionaries: DictionaryMarkerSource[], dictionaryInfo: Summary[]): string;
|
|
820
|
+
declare function getKebabCase(str: string): string;
|
|
821
|
+
|
|
822
|
+
//#endregion
|
|
823
|
+
//#region src/anki/anki-note-service.d.ts
|
|
824
|
+
//# sourceMappingURL=anki-template-util.d.ts.map
|
|
825
|
+
type BuildAnkiNoteFromDictionaryEntryInput = {
|
|
826
|
+
dictionaryEntry: DictionaryEntry;
|
|
827
|
+
cardFormat: AnkiCardFormat;
|
|
828
|
+
context: Context;
|
|
829
|
+
tags?: string[];
|
|
830
|
+
template?: string;
|
|
831
|
+
duplicateScope?: AnkiDuplicateScope;
|
|
832
|
+
duplicateScopeCheckAllModels?: boolean;
|
|
833
|
+
resultOutputMode?: ResultOutputMode;
|
|
834
|
+
glossaryLayoutMode?: GlossaryLayoutMode;
|
|
835
|
+
compactTags?: boolean;
|
|
836
|
+
dictionaryStylesMap?: Map<string, string>;
|
|
837
|
+
};
|
|
838
|
+
type BuildAnkiNoteFromTermResult = {
|
|
839
|
+
status: 'ok';
|
|
840
|
+
fields: Record<string, string>;
|
|
841
|
+
errors: string[];
|
|
842
|
+
} | {
|
|
843
|
+
status: 'no-entry';
|
|
844
|
+
errors: string[];
|
|
845
|
+
};
|
|
846
|
+
declare function createDefaultAnkiTemplateRenderer(handlebars?: HandlebarsInstance): Promise<AnkiTemplateRenderer>;
|
|
847
|
+
declare function getDefaultAnkiFieldTemplates(dynamicTemplates?: string): string;
|
|
848
|
+
declare function buildAnkiNoteFromDictionaryEntry(input: BuildAnkiNoteFromDictionaryEntryInput, handlebars?: HandlebarsInstance): Promise<CreateNoteResult>;
|
|
849
|
+
declare function buildAnkiNoteFromTerm(input: Omit<BuildAnkiNoteFromDictionaryEntryInput, 'dictionaryEntry' | 'template'> & {
|
|
850
|
+
entries: DictionaryEntry[];
|
|
851
|
+
dictionaries?: DictionaryMarkerSource[];
|
|
852
|
+
dictionaryInfo?: Summary[];
|
|
853
|
+
template?: string;
|
|
854
|
+
}, handlebars?: HandlebarsInstance): Promise<BuildAnkiNoteFromTermResult>;
|
|
855
|
+
|
|
856
|
+
//#endregion
|
|
857
|
+
//# sourceMappingURL=anki-note-service.d.ts.map
|
|
858
|
+
|
|
859
|
+
export { AnkiCardFormat, AnkiDictionaryEntry, AnkiDuplicateScope, AnkiKanjiDictionaryEntry, AnkiNoteBuilder as AnkiNoteBuilder$1, AnkiOptions, AnkiTemplateRenderer as AnkiTemplateRenderer$1, AnkiTermDictionaryEntry, ApiReflectResult, AudioOptions, AudioSourceOptions, BuildAnkiNoteFromDictionaryEntryInput, BuildAnkiNoteFromTermResult, CanAddNotesDetail, CardId, CardInfo, Cloze, CommonData, CompositeRenderData, Context, CreateNoteDetails, CreateNoteResult, DataType, DeferredPromiseDetails, DictionaryMarkerSource, DictionaryMedia, EventArgument, EventDispatcherOffGeneric, EventHandler, EventHandlerAny, EventNames, EventSurface, FrequencyNumber, FuriganaSegment, GeneralOptions, GlossaryLayoutMode, HandlebarsInstance, HelperFunction, HelperOptions, InjectAnkiNoteMediaDefinitionDetails, KanjiFrequencyEntry, KanjiStat, KanjiStatGroups, Media, MediaObject, MediaOptions, MessageBody, MinimalApi, Note, NoteData, NoteData$1, NoteFieldInfo, NoteFields, NoteId, NoteInfo, NoteInfoWrapper, NoteWithId, PartialRenderData, Pitch, PitchGroup, PitchTag, ProfileOptions, PublicContext, RejectionReason, RenderMultiItem, RenderMultiItem$1, RenderMultiResponse, RenderMultiResponse$1, RenderResult, RenderResult$1, Requirement, ResultOutputMode, SafeAny, SerializableObject, SerializedError, Tag$1 as Tag, TemplateRenderer, TermDefinition, TermDictionaryEntryType, TermFrequencyEntry, TermHeadword, TermPhoneticTranscription, TermPitchAccent, TextFuriganaReadingMode, TextFuriganaSegment, Timeout, TokenObject, TokenString, Transcription, TranscriptionGroup, TranslationOptions, TypeofResult, UnknownObject, buildAnkiNoteFromDictionaryEntry as buildAnkiNoteFromDictionaryEntry$1, buildAnkiNoteFromTerm as buildAnkiNoteFromTerm$1, createAnkiNoteData as createAnkiNoteData$1, createCachedValue as createCachedValue$1, createDefaultAnkiTemplateRenderer as createDefaultAnkiTemplateRenderer$1, getCachedValue as getCachedValue$1, getDefaultAnkiFieldTemplates as getDefaultAnkiFieldTemplates$1, getDynamicFieldMarkers as getDynamicFieldMarkers$1, getDynamicTemplates as getDynamicTemplates$1, getFrequencyHarmonic as getFrequencyHarmonic$1, getKebabCase as getKebabCase$1, getStandardFieldMarkers as getStandardFieldMarkers$1 };
|
|
860
|
+
//# sourceMappingURL=anki-note-service-BEzTEDPY.d.ts.map
|