yanki 1.2.11 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (304) hide show
  1. package/dist/bin/cli.js +58 -9
  2. package/dist/lib/index.d.ts +144 -1604
  3. package/dist/lib/index.js +50 -1
  4. package/package.json +31 -26
  5. package/readme.md +2 -2
  6. package/dist/abap-Dg923wIy.js +0 -1
  7. package/dist/actionscript-3-8WTK4YD2.js +0 -1
  8. package/dist/ada-CTi7YQtL.js +0 -1
  9. package/dist/andromeeda-CT0vplkN.js +0 -1
  10. package/dist/angular-html-rCdPnZ8w.js +0 -1
  11. package/dist/angular-ts-DYCYVCHu.js +0 -1
  12. package/dist/apache-PcO-DBxQ.js +0 -1
  13. package/dist/apex-CnCu5_gb.js +0 -1
  14. package/dist/apl-B743j01p.js +0 -1
  15. package/dist/applescript-BWh8DkcF.js +0 -1
  16. package/dist/ara-C1--7J61.js +0 -1
  17. package/dist/asciidoc-CkWYjVYI.js +0 -1
  18. package/dist/asm-CTFRnVOM.js +0 -1
  19. package/dist/astro-DHbdk5O0.js +0 -1
  20. package/dist/aurora-x-C0VKFdlO.js +0 -1
  21. package/dist/awk-CrWgQKhV.js +0 -1
  22. package/dist/ayu-dark-BJpTlUew.js +0 -1
  23. package/dist/ayu-light-O0eOCvqE.js +0 -1
  24. package/dist/ayu-mirage-BC8LA-_7.js +0 -1
  25. package/dist/ballerina-a0yOSyc5.js +0 -1
  26. package/dist/bat-B0cHNp6s.js +0 -1
  27. package/dist/beancount-dPJi_gci.js +0 -1
  28. package/dist/berry-CVKoklHx.js +0 -1
  29. package/dist/bibtex-DRcCXNgM.js +0 -1
  30. package/dist/bicep-jWz-hQ8I.js +0 -1
  31. package/dist/blade-h41ErOi-.js +0 -1
  32. package/dist/bsl-C7rNYC9b.js +0 -1
  33. package/dist/c-BG-tZi7o.js +0 -1
  34. package/dist/c3-2rTjmrCP.js +0 -1
  35. package/dist/cadence-BuaeHeSu.js +0 -1
  36. package/dist/cairo-BHkUC1B6.js +0 -1
  37. package/dist/catppuccin-frappe-D3lHSMns.js +0 -1
  38. package/dist/catppuccin-latte-DoBaWTGn.js +0 -1
  39. package/dist/catppuccin-macchiato-BkAuvdZC.js +0 -1
  40. package/dist/catppuccin-mocha-D9fcC0iT.js +0 -1
  41. package/dist/clarity-CC_0IFDj.js +0 -1
  42. package/dist/clojure-KnfDkB_V.js +0 -1
  43. package/dist/cmake-bh2MLnkv.js +0 -1
  44. package/dist/cobol-WHXSr_Wd.js +0 -1
  45. package/dist/codeowners-CtwIM3TN.js +0 -1
  46. package/dist/codeql-D164juXQ.js +0 -1
  47. package/dist/coffee-BWKAfs2s.js +0 -1
  48. package/dist/common-lisp-DXc9XcIM.js +0 -1
  49. package/dist/coq-BCSFDxg0.js +0 -1
  50. package/dist/cpp-CTmscSNZ.js +0 -1
  51. package/dist/crystal-BFJuErkW.js +0 -1
  52. package/dist/csharp-B7nLXyi8.js +0 -1
  53. package/dist/css-PZBBrkI0.js +0 -1
  54. package/dist/csv-D5aBhKLr.js +0 -1
  55. package/dist/cue-WCin6O4e.js +0 -1
  56. package/dist/cypher-DYQk2G82.js +0 -1
  57. package/dist/d-DVc-yF-l.js +0 -1
  58. package/dist/dark-plus-DLU5INA3.js +0 -1
  59. package/dist/dart-YLd5yyRs.js +0 -1
  60. package/dist/dax-oldcCaJg.js +0 -1
  61. package/dist/desktop-DZfyBMgF.js +0 -1
  62. package/dist/diff-jW5kmiru.js +0 -1
  63. package/dist/docker-DG9neUKd.js +0 -1
  64. package/dist/dotenv-Bea-FkXq.js +0 -1
  65. package/dist/dracula-XcYHBZy6.js +0 -1
  66. package/dist/dracula-soft-BPeX9gxW.js +0 -1
  67. package/dist/dream-maker-DAHQwpwp.js +0 -1
  68. package/dist/edge-BvW7BRWT.js +0 -1
  69. package/dist/elixir-C40XQAD9.js +0 -1
  70. package/dist/elm-DzXNHNQT.js +0 -1
  71. package/dist/emacs-lisp-BdGsgvrR.js +0 -1
  72. package/dist/erb-C4CxwLi_.js +0 -1
  73. package/dist/erlang-Jhp2iHYS.js +0 -1
  74. package/dist/everforest-dark-WOub3wle.js +0 -1
  75. package/dist/everforest-light-DCUg8VH8.js +0 -1
  76. package/dist/fennel-BH6gVCng.js +0 -1
  77. package/dist/fish-BxskpYPN.js +0 -1
  78. package/dist/fluent-Bwo2XpEt.js +0 -1
  79. package/dist/fortran-fixed-form-DoFUIhSC.js +0 -1
  80. package/dist/fortran-free-form-DB5N_DgY.js +0 -1
  81. package/dist/fsharp-DHaf8n3s.js +0 -1
  82. package/dist/gdresource--mAQ4nUO.js +0 -1
  83. package/dist/gdscript-C3mT4Uym.js +0 -1
  84. package/dist/gdshader-G7X6ysY3.js +0 -1
  85. package/dist/genie-DSsjfZMX.js +0 -1
  86. package/dist/gherkin-Cbsyuvab.js +0 -1
  87. package/dist/git-commit-CesLaiSz.js +0 -1
  88. package/dist/git-rebase-B9wKr8Mu.js +0 -1
  89. package/dist/github-dark-BQV5ugrc.js +0 -1
  90. package/dist/github-dark-default-DLWDM7FH.js +0 -1
  91. package/dist/github-dark-dimmed-D1FmiR_p.js +0 -1
  92. package/dist/github-dark-high-contrast-BilLoi0o.js +0 -1
  93. package/dist/github-light-Rcb2q3L5.js +0 -1
  94. package/dist/github-light-default-CQ75esMw.js +0 -1
  95. package/dist/github-light-high-contrast-CRF1wyLy.js +0 -1
  96. package/dist/gleam-BeBqoPwE.js +0 -1
  97. package/dist/glimmer-js-3dwOmeU7.js +0 -1
  98. package/dist/glimmer-ts-CGrdEN9y.js +0 -1
  99. package/dist/glsl-CJ5UNUz7.js +0 -1
  100. package/dist/gn-Dxr0sSUf.js +0 -1
  101. package/dist/gnuplot-CtW3R_Hz.js +0 -1
  102. package/dist/go-BBr2UQCn.js +0 -1
  103. package/dist/graphql-BXLvmlOo.js +0 -1
  104. package/dist/groovy-DFxE31Qs.js +0 -1
  105. package/dist/gruvbox-dark-hard-C37G1gbc.js +0 -1
  106. package/dist/gruvbox-dark-medium-C3G9m3TV.js +0 -1
  107. package/dist/gruvbox-dark-soft-eZmcmZ9I.js +0 -1
  108. package/dist/gruvbox-light-hard-BYj-vz_3.js +0 -1
  109. package/dist/gruvbox-light-medium-BdQlDiiF.js +0 -1
  110. package/dist/gruvbox-light-soft-BGNwjiRh.js +0 -1
  111. package/dist/hack-BVNIISZD.js +0 -1
  112. package/dist/haml-CNL2qJ9f.js +0 -1
  113. package/dist/handlebars-X5srullM.js +0 -1
  114. package/dist/haskell-CeCR1-Hh.js +0 -1
  115. package/dist/haxe-DVIybFAS.js +0 -1
  116. package/dist/hcl-B6OePqme.js +0 -1
  117. package/dist/hjson-D2jn7IRw.js +0 -1
  118. package/dist/hlsl-MKeth5V9.js +0 -1
  119. package/dist/horizon-cslQss18.js +0 -1
  120. package/dist/houston-RHIKkNfR.js +0 -1
  121. package/dist/html-B4bznzA2.js +0 -1
  122. package/dist/html-derivative-CD1Z7kSG.js +0 -1
  123. package/dist/http-Bb0P8zvE.js +0 -1
  124. package/dist/hurl-DdMgw5nt.js +0 -1
  125. package/dist/hxml-BdTS9Zj7.js +0 -1
  126. package/dist/hy-BZMqGtQj.js +0 -1
  127. package/dist/imba-D-Pk5S0X.js +0 -1
  128. package/dist/index-ClVrxBsa.js +0 -2
  129. package/dist/ini-Dix3pTmg.js +0 -1
  130. package/dist/java-BTDmaRNO.js +0 -1
  131. package/dist/javascript-WyGyM1wV.js +0 -1
  132. package/dist/jinja-Cibv3n81.js +0 -1
  133. package/dist/jison-CZOoZOej.js +0 -1
  134. package/dist/json-B8JryHcM.js +0 -1
  135. package/dist/json5-Cdatmj9n.js +0 -1
  136. package/dist/jsonc-CvUCa1o5.js +0 -1
  137. package/dist/jsonl-9I_GBd5L.js +0 -1
  138. package/dist/jsonnet-XoenQ2oc.js +0 -1
  139. package/dist/jssm-CWE2S0Z5.js +0 -1
  140. package/dist/jsx-8cLv2Six.js +0 -1
  141. package/dist/julia-DIzTBDVk.js +0 -1
  142. package/dist/kanagawa-dragon-BOvIHJVT.js +0 -1
  143. package/dist/kanagawa-lotus-Bwcd7Bvx.js +0 -1
  144. package/dist/kanagawa-wave-0SAlpf0s.js +0 -1
  145. package/dist/kdl-CMbyIXjQ.js +0 -1
  146. package/dist/kotlin-BQy537ds.js +0 -1
  147. package/dist/kusto-B_y0uMaZ.js +0 -1
  148. package/dist/laserwave-si7wuSrt.js +0 -1
  149. package/dist/latex-B3uSg0EJ.js +0 -1
  150. package/dist/lean-7hWDN_w4.js +0 -1
  151. package/dist/less-CaoNcwlE.js +0 -1
  152. package/dist/light-plus-g_Fi9vkG.js +0 -1
  153. package/dist/liquid-e5bbsXXe.js +0 -1
  154. package/dist/llvm-CiYQeg8E.js +0 -1
  155. package/dist/log-CcaF_xNv.js +0 -1
  156. package/dist/logo-D9WQLoKQ.js +0 -1
  157. package/dist/lua-CCXtT60v.js +0 -1
  158. package/dist/luau-BTSFCcFb.js +0 -1
  159. package/dist/make-DXVx14cr.js +0 -1
  160. package/dist/markdown-DX-TNHnc.js +0 -1
  161. package/dist/marko-CFpKsLoh.js +0 -1
  162. package/dist/material-theme-CIJ3cGaW.js +0 -1
  163. package/dist/material-theme-darker-BWg3m1GB.js +0 -1
  164. package/dist/material-theme-lighter-DR8HWMN7.js +0 -1
  165. package/dist/material-theme-ocean-CZf9pk28.js +0 -1
  166. package/dist/material-theme-palenight-BF01YeZy.js +0 -1
  167. package/dist/matlab-DzreyMvm.js +0 -1
  168. package/dist/mdc-BX9nsEef.js +0 -1
  169. package/dist/mdx-C2fqO2XY.js +0 -1
  170. package/dist/mermaid-Cwy4Up_p.js +0 -1
  171. package/dist/min-dark-DhfaepVE.js +0 -1
  172. package/dist/min-light-6xx0uMgm.js +0 -1
  173. package/dist/mipsasm-yE_Aqo9y.js +0 -1
  174. package/dist/mojo-Bk-6ipf4.js +0 -1
  175. package/dist/monokai-BodnsaDQ.js +0 -1
  176. package/dist/moonbit-C7bLf9Bh.js +0 -1
  177. package/dist/move-CyYMWVy5.js +0 -1
  178. package/dist/narrat-DXUZ_ZkW.js +0 -1
  179. package/dist/nextflow-MPHPbw14.js +0 -1
  180. package/dist/nginx-DGL4151v.js +0 -1
  181. package/dist/night-owl-EdP2Hztp.js +0 -1
  182. package/dist/night-owl-light-Bk-lYVyk.js +0 -1
  183. package/dist/nim-CvfVE-Jm.js +0 -1
  184. package/dist/nix-Ckjrpg0r.js +0 -1
  185. package/dist/nord-BAu0wM6c.js +0 -1
  186. package/dist/nushell-8dnicoUR.js +0 -1
  187. package/dist/objective-c-BoaBTdtz.js +0 -1
  188. package/dist/objective-cpp-DstR8hNy.js +0 -1
  189. package/dist/ocaml-DTbn2Hv7.js +0 -1
  190. package/dist/odin-Bxc4S6Xn.js +0 -1
  191. package/dist/one-dark-pro-utPxbBbJ.js +0 -1
  192. package/dist/one-light-BuCQ22aO.js +0 -1
  193. package/dist/openscad-CXHpNBsb.js +0 -1
  194. package/dist/pascal-Sr-XLSE6.js +0 -1
  195. package/dist/perl-Dl-vCdjY.js +0 -1
  196. package/dist/php-BnUU948c.js +0 -1
  197. package/dist/pkl-CRusufhw.js +0 -1
  198. package/dist/plastic-CXnNNlFZ.js +0 -1
  199. package/dist/plsql-Dbm3tV2N.js +0 -1
  200. package/dist/po-LG0lFwH4.js +0 -1
  201. package/dist/poimandres-BrOVMvuE.js +0 -1
  202. package/dist/polar-DjOs3GWb.js +0 -1
  203. package/dist/postcss-GRRkWn2F.js +0 -1
  204. package/dist/powerquery-DHf-dtTS.js +0 -1
  205. package/dist/powershell-CubgGmZX.js +0 -1
  206. package/dist/prisma-Dgf8IN_C.js +0 -1
  207. package/dist/prolog-9JcfiY6I.js +0 -1
  208. package/dist/proto-dqx_Sj2i.js +0 -1
  209. package/dist/pug-jKFt5v09.js +0 -1
  210. package/dist/puppet-B4ctDsrh.js +0 -1
  211. package/dist/purescript-B-mlhevv.js +0 -1
  212. package/dist/python-B6Ihcp-E.js +0 -1
  213. package/dist/qml-CXQr5hi3.js +0 -1
  214. package/dist/qmldir-DXd9s5XC.js +0 -1
  215. package/dist/qss-B7NnhfIi.js +0 -1
  216. package/dist/r-1ts4xG1r.js +0 -1
  217. package/dist/racket-CrxT4k8p.js +0 -1
  218. package/dist/raku-B9ngR1rt.js +0 -1
  219. package/dist/razor-AVvyMHo4.js +0 -1
  220. package/dist/red-DR6ZwibK.js +0 -1
  221. package/dist/reg-Cvyu2Gnx.js +0 -1
  222. package/dist/regexp-DK-WlHNu.js +0 -1
  223. package/dist/rel-CYd0g8C5.js +0 -1
  224. package/dist/riscv-C5dpdlr7.js +0 -1
  225. package/dist/ron-U45VO4hY.js +0 -1
  226. package/dist/rose-pine-Cd1NG3HO.js +0 -1
  227. package/dist/rose-pine-dawn-eauBvPfk.js +0 -1
  228. package/dist/rose-pine-moon-B3tSb9zr.js +0 -1
  229. package/dist/rosmsg-ZkSIzPhc.js +0 -1
  230. package/dist/rst-DwFZPvOu.js +0 -1
  231. package/dist/ruby-C0v-A00B.js +0 -1
  232. package/dist/rust-CxuBE0J8.js +0 -1
  233. package/dist/sas-9Dvcn_Se.js +0 -1
  234. package/dist/sass-bfEVHPJ8.js +0 -1
  235. package/dist/scala-Dtw19ca_.js +0 -1
  236. package/dist/scheme-OJppFQF3.js +0 -1
  237. package/dist/scss-CFlr0x0u.js +0 -1
  238. package/dist/sdbl-Bd9eE8IL.js +0 -1
  239. package/dist/shaderlab-CJHdEwFw.js +0 -1
  240. package/dist/shellscript-DgJyDXW6.js +0 -1
  241. package/dist/shellsession-BqFY_Jl7.js +0 -1
  242. package/dist/slack-dark-CWRQmTmo.js +0 -1
  243. package/dist/slack-ochin-DO_ok7XK.js +0 -1
  244. package/dist/smalltalk-B9IHbYt7.js +0 -1
  245. package/dist/snazzy-light-B5llO_gK.js +0 -1
  246. package/dist/solarized-dark-G9yBjKj_.js +0 -1
  247. package/dist/solarized-light-DeSzljQz.js +0 -1
  248. package/dist/solidity-B3CjIuAd.js +0 -1
  249. package/dist/soy-BnGnvCkT.js +0 -1
  250. package/dist/sparql-Ckj_9Rg5.js +0 -1
  251. package/dist/splunk-h-bNAnbk.js +0 -1
  252. package/dist/sql-BbONfI8K.js +0 -1
  253. package/dist/ssh-config-CywOjoXH.js +0 -1
  254. package/dist/stata-eYSq_k6x.js +0 -1
  255. package/dist/stylus-CIg617SB.js +0 -1
  256. package/dist/surrealql-W2k3R_tb.js +0 -1
  257. package/dist/svelte-Bq7yX3Ip.js +0 -1
  258. package/dist/swift-D8uC5CNv.js +0 -1
  259. package/dist/sync-files-Zngz3Rg8.js +0 -962
  260. package/dist/synthwave-84-DRVv-_m_.js +0 -1
  261. package/dist/system-verilog-Qdm_1g2q.js +0 -1
  262. package/dist/systemd-DMp0udv_.js +0 -1
  263. package/dist/talonscript-eRuyeYHl.js +0 -1
  264. package/dist/tasl-B9CVvjfG.js +0 -1
  265. package/dist/tcl-Bq9dbVAF.js +0 -1
  266. package/dist/templ-BIQx08BK.js +0 -1
  267. package/dist/terraform-CAp711iT.js +0 -1
  268. package/dist/tex-Dpq9weyt.js +0 -1
  269. package/dist/tokyo-night-BvwC8l2v.js +0 -1
  270. package/dist/toml-Ms459DBw.js +0 -1
  271. package/dist/ts-tags-D-LANnn2.js +0 -1
  272. package/dist/tsv-BFtm7NXx.js +0 -1
  273. package/dist/tsx-D6116Ycy.js +0 -1
  274. package/dist/turtle-DpRhbQZY.js +0 -1
  275. package/dist/twig-BCfKcIax.js +0 -1
  276. package/dist/typescript-BqvgUolh.js +0 -1
  277. package/dist/typespec-DhK7u29_.js +0 -1
  278. package/dist/typst-Dfd71gQj.js +0 -1
  279. package/dist/v-BH76v7br.js +0 -1
  280. package/dist/vala-z59IxkFd.js +0 -1
  281. package/dist/vb-4AxSLKIU.js +0 -1
  282. package/dist/verilog-LfQUkHDc.js +0 -1
  283. package/dist/vesper--t9w6MWz.js +0 -1
  284. package/dist/vhdl-DJCsFYgn.js +0 -1
  285. package/dist/viml-pbKHW3Ia.js +0 -1
  286. package/dist/vitesse-black-B_BYPdvp.js +0 -1
  287. package/dist/vitesse-dark-DOSOf2Sz.js +0 -1
  288. package/dist/vitesse-light-gUX51GpB.js +0 -1
  289. package/dist/vue-FQ0hgXO-.js +0 -1
  290. package/dist/vue-html-DH1-x0xc.js +0 -1
  291. package/dist/vue-vine-DeUyrIQS.js +0 -1
  292. package/dist/vyper-DpazWNpx.js +0 -1
  293. package/dist/wasm-CFi-k9--.js +0 -1
  294. package/dist/wasm-CiQ5tcoN.js +0 -1
  295. package/dist/wenyan-DoPRjnAP.js +0 -1
  296. package/dist/wgsl-CxjTZs-b.js +0 -1
  297. package/dist/wikitext-Bx2qct8O.js +0 -1
  298. package/dist/wit-DDW3hD69.js +0 -1
  299. package/dist/wolfram-pu21K997.js +0 -1
  300. package/dist/xml-BhAxjPaW.js +0 -1
  301. package/dist/xsl-6n2rlM5j.js +0 -1
  302. package/dist/yaml-Bopit2L3.js +0 -1
  303. package/dist/zenscript-BIAKq-aR.js +0 -1
  304. package/dist/zig-bSFrHQ7n.js +0 -1
@@ -1,1586 +1,122 @@
1
- /**
2
- Matches any [primitive value](https://developer.mozilla.org/en-US/docs/Glossary/Primitive).
3
-
4
- @category Type
5
- */
6
- type Primitive =
7
- | null
8
- | undefined
9
- | string
10
- | number
11
- | boolean
12
- | symbol
13
- | bigint;
14
-
15
- /**
16
- Returns a boolean for whether the given type is `any`.
17
-
18
- @link https://stackoverflow.com/a/49928360/1490091
19
-
20
- Useful in type utilities, such as disallowing `any`s to be passed to a function.
21
-
22
- @example
23
- ```
24
- import type {IsAny} from 'type-fest';
25
-
26
- const typedObject = {a: 1, b: 2} as const;
27
- const anyObject: any = {a: 1, b: 2};
28
-
29
- function get<O extends (IsAny<O> extends true ? {} : Record<string, number>), K extends keyof O = keyof O>(object: O, key: K) {
30
- return object[key];
31
- }
32
-
33
- const typedA = get(typedObject, 'a');
34
- //=> 1
35
-
36
- const anyA = get(anyObject, 'a');
37
- //=> any
38
- ```
39
-
40
- @category Type Guard
41
- @category Utilities
42
- */
43
- type IsAny<T> = 0 extends 1 & NoInfer<T> ? true : false;
44
-
45
- /**
46
- Returns a boolean for whether the given key is an optional key of type.
47
-
48
- This is useful when writing utility types or schema validators that need to differentiate `optional` keys.
49
-
50
- @example
51
- ```
52
- import type {IsOptionalKeyOf} from 'type-fest';
53
-
54
- type User = {
55
- name: string;
56
- surname: string;
57
-
58
- luckyNumber?: number;
59
- };
60
-
61
- type Admin = {
62
- name: string;
63
- surname?: string;
64
- };
65
-
66
- type T1 = IsOptionalKeyOf<User, 'luckyNumber'>;
67
- //=> true
68
-
69
- type T2 = IsOptionalKeyOf<User, 'name'>;
70
- //=> false
71
-
72
- type T3 = IsOptionalKeyOf<User, 'name' | 'luckyNumber'>;
73
- //=> boolean
74
-
75
- type T4 = IsOptionalKeyOf<User | Admin, 'name'>;
76
- //=> false
77
-
78
- type T5 = IsOptionalKeyOf<User | Admin, 'surname'>;
79
- //=> boolean
80
- ```
81
-
82
- @category Type Guard
83
- @category Utilities
84
- */
85
- type IsOptionalKeyOf<Type extends object, Key extends keyof Type> =
86
- IsAny<Type | Key> extends true ? never
87
- : Key extends keyof Type
88
- ? Type extends Record<Key, Type[Key]>
89
- ? false
90
- : true
91
- : false;
92
-
93
- /**
94
- Extract all optional keys from the given type.
95
-
96
- This is useful when you want to create a new type that contains different type values for the optional keys only.
97
-
98
- @example
99
- ```
100
- import type {OptionalKeysOf, Except} from 'type-fest';
101
-
102
- type User = {
103
- name: string;
104
- surname: string;
105
-
106
- luckyNumber?: number;
107
- };
108
-
109
- const REMOVE_FIELD = Symbol('remove field symbol');
110
- type UpdateOperation<Entity extends object> = Except<Partial<Entity>, OptionalKeysOf<Entity>> & {
111
- [Key in OptionalKeysOf<Entity>]?: Entity[Key] | typeof REMOVE_FIELD;
112
- };
113
-
114
- const update1: UpdateOperation<User> = {
115
- name: 'Alice',
116
- };
117
-
118
- const update2: UpdateOperation<User> = {
119
- name: 'Bob',
120
- luckyNumber: REMOVE_FIELD,
121
- };
122
- ```
123
-
124
- @category Utilities
125
- */
126
- type OptionalKeysOf<Type extends object> =
127
- Type extends unknown // For distributing `Type`
128
- ? (keyof {[Key in keyof Type as
129
- IsOptionalKeyOf<Type, Key> extends false
130
- ? never
131
- : Key
132
- ]: never
133
- }) & keyof Type // Intersect with `keyof Type` to ensure result of `OptionalKeysOf<Type>` is always assignable to `keyof Type`
134
- : never; // Should never happen
135
-
136
- /**
137
- Extract all required keys from the given type.
138
-
139
- 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...
140
-
141
- @example
142
- ```
143
- import type {RequiredKeysOf} from 'type-fest';
144
-
145
- declare function createValidation<
146
- Entity extends object,
147
- Key extends RequiredKeysOf<Entity> = RequiredKeysOf<Entity>,
148
- >(field: Key, validator: (value: Entity[Key]) => boolean): (entity: Entity) => boolean;
149
-
150
- type User = {
151
- name: string;
152
- surname: string;
153
- luckyNumber?: number;
154
- };
155
-
156
- const validator1 = createValidation<User>('name', value => value.length < 25);
157
- const validator2 = createValidation<User>('surname', value => value.length < 25);
158
-
159
- // @ts-expect-error
160
- const validator3 = createValidation<User>('luckyNumber', value => value > 0);
161
- // Error: Argument of type '"luckyNumber"' is not assignable to parameter of type '"name" | "surname"'.
162
- ```
163
-
164
- @category Utilities
165
- */
166
- type RequiredKeysOf<Type extends object> =
167
- Type extends unknown // For distributing `Type`
168
- ? Exclude<keyof Type, OptionalKeysOf<Type>>
169
- : never; // Should never happen
170
-
171
- /**
172
- Returns a boolean for whether the given type is `never`.
173
-
174
- @link https://github.com/microsoft/TypeScript/issues/31751#issuecomment-498526919
175
- @link https://stackoverflow.com/a/53984913/10292952
176
- @link https://www.zhenghao.io/posts/ts-never
177
-
178
- Useful in type utilities, such as checking if something does not occur.
179
-
180
- @example
181
- ```
182
- import type {IsNever, And} from 'type-fest';
183
-
184
- type A = IsNever<never>;
185
- //=> true
186
-
187
- type B = IsNever<any>;
188
- //=> false
189
-
190
- type C = IsNever<unknown>;
191
- //=> false
192
-
193
- type D = IsNever<never[]>;
194
- //=> false
195
-
196
- type E = IsNever<object>;
197
- //=> false
198
-
199
- type F = IsNever<string>;
200
- //=> false
201
- ```
202
-
203
- @example
204
- ```
205
- import type {IsNever} from 'type-fest';
206
-
207
- type IsTrue<T> = T extends true ? true : false;
208
-
209
- // When a distributive conditional is instantiated with `never`, the entire conditional results in `never`.
210
- type A = IsTrue<never>;
211
- //=> never
212
-
213
- // If you don't want that behaviour, you can explicitly add an `IsNever` check before the distributive conditional.
214
- type IsTrueFixed<T> =
215
- IsNever<T> extends true ? false : T extends true ? true : false;
216
-
217
- type B = IsTrueFixed<never>;
218
- //=> false
219
- ```
220
-
221
- @category Type Guard
222
- @category Utilities
223
- */
224
- type IsNever<T> = [T] extends [never] ? true : false;
225
-
226
- /**
227
- An if-else-like type that resolves depending on whether the given `boolean` type is `true` or `false`.
228
-
229
- Use-cases:
230
- - 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'>`.
231
-
232
- Note:
233
- - 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'`.
234
- - Returns the else branch if the given type is `never`. For example, `If<never, 'Y', 'N'>` will return `'N'`.
235
-
236
- @example
237
- ```
238
- import type {If} from 'type-fest';
239
-
240
- type A = If<true, 'yes', 'no'>;
241
- //=> 'yes'
242
-
243
- type B = If<false, 'yes', 'no'>;
244
- //=> 'no'
245
-
246
- type C = If<boolean, 'yes', 'no'>;
247
- //=> 'yes' | 'no'
248
-
249
- type D = If<any, 'yes', 'no'>;
250
- //=> 'yes' | 'no'
251
-
252
- type E = If<never, 'yes', 'no'>;
253
- //=> 'no'
254
- ```
255
-
256
- @example
257
- ```
258
- import type {If, IsAny, IsNever} from 'type-fest';
259
-
260
- type A = If<IsAny<unknown>, 'is any', 'not any'>;
261
- //=> 'not any'
262
-
263
- type B = If<IsNever<never>, 'is never', 'not never'>;
264
- //=> 'is never'
265
- ```
266
-
267
- @example
268
- ```
269
- import type {If, IsEqual} from 'type-fest';
270
-
271
- type IfEqual<T, U, IfBranch, ElseBranch> = If<IsEqual<T, U>, IfBranch, ElseBranch>;
272
-
273
- type A = IfEqual<string, string, 'equal', 'not equal'>;
274
- //=> 'equal'
275
-
276
- type B = IfEqual<string, number, 'equal', 'not equal'>;
277
- //=> 'not equal'
278
- ```
279
-
280
- 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:
1
+ import { YankiConnectOptions, YankiFetchAdapter, YankiParamsForAction } from "yanki-connect";
2
+ import { PartialDeep, Simplify } from "type-fest";
281
3
 
282
- @example
283
- ```
284
- import type {If, IsEqual, StringRepeat} from 'type-fest';
285
-
286
- type HundredZeroes = StringRepeat<'0', 100>;
287
-
288
- // The following implementation is not tail recursive
289
- type Includes<S extends string, Char extends string> =
290
- S extends `${infer First}${infer Rest}`
291
- ? If<IsEqual<First, Char>,
292
- 'found',
293
- Includes<Rest, Char>>
294
- : 'not found';
295
-
296
- // Hence, instantiations with long strings will fail
297
- // @ts-expect-error
298
- type Fails = Includes<HundredZeroes, '1'>;
299
- // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
300
- // Error: Type instantiation is excessively deep and possibly infinite.
301
-
302
- // However, if we use a simple conditional instead of `If`, the implementation becomes tail-recursive
303
- type IncludesWithoutIf<S extends string, Char extends string> =
304
- S extends `${infer First}${infer Rest}`
305
- ? IsEqual<First, Char> extends true
306
- ? 'found'
307
- : IncludesWithoutIf<Rest, Char>
308
- : 'not found';
309
-
310
- // Now, instantiations with long strings will work
311
- type Works = IncludesWithoutIf<HundredZeroes, '1'>;
312
- //=> 'not found'
313
- ```
314
-
315
- @category Type Guard
316
- @category Utilities
317
- */
318
- type If<Type extends boolean, IfBranch, ElseBranch> =
319
- IsNever<Type> extends true
320
- ? ElseBranch
321
- : Type extends true
322
- ? IfBranch
323
- : ElseBranch;
324
-
325
- /**
326
- Matches any primitive, `void`, `Date`, or `RegExp` value.
327
- */
328
- type BuiltIns = Primitive | void | Date | RegExp;
329
-
330
- /**
331
- Test if the given function has multiple call signatures.
332
-
333
- Needed to handle the case of a single call signature with properties.
334
-
335
- Multiple call signatures cannot currently be supported due to a TypeScript limitation.
336
- @see https://github.com/microsoft/TypeScript/issues/29732
337
- */
338
- type HasMultipleCallSignatures<T extends (...arguments_: any[]) => unknown> =
339
- T extends {(...arguments_: infer A): unknown; (...arguments_: infer B): unknown}
340
- ? B extends A
341
- ? A extends B
342
- ? false
343
- : true
344
- : true
345
- : false;
346
-
347
- /**
348
- 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.
349
-
350
- @example
351
- ```
352
- import type {Simplify} from 'type-fest';
353
-
354
- type PositionProps = {
355
- top: number;
356
- left: number;
357
- };
358
-
359
- type SizeProps = {
360
- width: number;
361
- height: number;
362
- };
363
-
364
- // In your editor, hovering over `Props` will show a flattened object with all the properties.
365
- type Props = Simplify<PositionProps & SizeProps>;
366
- ```
367
-
368
- 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.
369
-
370
- 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`.
371
-
372
- @example
373
- ```
374
- import type {Simplify} from 'type-fest';
375
-
376
- interface SomeInterface {
377
- foo: number;
378
- bar?: string;
379
- baz: number | undefined;
380
- }
381
-
382
- type SomeType = {
383
- foo: number;
384
- bar?: string;
385
- baz: number | undefined;
386
- };
387
-
388
- const literal = {foo: 123, bar: 'hello', baz: 456};
389
- const someType: SomeType = literal;
390
- const someInterface: SomeInterface = literal;
391
-
392
- declare function fn(object: Record<string, unknown>): void;
393
-
394
- fn(literal); // Good: literal object type is sealed
395
- fn(someType); // Good: type is sealed
396
- // @ts-expect-error
397
- fn(someInterface); // Error: Index signature for type 'string' is missing in type 'someInterface'. Because `interface` can be re-opened
398
- fn(someInterface as Simplify<SomeInterface>); // Good: transform an `interface` into a `type`
399
- ```
400
-
401
- @link https://github.com/microsoft/TypeScript/issues/15300
402
- @see {@link SimplifyDeep}
403
- @category Object
404
- */
405
- type Simplify<T> = {[KeyType in keyof T]: T[KeyType]} & {};
406
-
407
- /**
408
- Returns a boolean for whether the two given types are equal.
409
-
410
- @link https://github.com/microsoft/TypeScript/issues/27024#issuecomment-421529650
411
- @link https://stackoverflow.com/questions/68961864/how-does-the-equals-work-in-typescript/68963796#68963796
412
-
413
- Use-cases:
414
- - If you want to make a conditional branch based on the result of a comparison of two types.
415
-
416
- @example
417
- ```
418
- import type {IsEqual} from 'type-fest';
419
-
420
- // This type returns a boolean for whether the given array includes the given item.
421
- // `IsEqual` is used to compare the given array at position 0 and the given item and then return true if they are equal.
422
- type Includes<Value extends readonly any[], Item> =
423
- Value extends readonly [Value[0], ...infer rest]
424
- ? IsEqual<Value[0], Item> extends true
425
- ? true
426
- : Includes<rest, Item>
427
- : false;
428
- ```
429
-
430
- @category Type Guard
431
- @category Utilities
432
- */
433
- type IsEqual<A, B> =
434
- [A] extends [B]
435
- ? [B] extends [A]
436
- ? _IsEqual<A, B>
437
- : false
438
- : false;
439
-
440
- // This version fails the `equalWrappedTupleIntersectionToBeNeverAndNeverExpanded` test in `test-d/is-equal.ts`.
441
- type _IsEqual<A, B> =
442
- (<G>() => G extends A & G | G ? 1 : 2) extends
443
- (<G>() => G extends B & G | G ? 1 : 2)
444
- ? true
445
- : false;
446
-
447
- /**
448
- Omit any index signatures from the given object type, leaving only explicitly defined properties.
449
-
450
- This is the counterpart of `PickIndexSignature`.
451
-
452
- Use-cases:
453
- - Remove overly permissive signatures from third-party types.
454
-
455
- This type was taken from this [StackOverflow answer](https://stackoverflow.com/a/68261113/420747).
456
-
457
- 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>`.
458
-
459
- (The actual value type, `unknown`, is irrelevant and could be any type. Only the key type matters.)
460
-
461
- ```
462
- const indexed: Record<string, unknown> = {}; // Allowed
463
-
464
- // @ts-expect-error
465
- const keyed: Record<'foo', unknown> = {}; // Error
466
- // TS2739: Type '{}' is missing the following properties from type 'Record<"foo" | "bar", unknown>': foo, bar
467
- ```
468
-
469
- 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:
470
-
471
- ```
472
- type Indexed = {} extends Record<string, unknown>
473
- ? '✅ `{}` is assignable to `Record<string, unknown>`'
474
- : '❌ `{}` is NOT assignable to `Record<string, unknown>`';
475
-
476
- type IndexedResult = Indexed;
477
- //=> '✅ `{}` is assignable to `Record<string, unknown>`'
478
-
479
- type Keyed = {} extends Record<'foo' | 'bar', unknown>
480
- ? '✅ `{}` is assignable to `Record<\'foo\' | \'bar\', unknown>`'
481
- : '❌ `{}` is NOT assignable to `Record<\'foo\' | \'bar\', unknown>`';
482
-
483
- type KeyedResult = Keyed;
484
- //=> '❌ `{}` is NOT assignable to `Record<\'foo\' | \'bar\', unknown>`'
485
- ```
486
-
487
- 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`...
488
-
489
- ```
490
- type OmitIndexSignature<ObjectType> = {
491
- [KeyType in keyof ObjectType // Map each key of `ObjectType`...
492
- ]: ObjectType[KeyType]; // ...to its original value, i.e. `OmitIndexSignature<Foo> == Foo`.
493
- };
494
- ```
495
-
496
- ...whether an empty object (`{}`) would be assignable to an object with that `KeyType` (`Record<KeyType, unknown>`)...
497
-
498
- ```
499
- type OmitIndexSignature<ObjectType> = {
500
- [KeyType in keyof ObjectType
501
- // Is `{}` assignable to `Record<KeyType, unknown>`?
502
- as {} extends Record<KeyType, unknown>
503
- ? never // ✅ `{}` is assignable to `Record<KeyType, unknown>`
504
- : KeyType // ❌ `{}` is NOT assignable to `Record<KeyType, unknown>`
505
- ]: ObjectType[KeyType];
506
- };
507
- ```
508
-
509
- 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.
510
-
511
- @example
512
- ```
513
- import type {OmitIndexSignature} from 'type-fest';
514
-
515
- type Example = {
516
- // These index signatures will be removed.
517
- [x: string]: any;
518
- [x: number]: any;
519
- [x: symbol]: any;
520
- [x: `head-${string}`]: string;
521
- [x: `${string}-tail`]: string;
522
- [x: `head-${string}-tail`]: string;
523
- [x: `${bigint}`]: string;
524
- [x: `embedded-${number}`]: string;
525
-
526
- // These explicitly defined keys will remain.
527
- foo: 'bar';
528
- qux?: 'baz';
529
- };
530
-
531
- type ExampleWithoutIndexSignatures = OmitIndexSignature<Example>;
532
- //=> {foo: 'bar'; qux?: 'baz'}
533
- ```
534
-
535
- @see {@link PickIndexSignature}
536
- @category Object
537
- */
538
- type OmitIndexSignature<ObjectType> = {
539
- [KeyType in keyof ObjectType as {} extends Record<KeyType, unknown>
540
- ? never
541
- : KeyType]: ObjectType[KeyType];
542
- };
543
-
544
- /**
545
- Pick only index signatures from the given object type, leaving out all explicitly defined properties.
546
-
547
- This is the counterpart of `OmitIndexSignature`.
548
-
549
- @example
550
- ```
551
- import type {PickIndexSignature} from 'type-fest';
552
-
553
- declare const symbolKey: unique symbol;
554
-
555
- type Example = {
556
- // These index signatures will remain.
557
- [x: string]: unknown;
558
- [x: number]: unknown;
559
- [x: symbol]: unknown;
560
- [x: `head-${string}`]: string;
561
- [x: `${string}-tail`]: string;
562
- [x: `head-${string}-tail`]: string;
563
- [x: `${bigint}`]: string;
564
- [x: `embedded-${number}`]: string;
565
-
566
- // These explicitly defined keys will be removed.
567
- ['kebab-case-key']: string;
568
- [symbolKey]: string;
569
- foo: 'bar';
570
- qux?: 'baz';
571
- };
572
-
573
- type ExampleIndexSignature = PickIndexSignature<Example>;
574
- // {
575
- // [x: string]: unknown;
576
- // [x: number]: unknown;
577
- // [x: symbol]: unknown;
578
- // [x: `head-${string}`]: string;
579
- // [x: `${string}-tail`]: string;
580
- // [x: `head-${string}-tail`]: string;
581
- // [x: `${bigint}`]: string;
582
- // [x: `embedded-${number}`]: string;
583
- // }
584
- ```
585
-
586
- @see {@link OmitIndexSignature}
587
- @category Object
588
- */
589
- type PickIndexSignature<ObjectType> = {
590
- [KeyType in keyof ObjectType as {} extends Record<KeyType, unknown>
591
- ? KeyType
592
- : never]: ObjectType[KeyType];
593
- };
594
-
595
- // Merges two objects without worrying about index signatures.
596
- type SimpleMerge<Destination, Source> = Simplify<{
597
- [Key in keyof Destination as Key extends keyof Source ? never : Key]: Destination[Key];
598
- } & Source>;
599
-
600
- /**
601
- Merge two types into a new type. Keys of the second type overrides keys of the first type.
602
-
603
- @example
604
- ```
605
- import type {Merge} from 'type-fest';
606
-
607
- type Foo = {
608
- [x: string]: unknown;
609
- [x: number]: unknown;
610
- foo: string;
611
- bar: symbol;
612
- };
613
-
614
- type Bar = {
615
- [x: number]: number;
616
- [x: symbol]: unknown;
617
- bar: Date;
618
- baz: boolean;
619
- };
620
-
621
- export type FooBar = Merge<Foo, Bar>;
622
- //=> {
623
- // [x: string]: unknown;
624
- // [x: number]: number;
625
- // [x: symbol]: unknown;
626
- // foo: string;
627
- // bar: Date;
628
- // baz: boolean;
629
- // }
630
- ```
631
-
632
- 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.
633
-
634
- @see {@link ObjectMerge}
635
- @category Object
636
- */
637
- type Merge<Destination, Source> =
638
- Destination extends unknown // For distributing `Destination`
639
- ? Source extends unknown // For distributing `Source`
640
- ? If<IsEqual<Destination, Source>, Destination, _Merge<Destination, Source>>
641
- : never // Should never happen
642
- : never; // Should never happen
643
-
644
- type _Merge<Destination, Source> =
645
- Simplify<
646
- SimpleMerge<PickIndexSignature<Destination>, PickIndexSignature<Source>>
647
- & SimpleMerge<OmitIndexSignature<Destination>, OmitIndexSignature<Source>>
648
- >;
649
-
650
- /**
651
- Merges user specified options with default options.
652
-
653
- @example
654
- ```
655
- type PathsOptions = {maxRecursionDepth?: number; leavesOnly?: boolean};
656
- type DefaultPathsOptions = {maxRecursionDepth: 10; leavesOnly: false};
657
- type SpecifiedOptions = {leavesOnly: true};
658
-
659
- type Result = ApplyDefaultOptions<PathsOptions, DefaultPathsOptions, SpecifiedOptions>;
660
- //=> {maxRecursionDepth: 10; leavesOnly: true}
661
- ```
662
-
663
- @example
664
- ```
665
- // Complains if default values are not provided for optional options
666
-
667
- type PathsOptions = {maxRecursionDepth?: number; leavesOnly?: boolean};
668
- type DefaultPathsOptions = {maxRecursionDepth: 10};
669
- type SpecifiedOptions = {};
670
-
671
- type Result = ApplyDefaultOptions<PathsOptions, DefaultPathsOptions, SpecifiedOptions>;
672
- // ~~~~~~~~~~~~~~~~~~~
673
- // Property 'leavesOnly' is missing in type 'DefaultPathsOptions' but required in type '{ maxRecursionDepth: number; leavesOnly: boolean; }'.
674
- ```
675
-
676
- @example
677
- ```
678
- // Complains if an option's default type does not conform to the expected type
679
-
680
- type PathsOptions = {maxRecursionDepth?: number; leavesOnly?: boolean};
681
- type DefaultPathsOptions = {maxRecursionDepth: 10; leavesOnly: 'no'};
682
- type SpecifiedOptions = {};
683
-
684
- type Result = ApplyDefaultOptions<PathsOptions, DefaultPathsOptions, SpecifiedOptions>;
685
- // ~~~~~~~~~~~~~~~~~~~
686
- // Types of property 'leavesOnly' are incompatible. Type 'string' is not assignable to type 'boolean'.
687
- ```
688
-
689
- @example
690
- ```
691
- // Complains if an option's specified type does not conform to the expected type
692
-
693
- type PathsOptions = {maxRecursionDepth?: number; leavesOnly?: boolean};
694
- type DefaultPathsOptions = {maxRecursionDepth: 10; leavesOnly: false};
695
- type SpecifiedOptions = {leavesOnly: 'yes'};
696
-
697
- type Result = ApplyDefaultOptions<PathsOptions, DefaultPathsOptions, SpecifiedOptions>;
698
- // ~~~~~~~~~~~~~~~~
699
- // Types of property 'leavesOnly' are incompatible. Type 'string' is not assignable to type 'boolean'.
700
- ```
701
- */
702
- type ApplyDefaultOptions<
703
- Options extends object,
704
- Defaults extends Simplify<Omit<Required<Options>, RequiredKeysOf<Options>> & Partial<Record<RequiredKeysOf<Options>, never>>>,
705
- SpecifiedOptions extends Options,
706
- > =
707
- If<IsAny<SpecifiedOptions>, Defaults,
708
- If<IsNever<SpecifiedOptions>, Defaults,
709
- Simplify<Merge<Defaults, {
710
- [Key in keyof SpecifiedOptions
711
- as Key extends OptionalKeysOf<Options> ? undefined extends SpecifiedOptions[Key] ? never : Key : Key
712
- ]: SpecifiedOptions[Key]
713
- }> & Required<Options>>>>;
714
-
715
- /**
716
- @see {@link PartialDeep}
717
- */
718
- type PartialDeepOptions = {
719
- /**
720
- Whether to affect the individual elements of arrays and tuples.
721
-
722
- @default false
723
- */
724
- readonly recurseIntoArrays?: boolean;
725
-
726
- /**
727
- Allows `undefined` values in non-tuple arrays.
728
-
729
- - When set to `true`, elements of non-tuple arrays can be `undefined`.
730
- - When set to `false`, only explicitly defined elements are allowed in non-tuple arrays, ensuring stricter type checking.
731
-
732
- @default false
733
-
734
- @example
735
- You can allow `undefined` values in non-tuple arrays by passing `{recurseIntoArrays: true; allowUndefinedInNonTupleArrays: true}` as the second type argument:
736
-
737
- ```
738
- import type {PartialDeep} from 'type-fest';
739
-
740
- type Settings = {
741
- languages: string[];
742
- };
743
-
744
- declare const partialSettings: PartialDeep<Settings, {recurseIntoArrays: true; allowUndefinedInNonTupleArrays: true}>;
745
-
746
- partialSettings.languages = [undefined]; // OK
747
- ```
748
- */
749
- readonly allowUndefinedInNonTupleArrays?: boolean;
750
- };
751
-
752
- type DefaultPartialDeepOptions = {
753
- recurseIntoArrays: false;
754
- allowUndefinedInNonTupleArrays: false;
755
- };
756
-
757
- /**
758
- Create a type from another type with all keys and nested keys set to optional.
759
-
760
- Use-cases:
761
- - Merging a default settings/config object with another object, the second object would be a deep partial of the default object.
762
- - Mocking and testing complex entities, where populating an entire object with its keys would be redundant in terms of the mock or test.
763
-
764
- @example
765
- ```
766
- import type {PartialDeep} from 'type-fest';
767
-
768
- let settings = {
769
- textEditor: {
770
- fontSize: 14,
771
- fontColor: '#000000',
772
- fontWeight: 400,
773
- },
774
- autocomplete: false,
775
- autosave: true,
776
- };
777
-
778
- const applySavedSettings = (savedSettings: PartialDeep<typeof settings>) => (
779
- {...settings, ...savedSettings, textEditor: {...settings.textEditor, ...savedSettings.textEditor}}
780
- );
781
-
782
- settings = applySavedSettings({textEditor: {fontWeight: 500}});
783
- ```
784
-
785
- 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:
786
-
787
- ```
788
- import type {PartialDeep} from 'type-fest';
789
-
790
- type Shape = {
791
- dimensions: [number, number];
792
- };
793
-
794
- const partialShape: PartialDeep<Shape, {recurseIntoArrays: true}> = {
795
- dimensions: [], // OK
796
- };
797
-
798
- partialShape.dimensions = [15]; // OK
799
- ```
800
-
801
- @see {@link PartialDeepOptions}
802
-
803
- @category Object
804
- @category Array
805
- @category Set
806
- @category Map
807
- */
808
- type PartialDeep<T, Options extends PartialDeepOptions = {}> =
809
- _PartialDeep<T, ApplyDefaultOptions<PartialDeepOptions, DefaultPartialDeepOptions, Options>>;
810
-
811
- type _PartialDeep<T, Options extends Required<PartialDeepOptions>> = T extends BuiltIns | ((new (...arguments_: any[]) => unknown))
812
- ? T
813
- : T extends Map<infer KeyType, infer ValueType>
814
- ? PartialMapDeep<KeyType, ValueType, Options>
815
- : T extends Set<infer ItemType>
816
- ? PartialSetDeep<ItemType, Options>
817
- : T extends ReadonlyMap<infer KeyType, infer ValueType>
818
- ? PartialReadonlyMapDeep<KeyType, ValueType, Options>
819
- : T extends ReadonlySet<infer ItemType>
820
- ? PartialReadonlySetDeep<ItemType, Options>
821
- : T extends (...arguments_: any[]) => unknown
822
- ? IsNever<keyof T> extends true
823
- ? T // For functions with no properties
824
- : HasMultipleCallSignatures<T> extends true
825
- ? T
826
- : ((...arguments_: Parameters<T>) => ReturnType<T>) & PartialObjectDeep<T, Options>
827
- : T extends object
828
- ? T extends ReadonlyArray<infer ItemType> // Test for arrays/tuples, per https://github.com/microsoft/TypeScript/issues/35156
829
- ? Options['recurseIntoArrays'] extends true
830
- ? ItemType[] extends T // Test for arrays (non-tuples) specifically
831
- ? readonly ItemType[] extends T // Differentiate readonly and mutable arrays
832
- ? ReadonlyArray<_PartialDeep<Options['allowUndefinedInNonTupleArrays'] extends false ? ItemType : ItemType | undefined, Options>>
833
- : Array<_PartialDeep<Options['allowUndefinedInNonTupleArrays'] extends false ? ItemType : ItemType | undefined, Options>>
834
- : PartialObjectDeep<T, Options> // Tuples behave properly
835
- : T // If they don't opt into array testing, just use the original type
836
- : PartialObjectDeep<T, Options>
837
- : unknown;
838
-
839
- /**
840
- Same as `PartialDeep`, but accepts only `Map`s and as inputs. Internal helper for `PartialDeep`.
841
- */
842
- type PartialMapDeep<KeyType, ValueType, Options extends Required<PartialDeepOptions>> = {} & Map<_PartialDeep<KeyType, Options>, _PartialDeep<ValueType, Options>>;
843
-
844
- /**
845
- Same as `PartialDeep`, but accepts only `Set`s as inputs. Internal helper for `PartialDeep`.
846
- */
847
- type PartialSetDeep<T, Options extends Required<PartialDeepOptions>> = {} & Set<_PartialDeep<T, Options>>;
848
-
849
- /**
850
- Same as `PartialDeep`, but accepts only `ReadonlyMap`s as inputs. Internal helper for `PartialDeep`.
851
- */
852
- type PartialReadonlyMapDeep<KeyType, ValueType, Options extends Required<PartialDeepOptions>> = {} & ReadonlyMap<_PartialDeep<KeyType, Options>, _PartialDeep<ValueType, Options>>;
853
-
854
- /**
855
- Same as `PartialDeep`, but accepts only `ReadonlySet`s as inputs. Internal helper for `PartialDeep`.
856
- */
857
- type PartialReadonlySetDeep<T, Options extends Required<PartialDeepOptions>> = {} & ReadonlySet<_PartialDeep<T, Options>>;
858
-
859
- /**
860
- Same as `PartialDeep`, but accepts only `object`s as inputs. Internal helper for `PartialDeep`.
861
- */
862
- type PartialObjectDeep<ObjectType extends object, Options extends Required<PartialDeepOptions>> = {
863
- [KeyType in keyof ObjectType]?: _PartialDeep<ObjectType[KeyType], Options>
864
- };
865
-
866
- //#region src/types/deck.d.ts
867
- type DeckStats = {
868
- deck_id: number;
869
- learn_count: number;
870
- name: string;
871
- new_count: number;
872
- review_count: number;
873
- total_in_deck: number;
874
- };
875
- type DeckConfig = {
876
- autoplay: boolean;
877
- dyn: 1 | false;
878
- id: number;
879
- lapse: {
880
- delays: number[];
881
- leechAction: number;
882
- leechFails: number;
883
- minInt: number;
884
- mult: number;
885
- };
886
- maxTaken: number;
887
- mod: number;
888
- name: string;
889
- new: {
890
- bury: boolean;
891
- delays: number[];
892
- initialFactor: number;
893
- ints: number[];
894
- order: number;
895
- perDay: number;
896
- separate: boolean;
897
- };
898
- replayq: boolean;
899
- rev: {
900
- bury: boolean;
901
- ease4: number;
902
- fuzz: number;
903
- ivlFct: number;
904
- maxIvl: number;
905
- minSpace: number;
906
- perDay: number;
907
- };
908
- timer: number;
909
- usn: number;
910
- };
911
- type DeckRequests = Request<'changeDeck', 6, {
912
- cards: number[];
913
- deck: string;
914
- }> | Request<'cloneDeckConfigId', 6, {
915
- cloneFrom: number;
916
- name: string;
917
- }, false | number> | Request<'createDeck', 6, {
918
- deck: string;
919
- }, number> | Request<'deckNames', 6, never, string[]> | Request<'deckNamesAndIds', 6, never, Record<string, number>> | Request<'deleteDecks', 6, {
920
- cardsToo: true;
921
- decks: string[];
922
- }> | Request<'getDeckConfig', 6, {
923
- deck: string;
924
- }, DeckConfig> | Request<'getDecks', 6, Record<'cards', number[]>, Record<string, number[]>> | Request<'getDeckStats', 6, {
925
- decks: string[];
926
- }, Record<string, DeckStats>> | Request<'removeDeckConfigId', 6, {
927
- configId: number;
928
- }, boolean> | Request<'saveDeckConfig', 6, {
929
- config: DeckConfig;
930
- }, boolean> | Request<'setDeckConfigId', 6, {
931
- configId: number;
932
- decks: string[];
933
- }, boolean>;
934
- //#endregion
935
- //#region src/types/note.d.ts
936
- type NoteModel = 'Basic' | 'Basic (and reversed card)' | 'Basic (type in the answer)' | 'Cloze' | (string & {});
937
- type NoteMedia = {
938
- data?: string;
939
- fields?: string[];
940
- filename: string;
941
- path?: string;
942
- skipHash?: string;
943
- url?: string;
944
- };
945
- type Note = {
946
- audio?: NoteMedia[];
947
- deckName: string;
948
- fields: Record<string, string>;
949
- modelName: NoteModel;
950
- picture?: NoteMedia[];
951
- tags?: string[];
952
- video?: NoteMedia[];
953
- };
954
- type NoteWithCreationOptions = Note & {
955
- options?: {
956
- allowDuplicate?: boolean;
957
- duplicateScope?: 'deck' | (string & {});
958
- duplicateScopeOptions?: {
959
- checkAllModels?: boolean;
960
- checkChildren?: boolean;
961
- deckName?: null | string;
962
- };
963
- };
964
- };
965
- type NoteRequests = Request<'addNote', 6, {
966
- note: NoteWithCreationOptions;
967
- }, null | number> | Request<'addNotes', 6, {
968
- notes: NoteWithCreationOptions[];
969
- }, Array<null | string> | null> | Request<'addTags', 6, {
970
- notes: number[];
971
- tags: string;
972
- }> | Request<'canAddNotes', 6, {
973
- notes: NoteWithCreationOptions[];
974
- }, boolean[]> | Request<'canAddNotesWithErrorDetail', 6, {
975
- notes: NoteWithCreationOptions[];
976
- }, Array<{
977
- canAdd: false;
978
- error: string;
979
- } | {
980
- canAdd: true;
981
- }>> | Request<'clearUnusedTags', 6, never, string[]> | Request<'deleteNotes', 6, {
982
- notes: number[];
983
- }> | Request<'findNotes', 6, {
984
- query: string;
985
- }, number[]> | Request<'getNoteTags', 6, {
986
- note: number;
987
- }, string[]> | Request<'getTags', 6, never, string[]> | Request<'notesInfo', 6, {
988
- notes: number[];
989
- }, Array<{
990
- cards: number[];
991
- fields: Record<string, {
992
- order: number;
993
- value: string;
994
- }>;
995
- mod: number;
996
- modelName: string;
997
- noteId: number;
998
- profile: string;
999
- tags: string[];
1000
- }>> | Request<'notesModTime', 6, {
1001
- notes: number[];
1002
- }, Array<{
1003
- mod: number;
1004
- noteId: number;
1005
- }>> | Request<'removeEmptyNotes', 6> | Request<'removeTags', 6, {
1006
- notes: number[];
1007
- tags: string;
1008
- }> | Request<'replaceTags', 6, {
1009
- notes: number[];
1010
- replace_with_tag: string;
1011
- tag_to_replace: string;
1012
- }> | Request<'replaceTagsInAllNotes', 6, {
1013
- replace_with_tag: string;
1014
- tag_to_replace: string;
1015
- }> | Request<'updateNote', 6, {
1016
- note: {
1017
- audio?: NoteMedia[];
1018
- fields: Record<string, string>;
1019
- id: number;
1020
- picture?: NoteMedia[];
1021
- tags?: string[];
1022
- video?: NoteMedia[];
1023
- } | {
1024
- fields?: Record<string, string>;
1025
- id: number;
1026
- tags: string[];
1027
- };
1028
- }> | Request<'updateNoteFields', 6, {
1029
- note: {
1030
- audio?: NoteMedia[];
1031
- fields: Record<string, string>;
1032
- id: number;
1033
- picture?: NoteMedia[];
1034
- video?: NoteMedia[];
1035
- };
1036
- }> | Request<'updateNoteModel', 6, {
1037
- note: {
1038
- fields: Record<string, string>;
1039
- id: number;
1040
- modelName: string;
1041
- tags: string[];
1042
- };
1043
- }> | Request<'updateNoteTags', 6, {
1044
- note: number;
1045
- tags: string[];
1046
- }>;
1047
- //#endregion
1048
- //#region src/types/graphical.d.ts
1049
- type GraphicalRequests = Request<'guiAddCards', 6, {
1050
- note: Note;
1051
- }, number> | Request<'guiAnswerCard', 6, {
1052
- ease: number;
1053
- }, boolean> | Request<'guiBrowse', 6, {
1054
- query: string;
1055
- reorderCards?: {
1056
- columnId: CardBrowserColumns;
1057
- order: 'ascending' | 'descending';
1058
- };
1059
- }, number[]> | Request<'guiCheckDatabase', 6, never, true> | Request<'guiCurrentCard', 6, never, CardInfo | null> | Request<'guiDeckBrowser', 6> | Request<'guiDeckOverview', 6, {
1060
- name: string;
1061
- }, boolean> | Request<'guiDeckReview', 6, {
1062
- name: string;
1063
- }, boolean> | Request<'guiEditNote', 6, {
1064
- note: number;
1065
- }> | Request<'guiExitAnki', 6> | Request<'guiImportFile', 6, {
1066
- path: string;
1067
- }> | Request<'guiPlayAudio', 6, never, true> | Request<'guiSelectCard', 6, {
1068
- card: number;
1069
- }, boolean> | Request<'guiSelectedNotes', 6, never, number[]> | Request<'guiSelectNote', 6, {
1070
- note: number;
1071
- }, boolean> | Request<'guiShowAnswer', 6, never, boolean> | Request<'guiShowQuestion', 6, never, boolean> | Request<'guiStartCardTimer', 6, never, true> | Request<'guiUndo', 6, never, boolean>;
1072
- //#endregion
1073
- //#region src/types/media.d.ts
1074
- type MediaRequests = Request<'deleteMediaFile', 6, {
1075
- filename: string;
1076
- }> | Request<'getMediaDirPath', 6, never, string> | Request<'getMediaFilesNames', 6, {
1077
- pattern: string;
1078
- }, string[]> | Request<'retrieveMediaFile', 6, {
1079
- filename: string;
1080
- }, false | string> | Request<'storeMediaFile', 6, {
1081
- data?: string;
1082
- deleteExisting?: boolean;
1083
- filename: string;
1084
- path?: string;
1085
- url?: string;
1086
- }, string>;
1087
- //#endregion
1088
- //#region src/types/miscellaneous.d.ts
1089
- type MiscellaneousRequests = Request<'apiReflect', 6, {
1090
- actions: null | string[];
1091
- scopes: Array<'actions'>;
4
+ //#region src/lib/model/model.d.ts
5
+ declare const yankiModels: [{
6
+ readonly cardTemplates: [{
7
+ readonly Back: "{{FrontSide}}\n\n<hr id=answer>\n\n{{Back}}";
8
+ readonly Front: "{{Front}}";
9
+ readonly YankiNamespace: "{{YankiNamespace}}";
10
+ }];
11
+ readonly inOrderFields: ["Front", "Back", "YankiNamespace"];
12
+ readonly modelName: "Yanki - Basic";
1092
13
  }, {
1093
- actions: string[];
1094
- scopes: string[];
1095
- }> | Request<'exportPackage', 6, {
1096
- deck: string;
1097
- includeSched?: boolean;
1098
- path: string;
1099
- }, boolean> | Request<'getActiveProfile', 6, never, string> | Request<'getProfiles', 6, never, string[]> | Request<'importPackage', 6, {
1100
- path: string;
1101
- }, boolean> | Request<'loadProfile', 6, {
1102
- name: string;
1103
- }, true> | Request<'multi', 6, // Crazy, have to call this experimental
1104
- {
1105
- actions: Array<{
1106
- action: Requests['action'];
1107
- params?: Requests['params'];
1108
- version?: number;
1109
- }>;
1110
- }, Array<Requests['response'] | {
1111
- error: null | string;
1112
- result: Requests['response'];
1113
- }>> | Request<'reloadCollection', 6> | Request<'requestPermission', 6, never, {
1114
- permission: 'denied';
1115
- } | {
1116
- permission: 'granted';
1117
- requireApiKey: boolean;
1118
- version: boolean;
1119
- }> | Request<'sync', 6> | Request<'version', 6, never, number>;
1120
- //#endregion
1121
- //#region src/types/model.d.ts
1122
- type ModelField = {
1123
- collapsed: boolean;
1124
- description: string;
1125
- excludeFromSearch: boolean;
1126
- font: string;
1127
- id: number;
1128
- name: string;
1129
- ord: number;
1130
- plainText: boolean;
1131
- preventDeletion: boolean;
1132
- rtl: boolean;
1133
- size: number;
1134
- sticky: boolean;
1135
- tag: null;
1136
- };
1137
- type ModelTemplate = {
1138
- afmt: string;
1139
- bafmt: string;
1140
- bfont: string;
1141
- bqfmt: string;
1142
- bsize: number;
1143
- did: null;
1144
- id: number;
1145
- name: string;
1146
- ord: number;
1147
- qfmt: string;
1148
- };
1149
- type Model = {
1150
- css: string;
1151
- did: null;
1152
- flds: ModelField[];
1153
- id: number;
1154
- latexPost: string;
1155
- latexPre: string;
1156
- latexsvg: boolean;
1157
- mod: number;
1158
- name: string;
1159
- originalStockKind: number;
1160
- req: Array<[number, string, number[]]>;
1161
- sortf: number;
1162
- tmpls: ModelTemplate[];
1163
- type: number;
1164
- usn: number;
1165
- };
1166
- type ModelToCreate = {
1167
- cardTemplates: Array<{
1168
- [key: string]: string;
1169
- Back: string;
1170
- Front: string;
1171
- }>;
1172
- css?: string;
1173
- inOrderFields: string[];
1174
- isCloze?: boolean;
1175
- modelName: string;
1176
- };
1177
- type ModelRequests = Request<'createModel', 6, ModelToCreate, Model> | Request<'findAndReplaceInModels', 6, {
1178
- model: {
1179
- back: boolean;
1180
- css: boolean;
1181
- fieldText: string;
1182
- front: boolean;
1183
- modelName: string;
1184
- replaceText: string;
1185
- };
1186
- }, number> | Request<'findModelsById', 6, {
1187
- modelIds: number[];
1188
- }, Model[]> | Request<'findModelsByName', 6, {
1189
- modelNames: string[];
1190
- }, Model[]> | Request<'modelFieldAdd', 6, {
1191
- fieldName: string;
1192
- index: number;
1193
- modelName: string;
1194
- }> | Request<'modelFieldDescriptions', 6, {
1195
- description: string;
1196
- fieldName: string;
1197
- modelName: string;
1198
- }, boolean> | Request<'modelFieldFonts', 6, {
1199
- modelName: string;
1200
- }, Record<string, {
1201
- font: string;
1202
- size: number;
1203
- }>> | Request<'modelFieldNames', 6, {
1204
- modelName: string;
1205
- }, string[]> | Request<'modelFieldRemove', 6, {
1206
- fieldName: string;
1207
- modelName: string;
1208
- }> | Request<'modelFieldRename', 6, {
1209
- modelName: string;
1210
- newFieldName: string;
1211
- oldFieldName: string;
1212
- }> | Request<'modelFieldReposition', 6, {
1213
- fieldName: string;
1214
- index: number;
1215
- modelName: string;
1216
- }> | Request<'modelFieldSetDescription', 6, {
1217
- fieldName: string;
1218
- index: number;
1219
- modelName: string;
1220
- }> | Request<'modelFieldSetFont', 6, {
1221
- fieldName: string;
1222
- font: string;
1223
- modelName: string;
1224
- }> | Request<'modelFieldSetFontSize', 6, {
1225
- fieldName: string;
1226
- fontSize: number;
1227
- modelName: string;
1228
- }> | Request<'modelFieldsOnTemplates', 6, {
1229
- modelName: string;
1230
- }, Record<string, [string[], string[]]>> | Request<'modelNames', 6, never, string[]> | Request<'modelNamesAndIds', 6, never, Record<string, number>> | Request<'modelStyling', 6, {
1231
- modelName: string;
14
+ readonly cardTemplates: [{
15
+ readonly Back: "{{cloze:Front}}<br>\n{{Back}}";
16
+ readonly Front: "{{cloze:Front}}";
17
+ readonly YankiNamespace: "{{YankiNamespace}}";
18
+ }];
19
+ readonly inOrderFields: ["Front", "Back", "YankiNamespace"];
20
+ readonly isCloze: true;
21
+ readonly modelName: "Yanki - Cloze";
1232
22
  }, {
1233
- css: string;
1234
- }> | Request<'modelTemplateAdd', 6, {
1235
- modelName: string;
1236
- template: {
1237
- [key: string]: string;
23
+ readonly cardTemplates: [{
24
+ readonly Back: "{{Front}}\n\n<hr id=answer>\n\n{{type:Back}}";
25
+ readonly Front: "{{Front}}\n\n{{type:Back}}";
26
+ readonly YankiNamespace: "{{YankiNamespace}}";
27
+ }];
28
+ readonly inOrderFields: ["Front", "Back", "YankiNamespace"];
29
+ readonly modelName: "Yanki - Basic (type in the answer)";
30
+ }, {
31
+ readonly cardTemplates: [{
32
+ readonly Back: "{{FrontSide}}\n\n<hr id=answer>\n\n{{Back}}{{#Extra}}\n\n<hr>\n\n{{Extra}}{{/Extra}}";
33
+ readonly Front: "{{Front}}";
34
+ readonly YankiNamespace: "{{YankiNamespace}}";
35
+ }, {
36
+ readonly Back: "{{FrontSide}}\n\n<hr id=answer>\n\n{{Front}}{{#Extra}}\n\n<hr>\n\n{{Extra}}{{/Extra}}";
37
+ readonly Front: "{{Back}}";
38
+ readonly YankiNamespace: "{{YankiNamespace}}";
39
+ }];
40
+ readonly inOrderFields: ["Front", "Back", "Extra", "YankiNamespace"];
41
+ readonly modelName: "Yanki - Basic (and reversed card with extra)";
42
+ }];
43
+ type YankiModelName = (typeof yankiModels)[number]['modelName'];
44
+ //#endregion
45
+ //#region src/lib/model/note.d.ts
46
+ type YankiNote = Simplify<Omit<YankiParamsForAction<'addNote'>['note'], 'fields' | 'modelName' | 'options'> & {
47
+ cards?: number[];
48
+ fields: {
1238
49
  Back: string;
50
+ Extra?: string;
1239
51
  Front: string;
52
+ YankiNamespace: string;
1240
53
  };
1241
- }> | Request<'modelTemplateRemove', 6, {
1242
- modelName: string;
1243
- templateName: string;
1244
- }> | Request<'modelTemplateRename', 6, {
1245
- modelName: string;
1246
- newTemplateName: string;
1247
- oldTemplateName: string;
1248
- }> | Request<'modelTemplateReposition', 6, {
1249
- index: number;
1250
- modelName: string;
1251
- templateName: string;
1252
- }> | Request<'modelTemplates', 6, {
1253
- modelName: string;
1254
- }, Record<string, {
1255
- [key: string]: string;
1256
- Back: string;
1257
- Front: string;
1258
- }>> | Request<'updateModelStyling', 6, {
1259
- model: {
1260
- css: string;
1261
- name: string;
1262
- };
1263
- }> | Request<'updateModelTemplates', 6, {
1264
- model: {
1265
- name: string;
1266
- templates: Record<string, {
1267
- Back?: string;
1268
- Front?: string;
1269
- }>;
1270
- };
54
+ modelName: YankiModelName;
55
+ noteId: number | undefined;
1271
56
  }>;
1272
57
  //#endregion
1273
- //#region src/types/statistic.d.ts
1274
- type ReviewStatisticTuple = [reviewTime: number, cardID: number, usn: number, buttonPressed: number, newInterval: number, previousInterval: number, newFactor: number, reviewDuration: number, reviewType: number];
1275
- type StatisticRequests = Request<'cardReviews', 6, {
1276
- deck: string;
1277
- startID: number;
1278
- }, ReviewStatisticTuple[]> | Request<'getCollectionStatsHTML', 6, {
1279
- wholeCollection: boolean;
1280
- }, string> | Request<'getLatestReviewID', 6, {
1281
- deck: string;
1282
- }, number> | Request<'getNumCardsReviewedByDay', 6, never, Array<[string, number]>> | Request<'getNumCardsReviewedToday', 6, never, number> | Request<'getReviewsOfCards', 6, {
1283
- cards: string[];
1284
- }, Record<string, Array<{
1285
- /** ButtonPressed */ease: number; /** NewFactor */
1286
- factor: number; /** ReviewTime */
1287
- id: number; /** NewInterval */
1288
- ivl: number; /** PreviousInterval */
1289
- lastIvl: number; /** ReviewDuration */
1290
- time: number; /** ReviewType */
1291
- type: number; /** Usn */
1292
- usn: number;
1293
- }>>> | Request<'insertReviews', 6, {
1294
- reviews: ReviewStatisticTuple[];
1295
- }>;
1296
- //#endregion
1297
- //#region src/types/shared.d.ts
1298
- /**
1299
- * Abstract wrapper over an Anki Connect action / response
1300
- */
1301
- type Request<Action extends string, Version extends AnkiConnectVersion, Params = never, Result = null> = {
1302
- action: Action;
1303
- params: Params;
1304
- response: {
1305
- error: null | string;
1306
- result: Result;
1307
- };
1308
- version: Version;
1309
- };
1310
- /**
1311
- * Requests
1312
- */
1313
- type Requests = CardRequests | DeckRequests | GraphicalRequests | MediaRequests | MiscellaneousRequests | ModelRequests | NoteRequests | StatisticRequests;
1314
- type AnkiConnectVersion = 6;
1315
- type ParamsForAction<T extends Requests['action']> = Extract<Requests, {
1316
- action: T;
1317
- }>['params'];
1318
- //#endregion
1319
- //#region src/types/card.d.ts
1320
- type CardBrowserColumns = 'answer' | 'cardDue' | 'cardEase' | 'cardIvl' | 'cardLapses' | 'cardMod' | 'cardReps' | 'deck' | 'note' | 'noteCrt' | 'noteFld' | 'noteMod' | 'noteTags' | 'question' | 'template' | (string & {});
1321
- type CardValueKeys = 'data' | 'did' | 'due' | 'factor' | 'flags' | 'id' | 'ivl' | 'lapses' | 'left' | 'mod' | 'odid' | 'odue' | 'ord' | 'queue' | 'reps' | 'type' | 'usn';
1322
- type CardInfo = {
1323
- answer: string;
1324
- buttons?: number[];
1325
- cardId: number;
1326
- css: string;
1327
- deckName: string;
1328
- due: number;
1329
- fieldOrder: number;
1330
- fields: Record<string, {
1331
- order: number;
1332
- value: string;
58
+ //#region src/lib/shared/types.d.ts
59
+ type FetchAdapter = YankiFetchAdapter;
60
+ type ManageFilenames = 'off' | 'prompt' | 'response';
61
+ type SyncMediaAssets = 'all' | 'local' | 'off' | 'remote';
62
+ type FileAdapter = {
63
+ readFile(filePath: string): Promise<string>;
64
+ readFileBuffer(filePath: string): Promise<Uint8Array>;
65
+ rename(oldPath: string, newPath: string): Promise<void>;
66
+ stat(filePath: string): Promise<{
67
+ ctimeMs: number;
68
+ mtimeMs: number;
69
+ size: number;
1333
70
  }>;
1334
- interval: number;
1335
- lapses: number;
1336
- left: number;
1337
- mod: number;
1338
- modelName: string;
1339
- nextReviews: string[];
1340
- note: number;
1341
- ord: number;
1342
- question: string;
1343
- queue: number;
1344
- reps: number;
1345
- template: string;
1346
- type: number;
71
+ writeFile(filePath: string, data: string): Promise<void>;
1347
72
  };
1348
- type CardRequests = Request<'answerCards', 6, {
1349
- answers: Array<{
1350
- cardId: number;
1351
- ease: number;
1352
- }>;
1353
- }, boolean[]> | Request<'areDue', 6, {
1354
- cards: number[];
1355
- }, boolean[]> | Request<'areSuspended', 6, {
1356
- cards: number[];
1357
- }, Array<boolean | null>> | Request<'cardsInfo', 6, {
1358
- cards: number[];
1359
- }, CardInfo[]> | Request<'cardsModTime', 6, {
1360
- cards: number[];
1361
- }, {
1362
- cardId: number;
1363
- mod: number;
1364
- }> | Request<'cardsToNotes', 6, {
1365
- cards: number[];
1366
- }, number[]> | Request<'findCards', 6, {
1367
- query: string;
1368
- }, number[]> | Request<'forgetCards', 6, {
1369
- cards: number[];
1370
- }> | Request<'getEaseFactors', 6, {
1371
- cards: number[];
1372
- }, number[]> | Request<'getIntervals', 6, {
1373
- cards: number[];
1374
- complete?: boolean;
1375
- }, number[] | number[][]> | Request<'relearnCards', 6, {
1376
- cards: number[];
1377
- }> | Request<'setDueDate', 6, {
1378
- cards: number[];
1379
- days: string;
1380
- }, boolean> | Request<'setEaseFactors', 6, {
1381
- cards: number[];
1382
- easeFactors: number[];
1383
- }, boolean[]> | Request<'setSpecificValueOfCard', 6, {
1384
- card: number;
1385
- keys: CardValueKeys[];
1386
- newValues: string[];
1387
- }, boolean[]> | Request<'suspend', 6, {
1388
- cards: number[];
1389
- }, boolean> | Request<'suspended', 6, {
1390
- card: number;
1391
- }, boolean> | Request<'unsuspend', 6, {
1392
- cards: number[];
1393
- }, boolean>;
1394
- //#endregion
1395
- //#region src/client.d.ts
1396
- /**
1397
- * Subset of built-in Fetch interface that's actually used by Anki, for ease of
1398
- * external re-implementation when passing a custom fetch function to
1399
- * YankiClient.
1400
- */
1401
- type YankiFetchAdapter = (input: string, init?: {
1402
- body?: string;
1403
- headers?: Record<string, string>;
1404
- method?: string;
1405
- mode?: RequestMode;
1406
- }) => Promise<undefined | {
1407
- headers: Headers | Record<string, string>;
1408
- json(): Promise<any>;
1409
- status: number;
1410
- }>;
1411
- /** Optional options to pass when instantiating a new YankiConnect instance. */
1412
- type YankiConnectOptions = {
1413
- /**
1414
- * Attempt to open the desktop Anki.app if it's not already running.
1415
- *
1416
- * - `true` will always attempt to open Anki _when a request is made_. This
1417
- * might introduce significant latency on the first launch.
1418
- * - `false` will never attempt to open Anki. Requests will fail until
1419
- * something or someone else opens the Anki app.
1420
- * - `immediately` is a special option that will open Anki when the client is
1421
- * instantiated.
1422
- *
1423
- * The Anki desktop app must be running for the client and the underlying
1424
- * Anki-Connect service to work.
1425
- *
1426
- * Currently supported on macOS only.
1427
- *
1428
- * The client does not attempt to close the app.
1429
- * @default false
1430
- */
1431
- autoLaunch: 'immediately' | boolean;
73
+ type GlobalOptions = {
1432
74
  /**
1433
- * Advanced option to customize the resource fetch implementation used to make requests to Anki-Connect.
1434
- *
1435
- * Note that the signature reflects the subset of the built-in Fetch interface that's actually used by yanki-connect.
1436
- *
1437
- * The exact signature of this option is subject to change in the future.
1438
- * @default fetch
75
+ * Used for wiki link resolution
1439
76
  */
1440
- fetchAdapter: undefined | YankiFetchAdapter;
77
+ allFilePaths: string[];
78
+ ankiConnectOptions: YankiConnectOptions;
1441
79
  /**
1442
- * Host where the Anki-Connect service is running.
1443
- * @default 'http://127.0.0.1'
80
+ * Automatically sync any changes to AnkiWeb after Yanki has finished syncing
81
+ * locally. If false, only local Anki data is updated and you must manually
82
+ * invoke a sync to AnkiWeb. This is the equivalent of pushing the "sync"
83
+ * button in the Anki app.
1444
84
  */
1445
- host: string;
85
+ ankiWeb: boolean; /** Override where "/" should resolve to... useful in Obsidian to set the vault path as the "root" */
86
+ basePath: string | undefined; /** Run Anki's "Check Database" command after sync updates that might produce card corruption */
87
+ checkDatabase: boolean;
88
+ cwd: string;
89
+ dryRun: boolean;
1446
90
  /**
1447
- * Anki-Connect security key (optional)
1448
- * @default undefined
91
+ * Exposed for Obsidian, currently only used for getting URL content hashes
92
+ * and inferring MIME types of URLs without extensions.
93
+ * Note that ankiConnectOptions ALSO has a fetch adapter option specifically
94
+ * for communicating with Anki-Connect.
1449
95
  */
1450
- key: string | undefined;
1451
- /**
1452
- * Port where the Anki-Connect service is running.
1453
- * @default 8765
1454
- */
1455
- port: number;
96
+ fetchAdapter: FetchAdapter | undefined;
97
+ fileAdapter: FileAdapter | undefined;
98
+ manageFilenames: ManageFilenames; /** Only applies if manageFilenames is `true`. Will _not_ truncate user-specified file names in other cases. */
99
+ maxFilenameLength: number;
100
+ namespace: string; /** Ensures that wiki-style links work correctly */
101
+ obsidianVault: string | undefined; /** Exposed for testing only */
102
+ resolveUrls: boolean;
1456
103
  /**
1457
- * Anki-Connect API version.
1458
- *
1459
- * Only API version 6 is supported for now.
1460
- * @default 6
104
+ * Whether to treat single newlines in Markdown as line breaks in the
105
+ * resulting HTML (Obsidian has an application-level setting for this)
1461
106
  */
1462
- version: AnkiConnectVersion;
107
+ 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 */
108
+ strictMatching: boolean; /** Sync image, video, and audio assets to Anki's media storage system */
109
+ syncMediaAssets: SyncMediaAssets;
1463
110
  };
1464
-
1465
- declare const yankiModels: [{
1466
- readonly cardTemplates: [{
1467
- readonly Back: "{{FrontSide}}\n\n<hr id=answer>\n\n{{Back}}";
1468
- readonly Front: "{{Front}}";
1469
- readonly YankiNamespace: "{{YankiNamespace}}";
1470
- }];
1471
- readonly inOrderFields: ["Front", "Back", "YankiNamespace"];
1472
- readonly modelName: "Yanki - Basic";
1473
- }, {
1474
- readonly cardTemplates: [{
1475
- readonly Back: "{{cloze:Front}}<br>\n{{Back}}";
1476
- readonly Front: "{{cloze:Front}}";
1477
- readonly YankiNamespace: "{{YankiNamespace}}";
1478
- }];
1479
- readonly inOrderFields: ["Front", "Back", "YankiNamespace"];
1480
- readonly isCloze: true;
1481
- readonly modelName: "Yanki - Cloze";
1482
- }, {
1483
- readonly cardTemplates: [{
1484
- readonly Back: "{{Front}}\n\n<hr id=answer>\n\n{{type:Back}}";
1485
- readonly Front: "{{Front}}\n\n{{type:Back}}";
1486
- readonly YankiNamespace: "{{YankiNamespace}}";
1487
- }];
1488
- readonly inOrderFields: ["Front", "Back", "YankiNamespace"];
1489
- readonly modelName: "Yanki - Basic (type in the answer)";
1490
- }, {
1491
- readonly cardTemplates: [{
1492
- readonly Back: "{{FrontSide}}\n\n<hr id=answer>\n\n{{Back}}{{#Extra}}\n\n<hr>\n\n{{Extra}}{{/Extra}}";
1493
- readonly Front: "{{Front}}";
1494
- readonly YankiNamespace: "{{YankiNamespace}}";
1495
- }, {
1496
- readonly Back: "{{FrontSide}}\n\n<hr id=answer>\n\n{{Front}}{{#Extra}}\n\n<hr>\n\n{{Extra}}{{/Extra}}";
1497
- readonly Front: "{{Back}}";
1498
- readonly YankiNamespace: "{{YankiNamespace}}";
1499
- }];
1500
- readonly inOrderFields: ["Front", "Back", "Extra", "YankiNamespace"];
1501
- readonly modelName: "Yanki - Basic (and reversed card with extra)";
1502
- }];
1503
- type YankiModelName = (typeof yankiModels)[number]['modelName'];
1504
-
1505
- type YankiNote = Simplify<Omit<ParamsForAction<'addNote'>['note'], 'fields' | 'modelName' | 'options'> & {
1506
- cards?: number[];
1507
- fields: {
1508
- Back: string;
1509
- Extra?: string;
1510
- Front: string;
1511
- YankiNamespace: string;
1512
- };
1513
- modelName: YankiModelName;
1514
- noteId: number | undefined;
1515
- }>;
1516
-
1517
- type FetchAdapter = YankiFetchAdapter;
1518
- type ManageFilenames = 'off' | 'prompt' | 'response';
1519
- type SyncMediaAssets = 'all' | 'local' | 'off' | 'remote';
1520
- type FileAdapter = {
1521
- readFile(filePath: string): Promise<string>;
1522
- readFileBuffer(filePath: string): Promise<Uint8Array>;
1523
- rename(oldPath: string, newPath: string): Promise<void>;
1524
- stat(filePath: string): Promise<{
1525
- ctimeMs: number;
1526
- mtimeMs: number;
1527
- size: number;
1528
- }>;
1529
- writeFile(filePath: string, data: string): Promise<void>;
1530
- };
1531
- type GlobalOptions = {
1532
- /**
1533
- * Used for wiki link resolution
1534
- */
1535
- allFilePaths: string[];
1536
- ankiConnectOptions: YankiConnectOptions;
1537
- /**
1538
- * Automatically sync any changes to AnkiWeb after Yanki has finished syncing
1539
- * locally. If false, only local Anki data is updated and you must manually
1540
- * invoke a sync to AnkiWeb. This is the equivalent of pushing the "sync"
1541
- * button in the Anki app.
1542
- */
1543
- ankiWeb: boolean;
1544
- /** Override where "/" should resolve to... useful in Obsidian to set the vault path as the "root" */
1545
- basePath: string | undefined;
1546
- /** Run Anki's "Check Database" command after sync updates that might produce card corruption */
1547
- checkDatabase: boolean;
1548
- cwd: string;
1549
- dryRun: boolean;
1550
- /**
1551
- * Exposed for Obsidian, currently only used for getting URL content hashes
1552
- * and inferring MIME types of URLs without extensions.
1553
- * Note that ankiConnectOptions ALSO has a fetch adapter option specifically
1554
- * for communicating with Anki-Connect.
1555
- */
1556
- fetchAdapter: FetchAdapter | undefined;
1557
- fileAdapter: FileAdapter | undefined;
1558
- manageFilenames: ManageFilenames;
1559
- /** Only applies if manageFilenames is `true`. Will _not_ truncate user-specified file names in other cases. */
1560
- maxFilenameLength: number;
1561
- namespace: string;
1562
- /** Ensures that wiki-style links work correctly */
1563
- obsidianVault: string | undefined;
1564
- /** Exposed for testing only */
1565
- resolveUrls: boolean;
1566
- /**
1567
- * Whether to treat single newlines in Markdown as line breaks in the
1568
- * resulting HTML (Obsidian has an application-level setting for this)
1569
- */
1570
- strictLineBreaks: boolean;
1571
- /** 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 */
1572
- strictMatching: boolean;
1573
- /** Sync image, video, and audio assets to Anki's media storage system */
1574
- syncMediaAssets: SyncMediaAssets;
1575
- };
1576
-
111
+ //#endregion
112
+ //#region src/lib/actions/clean.d.ts
1577
113
  type CleanOptions = Pick<GlobalOptions, 'ankiConnectOptions' | 'ankiWeb' | 'dryRun' | 'namespace'>;
1578
114
  declare const defaultCleanOptions: CleanOptions;
1579
115
  type CleanResult = Simplify<Pick<GlobalOptions, 'ankiWeb' | 'dryRun' | 'namespace'> & {
1580
- deletedDecks: string[];
1581
- deletedMedia: string[];
1582
- deletedNotes: YankiNote[];
1583
- duration: number;
116
+ deletedDecks: string[];
117
+ deletedMedia: string[];
118
+ deletedNotes: YankiNote[];
119
+ duration: number;
1584
120
  }>;
1585
121
  /**
1586
122
  * Deletes all remote notes in Anki associated with the given namespace.
@@ -1591,34 +127,35 @@ type CleanResult = Simplify<Pick<GlobalOptions, 'ankiWeb' | 'dryRun' | 'namespac
1591
127
  */
1592
128
  declare function cleanNotes(options?: PartialDeep<CleanOptions>): Promise<CleanResult>;
1593
129
  declare function formatCleanResult(result: CleanResult, verbose?: boolean): string;
1594
-
130
+ //#endregion
131
+ //#region src/lib/actions/list.d.ts
1595
132
  type ListOptions = Pick<GlobalOptions, 'ankiConnectOptions' | 'namespace'>;
1596
133
  declare const defaultListOptions: ListOptions;
1597
134
  type ListResult = {
1598
- duration: number;
1599
- namespace: string;
1600
- notes: YankiNote[];
135
+ duration: number;
136
+ namespace: string;
137
+ notes: YankiNote[];
1601
138
  };
1602
139
  /**
1603
140
  * Description List notes currently in Anki...
1604
141
  */
1605
142
  declare function listNotes(options?: PartialDeep<ListOptions>): Promise<ListResult>;
1606
143
  declare function formatListResult(result: ListResult): string;
1607
-
144
+ //#endregion
145
+ //#region src/lib/actions/load-local-notes.d.ts
1608
146
  type LoadOptions = Pick<GlobalOptions, 'allFilePaths' | 'basePath' | 'fetchAdapter' | 'fileAdapter' | 'namespace' | 'obsidianVault' | 'strictLineBreaks' | 'syncMediaAssets'>;
1609
147
  type LocalNote = {
1610
- filePath: string;
1611
- filePathOriginal: string;
1612
- markdown: string;
1613
- note: YankiNote;
148
+ filePath: string;
149
+ filePathOriginal: string;
150
+ markdown: string;
151
+ note: YankiNote;
1614
152
  };
1615
-
1616
- type RenameNotesOptions = Pick<GlobalOptions, 'dryRun' | 'fileAdapter' | 'manageFilenames' | 'maxFilenameLength'
1617
- /** Included because this can technically change the content of the "first line" of a card */
1618
- | 'strictLineBreaks'>;
153
+ //#endregion
154
+ //#region src/lib/actions/rename.d.ts
155
+ type RenameNotesOptions = Pick<GlobalOptions, 'dryRun' | 'fileAdapter' | 'manageFilenames' | 'maxFilenameLength' /** Included because this can technically change the content of the "first line" of a card */ | 'strictLineBreaks'>;
1619
156
  type RenameFilesResult = {
1620
- dryRun: boolean;
1621
- notes: LocalNote[];
157
+ dryRun: boolean;
158
+ notes: LocalNote[];
1622
159
  };
1623
160
  type RenameFilesOptions = Simplify<LoadOptions & RenameNotesOptions>;
1624
161
  declare const defaultRenameFilesOptions: RenameFilesOptions;
@@ -1626,36 +163,38 @@ declare const defaultRenameFilesOptions: RenameFilesOptions;
1626
163
  * Currently used for testing and by `yanki-obsidian`.
1627
164
  */
1628
165
  declare function renameFiles(allLocalFilePaths: string[], options: Partial<RenameFilesOptions>): Promise<RenameFilesResult>;
1629
-
166
+ //#endregion
167
+ //#region src/lib/actions/style.d.ts
1630
168
  type SetStyleOptions = Pick<GlobalOptions, 'ankiConnectOptions' | 'ankiWeb' | 'dryRun'> & {
1631
- css: string;
169
+ css: string;
1632
170
  };
1633
171
  declare const defaultSetStyleOptions: SetStyleOptions;
1634
172
  type SetStyleResult = Simplify<Pick<GlobalOptions, 'ankiWeb' | 'dryRun'> & {
1635
- duration: number;
1636
- models: Array<{
1637
- action: 'unchanged' | 'updated';
1638
- name: string;
1639
- }>;
173
+ duration: number;
174
+ models: Array<{
175
+ action: 'unchanged' | 'updated';
176
+ name: string;
177
+ }>;
1640
178
  }>;
1641
179
  type GetStyleOptions = Pick<GlobalOptions, 'ankiConnectOptions'>;
1642
180
  declare const defaultGetStyleOptions: GetStyleOptions;
1643
181
  declare function getStyle(options: PartialDeep<GetStyleOptions>): Promise<string>;
1644
182
  declare function setStyle(options?: PartialDeep<SetStyleOptions>): Promise<SetStyleResult>;
1645
183
  declare function formatSetStyleResult(result: SetStyleResult, verbose?: boolean): string;
1646
-
184
+ //#endregion
185
+ //#region src/lib/actions/sync-notes.d.ts
1647
186
  type SyncedNote = {
1648
- action: 'ankiUnreachable' | 'created' | 'deleted' | 'matched' | 'unchanged' | 'updated';
1649
- note: YankiNote;
187
+ action: 'ankiUnreachable' | 'created' | 'deleted' | 'matched' | 'unchanged' | 'updated';
188
+ note: YankiNote;
1650
189
  };
1651
190
  type SyncNotesOptions = Pick<GlobalOptions, 'ankiConnectOptions' | 'ankiWeb' | 'checkDatabase' | 'dryRun' | 'namespace' | 'strictMatching'>;
1652
191
  declare const defaultSyncNotesOptions: SyncNotesOptions;
1653
192
  type SyncNotesResult = Simplify<Pick<GlobalOptions, 'ankiWeb' | 'dryRun' | 'namespace'> & {
1654
- deletedDecks: string[];
1655
- deletedMedia: string[];
1656
- duration: number;
1657
- fixedDatabase: boolean;
1658
- synced: SyncedNote[];
193
+ deletedDecks: string[];
194
+ deletedMedia: string[];
195
+ duration: number;
196
+ fixedDatabase: boolean;
197
+ synced: SyncedNote[];
1659
198
  }>;
1660
199
  /**
1661
200
  * Syncs local notes to Anki.
@@ -1665,15 +204,16 @@ type SyncNotesResult = Simplify<Pick<GlobalOptions, 'ankiWeb' | 'dryRun' | 'name
1665
204
  * @throws {Error} For various reasons...
1666
205
  */
1667
206
  declare function syncNotes(allLocalNotes: YankiNote[], options?: PartialDeep<SyncNotesOptions>): Promise<SyncNotesResult>;
1668
-
207
+ //#endregion
208
+ //#region src/lib/actions/sync-files.d.ts
1669
209
  type SyncFilesOptions = Simplify<Pick<GlobalOptions, 'allFilePaths' | 'basePath' | 'fetchAdapter' | 'fileAdapter' | 'manageFilenames' | 'maxFilenameLength' | 'obsidianVault' | 'strictLineBreaks' | 'syncMediaAssets'> & SyncNotesOptions>;
1670
210
  declare const defaultSyncFilesOptions: SyncFilesOptions;
1671
211
  type SyncedFile = Simplify<SyncedNote & {
1672
- filePath: string | undefined;
1673
- filePathOriginal: string | undefined;
212
+ filePath: string | undefined;
213
+ filePathOriginal: string | undefined;
1674
214
  }>;
1675
215
  type SyncFilesResult = Simplify<Omit<SyncNotesResult, 'synced'> & {
1676
- synced: SyncedFile[];
216
+ synced: SyncedFile[];
1677
217
  }>;
1678
218
  /**
1679
219
  * Sync a list of local yanki files to Anki.
@@ -1689,19 +229,19 @@ type SyncFilesResult = Simplify<Omit<SyncNotesResult, 'synced'> & {
1689
229
  */
1690
230
  declare function syncFiles(allLocalFilePaths: string[], options?: PartialDeep<SyncFilesOptions>): Promise<SyncFilesResult>;
1691
231
  declare function formatSyncFilesResult(result: SyncFilesResult, verbose?: boolean): string;
1692
-
232
+ //#endregion
233
+ //#region src/lib/parse/parse.d.ts
1693
234
  type GetNoteFromMarkdownOptions = Pick<GlobalOptions, 'allFilePaths' | 'basePath' | 'cwd' | 'fetchAdapter' | 'fileAdapter' | 'namespace' | 'obsidianVault' | 'resolveUrls' | 'strictLineBreaks' | 'syncMediaAssets'> & {
1694
- /** Needed for the public API, but optional for more efficient use internally when the namespace is already validated. */
1695
- namespaceValidationAndSanitization: boolean;
235
+ /** Needed for the public API, but optional for more efficient use internally when the namespace is already validated. */namespaceValidationAndSanitization: boolean;
1696
236
  };
1697
237
  declare const defaultGetNoteFromMarkdownOptions: GetNoteFromMarkdownOptions;
1698
238
  declare function getNoteFromMarkdown(markdown: string, options?: Partial<GetNoteFromMarkdownOptions>): Promise<YankiNote>;
1699
-
239
+ //#endregion
240
+ //#region src/lib/utilities/url.d.ts
1700
241
  declare function urlToHostAndPort(url: string): undefined | {
1701
- host: string;
1702
- port: number;
242
+ host: string;
243
+ port: number;
1703
244
  };
1704
245
  declare function hostAndPortToUrl(host: string, port: number): string;
1705
-
1706
- export { cleanNotes, defaultCleanOptions, defaultGetNoteFromMarkdownOptions, defaultGetStyleOptions, defaultListOptions, defaultRenameFilesOptions, defaultSetStyleOptions, defaultSyncFilesOptions, defaultSyncNotesOptions, formatCleanResult, formatListResult, formatSetStyleResult, formatSyncFilesResult, getNoteFromMarkdown, getStyle, hostAndPortToUrl, listNotes, renameFiles, setStyle, syncFiles, syncNotes, urlToHostAndPort };
1707
- export type { CleanOptions, CleanResult, FetchAdapter, FileAdapter, GetNoteFromMarkdownOptions, GetStyleOptions, ListOptions, RenameFilesOptions, RenameFilesResult, SetStyleOptions, SetStyleResult, SyncFilesOptions, SyncFilesResult, SyncNotesOptions, SyncNotesResult, YankiNote };
246
+ //#endregion
247
+ 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 };