yanki 2.0.0 → 2.0.2
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/bin/abap-lNEwo1Fh.js +1 -0
- package/dist/bin/actionscript-3-WtXz7Nc9.js +1 -0
- package/dist/bin/ada-CxieIYPC.js +1 -0
- package/dist/bin/andromeeda-CEVX-4Db.js +1 -0
- package/dist/bin/angular-html-CAOiQ-Sh.js +1 -0
- package/dist/bin/angular-html-qzs4hSq7.js +1 -0
- package/dist/bin/angular-ts-CugMBDjk.js +1 -0
- package/dist/bin/apache-zgaAodRu.js +1 -0
- package/dist/bin/apex-BNA6bSzI.js +1 -0
- package/dist/bin/apl-BOFh_hoE.js +1 -0
- package/dist/bin/applescript-D9ApUiQg.js +1 -0
- package/dist/bin/ara-Xn981wPy.js +1 -0
- package/dist/bin/asciidoc-C90J3qhX.js +1 -0
- package/dist/bin/asm-Cvg1-8xg.js +1 -0
- package/dist/bin/astro-Cm_dHcy3.js +1 -0
- package/dist/bin/aurora-x-BLDZZUdf.js +1 -0
- package/dist/bin/awk-BjDw91sP.js +1 -0
- package/dist/bin/ayu-dark-CV3szcXN.js +1 -0
- package/dist/bin/ayu-light-VFwhcb7b.js +1 -0
- package/dist/bin/ayu-mirage-jd_AuG1F.js +1 -0
- package/dist/bin/ballerina-vBN0WIlg.js +1 -0
- package/dist/bin/bat-C7p6Ubpb.js +1 -0
- package/dist/bin/beancount-zb-3xb6T.js +1 -0
- package/dist/bin/berry-B_fAwMGD.js +1 -0
- package/dist/bin/bibtex-AJFrnpSy.js +1 -0
- package/dist/bin/bicep-ZTMcEuYT.js +1 -0
- package/dist/bin/bird2-_hZ3FStw.js +1 -0
- package/dist/bin/blade-U1S3oe2k.js +1 -0
- package/dist/bin/bsl-0ORkkYmh.js +1 -0
- package/dist/bin/c-CdETmdiZ.js +1 -0
- package/dist/bin/c-DIXYfOSP.js +1 -0
- package/dist/bin/c3-CF_7Rl_o.js +1 -0
- package/dist/bin/cadence-BoKQX0Lv.js +1 -0
- package/dist/bin/cairo-kiUMtAsX.js +1 -0
- package/dist/bin/catppuccin-frappe-CHSjY7K5.js +1 -0
- package/dist/bin/catppuccin-latte-BIei23jc.js +1 -0
- package/dist/bin/catppuccin-macchiato-stEzqrNw.js +1 -0
- package/dist/bin/catppuccin-mocha-Csibodaz.js +1 -0
- package/dist/bin/clarity-CF2X0I3d.js +1 -0
- package/dist/bin/cli.js +309 -22
- package/dist/bin/clojure-D4EmLgj3.js +1 -0
- package/dist/bin/cmake-BADnWbaq.js +1 -0
- package/dist/bin/cmake-D8YNkuR-.js +1 -0
- package/dist/bin/cobol-0fKuGiZv.js +1 -0
- package/dist/bin/codeowners-CKcVmpS-.js +1 -0
- package/dist/bin/codeql-aBgygx2C.js +1 -0
- package/dist/bin/coffee-7hoZPzSj.js +1 -0
- package/dist/bin/common-lisp-C0AzPNil.js +1 -0
- package/dist/bin/coq-FNCdvNHe.js +1 -0
- package/dist/bin/cpp-5C3nn41J.js +1 -0
- package/dist/bin/cpp-gdwUInvu.js +1 -0
- package/dist/bin/crystal-Cc66vuxC.js +1 -0
- package/dist/bin/csharp-2Bjq_Rxi.js +1 -0
- package/dist/bin/csharp-CIll8D6u.js +1 -0
- package/dist/bin/css-C-sfFA03.js +1 -0
- package/dist/bin/css-CWs_acR3.js +1 -0
- package/dist/bin/csv-BU_TMxAS.js +1 -0
- package/dist/bin/csv-DxS-HYUf.js +1 -0
- package/dist/bin/cue-DV_1hEYT.js +1 -0
- package/dist/bin/cypher-DrvyYDIr.js +1 -0
- package/dist/bin/d-Dly9ufdX.js +1 -0
- package/dist/bin/dark-plus-B42qAV4C.js +1 -0
- package/dist/bin/dart-C2ROqx0Z.js +1 -0
- package/dist/bin/dax-vDoOL-fx.js +1 -0
- package/dist/bin/desktop-DoZVZZ4h.js +1 -0
- package/dist/bin/diff-By4RszRJ.js +1 -0
- package/dist/bin/diff-DP2jXnqp.js +1 -0
- package/dist/bin/docker-Bp8c7Dqi.js +1 -0
- package/dist/bin/dotenv-CEJeNbhS.js +1 -0
- package/dist/bin/dracula-DmN2zRHi.js +1 -0
- package/dist/bin/dracula-soft-CMTkd8vI.js +1 -0
- package/dist/bin/dream-maker-D3zsoW7J.js +1 -0
- package/dist/bin/edge-DetFnTa9.js +1 -0
- package/dist/bin/elixir-CrM98V7h.js +1 -0
- package/dist/bin/elm-CD-7RX5d.js +1 -0
- package/dist/bin/emacs-lisp-Cj_Ixk9i.js +1 -0
- package/dist/bin/erb-KO-P0SR0.js +1 -0
- package/dist/bin/erlang-BFKCgnPw.js +1 -0
- package/dist/bin/everforest-dark-C1ZUi0Ki.js +1 -0
- package/dist/bin/everforest-light-BiIEIFyN.js +1 -0
- package/dist/bin/fennel-DAD8VWfy.js +1 -0
- package/dist/bin/fish-G6fwZxok.js +1 -0
- package/dist/bin/fluent-BOBTNP2g.js +1 -0
- package/dist/bin/fortran-fixed-form-t-oisds5.js +1 -0
- package/dist/bin/fortran-free-form-By4p5LLA.js +1 -0
- package/dist/bin/fortran-free-form-C3X_sfp9.js +1 -0
- package/dist/bin/fsharp-Dq5iPDb2.js +1 -0
- package/dist/bin/gdresource-BNzPbQHR.js +1 -0
- package/dist/bin/gdscript-DF4DHgCD.js +1 -0
- package/dist/bin/gdscript-bYJURCOy.js +1 -0
- package/dist/bin/gdshader-BPirqxsQ.js +1 -0
- package/dist/bin/gdshader-KOuf2xVk.js +1 -0
- package/dist/bin/genie-DHT45pJu.js +1 -0
- package/dist/bin/gherkin-BOftJ3Qu.js +1 -0
- package/dist/bin/git-commit-Bkc1RnxN.js +1 -0
- package/dist/bin/git-rebase-BfAeU5XI.js +1 -0
- package/dist/bin/github-dark-Dhlw38v_.js +1 -0
- package/dist/bin/github-dark-default-ChurEZVr.js +1 -0
- package/dist/bin/github-dark-dimmed-Bg8moaOR.js +1 -0
- package/dist/bin/github-dark-high-contrast-BuMAw1v5.js +1 -0
- package/dist/bin/github-light-DUFhx0nQ.js +1 -0
- package/dist/bin/github-light-default-DhNuYLfL.js +1 -0
- package/dist/bin/github-light-high-contrast-VDpphmUr.js +1 -0
- package/dist/bin/gleam-BQORp6Ww.js +1 -0
- package/dist/bin/glimmer-js-BZd4ZfVU.js +1 -0
- package/dist/bin/glimmer-ts-UFNn11p7.js +1 -0
- package/dist/bin/glsl-DFAnV4bR.js +1 -0
- package/dist/bin/glsl-r9XJn22U.js +1 -0
- package/dist/bin/gn-BUvkHyO2.js +1 -0
- package/dist/bin/gnuplot-BiNqzIdJ.js +1 -0
- package/dist/bin/go-GcrXPybz.js +1 -0
- package/dist/bin/go-b5i9ZOwA.js +1 -0
- package/dist/bin/graphql-AasBDd3n.js +1 -0
- package/dist/bin/graphql-J1xs8wG6.js +1 -0
- package/dist/bin/groovy-DZM0Oins.js +1 -0
- package/dist/bin/gruvbox-dark-hard-B0-6V_Sa.js +1 -0
- package/dist/bin/gruvbox-dark-medium-B2kDYkf7.js +1 -0
- package/dist/bin/gruvbox-dark-soft-D80qdOIx.js +1 -0
- package/dist/bin/gruvbox-light-hard-np83Fhw4.js +1 -0
- package/dist/bin/gruvbox-light-medium--BtU_nk6.js +1 -0
- package/dist/bin/gruvbox-light-soft-BQQJZmHA.js +1 -0
- package/dist/bin/hack-DTChbFem.js +1 -0
- package/dist/bin/haml-Dz37fDMr.js +1 -0
- package/dist/bin/haml-lACpmly2.js +1 -0
- package/dist/bin/handlebars-B7ppocUa.js +1 -0
- package/dist/bin/haskell-ChFomDou.js +1 -0
- package/dist/bin/haxe-B4EsxHyL.js +1 -0
- package/dist/bin/haxe-Bgb4tX8C.js +1 -0
- package/dist/bin/hcl-B_oQREVc.js +1 -0
- package/dist/bin/hjson-B6rsoOCm.js +1 -0
- package/dist/bin/hlsl-CxhYg9sd.js +1 -0
- package/dist/bin/hlsl-Dzk9GcSJ.js +1 -0
- package/dist/bin/horizon-DC2iZgoY.js +1 -0
- package/dist/bin/horizon-bright-yXhu6egb.js +1 -0
- package/dist/bin/houston-CAkU4Xzv.js +1 -0
- package/dist/bin/html-Crjq5rc3.js +1 -0
- package/dist/bin/html-JSn89dCS.js +1 -0
- package/dist/bin/html-derivative-CsguVNJC.js +1 -0
- package/dist/bin/html-derivative-DhivRM2V.js +1 -0
- package/dist/bin/http-CfCri10f.js +1 -0
- package/dist/bin/hurl-C4sIrBP8.js +1 -0
- package/dist/bin/hxml-BY0JJAFc.js +1 -0
- package/dist/bin/hy-BzSjeCAF.js +1 -0
- package/dist/bin/imba-BCVM_gFu.js +1 -0
- package/dist/bin/ini-CK7-QP3O.js +1 -0
- package/dist/bin/java-BGzTmoXK.js +1 -0
- package/dist/bin/java-Dgsz0B-P.js +1 -0
- package/dist/bin/javascript-BNwJ9fBE.js +1 -0
- package/dist/bin/javascript-DTXNtrg0.js +1 -0
- package/dist/bin/jinja-D4pZPcl3.js +1 -0
- package/dist/bin/jison-CU_JndNM.js +1 -0
- package/dist/bin/json-BadQRMks.js +1 -0
- package/dist/bin/json-Dttibclf.js +1 -0
- package/dist/bin/json5-D-uNcxgL.js +1 -0
- package/dist/bin/jsonc-Mhn2hM5D.js +1 -0
- package/dist/bin/jsonl-DEwECwXy.js +1 -0
- package/dist/bin/jsonnet-aP9lctbz.js +1 -0
- package/dist/bin/jssm-Bzk9BSR5.js +1 -0
- package/dist/bin/jsx-CoE327E5.js +1 -0
- package/dist/bin/jsx-YopGa7XH.js +1 -0
- package/dist/bin/julia-DjiOTm9M.js +1 -0
- package/dist/bin/just-oDTZGZbN.js +1 -0
- package/dist/bin/kanagawa-dragon-DRuqSBxu.js +1 -0
- package/dist/bin/kanagawa-lotus-DFk8eUao.js +1 -0
- package/dist/bin/kanagawa-wave-wqQYYPW0.js +1 -0
- package/dist/bin/kdl-BBdrnnFN.js +1 -0
- package/dist/bin/kotlin-BOAeJ3Zn.js +1 -0
- package/dist/bin/kusto-D9rJ_wbq.js +1 -0
- package/dist/bin/laserwave-po4bDaOp.js +1 -0
- package/dist/bin/latex-B8d5LcJ8.js +1 -0
- package/dist/bin/lean--6SzPv5H.js +1 -0
- package/dist/bin/less-BrjQyxTC.js +1 -0
- package/dist/bin/less-DRwZNTsh.js +1 -0
- package/dist/bin/light-plus-B1SMNL2F.js +1 -0
- package/dist/bin/liquid-DuGPT5mZ.js +1 -0
- package/dist/bin/llvm-7RtiJHjj.js +1 -0
- package/dist/bin/log-KNtIq3vN.js +1 -0
- package/dist/bin/logo-BhWYf_9m.js +1 -0
- package/dist/bin/lua-BTFYnP6K.js +1 -0
- package/dist/bin/lua-mUj-7rV8.js +1 -0
- package/dist/bin/luau-CmcVV_DK.js +1 -0
- package/dist/bin/make-Df5gTOt9.js +1 -0
- package/dist/bin/markdown-BtUDO16i.js +1 -0
- package/dist/bin/markdown-dl1m7YAL.js +1 -0
- package/dist/bin/marko-CEM61Zib.js +1 -0
- package/dist/bin/material-theme-BhPjDEOe.js +1 -0
- package/dist/bin/material-theme-darker-LB0WiHs5.js +1 -0
- package/dist/bin/material-theme-lighter-b9Tsrc9R.js +1 -0
- package/dist/bin/material-theme-ocean-B1e0t2_i.js +1 -0
- package/dist/bin/material-theme-palenight-1CdY1ykl.js +1 -0
- package/dist/bin/matlab-Qa9-GHKp.js +1 -0
- package/dist/bin/mdc-Dya9Bdmr.js +1 -0
- package/dist/bin/mdx-DrGeQtwF.js +1 -0
- package/dist/bin/mermaid-CcPTwP9f.js +1 -0
- package/dist/bin/min-dark-Dujx5q9i.js +1 -0
- package/dist/bin/min-light-wZS1kyfV.js +1 -0
- package/dist/bin/mipsasm-BfvsshAY.js +1 -0
- package/dist/bin/mojo-C2BYzC14.js +1 -0
- package/dist/bin/monokai-w9z2AnJS.js +1 -0
- package/dist/bin/moonbit-DjpzDFB5.js +1 -0
- package/dist/bin/move-Bxr9ef96.js +1 -0
- package/dist/bin/narrat-DcRshums.js +1 -0
- package/dist/bin/nextflow-groovy-COoKx28o.js +1 -0
- package/dist/bin/nextflow-groovy-CpiNfI-c.js +1 -0
- package/dist/bin/nextflow-hLaJXrFj.js +1 -0
- package/dist/bin/nginx-CR6uKwZy.js +1 -0
- package/dist/bin/night-owl-CplppJJB.js +1 -0
- package/dist/bin/night-owl-light-BpOQXyuL.js +1 -0
- package/dist/bin/nim-DceKa9Nn.js +1 -0
- package/dist/bin/nix-CtTYb1HK.js +1 -0
- package/dist/bin/nord-hoPJ5Dy3.js +1 -0
- package/dist/bin/nushell-Cn3fXdgH.js +1 -0
- package/dist/bin/objective-c-BkduaOlQ.js +1 -0
- package/dist/bin/objective-cpp-Cn2j-b6G.js +1 -0
- package/dist/bin/ocaml-DqvuWcoq.js +1 -0
- package/dist/bin/odin-D7ha6-Ni.js +1 -0
- package/dist/bin/one-dark-pro-eMAAhFAk.js +1 -0
- package/dist/bin/one-light-CSbFTW4a.js +1 -0
- package/dist/bin/open-8AenGr4K.js +2 -0
- package/dist/bin/openscad-Dy0BqjE1.js +1 -0
- package/dist/bin/pascal-HLRSlJ2v.js +1 -0
- package/dist/bin/perl-B-LgtJc7.js +1 -0
- package/dist/bin/perl-B6GAvvHF.js +1 -0
- package/dist/bin/php-BAXKJjQn.js +1 -0
- package/dist/bin/php-D9zsHNF7.js +1 -0
- package/dist/bin/pkl-D0LsOQD5.js +1 -0
- package/dist/bin/plastic-DH0ROn14.js +1 -0
- package/dist/bin/plsql-Ckotkn8G.js +1 -0
- package/dist/bin/po-Qix2N2fA.js +1 -0
- package/dist/bin/poimandres-HErFvNSF.js +1 -0
- package/dist/bin/polar-DHAM8Rqb.js +1 -0
- package/dist/bin/postcss-D_yqFB4d.js +1 -0
- package/dist/bin/postcss-hgbxLNuF.js +1 -0
- package/dist/bin/powerquery-sXjCytsm.js +1 -0
- package/dist/bin/powershell-Br9y9LlC.js +1 -0
- package/dist/bin/prisma-COBUUaqE.js +1 -0
- package/dist/bin/prolog-BbJTvtA-.js +1 -0
- package/dist/bin/proto-DiR3FLO1.js +1 -0
- package/dist/bin/pug-F80Qp1DF.js +1 -0
- package/dist/bin/puppet-CNdK406T.js +1 -0
- package/dist/bin/purescript-Cgw06S43.js +1 -0
- package/dist/bin/python-BLuJ3b5I.js +1 -0
- package/dist/bin/python-DRu0B6X_.js +1 -0
- package/dist/bin/qml-Brw1WH4u.js +1 -0
- package/dist/bin/qmldir-tOWyMniz.js +1 -0
- package/dist/bin/qss-CQ_tB_vx.js +1 -0
- package/dist/bin/r-1QWtk6BQ.js +1 -0
- package/dist/bin/r-CeXuGenk.js +1 -0
- package/dist/bin/racket-xM_JlWdJ.js +1 -0
- package/dist/bin/raku-CsjbV0q-.js +1 -0
- package/dist/bin/razor-DKKN_syA.js +1 -0
- package/dist/bin/red-2s42RJtx.js +1 -0
- package/dist/bin/reg-CDO-JwKW.js +1 -0
- package/dist/bin/regexp-Aby82bH7.js +1 -0
- package/dist/bin/regexp-WPJh6EdZ.js +1 -0
- package/dist/bin/rel-Lnk3efq_.js +1 -0
- package/dist/bin/riscv-B6rT4cSG.js +1 -0
- package/dist/bin/ron-BiBOkEWn.js +1 -0
- package/dist/bin/rose-pine-CxwcSun-.js +1 -0
- package/dist/bin/rose-pine-dawn-DkCSMZNl.js +1 -0
- package/dist/bin/rose-pine-moon-CRcpU7ID.js +1 -0
- package/dist/bin/rosmsg-_EpaFX4E.js +1 -0
- package/dist/bin/rst-BHI_EFqA.js +1 -0
- package/dist/bin/ruby-DME9-fO-.js +1 -0
- package/dist/bin/ruby-Go_q6-3o.js +1 -0
- package/dist/bin/rust-Dzeg0wAa.js +1 -0
- package/dist/bin/sas-Dx90SbnG.js +1 -0
- package/dist/bin/sass-CfSmloHa.js +1 -0
- package/dist/bin/scala-BzM4CFnq.js +1 -0
- package/dist/bin/scheme-BqJLyHNb.js +1 -0
- package/dist/bin/scss-ByAjeRJP.js +1 -0
- package/dist/bin/scss-D8wnyi0z.js +1 -0
- package/dist/bin/sdbl-CSGqAXn4.js +1 -0
- package/dist/bin/sdbl-CVVKgb7O.js +1 -0
- package/dist/bin/shaderlab-8CiQ7btM.js +1 -0
- package/dist/bin/shellscript-CED9H1ao.js +1 -0
- package/dist/bin/shellscript-DhB4mnQ-.js +1 -0
- package/dist/bin/shellsession-xr72W2pP.js +1 -0
- package/dist/bin/slack-dark-BLjlSbC0.js +1 -0
- package/dist/bin/slack-ochin-BeSJq7AY.js +1 -0
- package/dist/bin/smalltalk-DrKePzpE.js +1 -0
- package/dist/bin/snazzy-light-hGizAcbG.js +1 -0
- package/dist/bin/solarized-dark-B47oUJnZ.js +1 -0
- package/dist/bin/solarized-light-COfgMzjY.js +1 -0
- package/dist/bin/solidity-93cGmCAT.js +1 -0
- package/dist/bin/soy-Cy2jSWuh.js +1 -0
- package/dist/bin/sparql-Bq74Yvwh.js +1 -0
- package/dist/bin/splunk-C1Hlgf0c.js +1 -0
- package/dist/bin/sql-BfsqdN68.js +1 -0
- package/dist/bin/sql-CWYhyc-w.js +1 -0
- package/dist/bin/ssh-config-mSCJO_Nw.js +1 -0
- package/dist/bin/stata-DawaFFYJ.js +1 -0
- package/dist/bin/stylus-CtR9dQIO.js +1 -0
- package/dist/bin/stylus-Dxd5rS5f.js +1 -0
- package/dist/bin/surrealql-B1iahgCh.js +1 -0
- package/dist/bin/svelte-CHomAVJT.js +1 -0
- package/dist/bin/swift-CmhdkGbJ.js +1 -0
- package/dist/bin/synthwave-84-C8lHUQgz.js +1 -0
- package/dist/bin/system-verilog-C5NPuZ4w.js +1 -0
- package/dist/bin/systemd-DWf13jtC.js +1 -0
- package/dist/bin/talonscript-BHUwvink.js +1 -0
- package/dist/bin/tasl-BqepUa6R.js +1 -0
- package/dist/bin/tcl-Cq_3s_LD.js +1 -0
- package/dist/bin/templ-BRBP2pJf.js +1 -0
- package/dist/bin/terraform-CJUb39F2.js +1 -0
- package/dist/bin/tex-5doNg0Ig.js +1 -0
- package/dist/bin/tex-BLh5zE4g.js +1 -0
- package/dist/bin/tokyo-night-DToTZO1M.js +1 -0
- package/dist/bin/toml-CcAy-xez.js +1 -0
- package/dist/bin/ts-tags-C0IwWXwE.js +1 -0
- package/dist/bin/tsv-2LD76W9Y.js +1 -0
- package/dist/bin/tsx-BMmbqG-q.js +1 -0
- package/dist/bin/tsx-BTd5Sf56.js +1 -0
- package/dist/bin/turtle-BFrhIdAM.js +1 -0
- package/dist/bin/turtle-D-xcuGf_.js +1 -0
- package/dist/bin/twig-D5Nfm9La.js +1 -0
- package/dist/bin/typescript-CPs8nV3S.js +1 -0
- package/dist/bin/typescript-DcBfMx29.js +1 -0
- package/dist/bin/typespec-CJG5em1O.js +1 -0
- package/dist/bin/typst-CdguKrlh.js +1 -0
- package/dist/bin/v-VnqxfSIy.js +1 -0
- package/dist/bin/vala-CPlxddOG.js +1 -0
- package/dist/bin/vb-Do7lrS7D.js +1 -0
- package/dist/bin/verilog-OGZUphCy.js +1 -0
- package/dist/bin/vesper-D6bcMq-9.js +1 -0
- package/dist/bin/vhdl-vQqxP3uc.js +1 -0
- package/dist/bin/viml-CRzBk174.js +1 -0
- package/dist/bin/vitesse-black-DZPzP4WR.js +1 -0
- package/dist/bin/vitesse-dark-Dn_i46a6.js +1 -0
- package/dist/bin/vitesse-light-BYktrL59.js +1 -0
- package/dist/bin/vue-html-D7v7uXO6.js +1 -0
- package/dist/bin/vue-vine-lH9fGYq_.js +1 -0
- package/dist/bin/vue-zYUVH6uJ.js +1 -0
- package/dist/bin/vyper-CxG5w_hf.js +1 -0
- package/dist/bin/wasm-C2OXzu0D.js +1 -0
- package/dist/bin/wasm-DfcgBtd_.js +1 -0
- package/dist/bin/wenyan-CeYhWKkN.js +1 -0
- package/dist/bin/wgsl-gGAb2oSq.js +1 -0
- package/dist/bin/wikitext-BNkXva03.js +1 -0
- package/dist/bin/wit-snpmR1aT.js +1 -0
- package/dist/bin/wolfram-BUWAXgpt.js +1 -0
- package/dist/bin/xml-CCj7o04Q.js +1 -0
- package/dist/bin/xml-CGrMwkeu.js +1 -0
- package/dist/bin/xsl-C-lr_lSi.js +1 -0
- package/dist/bin/yaml-Brl8JesV.js +1 -0
- package/dist/bin/yaml-Dg2Msz_B.js +1 -0
- package/dist/bin/zenscript-DAB1FI6O.js +1 -0
- package/dist/bin/zig-DZTxXyCC.js +1 -0
- package/dist/lib/index.d.ts +1 -1
- package/dist/lib/index.js +2911 -30
- package/dist/standalone/abap-lNEwo1Fh.js +1 -0
- package/dist/standalone/actionscript-3-WtXz7Nc9.js +1 -0
- package/dist/standalone/ada-CxieIYPC.js +1 -0
- package/dist/standalone/andromeeda-BylpTWnC.js +1 -0
- package/dist/standalone/angular-html-BDfh9ICS.js +1 -0
- package/dist/standalone/angular-ts-WiBasIpj.js +1 -0
- package/dist/standalone/apache-zgaAodRu.js +1 -0
- package/dist/standalone/apex-BNA6bSzI.js +1 -0
- package/dist/standalone/apl-B3nAIz3U.js +1 -0
- package/dist/standalone/applescript-D9ApUiQg.js +1 -0
- package/dist/standalone/ara-Xn981wPy.js +1 -0
- package/dist/standalone/asciidoc-C90J3qhX.js +1 -0
- package/dist/standalone/asm-Cvg1-8xg.js +1 -0
- package/dist/standalone/astro-C0A5Ee0R.js +1 -0
- package/dist/standalone/aurora-x-z2QLMo08.js +1 -0
- package/dist/standalone/awk-L1WqJyjl.js +1 -0
- package/dist/standalone/ayu-dark-DFAYKmY8.js +1 -0
- package/dist/standalone/ayu-light-ChPCIrww.js +1 -0
- package/dist/standalone/ayu-mirage-Be8UDvXu.js +1 -0
- package/dist/standalone/ballerina-DOw61Yuq.js +1 -0
- package/dist/standalone/bat-BJGaXoOz.js +1 -0
- package/dist/standalone/beancount-Cu6FxzuA.js +1 -0
- package/dist/standalone/berry-DiPZpURY.js +1 -0
- package/dist/standalone/bibtex-Dp74FGRo.js +1 -0
- package/dist/standalone/bicep-BwSAodHP.js +1 -0
- package/dist/standalone/bird2-B05GFxQw.js +1 -0
- package/dist/standalone/blade-Bh52-e5e.js +1 -0
- package/dist/standalone/bsl-DrHuh5kR.js +1 -0
- package/dist/standalone/c-C-hboKX2.js +1 -0
- package/dist/standalone/c3-BS3NJrFe.js +1 -0
- package/dist/standalone/cadence-DKUaB06W.js +1 -0
- package/dist/standalone/cairo-D055eoAu.js +1 -0
- package/dist/standalone/catppuccin-frappe-Dq9QR7eZ.js +1 -0
- package/dist/standalone/catppuccin-latte-yUwHFQst.js +1 -0
- package/dist/standalone/catppuccin-macchiato-KYmbHQyq.js +1 -0
- package/dist/standalone/catppuccin-mocha-DFrUhns1.js +1 -0
- package/dist/standalone/clarity-DKB_EYUy.js +1 -0
- package/dist/standalone/clojure-D7D2Zxsu.js +1 -0
- package/dist/standalone/cmake-Bju7ahwU.js +1 -0
- package/dist/standalone/cobol-C9xdim3W.js +1 -0
- package/dist/standalone/codeowners-Di1OvpcW.js +1 -0
- package/dist/standalone/codeql-KhL_IfCA.js +1 -0
- package/dist/standalone/coffee-CWthmHqg.js +1 -0
- package/dist/standalone/common-lisp-DL0ShAR3.js +1 -0
- package/dist/standalone/coq-YuXzTVD8.js +1 -0
- package/dist/standalone/cpp-BP_mYM2q.js +1 -0
- package/dist/standalone/crystal-BP8Y_JHu.js +1 -0
- package/dist/standalone/csharp-X4m7dqIW.js +1 -0
- package/dist/standalone/css-DZpGhzjZ.js +1 -0
- package/dist/standalone/csv-D_FJD-_L.js +1 -0
- package/dist/standalone/cue-Brrvnugl.js +1 -0
- package/dist/standalone/cypher-CieA2-Ow.js +1 -0
- package/dist/standalone/d-BeWU-E1F.js +1 -0
- package/dist/standalone/dark-plus-t8phC8vs.js +1 -0
- package/dist/standalone/dart-CcoouBGm.js +1 -0
- package/dist/standalone/dax-DZs9015r.js +1 -0
- package/dist/standalone/desktop-Bmf3DIqD.js +1 -0
- package/dist/standalone/diff-M4XuV4o4.js +1 -0
- package/dist/standalone/docker-Bf7rtiym.js +1 -0
- package/dist/standalone/dotenv-BwfGDw9z.js +1 -0
- package/dist/standalone/dracula-__iKjS5Q.js +1 -0
- package/dist/standalone/dracula-soft-Cn3YGlZ1.js +1 -0
- package/dist/standalone/dream-maker-BOxs3X-U.js +1 -0
- package/dist/standalone/edge-C7ZV1b67.js +1 -0
- package/dist/standalone/elixir-DaqZx2n-.js +1 -0
- package/dist/standalone/elm-Dop4RWjQ.js +1 -0
- package/dist/standalone/emacs-lisp-C1K9lKmb.js +1 -0
- package/dist/standalone/erb-CYhomfpC.js +1 -0
- package/dist/standalone/erlang-DX8GMz3W.js +1 -0
- package/dist/standalone/everforest-dark-CG-xS58q.js +1 -0
- package/dist/standalone/everforest-light-VnlgGH1r.js +1 -0
- package/dist/standalone/fennel-Bkp2zi6e.js +1 -0
- package/dist/standalone/fish-BSydEoPu.js +1 -0
- package/dist/standalone/fluent-CdeSNonp.js +1 -0
- package/dist/standalone/fortran-fixed-form-Q6JIc71r.js +1 -0
- package/dist/standalone/fortran-free-form-uMmrusbk.js +1 -0
- package/dist/standalone/fsharp-BNMUC2iW.js +1 -0
- package/dist/standalone/gdresource-BlhCtIAh.js +1 -0
- package/dist/standalone/gdscript-CjXE_VF4.js +1 -0
- package/dist/standalone/gdshader-D3GnIQMO.js +1 -0
- package/dist/standalone/genie-DjRp0HIF.js +1 -0
- package/dist/standalone/gherkin-CO-9Xf3O.js +1 -0
- package/dist/standalone/git-commit-BmPljjxo.js +1 -0
- package/dist/standalone/git-rebase-DVpnhtFe.js +1 -0
- package/dist/standalone/github-dark-DW2tvKKC.js +1 -0
- package/dist/standalone/github-dark-default-ChsP8enW.js +1 -0
- package/dist/standalone/github-dark-dimmed-DbObBUjn.js +1 -0
- package/dist/standalone/github-dark-high-contrast-DGQlFkmA.js +1 -0
- package/dist/standalone/github-light-JgN_--pJ.js +1 -0
- package/dist/standalone/github-light-default-Dyse0wyU.js +1 -0
- package/dist/standalone/github-light-high-contrast-CeZ5HGZn.js +1 -0
- package/dist/standalone/gleam-BIhdqQ3b.js +1 -0
- package/dist/standalone/glimmer-js-BxvF_2QK.js +1 -0
- package/dist/standalone/glimmer-ts-AM8hgR0M.js +1 -0
- package/dist/standalone/glsl-CeERM8Pu.js +1 -0
- package/dist/standalone/gn--jXLY5_N.js +1 -0
- package/dist/standalone/gnuplot-Bxet1c3v.js +1 -0
- package/dist/standalone/go-s39PxAzr.js +1 -0
- package/dist/standalone/graphql-B_NxG4GM.js +1 -0
- package/dist/standalone/groovy-CzT_Iae7.js +1 -0
- package/dist/standalone/gruvbox-dark-hard-C1uR-pvB.js +1 -0
- package/dist/standalone/gruvbox-dark-medium-C_NCtEMg.js +1 -0
- package/dist/standalone/gruvbox-dark-soft-DbASFM7u.js +1 -0
- package/dist/standalone/gruvbox-light-hard-BisBk_cZ.js +1 -0
- package/dist/standalone/gruvbox-light-medium-Cqf5GdYM.js +1 -0
- package/dist/standalone/gruvbox-light-soft-R3xWeYua.js +1 -0
- package/dist/standalone/hack-DOi7Q-_3.js +1 -0
- package/dist/standalone/haml-DqnJGs3l.js +1 -0
- package/dist/standalone/handlebars-BD-GTNyX.js +1 -0
- package/dist/standalone/haskell-BU_KScmc.js +1 -0
- package/dist/standalone/haxe-Dq20ysgQ.js +1 -0
- package/dist/standalone/hcl-C-NSNXCz.js +1 -0
- package/dist/standalone/hjson-C1slXyS7.js +1 -0
- package/dist/standalone/hlsl-nviGPNKF.js +1 -0
- package/dist/standalone/horizon-bright-CHsP19AA.js +1 -0
- package/dist/standalone/horizon-pIEktodb.js +1 -0
- package/dist/standalone/houston-DM-vL-Qy.js +1 -0
- package/dist/standalone/html-Dg4T4CWG.js +1 -0
- package/dist/standalone/html-derivative-Dy01fcFN.js +1 -0
- package/dist/standalone/http-Dcg4Y0LN.js +1 -0
- package/dist/standalone/hurl-DLBSghyU.js +1 -0
- package/dist/standalone/hxml-CkY94ZZG.js +1 -0
- package/dist/standalone/hy-CNbyPkG-.js +1 -0
- package/dist/standalone/imba-C3JgZFAu.js +1 -0
- package/dist/standalone/index.d.ts +1607 -0
- package/dist/standalone/index.js +228 -0
- package/dist/standalone/ini-CnSxfbfK.js +1 -0
- package/dist/standalone/java-CzlXKE3t.js +1 -0
- package/dist/standalone/javascript-FKiEkpOl.js +1 -0
- package/dist/standalone/jinja-rn3l-epj.js +1 -0
- package/dist/standalone/jison-Bb1qcUQw.js +1 -0
- package/dist/standalone/json-E5qb7BD2.js +1 -0
- package/dist/standalone/json5-BlfBFW_Y.js +1 -0
- package/dist/standalone/jsonc-BRJexVfP.js +1 -0
- package/dist/standalone/jsonl-D859SsoH.js +1 -0
- package/dist/standalone/jsonnet-sFIVPoTa.js +1 -0
- package/dist/standalone/jssm-BKvxMEP9.js +1 -0
- package/dist/standalone/jsx-D6UqkuWx.js +1 -0
- package/dist/standalone/julia-Bf0YFlEW.js +1 -0
- package/dist/standalone/just-CgnMO4TC.js +1 -0
- package/dist/standalone/kanagawa-dragon-BVeOdnTJ.js +1 -0
- package/dist/standalone/kanagawa-lotus-BPxif4UL.js +1 -0
- package/dist/standalone/kanagawa-wave-yTBcVIG8.js +1 -0
- package/dist/standalone/kdl-DHueRo8f.js +1 -0
- package/dist/standalone/kotlin-Dq1wwHQP.js +1 -0
- package/dist/standalone/kusto-SD8_YGH-.js +1 -0
- package/dist/standalone/laserwave-x5LKCxGn.js +1 -0
- package/dist/standalone/latex-CHYOx8yi.js +1 -0
- package/dist/standalone/lean-xWP4NbYS.js +1 -0
- package/dist/standalone/less-To8q_Luw.js +1 -0
- package/dist/standalone/light-plus-B9N5DQI_.js +1 -0
- package/dist/standalone/liquid-BTKRZY_L.js +1 -0
- package/dist/standalone/llvm-DSlzjbDz.js +1 -0
- package/dist/standalone/log-BUZNzUKc.js +1 -0
- package/dist/standalone/logo-Cdvy4UIe.js +1 -0
- package/dist/standalone/lua-RcKjZiH7.js +1 -0
- package/dist/standalone/luau-ChD5_OIQ.js +1 -0
- package/dist/standalone/make-PTqunrmv.js +1 -0
- package/dist/standalone/markdown-tUO1dt9m.js +1 -0
- package/dist/standalone/marko-CLH1Sh4A.js +1 -0
- package/dist/standalone/material-theme-CZJ_pRWf.js +1 -0
- package/dist/standalone/material-theme-darker-NnzT0yiw.js +1 -0
- package/dist/standalone/material-theme-lighter-B-3DgVxS.js +1 -0
- package/dist/standalone/material-theme-ocean-BZZHghfO.js +1 -0
- package/dist/standalone/material-theme-palenight-B9O9JO4H.js +1 -0
- package/dist/standalone/matlab-Co_sDlVB.js +1 -0
- package/dist/standalone/mdc-C1ZFsTbz.js +1 -0
- package/dist/standalone/mdx-B4AGJXox.js +1 -0
- package/dist/standalone/mermaid-4pySd3sl.js +1 -0
- package/dist/standalone/min-dark-DSigFwoh.js +1 -0
- package/dist/standalone/min-light-b8nqGai7.js +1 -0
- package/dist/standalone/mipsasm-DbZprEQm.js +1 -0
- package/dist/standalone/mojo-4kIBaoam.js +1 -0
- package/dist/standalone/monokai-BKSWoNnW.js +1 -0
- package/dist/standalone/moonbit-ZcSH7VpN.js +1 -0
- package/dist/standalone/move-BAMKTWoZ.js +1 -0
- package/dist/standalone/narrat-DYLRa4xG.js +1 -0
- package/dist/standalone/nextflow-CE20fCoX.js +1 -0
- package/dist/standalone/nextflow-groovy-Brjjw2F-.js +1 -0
- package/dist/standalone/nginx-CJQ7hxI6.js +1 -0
- package/dist/standalone/night-owl-BtS72I6-.js +1 -0
- package/dist/standalone/night-owl-light-fbFrWwTF.js +1 -0
- package/dist/standalone/nim-Czafvbe4.js +1 -0
- package/dist/standalone/nix-DlQjHQ1N.js +1 -0
- package/dist/standalone/nord-Kzx5CafP.js +1 -0
- package/dist/standalone/nushell-B04C_1w9.js +1 -0
- package/dist/standalone/objective-c-DO0dC44X.js +1 -0
- package/dist/standalone/objective-cpp-C6jZz_vb.js +1 -0
- package/dist/standalone/ocaml-D9wp3EJd.js +1 -0
- package/dist/standalone/odin-u5wG6Qd6.js +1 -0
- package/dist/standalone/one-dark-pro-x1jnl7Dq.js +1 -0
- package/dist/standalone/one-light-CHHJSb-V.js +1 -0
- package/dist/standalone/open-CGQvvIUq.js +2 -0
- package/dist/standalone/openscad-H5hW1BA6.js +1 -0
- package/dist/standalone/pascal-h7T9h7AG.js +1 -0
- package/dist/standalone/perl-CChoGwxr.js +1 -0
- package/dist/standalone/php-BW6t2_Q8.js +1 -0
- package/dist/standalone/pkl-Bs_8OmWM.js +1 -0
- package/dist/standalone/plastic-MRrPKBd1.js +1 -0
- package/dist/standalone/plsql-BrbZPaQW.js +1 -0
- package/dist/standalone/po-Diz0LmjW.js +1 -0
- package/dist/standalone/poimandres-D3Al1iQC.js +1 -0
- package/dist/standalone/polar-BCwHILUV.js +1 -0
- package/dist/standalone/postcss-D6Lmyt9A.js +1 -0
- package/dist/standalone/powerquery-CQr4BVoo.js +1 -0
- package/dist/standalone/powershell-B6zzL9QO.js +1 -0
- package/dist/standalone/prisma-yySgczME.js +1 -0
- package/dist/standalone/prolog-CZTkGNiW.js +1 -0
- package/dist/standalone/proto-Bu_Nhf7u.js +1 -0
- package/dist/standalone/pug-DJ5mt9QE.js +1 -0
- package/dist/standalone/puppet-CJffH6Q6.js +1 -0
- package/dist/standalone/purescript-CC7chrMM.js +1 -0
- package/dist/standalone/python-C0zrVFze.js +1 -0
- package/dist/standalone/qml-BxVojlB6.js +1 -0
- package/dist/standalone/qmldir-C14XBFWV.js +1 -0
- package/dist/standalone/qss-B5Hlft_e.js +1 -0
- package/dist/standalone/r-BJ2VNcvN.js +1 -0
- package/dist/standalone/racket-BhgskJzI.js +1 -0
- package/dist/standalone/raku-DsquHgLn.js +1 -0
- package/dist/standalone/razor-Dp2BNdgE.js +1 -0
- package/dist/standalone/red-B7RxoP7i.js +1 -0
- package/dist/standalone/reg-Bax0jtzQ.js +1 -0
- package/dist/standalone/regexp-BTh6yLg7.js +1 -0
- package/dist/standalone/rel-BJ9pN2G2.js +1 -0
- package/dist/standalone/riscv-C3I2jhjQ.js +1 -0
- package/dist/standalone/ron-B4yZ2p1h.js +1 -0
- package/dist/standalone/rose-pine-CesGHTut.js +1 -0
- package/dist/standalone/rose-pine-dawn-H7rm9o-e.js +1 -0
- package/dist/standalone/rose-pine-moon-BLFdnJwM.js +1 -0
- package/dist/standalone/rosmsg-xA4_Syxo.js +1 -0
- package/dist/standalone/rst-DL5K0SsC.js +1 -0
- package/dist/standalone/ruby-DuNhMjQX.js +1 -0
- package/dist/standalone/rust-BwguOFUq.js +1 -0
- package/dist/standalone/sas-CgrIRNnH.js +1 -0
- package/dist/standalone/sass-BZyNoloZ.js +1 -0
- package/dist/standalone/scala-CekfPUXd.js +1 -0
- package/dist/standalone/scheme-B2vB2nlX.js +1 -0
- package/dist/standalone/scss-B5Q0dl0C.js +1 -0
- package/dist/standalone/sdbl-B-nwTmgB.js +1 -0
- package/dist/standalone/shaderlab-B3x1KxeX.js +1 -0
- package/dist/standalone/shellscript-BUzexP2h.js +1 -0
- package/dist/standalone/shellsession-iw5paaXf.js +1 -0
- package/dist/standalone/slack-dark-DCR6M5dd.js +1 -0
- package/dist/standalone/slack-ochin-BxQ3FsyT.js +1 -0
- package/dist/standalone/smalltalk-Cy1j24XO.js +1 -0
- package/dist/standalone/snazzy-light-CjEw4xHM.js +1 -0
- package/dist/standalone/solarized-dark-XlQ9gXgZ.js +1 -0
- package/dist/standalone/solarized-light-isNaysOv.js +1 -0
- package/dist/standalone/solidity-C1mh1SRB.js +1 -0
- package/dist/standalone/soy-BExHEi9F.js +1 -0
- package/dist/standalone/sparql-38UvPuKm.js +1 -0
- package/dist/standalone/splunk-oM69IznW.js +1 -0
- package/dist/standalone/sql-CqT9Lw7j.js +1 -0
- package/dist/standalone/ssh-config-B0ZrS7Sv.js +1 -0
- package/dist/standalone/stata-XyxwKkW7.js +1 -0
- package/dist/standalone/stylus-B9JQrvWs.js +1 -0
- package/dist/standalone/surrealql-DeE9iwmm.js +1 -0
- package/dist/standalone/svelte-DbSBwS6o.js +1 -0
- package/dist/standalone/swift-CaafmPxt.js +1 -0
- package/dist/standalone/synthwave-84-BX-qCxDD.js +1 -0
- package/dist/standalone/system-verilog-J8T_iWHG.js +1 -0
- package/dist/standalone/systemd-DVL5CBpd.js +1 -0
- package/dist/standalone/talonscript-JJfmMcGp.js +1 -0
- package/dist/standalone/tasl-B1QiBRw2.js +1 -0
- package/dist/standalone/tcl-CqllcB5H.js +1 -0
- package/dist/standalone/templ-hC3Z5CVs.js +1 -0
- package/dist/standalone/terraform-wW0EQRMO.js +1 -0
- package/dist/standalone/tex-CpSHM71U.js +1 -0
- package/dist/standalone/tokyo-night-D6xJgjfK.js +1 -0
- package/dist/standalone/toml-BHrgvSPm.js +1 -0
- package/dist/standalone/ts-tags-BiWG72vW.js +1 -0
- package/dist/standalone/tsv-D73M_gRj.js +1 -0
- package/dist/standalone/tsx-D6awiul2.js +1 -0
- package/dist/standalone/turtle-C6QRqIYF.js +1 -0
- package/dist/standalone/twig-BGs9c0m6.js +1 -0
- package/dist/standalone/typescript-CWgyaUtY.js +1 -0
- package/dist/standalone/typespec-oIccER07.js +1 -0
- package/dist/standalone/typst-63_R-dcN.js +1 -0
- package/dist/standalone/v-DNh9rpzt.js +1 -0
- package/dist/standalone/vala-yZrEMgbl.js +1 -0
- package/dist/standalone/vb-CWiXLMNc.js +1 -0
- package/dist/standalone/verilog-D_YgnmVW.js +1 -0
- package/dist/standalone/vesper-BoY7BUOC.js +1 -0
- package/dist/standalone/vhdl-CIOMuzRr.js +1 -0
- package/dist/standalone/viml-KvIzNj-z.js +1 -0
- package/dist/standalone/vitesse-black-BC5aDvua.js +1 -0
- package/dist/standalone/vitesse-dark-C_RcLVAX.js +1 -0
- package/dist/standalone/vitesse-light-CbYhMxH_.js +1 -0
- package/dist/standalone/vue-HXXkW9Ol.js +1 -0
- package/dist/standalone/vue-html-DMGAGeUM.js +1 -0
- package/dist/standalone/vue-vine-CumWe8dY.js +1 -0
- package/dist/standalone/vyper-DQ6Iue0m.js +1 -0
- package/dist/standalone/wasm-BVujMf4j.js +1 -0
- package/dist/standalone/wasm-CttxofWT.js +1 -0
- package/dist/standalone/wenyan-sFr85_Wa.js +1 -0
- package/dist/standalone/wgsl-C8sJ4ScM.js +1 -0
- package/dist/standalone/wikitext-BHbI4LrJ.js +1 -0
- package/dist/standalone/wit-BrulQYCT.js +1 -0
- package/dist/standalone/wolfram-CkTHL-YU.js +1 -0
- package/dist/standalone/xml-OYKGlsbQ.js +1 -0
- package/dist/standalone/xsl-B9zh_nzP.js +1 -0
- package/dist/standalone/yaml-C2UdUGt-.js +1 -0
- package/dist/standalone/zenscript-CvnF8pfB.js +1 -0
- package/dist/standalone/zig-DrTOhqiK.js +1 -0
- package/package.json +22 -11
|
@@ -0,0 +1,1607 @@
|
|
|
1
|
+
//#region node_modules/.pnpm/type-fest@5.4.4/node_modules/type-fest/source/primitive.d.ts
|
|
2
|
+
/**
|
|
3
|
+
Matches any [primitive value](https://developer.mozilla.org/en-US/docs/Glossary/Primitive).
|
|
4
|
+
|
|
5
|
+
@category Type
|
|
6
|
+
*/
|
|
7
|
+
type Primitive = null | undefined | string | number | boolean | symbol | bigint;
|
|
8
|
+
//#endregion
|
|
9
|
+
//#region node_modules/.pnpm/type-fest@5.4.4/node_modules/type-fest/source/is-any.d.ts
|
|
10
|
+
/**
|
|
11
|
+
Returns a boolean for whether the given type is `any`.
|
|
12
|
+
|
|
13
|
+
@link https://stackoverflow.com/a/49928360/1490091
|
|
14
|
+
|
|
15
|
+
Useful in type utilities, such as disallowing `any`s to be passed to a function.
|
|
16
|
+
|
|
17
|
+
@example
|
|
18
|
+
```
|
|
19
|
+
import type {IsAny} from 'type-fest';
|
|
20
|
+
|
|
21
|
+
const typedObject = {a: 1, b: 2} as const;
|
|
22
|
+
const anyObject: any = {a: 1, b: 2};
|
|
23
|
+
|
|
24
|
+
function get<O extends (IsAny<O> extends true ? {} : Record<string, number>), K extends keyof O = keyof O>(object: O, key: K) {
|
|
25
|
+
return object[key];
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const typedA = get(typedObject, 'a');
|
|
29
|
+
//=> 1
|
|
30
|
+
|
|
31
|
+
const anyA = get(anyObject, 'a');
|
|
32
|
+
//=> any
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
@category Type Guard
|
|
36
|
+
@category Utilities
|
|
37
|
+
*/
|
|
38
|
+
type IsAny<T> = 0 extends 1 & NoInfer<T> ? true : false;
|
|
39
|
+
//#endregion
|
|
40
|
+
//#region node_modules/.pnpm/type-fest@5.4.4/node_modules/type-fest/source/is-optional-key-of.d.ts
|
|
41
|
+
/**
|
|
42
|
+
Returns a boolean for whether the given key is an optional key of type.
|
|
43
|
+
|
|
44
|
+
This is useful when writing utility types or schema validators that need to differentiate `optional` keys.
|
|
45
|
+
|
|
46
|
+
@example
|
|
47
|
+
```
|
|
48
|
+
import type {IsOptionalKeyOf} from 'type-fest';
|
|
49
|
+
|
|
50
|
+
type User = {
|
|
51
|
+
name: string;
|
|
52
|
+
surname: string;
|
|
53
|
+
|
|
54
|
+
luckyNumber?: number;
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
type Admin = {
|
|
58
|
+
name: string;
|
|
59
|
+
surname?: string;
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
type T1 = IsOptionalKeyOf<User, 'luckyNumber'>;
|
|
63
|
+
//=> true
|
|
64
|
+
|
|
65
|
+
type T2 = IsOptionalKeyOf<User, 'name'>;
|
|
66
|
+
//=> false
|
|
67
|
+
|
|
68
|
+
type T3 = IsOptionalKeyOf<User, 'name' | 'luckyNumber'>;
|
|
69
|
+
//=> boolean
|
|
70
|
+
|
|
71
|
+
type T4 = IsOptionalKeyOf<User | Admin, 'name'>;
|
|
72
|
+
//=> false
|
|
73
|
+
|
|
74
|
+
type T5 = IsOptionalKeyOf<User | Admin, 'surname'>;
|
|
75
|
+
//=> boolean
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
@category Type Guard
|
|
79
|
+
@category Utilities
|
|
80
|
+
*/
|
|
81
|
+
type IsOptionalKeyOf<Type extends object, Key extends keyof Type> = IsAny<Type | Key> extends true ? never : Key extends keyof Type ? Type extends Record<Key, Type[Key]> ? false : true : false;
|
|
82
|
+
//#endregion
|
|
83
|
+
//#region node_modules/.pnpm/type-fest@5.4.4/node_modules/type-fest/source/optional-keys-of.d.ts
|
|
84
|
+
/**
|
|
85
|
+
Extract all optional keys from the given type.
|
|
86
|
+
|
|
87
|
+
This is useful when you want to create a new type that contains different type values for the optional keys only.
|
|
88
|
+
|
|
89
|
+
@example
|
|
90
|
+
```
|
|
91
|
+
import type {OptionalKeysOf, Except} from 'type-fest';
|
|
92
|
+
|
|
93
|
+
type User = {
|
|
94
|
+
name: string;
|
|
95
|
+
surname: string;
|
|
96
|
+
|
|
97
|
+
luckyNumber?: number;
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
const REMOVE_FIELD = Symbol('remove field symbol');
|
|
101
|
+
type UpdateOperation<Entity extends object> = Except<Partial<Entity>, OptionalKeysOf<Entity>> & {
|
|
102
|
+
[Key in OptionalKeysOf<Entity>]?: Entity[Key] | typeof REMOVE_FIELD;
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
const update1: UpdateOperation<User> = {
|
|
106
|
+
name: 'Alice',
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
const update2: UpdateOperation<User> = {
|
|
110
|
+
name: 'Bob',
|
|
111
|
+
luckyNumber: REMOVE_FIELD,
|
|
112
|
+
};
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
@category Utilities
|
|
116
|
+
*/
|
|
117
|
+
type OptionalKeysOf<Type extends object> = Type extends unknown // For distributing `Type`
|
|
118
|
+
? (keyof { [Key in keyof Type as IsOptionalKeyOf<Type, Key> extends false ? never : Key]: never }) & keyof Type // Intersect with `keyof Type` to ensure result of `OptionalKeysOf<Type>` is always assignable to `keyof Type`
|
|
119
|
+
: never;
|
|
120
|
+
//#endregion
|
|
121
|
+
//#region node_modules/.pnpm/type-fest@5.4.4/node_modules/type-fest/source/required-keys-of.d.ts
|
|
122
|
+
/**
|
|
123
|
+
Extract all required keys from the given type.
|
|
124
|
+
|
|
125
|
+
This is useful when you want to create a new type that contains different type values for the required keys only or use the list of keys for validation purposes, etc...
|
|
126
|
+
|
|
127
|
+
@example
|
|
128
|
+
```
|
|
129
|
+
import type {RequiredKeysOf} from 'type-fest';
|
|
130
|
+
|
|
131
|
+
declare function createValidation<
|
|
132
|
+
Entity extends object,
|
|
133
|
+
Key extends RequiredKeysOf<Entity> = RequiredKeysOf<Entity>,
|
|
134
|
+
>(field: Key, validator: (value: Entity[Key]) => boolean): (entity: Entity) => boolean;
|
|
135
|
+
|
|
136
|
+
type User = {
|
|
137
|
+
name: string;
|
|
138
|
+
surname: string;
|
|
139
|
+
luckyNumber?: number;
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
const validator1 = createValidation<User>('name', value => value.length < 25);
|
|
143
|
+
const validator2 = createValidation<User>('surname', value => value.length < 25);
|
|
144
|
+
|
|
145
|
+
// @ts-expect-error
|
|
146
|
+
const validator3 = createValidation<User>('luckyNumber', value => value > 0);
|
|
147
|
+
// Error: Argument of type '"luckyNumber"' is not assignable to parameter of type '"name" | "surname"'.
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
@category Utilities
|
|
151
|
+
*/
|
|
152
|
+
type RequiredKeysOf<Type extends object> = Type extends unknown // For distributing `Type`
|
|
153
|
+
? Exclude<keyof Type, OptionalKeysOf<Type>> : never;
|
|
154
|
+
//#endregion
|
|
155
|
+
//#region node_modules/.pnpm/type-fest@5.4.4/node_modules/type-fest/source/is-never.d.ts
|
|
156
|
+
/**
|
|
157
|
+
Returns a boolean for whether the given type is `never`.
|
|
158
|
+
|
|
159
|
+
@link https://github.com/microsoft/TypeScript/issues/31751#issuecomment-498526919
|
|
160
|
+
@link https://stackoverflow.com/a/53984913/10292952
|
|
161
|
+
@link https://www.zhenghao.io/posts/ts-never
|
|
162
|
+
|
|
163
|
+
Useful in type utilities, such as checking if something does not occur.
|
|
164
|
+
|
|
165
|
+
@example
|
|
166
|
+
```
|
|
167
|
+
import type {IsNever, And} from 'type-fest';
|
|
168
|
+
|
|
169
|
+
type A = IsNever<never>;
|
|
170
|
+
//=> true
|
|
171
|
+
|
|
172
|
+
type B = IsNever<any>;
|
|
173
|
+
//=> false
|
|
174
|
+
|
|
175
|
+
type C = IsNever<unknown>;
|
|
176
|
+
//=> false
|
|
177
|
+
|
|
178
|
+
type D = IsNever<never[]>;
|
|
179
|
+
//=> false
|
|
180
|
+
|
|
181
|
+
type E = IsNever<object>;
|
|
182
|
+
//=> false
|
|
183
|
+
|
|
184
|
+
type F = IsNever<string>;
|
|
185
|
+
//=> false
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
@example
|
|
189
|
+
```
|
|
190
|
+
import type {IsNever} from 'type-fest';
|
|
191
|
+
|
|
192
|
+
type IsTrue<T> = T extends true ? true : false;
|
|
193
|
+
|
|
194
|
+
// When a distributive conditional is instantiated with `never`, the entire conditional results in `never`.
|
|
195
|
+
type A = IsTrue<never>;
|
|
196
|
+
//=> never
|
|
197
|
+
|
|
198
|
+
// If you don't want that behaviour, you can explicitly add an `IsNever` check before the distributive conditional.
|
|
199
|
+
type IsTrueFixed<T> =
|
|
200
|
+
IsNever<T> extends true ? false : T extends true ? true : false;
|
|
201
|
+
|
|
202
|
+
type B = IsTrueFixed<never>;
|
|
203
|
+
//=> false
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
@category Type Guard
|
|
207
|
+
@category Utilities
|
|
208
|
+
*/
|
|
209
|
+
type IsNever<T> = [T] extends [never] ? true : false;
|
|
210
|
+
//#endregion
|
|
211
|
+
//#region node_modules/.pnpm/type-fest@5.4.4/node_modules/type-fest/source/if.d.ts
|
|
212
|
+
/**
|
|
213
|
+
An if-else-like type that resolves depending on whether the given `boolean` type is `true` or `false`.
|
|
214
|
+
|
|
215
|
+
Use-cases:
|
|
216
|
+
- You can use this in combination with `Is*` types to create an if-else-like experience. For example, `If<IsAny<any>, 'is any', 'not any'>`.
|
|
217
|
+
|
|
218
|
+
Note:
|
|
219
|
+
- Returns a union of if branch and else branch if the given type is `boolean` or `any`. For example, `If<boolean, 'Y', 'N'>` will return `'Y' | 'N'`.
|
|
220
|
+
- Returns the else branch if the given type is `never`. For example, `If<never, 'Y', 'N'>` will return `'N'`.
|
|
221
|
+
|
|
222
|
+
@example
|
|
223
|
+
```
|
|
224
|
+
import type {If} from 'type-fest';
|
|
225
|
+
|
|
226
|
+
type A = If<true, 'yes', 'no'>;
|
|
227
|
+
//=> 'yes'
|
|
228
|
+
|
|
229
|
+
type B = If<false, 'yes', 'no'>;
|
|
230
|
+
//=> 'no'
|
|
231
|
+
|
|
232
|
+
type C = If<boolean, 'yes', 'no'>;
|
|
233
|
+
//=> 'yes' | 'no'
|
|
234
|
+
|
|
235
|
+
type D = If<any, 'yes', 'no'>;
|
|
236
|
+
//=> 'yes' | 'no'
|
|
237
|
+
|
|
238
|
+
type E = If<never, 'yes', 'no'>;
|
|
239
|
+
//=> 'no'
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
@example
|
|
243
|
+
```
|
|
244
|
+
import type {If, IsAny, IsNever} from 'type-fest';
|
|
245
|
+
|
|
246
|
+
type A = If<IsAny<unknown>, 'is any', 'not any'>;
|
|
247
|
+
//=> 'not any'
|
|
248
|
+
|
|
249
|
+
type B = If<IsNever<never>, 'is never', 'not never'>;
|
|
250
|
+
//=> 'is never'
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
@example
|
|
254
|
+
```
|
|
255
|
+
import type {If, IsEqual} from 'type-fest';
|
|
256
|
+
|
|
257
|
+
type IfEqual<T, U, IfBranch, ElseBranch> = If<IsEqual<T, U>, IfBranch, ElseBranch>;
|
|
258
|
+
|
|
259
|
+
type A = IfEqual<string, string, 'equal', 'not equal'>;
|
|
260
|
+
//=> 'equal'
|
|
261
|
+
|
|
262
|
+
type B = IfEqual<string, number, 'equal', 'not equal'>;
|
|
263
|
+
//=> 'not equal'
|
|
264
|
+
```
|
|
265
|
+
|
|
266
|
+
Note: Sometimes using the `If` type can make an implementation non–tail-recursive, which can impact performance. In such cases, it’s better to use a conditional directly. Refer to the following example:
|
|
267
|
+
|
|
268
|
+
@example
|
|
269
|
+
```
|
|
270
|
+
import type {If, IsEqual, StringRepeat} from 'type-fest';
|
|
271
|
+
|
|
272
|
+
type HundredZeroes = StringRepeat<'0', 100>;
|
|
273
|
+
|
|
274
|
+
// The following implementation is not tail recursive
|
|
275
|
+
type Includes<S extends string, Char extends string> =
|
|
276
|
+
S extends `${infer First}${infer Rest}`
|
|
277
|
+
? If<IsEqual<First, Char>,
|
|
278
|
+
'found',
|
|
279
|
+
Includes<Rest, Char>>
|
|
280
|
+
: 'not found';
|
|
281
|
+
|
|
282
|
+
// Hence, instantiations with long strings will fail
|
|
283
|
+
// @ts-expect-error
|
|
284
|
+
type Fails = Includes<HundredZeroes, '1'>;
|
|
285
|
+
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
286
|
+
// Error: Type instantiation is excessively deep and possibly infinite.
|
|
287
|
+
|
|
288
|
+
// However, if we use a simple conditional instead of `If`, the implementation becomes tail-recursive
|
|
289
|
+
type IncludesWithoutIf<S extends string, Char extends string> =
|
|
290
|
+
S extends `${infer First}${infer Rest}`
|
|
291
|
+
? IsEqual<First, Char> extends true
|
|
292
|
+
? 'found'
|
|
293
|
+
: IncludesWithoutIf<Rest, Char>
|
|
294
|
+
: 'not found';
|
|
295
|
+
|
|
296
|
+
// Now, instantiations with long strings will work
|
|
297
|
+
type Works = IncludesWithoutIf<HundredZeroes, '1'>;
|
|
298
|
+
//=> 'not found'
|
|
299
|
+
```
|
|
300
|
+
|
|
301
|
+
@category Type Guard
|
|
302
|
+
@category Utilities
|
|
303
|
+
*/
|
|
304
|
+
type If<Type extends boolean, IfBranch, ElseBranch> = IsNever<Type> extends true ? ElseBranch : Type extends true ? IfBranch : ElseBranch;
|
|
305
|
+
//#endregion
|
|
306
|
+
//#region node_modules/.pnpm/type-fest@5.4.4/node_modules/type-fest/source/internal/type.d.ts
|
|
307
|
+
/**
|
|
308
|
+
Matches any primitive, `void`, `Date`, or `RegExp` value.
|
|
309
|
+
*/
|
|
310
|
+
type BuiltIns = Primitive | void | Date | RegExp;
|
|
311
|
+
/**
|
|
312
|
+
Test if the given function has multiple call signatures.
|
|
313
|
+
|
|
314
|
+
Needed to handle the case of a single call signature with properties.
|
|
315
|
+
|
|
316
|
+
Multiple call signatures cannot currently be supported due to a TypeScript limitation.
|
|
317
|
+
@see https://github.com/microsoft/TypeScript/issues/29732
|
|
318
|
+
*/
|
|
319
|
+
type HasMultipleCallSignatures<T extends (...arguments_: any[]) => unknown> = T extends {
|
|
320
|
+
(...arguments_: infer A): unknown;
|
|
321
|
+
(...arguments_: infer B): unknown;
|
|
322
|
+
} ? B extends A ? A extends B ? false : true : true : false;
|
|
323
|
+
//#endregion
|
|
324
|
+
//#region node_modules/.pnpm/type-fest@5.4.4/node_modules/type-fest/source/simplify.d.ts
|
|
325
|
+
/**
|
|
326
|
+
Useful to flatten the type output to improve type hints shown in editors. And also to transform an interface into a type to aide with assignability.
|
|
327
|
+
|
|
328
|
+
@example
|
|
329
|
+
```
|
|
330
|
+
import type {Simplify} from 'type-fest';
|
|
331
|
+
|
|
332
|
+
type PositionProps = {
|
|
333
|
+
top: number;
|
|
334
|
+
left: number;
|
|
335
|
+
};
|
|
336
|
+
|
|
337
|
+
type SizeProps = {
|
|
338
|
+
width: number;
|
|
339
|
+
height: number;
|
|
340
|
+
};
|
|
341
|
+
|
|
342
|
+
// In your editor, hovering over `Props` will show a flattened object with all the properties.
|
|
343
|
+
type Props = Simplify<PositionProps & SizeProps>;
|
|
344
|
+
```
|
|
345
|
+
|
|
346
|
+
Sometimes it is desired to pass a value as a function argument that has a different type. At first inspection it may seem assignable, and then you discover it is not because the `value`'s type definition was defined as an interface. In the following example, `fn` requires an argument of type `Record<string, unknown>`. If the value is defined as a literal, then it is assignable. And if the `value` is defined as type using the `Simplify` utility the value is assignable. But if the `value` is defined as an interface, it is not assignable because the interface is not sealed and elsewhere a non-string property could be added to the interface.
|
|
347
|
+
|
|
348
|
+
If the type definition must be an interface (perhaps it was defined in a third-party npm package), then the `value` can be defined as `const value: Simplify<SomeInterface> = ...`. Then `value` will be assignable to the `fn` argument. Or the `value` can be cast as `Simplify<SomeInterface>` if you can't re-declare the `value`.
|
|
349
|
+
|
|
350
|
+
@example
|
|
351
|
+
```
|
|
352
|
+
import type {Simplify} from 'type-fest';
|
|
353
|
+
|
|
354
|
+
interface SomeInterface {
|
|
355
|
+
foo: number;
|
|
356
|
+
bar?: string;
|
|
357
|
+
baz: number | undefined;
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
type SomeType = {
|
|
361
|
+
foo: number;
|
|
362
|
+
bar?: string;
|
|
363
|
+
baz: number | undefined;
|
|
364
|
+
};
|
|
365
|
+
|
|
366
|
+
const literal = {foo: 123, bar: 'hello', baz: 456};
|
|
367
|
+
const someType: SomeType = literal;
|
|
368
|
+
const someInterface: SomeInterface = literal;
|
|
369
|
+
|
|
370
|
+
declare function fn(object: Record<string, unknown>): void;
|
|
371
|
+
|
|
372
|
+
fn(literal); // Good: literal object type is sealed
|
|
373
|
+
fn(someType); // Good: type is sealed
|
|
374
|
+
// @ts-expect-error
|
|
375
|
+
fn(someInterface); // Error: Index signature for type 'string' is missing in type 'someInterface'. Because `interface` can be re-opened
|
|
376
|
+
fn(someInterface as Simplify<SomeInterface>); // Good: transform an `interface` into a `type`
|
|
377
|
+
```
|
|
378
|
+
|
|
379
|
+
@link https://github.com/microsoft/TypeScript/issues/15300
|
|
380
|
+
@see {@link SimplifyDeep}
|
|
381
|
+
@category Object
|
|
382
|
+
*/
|
|
383
|
+
type Simplify<T> = { [KeyType in keyof T]: T[KeyType] } & {};
|
|
384
|
+
//#endregion
|
|
385
|
+
//#region node_modules/.pnpm/type-fest@5.4.4/node_modules/type-fest/source/is-equal.d.ts
|
|
386
|
+
/**
|
|
387
|
+
Returns a boolean for whether the two given types are equal.
|
|
388
|
+
|
|
389
|
+
@link https://github.com/microsoft/TypeScript/issues/27024#issuecomment-421529650
|
|
390
|
+
@link https://stackoverflow.com/questions/68961864/how-does-the-equals-work-in-typescript/68963796#68963796
|
|
391
|
+
|
|
392
|
+
Use-cases:
|
|
393
|
+
- If you want to make a conditional branch based on the result of a comparison of two types.
|
|
394
|
+
|
|
395
|
+
@example
|
|
396
|
+
```
|
|
397
|
+
import type {IsEqual} from 'type-fest';
|
|
398
|
+
|
|
399
|
+
// This type returns a boolean for whether the given array includes the given item.
|
|
400
|
+
// `IsEqual` is used to compare the given array at position 0 and the given item and then return true if they are equal.
|
|
401
|
+
type Includes<Value extends readonly any[], Item> =
|
|
402
|
+
Value extends readonly [Value[0], ...infer rest]
|
|
403
|
+
? IsEqual<Value[0], Item> extends true
|
|
404
|
+
? true
|
|
405
|
+
: Includes<rest, Item>
|
|
406
|
+
: false;
|
|
407
|
+
```
|
|
408
|
+
|
|
409
|
+
@category Type Guard
|
|
410
|
+
@category Utilities
|
|
411
|
+
*/
|
|
412
|
+
type IsEqual<A, B> = [A] extends [B] ? [B] extends [A] ? _IsEqual<A, B> : false : false;
|
|
413
|
+
// This version fails the `equalWrappedTupleIntersectionToBeNeverAndNeverExpanded` test in `test-d/is-equal.ts`.
|
|
414
|
+
type _IsEqual<A, B> = (<G>() => G extends A & G | G ? 1 : 2) extends (<G>() => G extends B & G | G ? 1 : 2) ? true : false;
|
|
415
|
+
//#endregion
|
|
416
|
+
//#region node_modules/.pnpm/type-fest@5.4.4/node_modules/type-fest/source/omit-index-signature.d.ts
|
|
417
|
+
/**
|
|
418
|
+
Omit any index signatures from the given object type, leaving only explicitly defined properties.
|
|
419
|
+
|
|
420
|
+
This is the counterpart of `PickIndexSignature`.
|
|
421
|
+
|
|
422
|
+
Use-cases:
|
|
423
|
+
- Remove overly permissive signatures from third-party types.
|
|
424
|
+
|
|
425
|
+
This type was taken from this [StackOverflow answer](https://stackoverflow.com/a/68261113/420747).
|
|
426
|
+
|
|
427
|
+
It relies on the fact that an empty object (`{}`) is assignable to an object with just an index signature, like `Record<string, unknown>`, but not to an object with explicitly defined keys, like `Record<'foo' | 'bar', unknown>`.
|
|
428
|
+
|
|
429
|
+
(The actual value type, `unknown`, is irrelevant and could be any type. Only the key type matters.)
|
|
430
|
+
|
|
431
|
+
```
|
|
432
|
+
const indexed: Record<string, unknown> = {}; // Allowed
|
|
433
|
+
|
|
434
|
+
// @ts-expect-error
|
|
435
|
+
const keyed: Record<'foo', unknown> = {}; // Error
|
|
436
|
+
// TS2739: Type '{}' is missing the following properties from type 'Record<"foo" | "bar", unknown>': foo, bar
|
|
437
|
+
```
|
|
438
|
+
|
|
439
|
+
Instead of causing a type error like the above, you can also use a [conditional type](https://www.typescriptlang.org/docs/handbook/2/conditional-types.html) to test whether a type is assignable to another:
|
|
440
|
+
|
|
441
|
+
```
|
|
442
|
+
type Indexed = {} extends Record<string, unknown>
|
|
443
|
+
? '✅ `{}` is assignable to `Record<string, unknown>`'
|
|
444
|
+
: '❌ `{}` is NOT assignable to `Record<string, unknown>`';
|
|
445
|
+
|
|
446
|
+
type IndexedResult = Indexed;
|
|
447
|
+
//=> '✅ `{}` is assignable to `Record<string, unknown>`'
|
|
448
|
+
|
|
449
|
+
type Keyed = {} extends Record<'foo' | 'bar', unknown>
|
|
450
|
+
? '✅ `{}` is assignable to `Record<\'foo\' | \'bar\', unknown>`'
|
|
451
|
+
: '❌ `{}` is NOT assignable to `Record<\'foo\' | \'bar\', unknown>`';
|
|
452
|
+
|
|
453
|
+
type KeyedResult = Keyed;
|
|
454
|
+
//=> '❌ `{}` is NOT assignable to `Record<\'foo\' | \'bar\', unknown>`'
|
|
455
|
+
```
|
|
456
|
+
|
|
457
|
+
Using a [mapped type](https://www.typescriptlang.org/docs/handbook/2/mapped-types.html#further-exploration), you can then check for each `KeyType` of `ObjectType`...
|
|
458
|
+
|
|
459
|
+
```
|
|
460
|
+
type OmitIndexSignature<ObjectType> = {
|
|
461
|
+
[KeyType in keyof ObjectType // Map each key of `ObjectType`...
|
|
462
|
+
]: ObjectType[KeyType]; // ...to its original value, i.e. `OmitIndexSignature<Foo> == Foo`.
|
|
463
|
+
};
|
|
464
|
+
```
|
|
465
|
+
|
|
466
|
+
...whether an empty object (`{}`) would be assignable to an object with that `KeyType` (`Record<KeyType, unknown>`)...
|
|
467
|
+
|
|
468
|
+
```
|
|
469
|
+
type OmitIndexSignature<ObjectType> = {
|
|
470
|
+
[KeyType in keyof ObjectType
|
|
471
|
+
// Is `{}` assignable to `Record<KeyType, unknown>`?
|
|
472
|
+
as {} extends Record<KeyType, unknown>
|
|
473
|
+
? never // ✅ `{}` is assignable to `Record<KeyType, unknown>`
|
|
474
|
+
: KeyType // ❌ `{}` is NOT assignable to `Record<KeyType, unknown>`
|
|
475
|
+
]: ObjectType[KeyType];
|
|
476
|
+
};
|
|
477
|
+
```
|
|
478
|
+
|
|
479
|
+
If `{}` is assignable, it means that `KeyType` is an index signature and we want to remove it. If it is not assignable, `KeyType` is a "real" key and we want to keep it.
|
|
480
|
+
|
|
481
|
+
@example
|
|
482
|
+
```
|
|
483
|
+
import type {OmitIndexSignature} from 'type-fest';
|
|
484
|
+
|
|
485
|
+
type Example = {
|
|
486
|
+
// These index signatures will be removed.
|
|
487
|
+
[x: string]: any;
|
|
488
|
+
[x: number]: any;
|
|
489
|
+
[x: symbol]: any;
|
|
490
|
+
[x: `head-${string}`]: string;
|
|
491
|
+
[x: `${string}-tail`]: string;
|
|
492
|
+
[x: `head-${string}-tail`]: string;
|
|
493
|
+
[x: `${bigint}`]: string;
|
|
494
|
+
[x: `embedded-${number}`]: string;
|
|
495
|
+
|
|
496
|
+
// These explicitly defined keys will remain.
|
|
497
|
+
foo: 'bar';
|
|
498
|
+
qux?: 'baz';
|
|
499
|
+
};
|
|
500
|
+
|
|
501
|
+
type ExampleWithoutIndexSignatures = OmitIndexSignature<Example>;
|
|
502
|
+
//=> {foo: 'bar'; qux?: 'baz'}
|
|
503
|
+
```
|
|
504
|
+
|
|
505
|
+
@see {@link PickIndexSignature}
|
|
506
|
+
@category Object
|
|
507
|
+
*/
|
|
508
|
+
type OmitIndexSignature<ObjectType> = { [KeyType in keyof ObjectType as {} extends Record<KeyType, unknown> ? never : KeyType]: ObjectType[KeyType] };
|
|
509
|
+
//#endregion
|
|
510
|
+
//#region node_modules/.pnpm/type-fest@5.4.4/node_modules/type-fest/source/pick-index-signature.d.ts
|
|
511
|
+
/**
|
|
512
|
+
Pick only index signatures from the given object type, leaving out all explicitly defined properties.
|
|
513
|
+
|
|
514
|
+
This is the counterpart of `OmitIndexSignature`.
|
|
515
|
+
|
|
516
|
+
@example
|
|
517
|
+
```
|
|
518
|
+
import type {PickIndexSignature} from 'type-fest';
|
|
519
|
+
|
|
520
|
+
declare const symbolKey: unique symbol;
|
|
521
|
+
|
|
522
|
+
type Example = {
|
|
523
|
+
// These index signatures will remain.
|
|
524
|
+
[x: string]: unknown;
|
|
525
|
+
[x: number]: unknown;
|
|
526
|
+
[x: symbol]: unknown;
|
|
527
|
+
[x: `head-${string}`]: string;
|
|
528
|
+
[x: `${string}-tail`]: string;
|
|
529
|
+
[x: `head-${string}-tail`]: string;
|
|
530
|
+
[x: `${bigint}`]: string;
|
|
531
|
+
[x: `embedded-${number}`]: string;
|
|
532
|
+
|
|
533
|
+
// These explicitly defined keys will be removed.
|
|
534
|
+
['kebab-case-key']: string;
|
|
535
|
+
[symbolKey]: string;
|
|
536
|
+
foo: 'bar';
|
|
537
|
+
qux?: 'baz';
|
|
538
|
+
};
|
|
539
|
+
|
|
540
|
+
type ExampleIndexSignature = PickIndexSignature<Example>;
|
|
541
|
+
// {
|
|
542
|
+
// [x: string]: unknown;
|
|
543
|
+
// [x: number]: unknown;
|
|
544
|
+
// [x: symbol]: unknown;
|
|
545
|
+
// [x: `head-${string}`]: string;
|
|
546
|
+
// [x: `${string}-tail`]: string;
|
|
547
|
+
// [x: `head-${string}-tail`]: string;
|
|
548
|
+
// [x: `${bigint}`]: string;
|
|
549
|
+
// [x: `embedded-${number}`]: string;
|
|
550
|
+
// }
|
|
551
|
+
```
|
|
552
|
+
|
|
553
|
+
@see {@link OmitIndexSignature}
|
|
554
|
+
@category Object
|
|
555
|
+
*/
|
|
556
|
+
type PickIndexSignature<ObjectType> = { [KeyType in keyof ObjectType as {} extends Record<KeyType, unknown> ? KeyType : never]: ObjectType[KeyType] };
|
|
557
|
+
//#endregion
|
|
558
|
+
//#region node_modules/.pnpm/type-fest@5.4.4/node_modules/type-fest/source/merge.d.ts
|
|
559
|
+
// Merges two objects without worrying about index signatures.
|
|
560
|
+
type SimpleMerge<Destination, Source> = Simplify<{ [Key in keyof Destination as Key extends keyof Source ? never : Key]: Destination[Key] } & Source>;
|
|
561
|
+
/**
|
|
562
|
+
Merge two types into a new type. Keys of the second type overrides keys of the first type.
|
|
563
|
+
|
|
564
|
+
@example
|
|
565
|
+
```
|
|
566
|
+
import type {Merge} from 'type-fest';
|
|
567
|
+
|
|
568
|
+
type Foo = {
|
|
569
|
+
[x: string]: unknown;
|
|
570
|
+
[x: number]: unknown;
|
|
571
|
+
foo: string;
|
|
572
|
+
bar: symbol;
|
|
573
|
+
};
|
|
574
|
+
|
|
575
|
+
type Bar = {
|
|
576
|
+
[x: number]: number;
|
|
577
|
+
[x: symbol]: unknown;
|
|
578
|
+
bar: Date;
|
|
579
|
+
baz: boolean;
|
|
580
|
+
};
|
|
581
|
+
|
|
582
|
+
export type FooBar = Merge<Foo, Bar>;
|
|
583
|
+
//=> {
|
|
584
|
+
// [x: string]: unknown;
|
|
585
|
+
// [x: number]: number;
|
|
586
|
+
// [x: symbol]: unknown;
|
|
587
|
+
// foo: string;
|
|
588
|
+
// bar: Date;
|
|
589
|
+
// baz: boolean;
|
|
590
|
+
// }
|
|
591
|
+
```
|
|
592
|
+
|
|
593
|
+
Note: If you want a merge type that more accurately reflects the runtime behavior of object spread or `Object.assign`, refer to the {@link ObjectMerge} type.
|
|
594
|
+
|
|
595
|
+
@see {@link ObjectMerge}
|
|
596
|
+
@category Object
|
|
597
|
+
*/
|
|
598
|
+
type Merge<Destination, Source> = Destination extends unknown // For distributing `Destination`
|
|
599
|
+
? Source extends unknown // For distributing `Source`
|
|
600
|
+
? If<IsEqual<Destination, Source>, Destination, _Merge<Destination, Source>> : never // Should never happen
|
|
601
|
+
: never;
|
|
602
|
+
// Should never happen
|
|
603
|
+
type _Merge<Destination, Source> = Simplify<SimpleMerge<PickIndexSignature<Destination>, PickIndexSignature<Source>> & SimpleMerge<OmitIndexSignature<Destination>, OmitIndexSignature<Source>>>;
|
|
604
|
+
//#endregion
|
|
605
|
+
//#region node_modules/.pnpm/type-fest@5.4.4/node_modules/type-fest/source/internal/object.d.ts
|
|
606
|
+
/**
|
|
607
|
+
Merges user specified options with default options.
|
|
608
|
+
|
|
609
|
+
@example
|
|
610
|
+
```
|
|
611
|
+
type PathsOptions = {maxRecursionDepth?: number; leavesOnly?: boolean};
|
|
612
|
+
type DefaultPathsOptions = {maxRecursionDepth: 10; leavesOnly: false};
|
|
613
|
+
type SpecifiedOptions = {leavesOnly: true};
|
|
614
|
+
|
|
615
|
+
type Result = ApplyDefaultOptions<PathsOptions, DefaultPathsOptions, SpecifiedOptions>;
|
|
616
|
+
//=> {maxRecursionDepth: 10; leavesOnly: true}
|
|
617
|
+
```
|
|
618
|
+
|
|
619
|
+
@example
|
|
620
|
+
```
|
|
621
|
+
// Complains if default values are not provided for optional options
|
|
622
|
+
|
|
623
|
+
type PathsOptions = {maxRecursionDepth?: number; leavesOnly?: boolean};
|
|
624
|
+
type DefaultPathsOptions = {maxRecursionDepth: 10};
|
|
625
|
+
type SpecifiedOptions = {};
|
|
626
|
+
|
|
627
|
+
type Result = ApplyDefaultOptions<PathsOptions, DefaultPathsOptions, SpecifiedOptions>;
|
|
628
|
+
// ~~~~~~~~~~~~~~~~~~~
|
|
629
|
+
// Property 'leavesOnly' is missing in type 'DefaultPathsOptions' but required in type '{ maxRecursionDepth: number; leavesOnly: boolean; }'.
|
|
630
|
+
```
|
|
631
|
+
|
|
632
|
+
@example
|
|
633
|
+
```
|
|
634
|
+
// Complains if an option's default type does not conform to the expected type
|
|
635
|
+
|
|
636
|
+
type PathsOptions = {maxRecursionDepth?: number; leavesOnly?: boolean};
|
|
637
|
+
type DefaultPathsOptions = {maxRecursionDepth: 10; leavesOnly: 'no'};
|
|
638
|
+
type SpecifiedOptions = {};
|
|
639
|
+
|
|
640
|
+
type Result = ApplyDefaultOptions<PathsOptions, DefaultPathsOptions, SpecifiedOptions>;
|
|
641
|
+
// ~~~~~~~~~~~~~~~~~~~
|
|
642
|
+
// Types of property 'leavesOnly' are incompatible. Type 'string' is not assignable to type 'boolean'.
|
|
643
|
+
```
|
|
644
|
+
|
|
645
|
+
@example
|
|
646
|
+
```
|
|
647
|
+
// Complains if an option's specified type does not conform to the expected type
|
|
648
|
+
|
|
649
|
+
type PathsOptions = {maxRecursionDepth?: number; leavesOnly?: boolean};
|
|
650
|
+
type DefaultPathsOptions = {maxRecursionDepth: 10; leavesOnly: false};
|
|
651
|
+
type SpecifiedOptions = {leavesOnly: 'yes'};
|
|
652
|
+
|
|
653
|
+
type Result = ApplyDefaultOptions<PathsOptions, DefaultPathsOptions, SpecifiedOptions>;
|
|
654
|
+
// ~~~~~~~~~~~~~~~~
|
|
655
|
+
// Types of property 'leavesOnly' are incompatible. Type 'string' is not assignable to type 'boolean'.
|
|
656
|
+
```
|
|
657
|
+
*/
|
|
658
|
+
type ApplyDefaultOptions<Options extends object, Defaults extends Simplify<Omit<Required<Options>, RequiredKeysOf<Options>> & Partial<Record<RequiredKeysOf<Options>, never>>>, SpecifiedOptions extends Options> = If<IsAny<SpecifiedOptions>, Defaults, If<IsNever<SpecifiedOptions>, Defaults, Simplify<Merge<Defaults, { [Key in keyof SpecifiedOptions as Key extends OptionalKeysOf<Options> ? undefined extends SpecifiedOptions[Key] ? never : Key : Key]: SpecifiedOptions[Key] }> & Required<Options>>>>;
|
|
659
|
+
//#endregion
|
|
660
|
+
//#region node_modules/.pnpm/type-fest@5.4.4/node_modules/type-fest/source/partial-deep.d.ts
|
|
661
|
+
/**
|
|
662
|
+
@see {@link PartialDeep}
|
|
663
|
+
*/
|
|
664
|
+
type PartialDeepOptions = {
|
|
665
|
+
/**
|
|
666
|
+
Whether to affect the individual elements of arrays and tuples.
|
|
667
|
+
@default false
|
|
668
|
+
*/
|
|
669
|
+
readonly recurseIntoArrays?: boolean;
|
|
670
|
+
/**
|
|
671
|
+
Allows `undefined` values in non-tuple arrays.
|
|
672
|
+
- When set to `true`, elements of non-tuple arrays can be `undefined`.
|
|
673
|
+
- When set to `false`, only explicitly defined elements are allowed in non-tuple arrays, ensuring stricter type checking.
|
|
674
|
+
@default false
|
|
675
|
+
@example
|
|
676
|
+
You can allow `undefined` values in non-tuple arrays by passing `{recurseIntoArrays: true; allowUndefinedInNonTupleArrays: true}` as the second type argument:
|
|
677
|
+
```
|
|
678
|
+
import type {PartialDeep} from 'type-fest';
|
|
679
|
+
type Settings = {
|
|
680
|
+
languages: string[];
|
|
681
|
+
};
|
|
682
|
+
declare const partialSettings: PartialDeep<Settings, {recurseIntoArrays: true; allowUndefinedInNonTupleArrays: true}>;
|
|
683
|
+
partialSettings.languages = [undefined]; // OK
|
|
684
|
+
```
|
|
685
|
+
*/
|
|
686
|
+
readonly allowUndefinedInNonTupleArrays?: boolean;
|
|
687
|
+
};
|
|
688
|
+
type DefaultPartialDeepOptions = {
|
|
689
|
+
recurseIntoArrays: false;
|
|
690
|
+
allowUndefinedInNonTupleArrays: false;
|
|
691
|
+
};
|
|
692
|
+
/**
|
|
693
|
+
Create a type from another type with all keys and nested keys set to optional.
|
|
694
|
+
|
|
695
|
+
Use-cases:
|
|
696
|
+
- Merging a default settings/config object with another object, the second object would be a deep partial of the default object.
|
|
697
|
+
- Mocking and testing complex entities, where populating an entire object with its keys would be redundant in terms of the mock or test.
|
|
698
|
+
|
|
699
|
+
@example
|
|
700
|
+
```
|
|
701
|
+
import type {PartialDeep} from 'type-fest';
|
|
702
|
+
|
|
703
|
+
let settings = {
|
|
704
|
+
textEditor: {
|
|
705
|
+
fontSize: 14,
|
|
706
|
+
fontColor: '#000000',
|
|
707
|
+
fontWeight: 400,
|
|
708
|
+
},
|
|
709
|
+
autocomplete: false,
|
|
710
|
+
autosave: true,
|
|
711
|
+
};
|
|
712
|
+
|
|
713
|
+
const applySavedSettings = (savedSettings: PartialDeep<typeof settings>) => (
|
|
714
|
+
{...settings, ...savedSettings, textEditor: {...settings.textEditor, ...savedSettings.textEditor}}
|
|
715
|
+
);
|
|
716
|
+
|
|
717
|
+
settings = applySavedSettings({textEditor: {fontWeight: 500}});
|
|
718
|
+
```
|
|
719
|
+
|
|
720
|
+
By default, this does not affect elements in array and tuple types. You can change this by passing `{recurseIntoArrays: true}` as the second type argument:
|
|
721
|
+
|
|
722
|
+
```
|
|
723
|
+
import type {PartialDeep} from 'type-fest';
|
|
724
|
+
|
|
725
|
+
type Shape = {
|
|
726
|
+
dimensions: [number, number];
|
|
727
|
+
};
|
|
728
|
+
|
|
729
|
+
const partialShape: PartialDeep<Shape, {recurseIntoArrays: true}> = {
|
|
730
|
+
dimensions: [], // OK
|
|
731
|
+
};
|
|
732
|
+
|
|
733
|
+
partialShape.dimensions = [15]; // OK
|
|
734
|
+
```
|
|
735
|
+
|
|
736
|
+
@see {@link PartialDeepOptions}
|
|
737
|
+
|
|
738
|
+
@category Object
|
|
739
|
+
@category Array
|
|
740
|
+
@category Set
|
|
741
|
+
@category Map
|
|
742
|
+
*/
|
|
743
|
+
type PartialDeep<T, Options extends PartialDeepOptions = {}> = _PartialDeep<T, ApplyDefaultOptions<PartialDeepOptions, DefaultPartialDeepOptions, Options>>;
|
|
744
|
+
type _PartialDeep<T, Options extends Required<PartialDeepOptions>> = T extends BuiltIns | ((new (...arguments_: any[]) => unknown)) ? T : T extends Map<infer KeyType, infer ValueType> ? PartialMapDeep<KeyType, ValueType, Options> : T extends Set<infer ItemType> ? PartialSetDeep<ItemType, Options> : T extends ReadonlyMap<infer KeyType, infer ValueType> ? PartialReadonlyMapDeep<KeyType, ValueType, Options> : T extends ReadonlySet<infer ItemType> ? PartialReadonlySetDeep<ItemType, Options> : T extends ((...arguments_: any[]) => unknown) ? IsNever<keyof T> extends true ? T // For functions with no properties
|
|
745
|
+
: HasMultipleCallSignatures<T> extends true ? T : ((...arguments_: Parameters<T>) => ReturnType<T>) & PartialObjectDeep<T, Options> : T extends object ? T extends ReadonlyArray<infer ItemType> // Test for arrays/tuples, per https://github.com/microsoft/TypeScript/issues/35156
|
|
746
|
+
? Options['recurseIntoArrays'] extends true ? ItemType[] extends T // Test for arrays (non-tuples) specifically
|
|
747
|
+
? readonly ItemType[] extends T // Differentiate readonly and mutable arrays
|
|
748
|
+
? ReadonlyArray<_PartialDeep<Options['allowUndefinedInNonTupleArrays'] extends false ? ItemType : ItemType | undefined, Options>> : Array<_PartialDeep<Options['allowUndefinedInNonTupleArrays'] extends false ? ItemType : ItemType | undefined, Options>> : PartialObjectDeep<T, Options> // Tuples behave properly
|
|
749
|
+
: T // If they don't opt into array testing, just use the original type
|
|
750
|
+
: PartialObjectDeep<T, Options> : unknown;
|
|
751
|
+
/**
|
|
752
|
+
Same as `PartialDeep`, but accepts only `Map`s and as inputs. Internal helper for `PartialDeep`.
|
|
753
|
+
*/
|
|
754
|
+
type PartialMapDeep<KeyType, ValueType, Options extends Required<PartialDeepOptions>> = {} & Map<_PartialDeep<KeyType, Options>, _PartialDeep<ValueType, Options>>;
|
|
755
|
+
/**
|
|
756
|
+
Same as `PartialDeep`, but accepts only `Set`s as inputs. Internal helper for `PartialDeep`.
|
|
757
|
+
*/
|
|
758
|
+
type PartialSetDeep<T, Options extends Required<PartialDeepOptions>> = {} & Set<_PartialDeep<T, Options>>;
|
|
759
|
+
/**
|
|
760
|
+
Same as `PartialDeep`, but accepts only `ReadonlyMap`s as inputs. Internal helper for `PartialDeep`.
|
|
761
|
+
*/
|
|
762
|
+
type PartialReadonlyMapDeep<KeyType, ValueType, Options extends Required<PartialDeepOptions>> = {} & ReadonlyMap<_PartialDeep<KeyType, Options>, _PartialDeep<ValueType, Options>>;
|
|
763
|
+
/**
|
|
764
|
+
Same as `PartialDeep`, but accepts only `ReadonlySet`s as inputs. Internal helper for `PartialDeep`.
|
|
765
|
+
*/
|
|
766
|
+
type PartialReadonlySetDeep<T, Options extends Required<PartialDeepOptions>> = {} & ReadonlySet<_PartialDeep<T, Options>>;
|
|
767
|
+
/**
|
|
768
|
+
Same as `PartialDeep`, but accepts only `object`s as inputs. Internal helper for `PartialDeep`.
|
|
769
|
+
*/
|
|
770
|
+
type PartialObjectDeep<ObjectType extends object, Options extends Required<PartialDeepOptions>> = { [KeyType in keyof ObjectType]?: _PartialDeep<ObjectType[KeyType], Options> };
|
|
771
|
+
//#endregion
|
|
772
|
+
//#region node_modules/.pnpm/yanki-connect@4.0.1/node_modules/yanki-connect/dist/index.d.ts
|
|
773
|
+
//#region src/types/deck.d.ts
|
|
774
|
+
type DeckStats = {
|
|
775
|
+
deck_id: number;
|
|
776
|
+
learn_count: number;
|
|
777
|
+
name: string;
|
|
778
|
+
new_count: number;
|
|
779
|
+
review_count: number;
|
|
780
|
+
total_in_deck: number;
|
|
781
|
+
};
|
|
782
|
+
type DeckConfig = {
|
|
783
|
+
autoplay: boolean;
|
|
784
|
+
dyn: 1 | false;
|
|
785
|
+
id: number;
|
|
786
|
+
lapse: {
|
|
787
|
+
delays: number[];
|
|
788
|
+
leechAction: number;
|
|
789
|
+
leechFails: number;
|
|
790
|
+
minInt: number;
|
|
791
|
+
mult: number;
|
|
792
|
+
};
|
|
793
|
+
maxTaken: number;
|
|
794
|
+
mod: number;
|
|
795
|
+
name: string;
|
|
796
|
+
new: {
|
|
797
|
+
bury: boolean;
|
|
798
|
+
delays: number[];
|
|
799
|
+
initialFactor: number;
|
|
800
|
+
ints: number[];
|
|
801
|
+
order: number;
|
|
802
|
+
perDay: number;
|
|
803
|
+
separate: boolean;
|
|
804
|
+
};
|
|
805
|
+
replayq: boolean;
|
|
806
|
+
rev: {
|
|
807
|
+
bury: boolean;
|
|
808
|
+
ease4: number;
|
|
809
|
+
fuzz: number;
|
|
810
|
+
ivlFct: number;
|
|
811
|
+
maxIvl: number;
|
|
812
|
+
minSpace: number;
|
|
813
|
+
perDay: number;
|
|
814
|
+
};
|
|
815
|
+
timer: number;
|
|
816
|
+
usn: number;
|
|
817
|
+
};
|
|
818
|
+
type DeckRequests = Request<'changeDeck', 6, {
|
|
819
|
+
cards: number[];
|
|
820
|
+
deck: string;
|
|
821
|
+
}> | Request<'cloneDeckConfigId', 6, {
|
|
822
|
+
cloneFrom: number;
|
|
823
|
+
name: string;
|
|
824
|
+
}, false | number> | Request<'createDeck', 6, {
|
|
825
|
+
deck: string;
|
|
826
|
+
}, number> | Request<'deckNames', 6, never, string[]> | Request<'deckNamesAndIds', 6, never, Record<string, number>> | Request<'deleteDecks', 6, {
|
|
827
|
+
cardsToo: true;
|
|
828
|
+
decks: string[];
|
|
829
|
+
}> | Request<'getDeckConfig', 6, {
|
|
830
|
+
deck: string;
|
|
831
|
+
}, DeckConfig> | Request<'getDecks', 6, Record<'cards', number[]>, Record<string, number[]>> | Request<'getDeckStats', 6, {
|
|
832
|
+
decks: string[];
|
|
833
|
+
}, Record<string, DeckStats>> | Request<'removeDeckConfigId', 6, {
|
|
834
|
+
configId: number;
|
|
835
|
+
}, boolean> | Request<'saveDeckConfig', 6, {
|
|
836
|
+
config: DeckConfig;
|
|
837
|
+
}, boolean> | Request<'setDeckConfigId', 6, {
|
|
838
|
+
configId: number;
|
|
839
|
+
decks: string[];
|
|
840
|
+
}, boolean>; //#endregion
|
|
841
|
+
//#region src/types/note.d.ts
|
|
842
|
+
type NoteModel = 'Basic' | 'Basic (and reversed card)' | 'Basic (type in the answer)' | 'Cloze' | (string & {});
|
|
843
|
+
type NoteMedia = {
|
|
844
|
+
data?: string;
|
|
845
|
+
fields?: string[];
|
|
846
|
+
filename: string;
|
|
847
|
+
path?: string;
|
|
848
|
+
skipHash?: string;
|
|
849
|
+
url?: string;
|
|
850
|
+
};
|
|
851
|
+
type Note = {
|
|
852
|
+
audio?: NoteMedia[];
|
|
853
|
+
deckName: string;
|
|
854
|
+
fields: Record<string, string>;
|
|
855
|
+
modelName: NoteModel;
|
|
856
|
+
picture?: NoteMedia[];
|
|
857
|
+
tags?: string[];
|
|
858
|
+
video?: NoteMedia[];
|
|
859
|
+
};
|
|
860
|
+
type NoteWithCreationOptions = Note & {
|
|
861
|
+
options?: {
|
|
862
|
+
allowDuplicate?: boolean;
|
|
863
|
+
duplicateScope?: 'deck' | (string & {});
|
|
864
|
+
duplicateScopeOptions?: {
|
|
865
|
+
checkAllModels?: boolean;
|
|
866
|
+
checkChildren?: boolean;
|
|
867
|
+
deckName?: null | string;
|
|
868
|
+
};
|
|
869
|
+
};
|
|
870
|
+
};
|
|
871
|
+
type NoteRequests = Request<'addNote', 6, {
|
|
872
|
+
note: NoteWithCreationOptions;
|
|
873
|
+
}, null | number> | Request<'addNotes', 6, {
|
|
874
|
+
notes: NoteWithCreationOptions[];
|
|
875
|
+
}, Array<null | string> | null> | Request<'addTags', 6, {
|
|
876
|
+
notes: number[];
|
|
877
|
+
tags: string;
|
|
878
|
+
}> | Request<'canAddNotes', 6, {
|
|
879
|
+
notes: NoteWithCreationOptions[];
|
|
880
|
+
}, boolean[]> | Request<'canAddNotesWithErrorDetail', 6, {
|
|
881
|
+
notes: NoteWithCreationOptions[];
|
|
882
|
+
}, Array<{
|
|
883
|
+
canAdd: false;
|
|
884
|
+
error: string;
|
|
885
|
+
} | {
|
|
886
|
+
canAdd: true;
|
|
887
|
+
}>> | Request<'clearUnusedTags', 6, never, string[]> | Request<'deleteNotes', 6, {
|
|
888
|
+
notes: number[];
|
|
889
|
+
}> | Request<'findNotes', 6, {
|
|
890
|
+
query: string;
|
|
891
|
+
}, number[]> | Request<'getNoteTags', 6, {
|
|
892
|
+
note: number;
|
|
893
|
+
}, string[]> | Request<'getTags', 6, never, string[]> | Request<'notesInfo', 6, {
|
|
894
|
+
notes: number[];
|
|
895
|
+
}, Array<{
|
|
896
|
+
cards: number[];
|
|
897
|
+
fields: Record<string, {
|
|
898
|
+
order: number;
|
|
899
|
+
value: string;
|
|
900
|
+
}>;
|
|
901
|
+
mod: number;
|
|
902
|
+
modelName: string;
|
|
903
|
+
noteId: number;
|
|
904
|
+
profile: string;
|
|
905
|
+
tags: string[];
|
|
906
|
+
}>> | Request<'notesModTime', 6, {
|
|
907
|
+
notes: number[];
|
|
908
|
+
}, Array<{
|
|
909
|
+
mod: number;
|
|
910
|
+
noteId: number;
|
|
911
|
+
}>> | Request<'removeEmptyNotes', 6> | Request<'removeTags', 6, {
|
|
912
|
+
notes: number[];
|
|
913
|
+
tags: string;
|
|
914
|
+
}> | Request<'replaceTags', 6, {
|
|
915
|
+
notes: number[];
|
|
916
|
+
replace_with_tag: string;
|
|
917
|
+
tag_to_replace: string;
|
|
918
|
+
}> | Request<'replaceTagsInAllNotes', 6, {
|
|
919
|
+
replace_with_tag: string;
|
|
920
|
+
tag_to_replace: string;
|
|
921
|
+
}> | Request<'updateNote', 6, {
|
|
922
|
+
note: {
|
|
923
|
+
audio?: NoteMedia[];
|
|
924
|
+
fields: Record<string, string>;
|
|
925
|
+
id: number;
|
|
926
|
+
picture?: NoteMedia[];
|
|
927
|
+
tags?: string[];
|
|
928
|
+
video?: NoteMedia[];
|
|
929
|
+
} | {
|
|
930
|
+
fields?: Record<string, string>;
|
|
931
|
+
id: number;
|
|
932
|
+
tags: string[];
|
|
933
|
+
};
|
|
934
|
+
}> | Request<'updateNoteFields', 6, {
|
|
935
|
+
note: {
|
|
936
|
+
audio?: NoteMedia[];
|
|
937
|
+
fields: Record<string, string>;
|
|
938
|
+
id: number;
|
|
939
|
+
picture?: NoteMedia[];
|
|
940
|
+
video?: NoteMedia[];
|
|
941
|
+
};
|
|
942
|
+
}> | Request<'updateNoteModel', 6, {
|
|
943
|
+
note: {
|
|
944
|
+
fields: Record<string, string>;
|
|
945
|
+
id: number;
|
|
946
|
+
modelName: string;
|
|
947
|
+
tags: string[];
|
|
948
|
+
};
|
|
949
|
+
}> | Request<'updateNoteTags', 6, {
|
|
950
|
+
note: number;
|
|
951
|
+
tags: string[];
|
|
952
|
+
}>; //#endregion
|
|
953
|
+
//#region src/types/graphical.d.ts
|
|
954
|
+
type GraphicalRequests = Request<'guiAddCards', 6, {
|
|
955
|
+
note: Note;
|
|
956
|
+
}, number> | Request<'guiAnswerCard', 6, {
|
|
957
|
+
ease: number;
|
|
958
|
+
}, boolean> | Request<'guiBrowse', 6, {
|
|
959
|
+
query: string;
|
|
960
|
+
reorderCards?: {
|
|
961
|
+
columnId: CardBrowserColumns;
|
|
962
|
+
order: 'ascending' | 'descending';
|
|
963
|
+
};
|
|
964
|
+
}, number[]> | Request<'guiCheckDatabase', 6, never, true> | Request<'guiCurrentCard', 6, never, CardInfo | null> | Request<'guiDeckBrowser', 6> | Request<'guiDeckOverview', 6, {
|
|
965
|
+
name: string;
|
|
966
|
+
}, boolean> | Request<'guiDeckReview', 6, {
|
|
967
|
+
name: string;
|
|
968
|
+
}, boolean> | Request<'guiEditNote', 6, {
|
|
969
|
+
note: number;
|
|
970
|
+
}> | Request<'guiExitAnki', 6> | Request<'guiImportFile', 6, {
|
|
971
|
+
path: string;
|
|
972
|
+
}> | Request<'guiPlayAudio', 6, never, true> | Request<'guiSelectCard', 6, {
|
|
973
|
+
card: number;
|
|
974
|
+
}, boolean> | Request<'guiSelectedNotes', 6, never, number[]> | Request<'guiSelectNote', 6, {
|
|
975
|
+
note: number;
|
|
976
|
+
}, boolean> | Request<'guiShowAnswer', 6, never, boolean> | Request<'guiShowQuestion', 6, never, boolean> | Request<'guiStartCardTimer', 6, never, true> | Request<'guiUndo', 6, never, boolean>; //#endregion
|
|
977
|
+
//#region src/types/media.d.ts
|
|
978
|
+
type MediaRequests = Request<'deleteMediaFile', 6, {
|
|
979
|
+
filename: string;
|
|
980
|
+
}> | Request<'getMediaDirPath', 6, never, string> | Request<'getMediaFilesNames', 6, {
|
|
981
|
+
pattern: string;
|
|
982
|
+
}, string[]> | Request<'retrieveMediaFile', 6, {
|
|
983
|
+
filename: string;
|
|
984
|
+
}, false | string> | Request<'storeMediaFile', 6, {
|
|
985
|
+
data?: string;
|
|
986
|
+
deleteExisting?: boolean;
|
|
987
|
+
filename: string;
|
|
988
|
+
path?: string;
|
|
989
|
+
url?: string;
|
|
990
|
+
}, string>; //#endregion
|
|
991
|
+
//#region src/types/miscellaneous.d.ts
|
|
992
|
+
type MiscellaneousRequests = Request<'apiReflect', 6, {
|
|
993
|
+
actions: null | string[];
|
|
994
|
+
scopes: Array<'actions'>;
|
|
995
|
+
}, {
|
|
996
|
+
actions: string[];
|
|
997
|
+
scopes: string[];
|
|
998
|
+
}> | Request<'exportPackage', 6, {
|
|
999
|
+
deck: string;
|
|
1000
|
+
includeSched?: boolean;
|
|
1001
|
+
path: string;
|
|
1002
|
+
}, boolean> | Request<'getActiveProfile', 6, never, string> | Request<'getProfiles', 6, never, string[]> | Request<'importPackage', 6, {
|
|
1003
|
+
path: string;
|
|
1004
|
+
}, boolean> | Request<'loadProfile', 6, {
|
|
1005
|
+
name: string;
|
|
1006
|
+
}, true> | Request<'multi', 6, // Crazy, have to call this experimental
|
|
1007
|
+
{
|
|
1008
|
+
actions: Array<{
|
|
1009
|
+
action: Requests['action'];
|
|
1010
|
+
params?: Requests['params'];
|
|
1011
|
+
version?: number;
|
|
1012
|
+
}>;
|
|
1013
|
+
}, Array<Requests['response'] | {
|
|
1014
|
+
error: null | string;
|
|
1015
|
+
result: Requests['response'];
|
|
1016
|
+
}>> | Request<'reloadCollection', 6> | Request<'requestPermission', 6, never, {
|
|
1017
|
+
permission: 'denied';
|
|
1018
|
+
} | {
|
|
1019
|
+
permission: 'granted';
|
|
1020
|
+
requireApiKey: boolean;
|
|
1021
|
+
version: boolean;
|
|
1022
|
+
}> | Request<'sync', 6> | Request<'version', 6, never, number>; //#endregion
|
|
1023
|
+
//#region src/types/model.d.ts
|
|
1024
|
+
type ModelField = {
|
|
1025
|
+
collapsed: boolean;
|
|
1026
|
+
description: string;
|
|
1027
|
+
excludeFromSearch: boolean;
|
|
1028
|
+
font: string;
|
|
1029
|
+
id: number;
|
|
1030
|
+
name: string;
|
|
1031
|
+
ord: number;
|
|
1032
|
+
plainText: boolean;
|
|
1033
|
+
preventDeletion: boolean;
|
|
1034
|
+
rtl: boolean;
|
|
1035
|
+
size: number;
|
|
1036
|
+
sticky: boolean;
|
|
1037
|
+
tag: null;
|
|
1038
|
+
};
|
|
1039
|
+
type ModelTemplate = {
|
|
1040
|
+
afmt: string;
|
|
1041
|
+
bafmt: string;
|
|
1042
|
+
bfont: string;
|
|
1043
|
+
bqfmt: string;
|
|
1044
|
+
bsize: number;
|
|
1045
|
+
did: null;
|
|
1046
|
+
id: number;
|
|
1047
|
+
name: string;
|
|
1048
|
+
ord: number;
|
|
1049
|
+
qfmt: string;
|
|
1050
|
+
};
|
|
1051
|
+
type Model = {
|
|
1052
|
+
css: string;
|
|
1053
|
+
did: null;
|
|
1054
|
+
flds: ModelField[];
|
|
1055
|
+
id: number;
|
|
1056
|
+
latexPost: string;
|
|
1057
|
+
latexPre: string;
|
|
1058
|
+
latexsvg: boolean;
|
|
1059
|
+
mod: number;
|
|
1060
|
+
name: string;
|
|
1061
|
+
originalStockKind: number;
|
|
1062
|
+
req: Array<[number, string, number[]]>;
|
|
1063
|
+
sortf: number;
|
|
1064
|
+
tmpls: ModelTemplate[];
|
|
1065
|
+
type: number;
|
|
1066
|
+
usn: number;
|
|
1067
|
+
};
|
|
1068
|
+
type ModelToCreate = {
|
|
1069
|
+
cardTemplates: Array<{
|
|
1070
|
+
[key: string]: string;
|
|
1071
|
+
Back: string;
|
|
1072
|
+
Front: string;
|
|
1073
|
+
}>;
|
|
1074
|
+
css?: string;
|
|
1075
|
+
inOrderFields: string[];
|
|
1076
|
+
isCloze?: boolean;
|
|
1077
|
+
modelName: string;
|
|
1078
|
+
};
|
|
1079
|
+
type ModelRequests = Request<'createModel', 6, ModelToCreate, Model> | Request<'findAndReplaceInModels', 6, {
|
|
1080
|
+
model: {
|
|
1081
|
+
back: boolean;
|
|
1082
|
+
css: boolean;
|
|
1083
|
+
fieldText: string;
|
|
1084
|
+
front: boolean;
|
|
1085
|
+
modelName: string;
|
|
1086
|
+
replaceText: string;
|
|
1087
|
+
};
|
|
1088
|
+
}, number> | Request<'findModelsById', 6, {
|
|
1089
|
+
modelIds: number[];
|
|
1090
|
+
}, Model[]> | Request<'findModelsByName', 6, {
|
|
1091
|
+
modelNames: string[];
|
|
1092
|
+
}, Model[]> | Request<'modelFieldAdd', 6, {
|
|
1093
|
+
fieldName: string;
|
|
1094
|
+
index: number;
|
|
1095
|
+
modelName: string;
|
|
1096
|
+
}> | Request<'modelFieldDescriptions', 6, {
|
|
1097
|
+
description: string;
|
|
1098
|
+
fieldName: string;
|
|
1099
|
+
modelName: string;
|
|
1100
|
+
}, boolean> | Request<'modelFieldFonts', 6, {
|
|
1101
|
+
modelName: string;
|
|
1102
|
+
}, Record<string, {
|
|
1103
|
+
font: string;
|
|
1104
|
+
size: number;
|
|
1105
|
+
}>> | Request<'modelFieldNames', 6, {
|
|
1106
|
+
modelName: string;
|
|
1107
|
+
}, string[]> | Request<'modelFieldRemove', 6, {
|
|
1108
|
+
fieldName: string;
|
|
1109
|
+
modelName: string;
|
|
1110
|
+
}> | Request<'modelFieldRename', 6, {
|
|
1111
|
+
modelName: string;
|
|
1112
|
+
newFieldName: string;
|
|
1113
|
+
oldFieldName: string;
|
|
1114
|
+
}> | Request<'modelFieldReposition', 6, {
|
|
1115
|
+
fieldName: string;
|
|
1116
|
+
index: number;
|
|
1117
|
+
modelName: string;
|
|
1118
|
+
}> | Request<'modelFieldSetDescription', 6, {
|
|
1119
|
+
fieldName: string;
|
|
1120
|
+
index: number;
|
|
1121
|
+
modelName: string;
|
|
1122
|
+
}> | Request<'modelFieldSetFont', 6, {
|
|
1123
|
+
fieldName: string;
|
|
1124
|
+
font: string;
|
|
1125
|
+
modelName: string;
|
|
1126
|
+
}> | Request<'modelFieldSetFontSize', 6, {
|
|
1127
|
+
fieldName: string;
|
|
1128
|
+
fontSize: number;
|
|
1129
|
+
modelName: string;
|
|
1130
|
+
}> | Request<'modelFieldsOnTemplates', 6, {
|
|
1131
|
+
modelName: string;
|
|
1132
|
+
}, Record<string, [string[], string[]]>> | Request<'modelNames', 6, never, string[]> | Request<'modelNamesAndIds', 6, never, Record<string, number>> | Request<'modelStyling', 6, {
|
|
1133
|
+
modelName: string;
|
|
1134
|
+
}, {
|
|
1135
|
+
css: string;
|
|
1136
|
+
}> | Request<'modelTemplateAdd', 6, {
|
|
1137
|
+
modelName: string;
|
|
1138
|
+
template: {
|
|
1139
|
+
[key: string]: string;
|
|
1140
|
+
Back: string;
|
|
1141
|
+
Front: string;
|
|
1142
|
+
};
|
|
1143
|
+
}> | Request<'modelTemplateRemove', 6, {
|
|
1144
|
+
modelName: string;
|
|
1145
|
+
templateName: string;
|
|
1146
|
+
}> | Request<'modelTemplateRename', 6, {
|
|
1147
|
+
modelName: string;
|
|
1148
|
+
newTemplateName: string;
|
|
1149
|
+
oldTemplateName: string;
|
|
1150
|
+
}> | Request<'modelTemplateReposition', 6, {
|
|
1151
|
+
index: number;
|
|
1152
|
+
modelName: string;
|
|
1153
|
+
templateName: string;
|
|
1154
|
+
}> | Request<'modelTemplates', 6, {
|
|
1155
|
+
modelName: string;
|
|
1156
|
+
}, Record<string, {
|
|
1157
|
+
[key: string]: string;
|
|
1158
|
+
Back: string;
|
|
1159
|
+
Front: string;
|
|
1160
|
+
}>> | Request<'updateModelStyling', 6, {
|
|
1161
|
+
model: {
|
|
1162
|
+
css: string;
|
|
1163
|
+
name: string;
|
|
1164
|
+
};
|
|
1165
|
+
}> | Request<'updateModelTemplates', 6, {
|
|
1166
|
+
model: {
|
|
1167
|
+
name: string;
|
|
1168
|
+
templates: Record<string, {
|
|
1169
|
+
Back?: string;
|
|
1170
|
+
Front?: string;
|
|
1171
|
+
}>;
|
|
1172
|
+
};
|
|
1173
|
+
}>; //#endregion
|
|
1174
|
+
//#region src/types/statistic.d.ts
|
|
1175
|
+
type ReviewStatisticTuple = [reviewTime: number, cardID: number, usn: number, buttonPressed: number, newInterval: number, previousInterval: number, newFactor: number, reviewDuration: number, reviewType: number];
|
|
1176
|
+
type StatisticRequests = Request<'cardReviews', 6, {
|
|
1177
|
+
deck: string;
|
|
1178
|
+
startID: number;
|
|
1179
|
+
}, ReviewStatisticTuple[]> | Request<'getCollectionStatsHTML', 6, {
|
|
1180
|
+
wholeCollection: boolean;
|
|
1181
|
+
}, string> | Request<'getLatestReviewID', 6, {
|
|
1182
|
+
deck: string;
|
|
1183
|
+
}, number> | Request<'getNumCardsReviewedByDay', 6, never, Array<[string, number]>> | Request<'getNumCardsReviewedToday', 6, never, number> | Request<'getReviewsOfCards', 6, {
|
|
1184
|
+
cards: string[];
|
|
1185
|
+
}, Record<string, Array<{
|
|
1186
|
+
/** ButtonPressed */ease: number; /** NewFactor */
|
|
1187
|
+
factor: number; /** ReviewTime */
|
|
1188
|
+
id: number; /** NewInterval */
|
|
1189
|
+
ivl: number; /** PreviousInterval */
|
|
1190
|
+
lastIvl: number; /** ReviewDuration */
|
|
1191
|
+
time: number; /** ReviewType */
|
|
1192
|
+
type: number; /** Usn */
|
|
1193
|
+
usn: number;
|
|
1194
|
+
}>>> | Request<'insertReviews', 6, {
|
|
1195
|
+
reviews: ReviewStatisticTuple[];
|
|
1196
|
+
}>; //#endregion
|
|
1197
|
+
//#region src/types/shared.d.ts
|
|
1198
|
+
/**
|
|
1199
|
+
* Abstract wrapper over an Anki Connect action / response
|
|
1200
|
+
*/
|
|
1201
|
+
type Request<Action extends string, Version extends AnkiConnectVersion, Params = never, Result = null> = {
|
|
1202
|
+
action: Action;
|
|
1203
|
+
params: Params;
|
|
1204
|
+
response: {
|
|
1205
|
+
error: null | string;
|
|
1206
|
+
result: Result;
|
|
1207
|
+
};
|
|
1208
|
+
version: Version;
|
|
1209
|
+
};
|
|
1210
|
+
/**
|
|
1211
|
+
* Requests
|
|
1212
|
+
*/
|
|
1213
|
+
type Requests = CardRequests | DeckRequests | GraphicalRequests | MediaRequests | MiscellaneousRequests | ModelRequests | NoteRequests | StatisticRequests;
|
|
1214
|
+
type AnkiConnectVersion = 6;
|
|
1215
|
+
type ParamsForAction<T extends Requests['action']> = Extract<Requests, {
|
|
1216
|
+
action: T;
|
|
1217
|
+
}>['params'];
|
|
1218
|
+
//#endregion
|
|
1219
|
+
//#region src/types/card.d.ts
|
|
1220
|
+
type CardBrowserColumns = 'answer' | 'cardDue' | 'cardEase' | 'cardIvl' | 'cardLapses' | 'cardMod' | 'cardReps' | 'deck' | 'note' | 'noteCrt' | 'noteFld' | 'noteMod' | 'noteTags' | 'question' | 'template' | (string & {});
|
|
1221
|
+
type CardValueKeys = 'data' | 'did' | 'due' | 'factor' | 'flags' | 'id' | 'ivl' | 'lapses' | 'left' | 'mod' | 'odid' | 'odue' | 'ord' | 'queue' | 'reps' | 'type' | 'usn';
|
|
1222
|
+
type CardInfo = {
|
|
1223
|
+
answer: string;
|
|
1224
|
+
buttons?: number[];
|
|
1225
|
+
cardId: number;
|
|
1226
|
+
css: string;
|
|
1227
|
+
deckName: string;
|
|
1228
|
+
due: number;
|
|
1229
|
+
fieldOrder: number;
|
|
1230
|
+
fields: Record<string, {
|
|
1231
|
+
order: number;
|
|
1232
|
+
value: string;
|
|
1233
|
+
}>;
|
|
1234
|
+
interval: number;
|
|
1235
|
+
lapses: number;
|
|
1236
|
+
left: number;
|
|
1237
|
+
mod: number;
|
|
1238
|
+
modelName: string;
|
|
1239
|
+
nextReviews: string[];
|
|
1240
|
+
note: number;
|
|
1241
|
+
ord: number;
|
|
1242
|
+
question: string;
|
|
1243
|
+
queue: number;
|
|
1244
|
+
reps: number;
|
|
1245
|
+
template: string;
|
|
1246
|
+
type: number;
|
|
1247
|
+
};
|
|
1248
|
+
type CardRequests = Request<'answerCards', 6, {
|
|
1249
|
+
answers: Array<{
|
|
1250
|
+
cardId: number;
|
|
1251
|
+
ease: number;
|
|
1252
|
+
}>;
|
|
1253
|
+
}, boolean[]> | Request<'areDue', 6, {
|
|
1254
|
+
cards: number[];
|
|
1255
|
+
}, boolean[]> | Request<'areSuspended', 6, {
|
|
1256
|
+
cards: number[];
|
|
1257
|
+
}, Array<boolean | null>> | Request<'cardsInfo', 6, {
|
|
1258
|
+
cards: number[];
|
|
1259
|
+
}, CardInfo[]> | Request<'cardsModTime', 6, {
|
|
1260
|
+
cards: number[];
|
|
1261
|
+
}, {
|
|
1262
|
+
cardId: number;
|
|
1263
|
+
mod: number;
|
|
1264
|
+
}> | Request<'cardsToNotes', 6, {
|
|
1265
|
+
cards: number[];
|
|
1266
|
+
}, number[]> | Request<'findCards', 6, {
|
|
1267
|
+
query: string;
|
|
1268
|
+
}, number[]> | Request<'forgetCards', 6, {
|
|
1269
|
+
cards: number[];
|
|
1270
|
+
}> | Request<'getEaseFactors', 6, {
|
|
1271
|
+
cards: number[];
|
|
1272
|
+
}, number[]> | Request<'getIntervals', 6, {
|
|
1273
|
+
cards: number[];
|
|
1274
|
+
complete?: boolean;
|
|
1275
|
+
}, number[] | number[][]> | Request<'relearnCards', 6, {
|
|
1276
|
+
cards: number[];
|
|
1277
|
+
}> | Request<'setDueDate', 6, {
|
|
1278
|
+
cards: number[];
|
|
1279
|
+
days: string;
|
|
1280
|
+
}, boolean> | Request<'setEaseFactors', 6, {
|
|
1281
|
+
cards: number[];
|
|
1282
|
+
easeFactors: number[];
|
|
1283
|
+
}, boolean[]> | Request<'setSpecificValueOfCard', 6, {
|
|
1284
|
+
card: number;
|
|
1285
|
+
keys: CardValueKeys[];
|
|
1286
|
+
newValues: string[];
|
|
1287
|
+
}, boolean[]> | Request<'suspend', 6, {
|
|
1288
|
+
cards: number[];
|
|
1289
|
+
}, boolean> | Request<'suspended', 6, {
|
|
1290
|
+
card: number;
|
|
1291
|
+
}, boolean> | Request<'unsuspend', 6, {
|
|
1292
|
+
cards: number[];
|
|
1293
|
+
}, boolean>; //#endregion
|
|
1294
|
+
//#region src/client.d.ts
|
|
1295
|
+
/**
|
|
1296
|
+
* Subset of built-in Fetch interface that's actually used by Anki, for ease of
|
|
1297
|
+
* external re-implementation when passing a custom fetch function to
|
|
1298
|
+
* YankiClient.
|
|
1299
|
+
*/
|
|
1300
|
+
type YankiFetchAdapter = (input: string, init?: {
|
|
1301
|
+
body?: string;
|
|
1302
|
+
headers?: Record<string, string>;
|
|
1303
|
+
method?: string;
|
|
1304
|
+
mode?: RequestMode;
|
|
1305
|
+
}) => Promise<undefined | {
|
|
1306
|
+
headers: Headers | Record<string, string>;
|
|
1307
|
+
json(): Promise<any>;
|
|
1308
|
+
status: number;
|
|
1309
|
+
}>;
|
|
1310
|
+
/** Optional options to pass when instantiating a new YankiConnect instance. */
|
|
1311
|
+
type YankiConnectOptions = {
|
|
1312
|
+
/**
|
|
1313
|
+
* Attempt to open the desktop Anki.app if it's not already running.
|
|
1314
|
+
*
|
|
1315
|
+
* - `true` will always attempt to open Anki _when a request is made_. This
|
|
1316
|
+
* might introduce significant latency on the first launch.
|
|
1317
|
+
* - `false` will never attempt to open Anki. Requests will fail until
|
|
1318
|
+
* something or someone else opens the Anki app.
|
|
1319
|
+
* - `immediately` is a special option that will open Anki when the client is
|
|
1320
|
+
* instantiated.
|
|
1321
|
+
*
|
|
1322
|
+
* The Anki desktop app must be running for the client and the underlying
|
|
1323
|
+
* Anki-Connect service to work.
|
|
1324
|
+
*
|
|
1325
|
+
* Currently supported on macOS only.
|
|
1326
|
+
*
|
|
1327
|
+
* The client does not attempt to close the app.
|
|
1328
|
+
* @default false
|
|
1329
|
+
*/
|
|
1330
|
+
autoLaunch: 'immediately' | boolean;
|
|
1331
|
+
/**
|
|
1332
|
+
* Advanced option to customize the resource fetch implementation used to make requests to Anki-Connect.
|
|
1333
|
+
*
|
|
1334
|
+
* Note that the signature reflects the subset of the built-in Fetch interface that's actually used by yanki-connect.
|
|
1335
|
+
*
|
|
1336
|
+
* The exact signature of this option is subject to change in the future.
|
|
1337
|
+
* @default fetch
|
|
1338
|
+
*/
|
|
1339
|
+
fetchAdapter: undefined | YankiFetchAdapter;
|
|
1340
|
+
/**
|
|
1341
|
+
* Host where the Anki-Connect service is running.
|
|
1342
|
+
* @default 'http://127.0.0.1'
|
|
1343
|
+
*/
|
|
1344
|
+
host: string;
|
|
1345
|
+
/**
|
|
1346
|
+
* Anki-Connect security key (optional)
|
|
1347
|
+
* @default undefined
|
|
1348
|
+
*/
|
|
1349
|
+
key: string | undefined;
|
|
1350
|
+
/**
|
|
1351
|
+
* Port where the Anki-Connect service is running.
|
|
1352
|
+
* @default 8765
|
|
1353
|
+
*/
|
|
1354
|
+
port: number;
|
|
1355
|
+
/**
|
|
1356
|
+
* Anki-Connect API version.
|
|
1357
|
+
*
|
|
1358
|
+
* Only API version 6 is supported for now.
|
|
1359
|
+
* @default 6
|
|
1360
|
+
*/
|
|
1361
|
+
version: AnkiConnectVersion;
|
|
1362
|
+
};
|
|
1363
|
+
//#endregion
|
|
1364
|
+
//#region src/lib/model/model.d.ts
|
|
1365
|
+
declare const yankiModels: [{
|
|
1366
|
+
readonly cardTemplates: [{
|
|
1367
|
+
readonly Back: "{{FrontSide}}\n\n<hr id=answer>\n\n{{Back}}";
|
|
1368
|
+
readonly Front: "{{Front}}";
|
|
1369
|
+
readonly YankiNamespace: "{{YankiNamespace}}";
|
|
1370
|
+
}];
|
|
1371
|
+
readonly inOrderFields: ["Front", "Back", "YankiNamespace"];
|
|
1372
|
+
readonly modelName: "Yanki - Basic";
|
|
1373
|
+
}, {
|
|
1374
|
+
readonly cardTemplates: [{
|
|
1375
|
+
readonly Back: "{{cloze:Front}}<br>\n{{Back}}";
|
|
1376
|
+
readonly Front: "{{cloze:Front}}";
|
|
1377
|
+
readonly YankiNamespace: "{{YankiNamespace}}";
|
|
1378
|
+
}];
|
|
1379
|
+
readonly inOrderFields: ["Front", "Back", "YankiNamespace"];
|
|
1380
|
+
readonly isCloze: true;
|
|
1381
|
+
readonly modelName: "Yanki - Cloze";
|
|
1382
|
+
}, {
|
|
1383
|
+
readonly cardTemplates: [{
|
|
1384
|
+
readonly Back: "{{Front}}\n\n<hr id=answer>\n\n{{type:Back}}";
|
|
1385
|
+
readonly Front: "{{Front}}\n\n{{type:Back}}";
|
|
1386
|
+
readonly YankiNamespace: "{{YankiNamespace}}";
|
|
1387
|
+
}];
|
|
1388
|
+
readonly inOrderFields: ["Front", "Back", "YankiNamespace"];
|
|
1389
|
+
readonly modelName: "Yanki - Basic (type in the answer)";
|
|
1390
|
+
}, {
|
|
1391
|
+
readonly cardTemplates: [{
|
|
1392
|
+
readonly Back: "{{FrontSide}}\n\n<hr id=answer>\n\n{{Back}}{{#Extra}}\n\n<hr>\n\n{{Extra}}{{/Extra}}";
|
|
1393
|
+
readonly Front: "{{Front}}";
|
|
1394
|
+
readonly YankiNamespace: "{{YankiNamespace}}";
|
|
1395
|
+
}, {
|
|
1396
|
+
readonly Back: "{{FrontSide}}\n\n<hr id=answer>\n\n{{Front}}{{#Extra}}\n\n<hr>\n\n{{Extra}}{{/Extra}}";
|
|
1397
|
+
readonly Front: "{{Back}}";
|
|
1398
|
+
readonly YankiNamespace: "{{YankiNamespace}}";
|
|
1399
|
+
}];
|
|
1400
|
+
readonly inOrderFields: ["Front", "Back", "Extra", "YankiNamespace"];
|
|
1401
|
+
readonly modelName: "Yanki - Basic (and reversed card with extra)";
|
|
1402
|
+
}];
|
|
1403
|
+
type YankiModelName = (typeof yankiModels)[number]['modelName'];
|
|
1404
|
+
//#endregion
|
|
1405
|
+
//#region src/lib/model/note.d.ts
|
|
1406
|
+
type YankiNote = Simplify<Omit<ParamsForAction<'addNote'>['note'], 'fields' | 'modelName' | 'options'> & {
|
|
1407
|
+
cards?: number[];
|
|
1408
|
+
fields: {
|
|
1409
|
+
Back: string;
|
|
1410
|
+
Extra?: string;
|
|
1411
|
+
Front: string;
|
|
1412
|
+
YankiNamespace: string;
|
|
1413
|
+
};
|
|
1414
|
+
modelName: YankiModelName;
|
|
1415
|
+
noteId: number | undefined;
|
|
1416
|
+
}>;
|
|
1417
|
+
//#endregion
|
|
1418
|
+
//#region src/lib/shared/types.d.ts
|
|
1419
|
+
type FetchAdapter = YankiFetchAdapter;
|
|
1420
|
+
type ManageFilenames = 'off' | 'prompt' | 'response';
|
|
1421
|
+
type SyncMediaAssets = 'all' | 'local' | 'off' | 'remote';
|
|
1422
|
+
type FileAdapter = {
|
|
1423
|
+
readFile(filePath: string): Promise<string>;
|
|
1424
|
+
readFileBuffer(filePath: string): Promise<Uint8Array>;
|
|
1425
|
+
rename(oldPath: string, newPath: string): Promise<void>;
|
|
1426
|
+
stat(filePath: string): Promise<{
|
|
1427
|
+
ctimeMs: number;
|
|
1428
|
+
mtimeMs: number;
|
|
1429
|
+
size: number;
|
|
1430
|
+
}>;
|
|
1431
|
+
writeFile(filePath: string, data: string): Promise<void>;
|
|
1432
|
+
};
|
|
1433
|
+
type GlobalOptions = {
|
|
1434
|
+
/**
|
|
1435
|
+
* Used for wiki link resolution
|
|
1436
|
+
*/
|
|
1437
|
+
allFilePaths: string[];
|
|
1438
|
+
ankiConnectOptions: YankiConnectOptions;
|
|
1439
|
+
/**
|
|
1440
|
+
* Automatically sync any changes to AnkiWeb after Yanki has finished syncing
|
|
1441
|
+
* locally. If false, only local Anki data is updated and you must manually
|
|
1442
|
+
* invoke a sync to AnkiWeb. This is the equivalent of pushing the "sync"
|
|
1443
|
+
* button in the Anki app.
|
|
1444
|
+
*/
|
|
1445
|
+
ankiWeb: boolean; /** Override where "/" should resolve to... useful in Obsidian to set the vault path as the "root" */
|
|
1446
|
+
basePath: string | undefined; /** Run Anki's "Check Database" command after sync updates that might produce card corruption */
|
|
1447
|
+
checkDatabase: boolean;
|
|
1448
|
+
cwd: string;
|
|
1449
|
+
dryRun: boolean;
|
|
1450
|
+
/**
|
|
1451
|
+
* Exposed for Obsidian, currently only used for getting URL content hashes
|
|
1452
|
+
* and inferring MIME types of URLs without extensions.
|
|
1453
|
+
* Note that ankiConnectOptions ALSO has a fetch adapter option specifically
|
|
1454
|
+
* for communicating with Anki-Connect.
|
|
1455
|
+
*/
|
|
1456
|
+
fetchAdapter: FetchAdapter | undefined;
|
|
1457
|
+
fileAdapter: FileAdapter | undefined;
|
|
1458
|
+
manageFilenames: ManageFilenames; /** Only applies if manageFilenames is `true`. Will _not_ truncate user-specified file names in other cases. */
|
|
1459
|
+
maxFilenameLength: number;
|
|
1460
|
+
namespace: string; /** Ensures that wiki-style links work correctly */
|
|
1461
|
+
obsidianVault: string | undefined; /** Exposed for testing only */
|
|
1462
|
+
resolveUrls: boolean;
|
|
1463
|
+
/**
|
|
1464
|
+
* Whether to treat single newlines in Markdown as line breaks in the
|
|
1465
|
+
* resulting HTML (Obsidian has an application-level setting for this)
|
|
1466
|
+
*/
|
|
1467
|
+
strictLineBreaks: boolean; /** Only consider exact noteId matches between the local and remote copies to be equivalent, don't match local notes with "orphaned" remote notes based on content */
|
|
1468
|
+
strictMatching: boolean; /** Sync image, video, and audio assets to Anki's media storage system */
|
|
1469
|
+
syncMediaAssets: SyncMediaAssets;
|
|
1470
|
+
};
|
|
1471
|
+
//#endregion
|
|
1472
|
+
//#region src/lib/actions/clean.d.ts
|
|
1473
|
+
type CleanOptions = Pick<GlobalOptions, 'ankiConnectOptions' | 'ankiWeb' | 'dryRun' | 'namespace'>;
|
|
1474
|
+
declare const defaultCleanOptions: CleanOptions;
|
|
1475
|
+
type CleanResult = Simplify<Pick<GlobalOptions, 'ankiWeb' | 'dryRun' | 'namespace'> & {
|
|
1476
|
+
deletedDecks: string[];
|
|
1477
|
+
deletedMedia: string[];
|
|
1478
|
+
deletedNotes: YankiNote[];
|
|
1479
|
+
duration: number;
|
|
1480
|
+
}>;
|
|
1481
|
+
/**
|
|
1482
|
+
* Deletes all remote notes in Anki associated with the given namespace.
|
|
1483
|
+
*
|
|
1484
|
+
* Use with significant caution. Mostly useful for testing.
|
|
1485
|
+
* @returns The IDs of the notes that were deleted
|
|
1486
|
+
* @throws {Error} If Anki is unreachable or another error occurs during deletion.
|
|
1487
|
+
*/
|
|
1488
|
+
declare function cleanNotes(options?: PartialDeep<CleanOptions>): Promise<CleanResult>;
|
|
1489
|
+
declare function formatCleanResult(result: CleanResult, verbose?: boolean): string;
|
|
1490
|
+
//#endregion
|
|
1491
|
+
//#region src/lib/actions/list.d.ts
|
|
1492
|
+
type ListOptions = Pick<GlobalOptions, 'ankiConnectOptions' | 'namespace'>;
|
|
1493
|
+
declare const defaultListOptions: ListOptions;
|
|
1494
|
+
type ListResult = {
|
|
1495
|
+
duration: number;
|
|
1496
|
+
namespace: string;
|
|
1497
|
+
notes: YankiNote[];
|
|
1498
|
+
};
|
|
1499
|
+
/**
|
|
1500
|
+
* Description List notes currently in Anki...
|
|
1501
|
+
*/
|
|
1502
|
+
declare function listNotes(options?: PartialDeep<ListOptions>): Promise<ListResult>;
|
|
1503
|
+
declare function formatListResult(result: ListResult): string;
|
|
1504
|
+
//#endregion
|
|
1505
|
+
//#region src/lib/actions/load-local-notes.d.ts
|
|
1506
|
+
type LoadOptions = Pick<GlobalOptions, 'allFilePaths' | 'basePath' | 'fetchAdapter' | 'fileAdapter' | 'namespace' | 'obsidianVault' | 'strictLineBreaks' | 'syncMediaAssets'>;
|
|
1507
|
+
type LocalNote = {
|
|
1508
|
+
filePath: string;
|
|
1509
|
+
filePathOriginal: string;
|
|
1510
|
+
markdown: string;
|
|
1511
|
+
note: YankiNote;
|
|
1512
|
+
};
|
|
1513
|
+
//#endregion
|
|
1514
|
+
//#region src/lib/actions/rename.d.ts
|
|
1515
|
+
type RenameNotesOptions = Pick<GlobalOptions, 'dryRun' | 'fileAdapter' | 'manageFilenames' | 'maxFilenameLength' /** Included because this can technically change the content of the "first line" of a card */ | 'strictLineBreaks'>;
|
|
1516
|
+
type RenameFilesResult = {
|
|
1517
|
+
dryRun: boolean;
|
|
1518
|
+
notes: LocalNote[];
|
|
1519
|
+
};
|
|
1520
|
+
type RenameFilesOptions = Simplify<LoadOptions & RenameNotesOptions>;
|
|
1521
|
+
declare const defaultRenameFilesOptions: RenameFilesOptions;
|
|
1522
|
+
/**
|
|
1523
|
+
* Currently used for testing and by `yanki-obsidian`.
|
|
1524
|
+
*/
|
|
1525
|
+
declare function renameFiles(allLocalFilePaths: string[], options: Partial<RenameFilesOptions>): Promise<RenameFilesResult>;
|
|
1526
|
+
//#endregion
|
|
1527
|
+
//#region src/lib/actions/style.d.ts
|
|
1528
|
+
type SetStyleOptions = Pick<GlobalOptions, 'ankiConnectOptions' | 'ankiWeb' | 'dryRun'> & {
|
|
1529
|
+
css: string;
|
|
1530
|
+
};
|
|
1531
|
+
declare const defaultSetStyleOptions: SetStyleOptions;
|
|
1532
|
+
type SetStyleResult = Simplify<Pick<GlobalOptions, 'ankiWeb' | 'dryRun'> & {
|
|
1533
|
+
duration: number;
|
|
1534
|
+
models: Array<{
|
|
1535
|
+
action: 'unchanged' | 'updated';
|
|
1536
|
+
name: string;
|
|
1537
|
+
}>;
|
|
1538
|
+
}>;
|
|
1539
|
+
type GetStyleOptions = Pick<GlobalOptions, 'ankiConnectOptions'>;
|
|
1540
|
+
declare const defaultGetStyleOptions: GetStyleOptions;
|
|
1541
|
+
declare function getStyle(options: PartialDeep<GetStyleOptions>): Promise<string>;
|
|
1542
|
+
declare function setStyle(options?: PartialDeep<SetStyleOptions>): Promise<SetStyleResult>;
|
|
1543
|
+
declare function formatSetStyleResult(result: SetStyleResult, verbose?: boolean): string;
|
|
1544
|
+
//#endregion
|
|
1545
|
+
//#region src/lib/actions/sync-notes.d.ts
|
|
1546
|
+
type SyncedNote = {
|
|
1547
|
+
action: 'ankiUnreachable' | 'created' | 'deleted' | 'matched' | 'unchanged' | 'updated';
|
|
1548
|
+
note: YankiNote;
|
|
1549
|
+
};
|
|
1550
|
+
type SyncNotesOptions = Pick<GlobalOptions, 'ankiConnectOptions' | 'ankiWeb' | 'checkDatabase' | 'dryRun' | 'fileAdapter' | 'namespace' | 'strictMatching'>;
|
|
1551
|
+
declare const defaultSyncNotesOptions: SyncNotesOptions;
|
|
1552
|
+
type SyncNotesResult = Simplify<Pick<GlobalOptions, 'ankiWeb' | 'dryRun' | 'namespace'> & {
|
|
1553
|
+
deletedDecks: string[];
|
|
1554
|
+
deletedMedia: string[];
|
|
1555
|
+
duration: number;
|
|
1556
|
+
fixedDatabase: boolean;
|
|
1557
|
+
synced: SyncedNote[];
|
|
1558
|
+
}>;
|
|
1559
|
+
/**
|
|
1560
|
+
* Syncs local notes to Anki.
|
|
1561
|
+
* @param allLocalNotes All the YankiNotes to sync
|
|
1562
|
+
* @returns The synced notes (with new IDs where applicable), plus some stats
|
|
1563
|
+
* about the sync
|
|
1564
|
+
* @throws {Error} For various reasons...
|
|
1565
|
+
*/
|
|
1566
|
+
declare function syncNotes(allLocalNotes: YankiNote[], options?: PartialDeep<SyncNotesOptions>): Promise<SyncNotesResult>;
|
|
1567
|
+
//#endregion
|
|
1568
|
+
//#region src/lib/actions/sync-files.d.ts
|
|
1569
|
+
type SyncFilesOptions = Simplify<Pick<GlobalOptions, 'allFilePaths' | 'basePath' | 'fetchAdapter' | 'fileAdapter' | 'manageFilenames' | 'maxFilenameLength' | 'obsidianVault' | 'strictLineBreaks' | 'syncMediaAssets'> & SyncNotesOptions>;
|
|
1570
|
+
declare const defaultSyncFilesOptions: SyncFilesOptions;
|
|
1571
|
+
type SyncedFile = Simplify<SyncedNote & {
|
|
1572
|
+
filePath: string | undefined;
|
|
1573
|
+
filePathOriginal: string | undefined;
|
|
1574
|
+
}>;
|
|
1575
|
+
type SyncFilesResult = Simplify<Omit<SyncNotesResult, 'synced'> & {
|
|
1576
|
+
synced: SyncedFile[];
|
|
1577
|
+
}>;
|
|
1578
|
+
/**
|
|
1579
|
+
* Sync a list of local yanki files to Anki.
|
|
1580
|
+
*
|
|
1581
|
+
* Wraps the syncNotes function to handle file I/O.
|
|
1582
|
+
*
|
|
1583
|
+
* Most importantly, it updates the note IDs in the frontmatter of the local
|
|
1584
|
+
* files.
|
|
1585
|
+
* @param allLocalFilePaths Array of paths to the local markdown files
|
|
1586
|
+
* @returns The synced files (with new IDs where applicable), plus some stats
|
|
1587
|
+
* about the sync
|
|
1588
|
+
* @throws {Error} If syncing fails or file operations encounter an error.
|
|
1589
|
+
*/
|
|
1590
|
+
declare function syncFiles(allLocalFilePaths: string[], options?: PartialDeep<SyncFilesOptions>): Promise<SyncFilesResult>;
|
|
1591
|
+
declare function formatSyncFilesResult(result: SyncFilesResult, verbose?: boolean): string;
|
|
1592
|
+
//#endregion
|
|
1593
|
+
//#region src/lib/parse/parse.d.ts
|
|
1594
|
+
type GetNoteFromMarkdownOptions = Pick<GlobalOptions, 'allFilePaths' | 'basePath' | 'cwd' | 'fetchAdapter' | 'fileAdapter' | 'namespace' | 'obsidianVault' | 'resolveUrls' | 'strictLineBreaks' | 'syncMediaAssets'> & {
|
|
1595
|
+
/** Needed for the public API, but optional for more efficient use internally when the namespace is already validated. */namespaceValidationAndSanitization: boolean;
|
|
1596
|
+
};
|
|
1597
|
+
declare const defaultGetNoteFromMarkdownOptions: GetNoteFromMarkdownOptions;
|
|
1598
|
+
declare function getNoteFromMarkdown(markdown: string, options?: Partial<GetNoteFromMarkdownOptions>): Promise<YankiNote>;
|
|
1599
|
+
//#endregion
|
|
1600
|
+
//#region src/lib/utilities/url.d.ts
|
|
1601
|
+
declare function urlToHostAndPort(url: string): undefined | {
|
|
1602
|
+
host: string;
|
|
1603
|
+
port: number;
|
|
1604
|
+
};
|
|
1605
|
+
declare function hostAndPortToUrl(host: string, port: number): string;
|
|
1606
|
+
//#endregion
|
|
1607
|
+
export { type CleanOptions, type CleanResult, type FetchAdapter, type FileAdapter, type GetNoteFromMarkdownOptions, type GetStyleOptions, type ListOptions, type RenameFilesOptions, type RenameFilesResult, type SetStyleOptions, type SetStyleResult, type SyncFilesOptions, type SyncFilesResult, type SyncNotesOptions, type SyncNotesResult, type YankiNote, cleanNotes, defaultCleanOptions, defaultGetNoteFromMarkdownOptions, defaultGetStyleOptions, defaultListOptions, defaultRenameFilesOptions, defaultSetStyleOptions, defaultSyncFilesOptions, defaultSyncNotesOptions, formatCleanResult, formatListResult, formatSetStyleResult, formatSyncFilesResult, getNoteFromMarkdown, getStyle, hostAndPortToUrl, listNotes, renameFiles, setStyle, syncFiles, syncNotes, urlToHostAndPort };
|