obsidian-dev-utils 80.1.0 → 82.0.0-beta.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 (398) hide show
  1. package/CHANGELOG.md +34 -0
  2. package/dist/lib/cjs/abort-controller.cjs +12 -9
  3. package/dist/lib/cjs/abort-controller.d.cts +2 -2
  4. package/dist/lib/cjs/async-events.cjs +9 -1
  5. package/dist/lib/cjs/async-events.d.cts +9 -1
  6. package/dist/lib/cjs/async.cjs +93 -34
  7. package/dist/lib/cjs/async.d.cts +87 -17
  8. package/dist/lib/cjs/codemirror/state-field-spec.d.cts +1 -1
  9. package/dist/lib/cjs/css-class.cjs +6 -1
  10. package/dist/lib/cjs/css-class.d.cts +20 -0
  11. package/dist/lib/cjs/debug.cjs +26 -9
  12. package/dist/lib/cjs/debug.d.cts +24 -6
  13. package/dist/lib/cjs/disposable.cjs +234 -0
  14. package/dist/lib/cjs/disposable.d.cts +124 -0
  15. package/dist/lib/cjs/error.cjs +29 -18
  16. package/dist/lib/cjs/error.d.cts +23 -7
  17. package/dist/lib/cjs/function.d.cts +1 -1
  18. package/dist/lib/cjs/html-element.cjs +9 -6
  19. package/dist/lib/cjs/html-element.d.cts +5 -3
  20. package/dist/lib/cjs/index.cjs +4 -1
  21. package/dist/lib/cjs/index.d.cts +1 -0
  22. package/dist/lib/cjs/library.cjs +2 -2
  23. package/dist/lib/cjs/object-utils.cjs +233 -128
  24. package/dist/lib/cjs/object-utils.d.cts +38 -13
  25. package/dist/lib/cjs/obsidian/@types/dataview/api/plugin-api.d.cts +1 -1
  26. package/dist/lib/cjs/obsidian/@types/dataview/data-index/index.d.cts +1 -1
  27. package/dist/lib/cjs/obsidian/@types/dataview/data-model/markdown.d.cts +2 -2
  28. package/dist/lib/cjs/obsidian/@types/dataview/data-model/serialized/markdown.d.cts +2 -2
  29. package/dist/lib/cjs/obsidian/@types/dataview/index.d.cts +1 -1
  30. package/dist/lib/cjs/obsidian/@types/dataview/query/engine.d.cts +1 -1
  31. package/dist/lib/cjs/obsidian/@types/dataview/typings/obsidian-ex.d.cts +1 -1
  32. package/dist/lib/cjs/obsidian/@types/dataview/ui/lp-render.d.cts +1 -1
  33. package/dist/lib/cjs/obsidian/@types/dataview/ui/markdown.d.cts +1 -1
  34. package/dist/lib/cjs/obsidian/@types/dataview/ui/views/calendar-view.d.cts +1 -1
  35. package/dist/lib/cjs/obsidian/@types/dataview/ui/views/inline-view.d.cts +1 -1
  36. package/dist/lib/cjs/obsidian/@types/dataview/ui/views/list-view.d.cts +2 -2
  37. package/dist/lib/cjs/obsidian/@types/dataview/ui/views/table-view.d.cts +2 -2
  38. package/dist/lib/cjs/obsidian/@types/dataview/ui/views/task-view.d.cts +1 -1
  39. package/dist/lib/cjs/obsidian/active-file-provider.d.cts +1 -1
  40. package/dist/lib/cjs/obsidian/app.d.cts +1 -1
  41. package/dist/lib/cjs/obsidian/async-with-notice.cjs +9 -6
  42. package/dist/lib/cjs/obsidian/async-with-notice.d.cts +16 -3
  43. package/dist/lib/cjs/obsidian/attachment-path.cjs +45 -13
  44. package/dist/lib/cjs/obsidian/attachment-path.d.cts +47 -9
  45. package/dist/lib/cjs/obsidian/backlink.cjs +6 -6
  46. package/dist/lib/cjs/obsidian/backlink.d.cts +6 -2
  47. package/dist/lib/cjs/obsidian/bases-view-registrar.d.cts +1 -1
  48. package/dist/lib/cjs/obsidian/callout.cjs +1 -1
  49. package/dist/lib/cjs/obsidian/callout.d.cts +8 -0
  50. package/dist/lib/cjs/obsidian/case-insensitive-file-index.d.cts +1 -1
  51. package/dist/lib/cjs/obsidian/code-block-markdown-information.d.cts +1 -1
  52. package/dist/lib/cjs/obsidian/command-handlers/abstract-file-command-handler.cjs +53 -16
  53. package/dist/lib/cjs/obsidian/command-handlers/abstract-file-command-handler.d.cts +84 -10
  54. package/dist/lib/cjs/obsidian/command-handlers/command-handler.d.cts +1 -1
  55. package/dist/lib/cjs/obsidian/command-handlers/editor-command-handler.cjs +25 -5
  56. package/dist/lib/cjs/obsidian/command-handlers/editor-command-handler.d.cts +38 -2
  57. package/dist/lib/cjs/obsidian/command-handlers/file-command-handler.cjs +33 -19
  58. package/dist/lib/cjs/obsidian/command-handlers/file-command-handler.d.cts +45 -19
  59. package/dist/lib/cjs/obsidian/command-handlers/folder-command-handler.cjs +33 -19
  60. package/dist/lib/cjs/obsidian/command-handlers/folder-command-handler.d.cts +45 -19
  61. package/dist/lib/cjs/obsidian/command-handlers/global-command-handler.d.cts +2 -2
  62. package/dist/lib/cjs/obsidian/command-handlers/open-settings-command-handler.d.cts +1 -1
  63. package/dist/lib/cjs/obsidian/command-registrar.d.cts +1 -1
  64. package/dist/lib/cjs/obsidian/components/all-windows-event-component.cjs +17 -9
  65. package/dist/lib/cjs/obsidian/components/all-windows-event-component.d.cts +49 -9
  66. package/dist/lib/cjs/obsidian/components/async-error-handler-component.cjs +5 -2
  67. package/dist/lib/cjs/obsidian/components/case-insensitive-file-index-component.d.cts +1 -1
  68. package/dist/lib/cjs/obsidian/components/disposable-component.cjs +5 -10
  69. package/dist/lib/cjs/obsidian/components/disposable-component.d.cts +0 -7
  70. package/dist/lib/cjs/obsidian/components/embed-extensions-component.d.cts +2 -2
  71. package/dist/lib/cjs/obsidian/components/layout-ready-component.d.cts +2 -2
  72. package/dist/lib/cjs/obsidian/components/menu-event-registrar-component.d.cts +1 -1
  73. package/dist/lib/cjs/obsidian/components/monkey-around-component.d.cts +1 -1
  74. package/dist/lib/cjs/obsidian/components/plugin-context-component.d.cts +1 -1
  75. package/dist/lib/cjs/obsidian/components/plugin-notice-component.cjs +1 -1
  76. package/dist/lib/cjs/obsidian/components/plugin-notice-component.d.cts +3 -2
  77. package/dist/lib/cjs/obsidian/components/plugin-settings-component.cjs +24 -8
  78. package/dist/lib/cjs/obsidian/components/plugin-settings-component.d.cts +26 -5
  79. package/dist/lib/cjs/obsidian/components/plugin-settings-tab-component.d.cts +1 -1
  80. package/dist/lib/cjs/obsidian/components/registry-component.d.cts +1 -1
  81. package/dist/lib/cjs/obsidian/components/rename-delete-handler-component.cjs +195 -72
  82. package/dist/lib/cjs/obsidian/components/rename-delete-handler-component.d.cts +4 -1
  83. package/dist/lib/cjs/obsidian/constructors/getDomEventsHandlersConstructor.d.cts +2 -2
  84. package/dist/lib/cjs/obsidian/data-handler.d.cts +1 -1
  85. package/dist/lib/cjs/obsidian/dataview-link.cjs +7 -2
  86. package/dist/lib/cjs/obsidian/dataview-link.d.cts +22 -5
  87. package/dist/lib/cjs/obsidian/dataview.cjs +27 -10
  88. package/dist/lib/cjs/obsidian/dataview.d.cts +32 -7
  89. package/dist/lib/cjs/obsidian/editor-extension-registrar.d.cts +1 -1
  90. package/dist/lib/cjs/obsidian/editor-lock.cjs +245 -0
  91. package/dist/lib/cjs/obsidian/editor-lock.d.cts +57 -0
  92. package/dist/lib/cjs/obsidian/editor.cjs +7 -1
  93. package/dist/lib/cjs/obsidian/editor.d.cts +3 -2
  94. package/dist/lib/cjs/obsidian/file-change.cjs +103 -27
  95. package/dist/lib/cjs/obsidian/file-change.d.cts +55 -14
  96. package/dist/lib/cjs/obsidian/file-manager.cjs +61 -32
  97. package/dist/lib/cjs/obsidian/file-manager.d.cts +65 -15
  98. package/dist/lib/cjs/obsidian/file-system.cjs +122 -23
  99. package/dist/lib/cjs/obsidian/file-system.d.cts +189 -40
  100. package/dist/lib/cjs/obsidian/frontmatter-link-cache-with-offsets.d.cts +1 -1
  101. package/dist/lib/cjs/obsidian/frontmatter.cjs +7 -2
  102. package/dist/lib/cjs/obsidian/hover-link-source-registrar.d.cts +1 -1
  103. package/dist/lib/cjs/obsidian/i18n/i18n.d.cts +1 -1
  104. package/dist/lib/cjs/obsidian/i18n/locales/en.cjs +4 -1
  105. package/dist/lib/cjs/obsidian/i18n/locales/en.d.cts +3 -0
  106. package/dist/lib/cjs/obsidian/i18n/locales/translations-map.d.cts +3 -0
  107. package/dist/lib/cjs/obsidian/index.cjs +4 -1
  108. package/dist/lib/cjs/obsidian/index.d.cts +1 -0
  109. package/dist/lib/cjs/obsidian/link.cjs +326 -129
  110. package/dist/lib/cjs/obsidian/link.d.cts +133 -36
  111. package/dist/lib/cjs/obsidian/logger.cjs +48 -22
  112. package/dist/lib/cjs/obsidian/logger.d.cts +27 -6
  113. package/dist/lib/cjs/obsidian/loop.cjs +14 -4
  114. package/dist/lib/cjs/obsidian/loop.d.cts +27 -8
  115. package/dist/lib/cjs/obsidian/markdown-code-block-processor-registrar.d.cts +2 -2
  116. package/dist/lib/cjs/obsidian/markdown-code-block-processor.cjs +155 -107
  117. package/dist/lib/cjs/obsidian/markdown-code-block-processor.d.cts +16 -6
  118. package/dist/lib/cjs/obsidian/markdown-post-processor-registrar.cjs +1 -1
  119. package/dist/lib/cjs/obsidian/markdown-post-processor-registrar.d.cts +5 -3
  120. package/dist/lib/cjs/obsidian/markdown-view.d.cts +1 -1
  121. package/dist/lib/cjs/obsidian/markdown.cjs +40 -11
  122. package/dist/lib/cjs/obsidian/markdown.d.cts +85 -17
  123. package/dist/lib/cjs/obsidian/menu-event-registrar.d.cts +1 -1
  124. package/dist/lib/cjs/obsidian/metadata-cache.cjs +88 -32
  125. package/dist/lib/cjs/obsidian/metadata-cache.d.cts +42 -32
  126. package/dist/lib/cjs/obsidian/modals/alert.cjs +1 -1
  127. package/dist/lib/cjs/obsidian/modals/alert.d.cts +2 -0
  128. package/dist/lib/cjs/obsidian/modals/confirm.cjs +1 -1
  129. package/dist/lib/cjs/obsidian/modals/confirm.d.cts +2 -0
  130. package/dist/lib/cjs/obsidian/modals/index.cjs +4 -1
  131. package/dist/lib/cjs/obsidian/modals/index.d.cts +1 -0
  132. package/dist/lib/cjs/obsidian/modals/minimizable-modal.cjs +234 -0
  133. package/dist/lib/cjs/obsidian/modals/minimizable-modal.d.cts +74 -0
  134. package/dist/lib/cjs/obsidian/modals/modal.d.cts +1 -1
  135. package/dist/lib/cjs/obsidian/modals/prompt.cjs +1 -1
  136. package/dist/lib/cjs/obsidian/modals/prompt.d.cts +7 -1
  137. package/dist/lib/cjs/obsidian/modals/select-item.cjs +1 -1
  138. package/dist/lib/cjs/obsidian/modals/select-item.d.cts +2 -0
  139. package/dist/lib/cjs/obsidian/obsidian-protocol-handler-registrar.d.cts +2 -2
  140. package/dist/lib/cjs/obsidian/obsidian-settings.d.cts +1 -1
  141. package/dist/lib/cjs/obsidian/path-settings.cjs +5 -2
  142. package/dist/lib/cjs/obsidian/plugin/plugin-context.d.cts +1 -1
  143. package/dist/lib/cjs/obsidian/plugin/plugin-event-source.cjs +5 -1
  144. package/dist/lib/cjs/obsidian/plugin/plugin-event-source.d.cts +5 -1
  145. package/dist/lib/cjs/obsidian/plugin/plugin-settings-tab.cjs +15 -7
  146. package/dist/lib/cjs/obsidian/plugin/plugin-settings-tab.d.cts +51 -14
  147. package/dist/lib/cjs/obsidian/plugin/plugin.cjs +22 -16
  148. package/dist/lib/cjs/obsidian/plugin/plugin.d.cts +6 -6
  149. package/dist/lib/cjs/obsidian/plugin-cli-handler-registrar.d.cts +2 -2
  150. package/dist/lib/cjs/obsidian/queue.cjs +9 -7
  151. package/dist/lib/cjs/obsidian/queue.d.cts +15 -3
  152. package/dist/lib/cjs/obsidian/react/app-context.d.cts +1 -1
  153. package/dist/lib/cjs/obsidian/reference.d.cts +1 -1
  154. package/dist/lib/cjs/obsidian/resource-url.cjs +7 -2
  155. package/dist/lib/cjs/obsidian/resource-url.d.cts +20 -5
  156. package/dist/lib/cjs/obsidian/ribbon-icon-registrar.d.cts +1 -1
  157. package/dist/lib/cjs/obsidian/setting-components/value-component-with-change-tracking.d.cts +1 -1
  158. package/dist/lib/cjs/obsidian/setting-ex.d.cts +1 -1
  159. package/dist/lib/cjs/obsidian/status-bar-item-registrar.cjs +4 -2
  160. package/dist/lib/cjs/obsidian/status-bar-item-registrar.d.cts +6 -2
  161. package/dist/lib/cjs/obsidian/vault-delete.cjs +19 -15
  162. package/dist/lib/cjs/obsidian/vault-delete.d.cts +12 -7
  163. package/dist/lib/cjs/obsidian/vault.cjs +116 -59
  164. package/dist/lib/cjs/obsidian/vault.d.cts +188 -45
  165. package/dist/lib/cjs/obsidian/view-registrar.d.cts +1 -1
  166. package/dist/lib/cjs/obsidian/workspace.d.cts +1 -1
  167. package/dist/lib/cjs/path.cjs +12 -5
  168. package/dist/lib/cjs/path.d.cts +15 -3
  169. package/dist/lib/cjs/reg-exp.cjs +101 -78
  170. package/dist/lib/cjs/script-utils/build.cjs +9 -5
  171. package/dist/lib/cjs/script-utils/bundlers/esbuild-impl/change-extension-plugin.cjs +34 -14
  172. package/dist/lib/cjs/script-utils/bundlers/esbuild-impl/change-extension-plugin.d.cts +1 -1
  173. package/dist/lib/cjs/script-utils/bundlers/esbuild-impl/copy-to-obsidian-plugins-folder-plugin.cjs +20 -5
  174. package/dist/lib/cjs/script-utils/bundlers/esbuild-impl/copy-to-obsidian-plugins-folder-plugin.d.cts +24 -6
  175. package/dist/lib/cjs/script-utils/bundlers/esbuild-impl/custom-esbuild-options-plugin.d.cts +1 -1
  176. package/dist/lib/cjs/script-utils/bundlers/esbuild-impl/dependency.cjs +11 -4
  177. package/dist/lib/cjs/script-utils/bundlers/esbuild-impl/fix-esm-plugin.cjs +6 -2
  178. package/dist/lib/cjs/script-utils/bundlers/esbuild-impl/fix-esm-plugin.d.cts +1 -1
  179. package/dist/lib/cjs/script-utils/bundlers/esbuild-impl/fix-source-maps-plugin.cjs +31 -12
  180. package/dist/lib/cjs/script-utils/bundlers/esbuild-impl/fix-source-maps-plugin.d.cts +20 -5
  181. package/dist/lib/cjs/script-utils/bundlers/esbuild-impl/obsidian-plugin-builder.cjs +7 -7
  182. package/dist/lib/cjs/script-utils/bundlers/esbuild-impl/obsidian-plugin-builder.d.cts +1 -1
  183. package/dist/lib/cjs/script-utils/bundlers/esbuild-impl/preprocess-plugin.cjs +12 -3
  184. package/dist/lib/cjs/script-utils/bundlers/esbuild-impl/preprocess-plugin.d.cts +1 -1
  185. package/dist/lib/cjs/script-utils/bundlers/esbuild-impl/rename-css-plugin.d.cts +1 -1
  186. package/dist/lib/cjs/script-utils/bundlers/esbuild-impl/svelte-wrapper-plugin.d.cts +1 -1
  187. package/dist/lib/cjs/script-utils/check-project-types.cjs +5 -1
  188. package/dist/lib/cjs/script-utils/check-project-types.d.cts +10 -2
  189. package/dist/lib/cjs/script-utils/cli-utils.cjs +6 -2
  190. package/dist/lib/cjs/script-utils/cli-utils.d.cts +1 -1
  191. package/dist/lib/cjs/script-utils/commitlint-config.d.cts +1 -1
  192. package/dist/lib/cjs/script-utils/exec.cjs +47 -12
  193. package/dist/lib/cjs/script-utils/exec.d.cts +12 -0
  194. package/dist/lib/cjs/script-utils/formatters/dprint.cjs +3 -3
  195. package/dist/lib/cjs/script-utils/formatters/dprint.d.cts +2 -0
  196. package/dist/lib/cjs/script-utils/fs.d.cts +1 -1
  197. package/dist/lib/cjs/script-utils/json.cjs +9 -5
  198. package/dist/lib/cjs/script-utils/json.d.cts +41 -9
  199. package/dist/lib/cjs/script-utils/linters/eslint-config.d.cts +1 -1
  200. package/dist/lib/cjs/script-utils/linters/eslint-rules/no-async-callback-to-unsafe-return.d.cts +1 -1
  201. package/dist/lib/cjs/script-utils/linters/eslint-rules/no-unused-params-members.cjs +8 -3
  202. package/dist/lib/cjs/script-utils/linters/eslint-rules/no-unused-params-members.d.cts +1 -1
  203. package/dist/lib/cjs/script-utils/linters/eslint-rules/no-used-underscore-variables.d.cts +1 -1
  204. package/dist/lib/cjs/script-utils/linters/eslint-rules/obsidian-dev-utils-plugin.d.cts +1 -1
  205. package/dist/lib/cjs/script-utils/linters/eslint-rules/params-options-name-match.d.cts +1 -1
  206. package/dist/lib/cjs/script-utils/linters/eslint-rules/prefer-noop-async.d.cts +1 -1
  207. package/dist/lib/cjs/script-utils/linters/eslint-rules/readonly-params-options-result-members.d.cts +1 -1
  208. package/dist/lib/cjs/script-utils/linters/eslint-rules/require-component-suffix.cjs +27 -7
  209. package/dist/lib/cjs/script-utils/linters/eslint-rules/require-component-suffix.d.cts +1 -1
  210. package/dist/lib/cjs/script-utils/linters/eslint-rules/require-method-template.cjs +7 -3
  211. package/dist/lib/cjs/script-utils/linters/eslint-rules/require-method-template.d.cts +1 -1
  212. package/dist/lib/cjs/script-utils/linters/eslint-rules/require-super-call.cjs +8 -3
  213. package/dist/lib/cjs/script-utils/linters/eslint-rules/require-super-call.d.cts +1 -1
  214. package/dist/lib/cjs/script-utils/linters/eslint-rules/rule-tester-helper.d.cts +2 -2
  215. package/dist/lib/cjs/script-utils/linters/eslint.cjs +3 -3
  216. package/dist/lib/cjs/script-utils/linters/eslint.d.cts +2 -0
  217. package/dist/lib/cjs/script-utils/linters/markdownlint-types/@types/markdownlint-cli2-config-schema.d.cts +1 -1
  218. package/dist/lib/cjs/script-utils/linters/markdownlint.cjs +3 -3
  219. package/dist/lib/cjs/script-utils/linters/markdownlint.d.cts +2 -0
  220. package/dist/lib/cjs/script-utils/linters/over-exposure.cjs +72 -30
  221. package/dist/lib/cjs/script-utils/linters/over-exposure.d.cts +9 -1
  222. package/dist/lib/cjs/script-utils/npm-publish.cjs +2 -2
  223. package/dist/lib/cjs/script-utils/npm.cjs +18 -9
  224. package/dist/lib/cjs/script-utils/npm.d.cts +3 -1
  225. package/dist/lib/cjs/script-utils/root.cjs +20 -5
  226. package/dist/lib/cjs/script-utils/root.d.cts +45 -9
  227. package/dist/lib/cjs/script-utils/test-runners/vitest.cjs +1 -1
  228. package/dist/lib/cjs/script-utils/test-runners/vitest.d.cts +2 -0
  229. package/dist/lib/cjs/script-utils/validate-declarations.cjs +8 -44
  230. package/dist/lib/cjs/script-utils/validate-declarations.d.cts +22 -9
  231. package/dist/lib/cjs/script-utils/version.cjs +36 -19
  232. package/dist/lib/cjs/script-utils/version.d.cts +20 -7
  233. package/dist/lib/cjs/strict-proxy.cjs +10 -1
  234. package/dist/lib/cjs/string.cjs +63 -22
  235. package/dist/lib/cjs/string.d.cts +194 -40
  236. package/dist/lib/cjs/value-provider.d.cts +1 -1
  237. package/dist/lib/esm/abort-controller.d.mts +2 -2
  238. package/dist/lib/esm/abort-controller.mjs +12 -9
  239. package/dist/lib/esm/async-events.d.mts +8 -0
  240. package/dist/lib/esm/async-events.mjs +9 -1
  241. package/dist/lib/esm/async.d.mts +86 -16
  242. package/dist/lib/esm/async.mjs +93 -34
  243. package/dist/lib/esm/css-class.d.mts +20 -0
  244. package/dist/lib/esm/css-class.mjs +6 -1
  245. package/dist/lib/esm/debug.d.mts +23 -5
  246. package/dist/lib/esm/debug.mjs +26 -9
  247. package/dist/lib/esm/disposable.d.mts +124 -0
  248. package/dist/lib/esm/disposable.mjs +122 -0
  249. package/dist/lib/esm/error.d.mts +23 -7
  250. package/dist/lib/esm/error.mjs +29 -18
  251. package/dist/lib/esm/html-element.d.mts +4 -2
  252. package/dist/lib/esm/html-element.mjs +9 -6
  253. package/dist/lib/esm/index.d.mts +1 -0
  254. package/dist/lib/esm/index.mjs +3 -1
  255. package/dist/lib/esm/library.mjs +2 -2
  256. package/dist/lib/esm/object-utils.d.mts +37 -12
  257. package/dist/lib/esm/object-utils.mjs +233 -128
  258. package/dist/lib/esm/obsidian/async-with-notice.d.mts +15 -2
  259. package/dist/lib/esm/obsidian/async-with-notice.mjs +9 -6
  260. package/dist/lib/esm/obsidian/attachment-path.d.mts +46 -8
  261. package/dist/lib/esm/obsidian/attachment-path.mjs +45 -13
  262. package/dist/lib/esm/obsidian/backlink.d.mts +6 -2
  263. package/dist/lib/esm/obsidian/backlink.mjs +6 -6
  264. package/dist/lib/esm/obsidian/callout.d.mts +8 -0
  265. package/dist/lib/esm/obsidian/callout.mjs +1 -1
  266. package/dist/lib/esm/obsidian/command-handlers/abstract-file-command-handler.d.mts +83 -9
  267. package/dist/lib/esm/obsidian/command-handlers/abstract-file-command-handler.mjs +53 -16
  268. package/dist/lib/esm/obsidian/command-handlers/editor-command-handler.d.mts +37 -1
  269. package/dist/lib/esm/obsidian/command-handlers/editor-command-handler.mjs +25 -5
  270. package/dist/lib/esm/obsidian/command-handlers/file-command-handler.d.mts +43 -17
  271. package/dist/lib/esm/obsidian/command-handlers/file-command-handler.mjs +33 -19
  272. package/dist/lib/esm/obsidian/command-handlers/folder-command-handler.d.mts +43 -17
  273. package/dist/lib/esm/obsidian/command-handlers/folder-command-handler.mjs +33 -19
  274. package/dist/lib/esm/obsidian/components/all-windows-event-component.d.mts +48 -8
  275. package/dist/lib/esm/obsidian/components/all-windows-event-component.mjs +17 -9
  276. package/dist/lib/esm/obsidian/components/async-error-handler-component.mjs +5 -2
  277. package/dist/lib/esm/obsidian/components/disposable-component.d.mts +0 -7
  278. package/dist/lib/esm/obsidian/components/disposable-component.mjs +3 -7
  279. package/dist/lib/esm/obsidian/components/plugin-notice-component.d.mts +3 -2
  280. package/dist/lib/esm/obsidian/components/plugin-notice-component.mjs +1 -1
  281. package/dist/lib/esm/obsidian/components/plugin-settings-component.d.mts +25 -4
  282. package/dist/lib/esm/obsidian/components/plugin-settings-component.mjs +24 -8
  283. package/dist/lib/esm/obsidian/components/rename-delete-handler-component.d.mts +3 -0
  284. package/dist/lib/esm/obsidian/components/rename-delete-handler-component.mjs +197 -79
  285. package/dist/lib/esm/obsidian/dataview-link.d.mts +22 -5
  286. package/dist/lib/esm/obsidian/dataview-link.mjs +7 -2
  287. package/dist/lib/esm/obsidian/dataview.d.mts +31 -6
  288. package/dist/lib/esm/obsidian/dataview.mjs +27 -10
  289. package/dist/lib/esm/obsidian/editor-lock.d.mts +57 -0
  290. package/dist/lib/esm/obsidian/editor-lock.mjs +141 -0
  291. package/dist/lib/esm/obsidian/editor.d.mts +2 -1
  292. package/dist/lib/esm/obsidian/editor.mjs +7 -1
  293. package/dist/lib/esm/obsidian/file-change.d.mts +54 -13
  294. package/dist/lib/esm/obsidian/file-change.mjs +104 -27
  295. package/dist/lib/esm/obsidian/file-manager.d.mts +63 -13
  296. package/dist/lib/esm/obsidian/file-manager.mjs +65 -33
  297. package/dist/lib/esm/obsidian/file-system.d.mts +188 -39
  298. package/dist/lib/esm/obsidian/file-system.mjs +122 -23
  299. package/dist/lib/esm/obsidian/frontmatter.mjs +7 -2
  300. package/dist/lib/esm/obsidian/i18n/locales/en.d.mts +3 -0
  301. package/dist/lib/esm/obsidian/i18n/locales/en.mjs +4 -1
  302. package/dist/lib/esm/obsidian/i18n/locales/translations-map.d.mts +3 -0
  303. package/dist/lib/esm/obsidian/index.d.mts +1 -0
  304. package/dist/lib/esm/obsidian/index.mjs +3 -1
  305. package/dist/lib/esm/obsidian/link.d.mts +131 -34
  306. package/dist/lib/esm/obsidian/link.mjs +327 -130
  307. package/dist/lib/esm/obsidian/logger.d.mts +26 -5
  308. package/dist/lib/esm/obsidian/logger.mjs +48 -22
  309. package/dist/lib/esm/obsidian/loop.d.mts +26 -7
  310. package/dist/lib/esm/obsidian/loop.mjs +14 -4
  311. package/dist/lib/esm/obsidian/markdown-code-block-processor.d.mts +15 -5
  312. package/dist/lib/esm/obsidian/markdown-code-block-processor.mjs +155 -107
  313. package/dist/lib/esm/obsidian/markdown-post-processor-registrar.d.mts +3 -1
  314. package/dist/lib/esm/obsidian/markdown-post-processor-registrar.mjs +1 -1
  315. package/dist/lib/esm/obsidian/markdown.d.mts +84 -16
  316. package/dist/lib/esm/obsidian/markdown.mjs +40 -11
  317. package/dist/lib/esm/obsidian/metadata-cache.d.mts +40 -30
  318. package/dist/lib/esm/obsidian/metadata-cache.mjs +88 -30
  319. package/dist/lib/esm/obsidian/modals/alert.d.mts +2 -0
  320. package/dist/lib/esm/obsidian/modals/alert.mjs +1 -1
  321. package/dist/lib/esm/obsidian/modals/confirm.d.mts +2 -0
  322. package/dist/lib/esm/obsidian/modals/confirm.mjs +1 -1
  323. package/dist/lib/esm/obsidian/modals/index.d.mts +1 -0
  324. package/dist/lib/esm/obsidian/modals/index.mjs +3 -1
  325. package/dist/lib/esm/obsidian/modals/minimizable-modal.d.mts +74 -0
  326. package/dist/lib/esm/obsidian/modals/minimizable-modal.mjs +126 -0
  327. package/dist/lib/esm/obsidian/modals/prompt.d.mts +6 -0
  328. package/dist/lib/esm/obsidian/modals/prompt.mjs +1 -1
  329. package/dist/lib/esm/obsidian/modals/select-item.d.mts +2 -0
  330. package/dist/lib/esm/obsidian/modals/select-item.mjs +1 -1
  331. package/dist/lib/esm/obsidian/path-settings.mjs +5 -2
  332. package/dist/lib/esm/obsidian/plugin/plugin-event-source.d.mts +4 -0
  333. package/dist/lib/esm/obsidian/plugin/plugin-event-source.mjs +5 -1
  334. package/dist/lib/esm/obsidian/plugin/plugin-settings-tab.d.mts +48 -11
  335. package/dist/lib/esm/obsidian/plugin/plugin-settings-tab.mjs +15 -7
  336. package/dist/lib/esm/obsidian/plugin/plugin.d.mts +4 -4
  337. package/dist/lib/esm/obsidian/plugin/plugin.mjs +24 -21
  338. package/dist/lib/esm/obsidian/queue.d.mts +14 -2
  339. package/dist/lib/esm/obsidian/queue.mjs +9 -7
  340. package/dist/lib/esm/obsidian/resource-url.d.mts +19 -4
  341. package/dist/lib/esm/obsidian/resource-url.mjs +7 -2
  342. package/dist/lib/esm/obsidian/status-bar-item-registrar.d.mts +6 -2
  343. package/dist/lib/esm/obsidian/status-bar-item-registrar.mjs +4 -2
  344. package/dist/lib/esm/obsidian/vault-delete.d.mts +11 -6
  345. package/dist/lib/esm/obsidian/vault-delete.mjs +19 -15
  346. package/dist/lib/esm/obsidian/vault.d.mts +187 -44
  347. package/dist/lib/esm/obsidian/vault.mjs +116 -59
  348. package/dist/lib/esm/path.d.mts +15 -3
  349. package/dist/lib/esm/path.mjs +12 -5
  350. package/dist/lib/esm/reg-exp.mjs +101 -78
  351. package/dist/lib/esm/script-utils/build.mjs +9 -5
  352. package/dist/lib/esm/script-utils/bundlers/esbuild-impl/change-extension-plugin.mjs +34 -14
  353. package/dist/lib/esm/script-utils/bundlers/esbuild-impl/copy-to-obsidian-plugins-folder-plugin.d.mts +23 -5
  354. package/dist/lib/esm/script-utils/bundlers/esbuild-impl/copy-to-obsidian-plugins-folder-plugin.mjs +20 -5
  355. package/dist/lib/esm/script-utils/bundlers/esbuild-impl/dependency.mjs +11 -4
  356. package/dist/lib/esm/script-utils/bundlers/esbuild-impl/fix-esm-plugin.mjs +6 -2
  357. package/dist/lib/esm/script-utils/bundlers/esbuild-impl/fix-source-maps-plugin.d.mts +19 -4
  358. package/dist/lib/esm/script-utils/bundlers/esbuild-impl/fix-source-maps-plugin.mjs +31 -12
  359. package/dist/lib/esm/script-utils/bundlers/esbuild-impl/obsidian-plugin-builder.mjs +7 -7
  360. package/dist/lib/esm/script-utils/bundlers/esbuild-impl/preprocess-plugin.mjs +12 -3
  361. package/dist/lib/esm/script-utils/check-project-types.d.mts +9 -1
  362. package/dist/lib/esm/script-utils/check-project-types.mjs +5 -1
  363. package/dist/lib/esm/script-utils/cli-utils.mjs +6 -2
  364. package/dist/lib/esm/script-utils/exec.d.mts +12 -0
  365. package/dist/lib/esm/script-utils/exec.mjs +47 -12
  366. package/dist/lib/esm/script-utils/formatters/dprint.d.mts +2 -0
  367. package/dist/lib/esm/script-utils/formatters/dprint.mjs +3 -3
  368. package/dist/lib/esm/script-utils/json.d.mts +40 -8
  369. package/dist/lib/esm/script-utils/json.mjs +9 -5
  370. package/dist/lib/esm/script-utils/linters/eslint-rules/no-unused-params-members.mjs +8 -3
  371. package/dist/lib/esm/script-utils/linters/eslint-rules/require-component-suffix.mjs +27 -7
  372. package/dist/lib/esm/script-utils/linters/eslint-rules/require-method-template.mjs +7 -3
  373. package/dist/lib/esm/script-utils/linters/eslint-rules/require-super-call.mjs +8 -3
  374. package/dist/lib/esm/script-utils/linters/eslint.d.mts +2 -0
  375. package/dist/lib/esm/script-utils/linters/eslint.mjs +3 -3
  376. package/dist/lib/esm/script-utils/linters/markdownlint-types/@types/markdownlint-cli2-config-schema.d.mts +1 -1
  377. package/dist/lib/esm/script-utils/linters/markdownlint.d.mts +2 -0
  378. package/dist/lib/esm/script-utils/linters/markdownlint.mjs +3 -3
  379. package/dist/lib/esm/script-utils/linters/over-exposure.d.mts +8 -0
  380. package/dist/lib/esm/script-utils/linters/over-exposure.mjs +72 -30
  381. package/dist/lib/esm/script-utils/npm-publish.mjs +2 -2
  382. package/dist/lib/esm/script-utils/npm.d.mts +2 -0
  383. package/dist/lib/esm/script-utils/npm.mjs +18 -9
  384. package/dist/lib/esm/script-utils/root.d.mts +45 -9
  385. package/dist/lib/esm/script-utils/root.mjs +20 -5
  386. package/dist/lib/esm/script-utils/test-runners/vitest.d.mts +2 -0
  387. package/dist/lib/esm/script-utils/test-runners/vitest.mjs +1 -1
  388. package/dist/lib/esm/script-utils/validate-declarations.d.mts +22 -9
  389. package/dist/lib/esm/script-utils/validate-declarations.mjs +8 -51
  390. package/dist/lib/esm/script-utils/version.d.mts +20 -7
  391. package/dist/lib/esm/script-utils/version.mjs +36 -19
  392. package/dist/lib/esm/strict-proxy.mjs +10 -1
  393. package/dist/lib/esm/string.d.mts +194 -40
  394. package/dist/lib/esm/string.mjs +63 -22
  395. package/dist/styles.css +5 -1
  396. package/obsidian/Modals/minimizable-modal/package.json +6 -0
  397. package/obsidian/editor-lock/package.json +6 -0
  398. package/package.json +9 -9
@@ -5,15 +5,20 @@
5
5
  * This module provides deletion utilities that require metadata cache access.
6
6
  */
7
7
  import type { App } from 'obsidian';
8
+ import type { PluginNoticeComponent } from './components/plugin-notice-component.mjs';
8
9
  import type { PathOrAbstractFile } from './file-system.mjs';
10
+ interface DeleteIfNotUsedParams {
11
+ readonly app: App;
12
+ readonly deletedNotePath?: string;
13
+ readonly pathOrFile: PathOrAbstractFile;
14
+ readonly pluginNoticeComponent?: PluginNoticeComponent;
15
+ readonly shouldDeleteEmptyFolders?: boolean;
16
+ }
9
17
  /**
10
18
  * Deletes an abstract file safely from the vault, but only if it is not referenced by other notes.
11
19
  *
12
- * @param app - The Obsidian application instance.
13
- * @param pathOrFile - The path or abstract file to delete.
14
- * @param deletedNotePath - Optional. The path of the note that triggered the removal.
15
- * @param shouldReportUsedAttachments - Optional. If `true`, a notice will be shown for each attachment that is still used by other notes.
16
- * @param shouldDeleteEmptyFolders - Optional. If `true`, empty folders will be deleted.
20
+ * @param params - The parameters for the function.
17
21
  * @returns A {@link Promise} that resolves to a boolean indicating whether the removal was successful.
18
22
  */
19
- export declare function deleteIfNotUsed(app: App, pathOrFile: PathOrAbstractFile, deletedNotePath?: string, shouldReportUsedAttachments?: boolean, shouldDeleteEmptyFolders?: boolean): Promise<boolean>;
23
+ export declare function deleteIfNotUsed(params: DeleteIfNotUsedParams): Promise<boolean>;
24
+ export {};
@@ -21,8 +21,8 @@ if you want to view the source, please visit the github repository of this plugi
21
21
  globalThis.process = browserProcess;
22
22
  })();
23
23
 
24
- import { Notice } from "obsidian";
25
24
  import { printError } from "../error.mjs";
25
+ import { normalizeOptionalProperties } from "../object-utils.mjs";
26
26
  import {
27
27
  getAbstractFileOrNull,
28
28
  isFile,
@@ -35,33 +35,37 @@ import {
35
35
  listSafe,
36
36
  trashSafe
37
37
  } from "./vault.mjs";
38
- async function deleteIfNotUsed(app, pathOrFile, deletedNotePath, shouldReportUsedAttachments, shouldDeleteEmptyFolders) {
39
- const file = getAbstractFileOrNull(app, pathOrFile);
38
+ async function deleteIfNotUsed(params) {
39
+ const file = getAbstractFileOrNull({ app: params.app, pathOrFile: params.pathOrFile });
40
40
  if (!file) {
41
41
  return false;
42
42
  }
43
- let canDelete = isFile(file) || (shouldDeleteEmptyFolders ?? true);
43
+ let canDelete = isFile(file) || (params.shouldDeleteEmptyFolders ?? true);
44
44
  if (isFile(file)) {
45
- const backlinks = await getBacklinksForFileSafe(app, file);
46
- if (deletedNotePath) {
47
- backlinks.clear(deletedNotePath);
45
+ const backlinks = await getBacklinksForFileSafe({ app: params.app, pathOrFile: file });
46
+ if (params.deletedNotePath) {
47
+ backlinks.clear(params.deletedNotePath);
48
48
  }
49
49
  if (backlinks.count() !== 0) {
50
- if (shouldReportUsedAttachments) {
51
- new Notice(t(($) => $.obsidianDevUtils.notices.attachmentIsStillUsed, { attachmentPath: file.path }));
52
- }
50
+ params.pluginNoticeComponent?.showNotice(t(($) => $.obsidianDevUtils.notices.attachmentIsStillUsed, { attachmentPath: file.path }));
53
51
  canDelete = false;
54
52
  }
55
53
  } else if (isFolder(file)) {
56
- const listedFiles = await listSafe(app, file);
54
+ const listedFiles = await listSafe(params.app, file);
57
55
  for (const child of [...listedFiles.files, ...listedFiles.folders]) {
58
- canDelete &&= await deleteIfNotUsed(app, child, deletedNotePath, shouldReportUsedAttachments);
56
+ canDelete &&= await deleteIfNotUsed(normalizeOptionalProperties({
57
+ app: params.app,
58
+ deletedNotePath: params.deletedNotePath,
59
+ pathOrFile: child,
60
+ pluginNoticeComponent: params.pluginNoticeComponent,
61
+ shouldDeleteEmptyFolders: params.shouldDeleteEmptyFolders
62
+ }));
59
63
  }
60
- canDelete &&= await isEmptyFolder(app, file);
64
+ canDelete &&= await isEmptyFolder(params.app, file);
61
65
  }
62
66
  if (canDelete) {
63
67
  try {
64
- await trashSafe(app, file);
68
+ await trashSafe(params.app, file);
65
69
  } catch (e) {
66
70
  printError(new Error(`Failed to delete ${file.path}`, { cause: e }));
67
71
  canDelete = false;
@@ -72,4 +76,4 @@ async function deleteIfNotUsed(app, pathOrFile, deletedNotePath, shouldReportUse
72
76
  export {
73
77
  deleteIfNotUsed
74
78
  };
75
- //# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vLi4vLi4vLi4vc3JjL29ic2lkaWFuL3ZhdWx0LWRlbGV0ZS50cyJdLAogICJzb3VyY2VzQ29udGVudCI6IFsiLyoqXG4gKiBAZmlsZVxuICpcbiAqIFRoaXMgbW9kdWxlIHByb3ZpZGVzIGRlbGV0aW9uIHV0aWxpdGllcyB0aGF0IHJlcXVpcmUgbWV0YWRhdGEgY2FjaGUgYWNjZXNzLlxuICovXG5cbmltcG9ydCB0eXBlIHsgQXBwIH0gZnJvbSAnb2JzaWRpYW4nO1xuXG5pbXBvcnQgeyBOb3RpY2UgfSBmcm9t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UFBSSxFQUFFLE9BQU8sRUFBRSxDQUFDLENBQUM7QUFDbkUsa0JBQVk7QUFBQSxJQUNkO0FBQUEsRUFDRjtBQUVBLFNBQU87QUFDVDsiLAogICJuYW1lcyI6IFtdCn0K
@@ -16,32 +16,193 @@ import { FileSystemType } from './file-system.mjs';
16
16
  export interface ContentArgs {
17
17
  readonly content: string;
18
18
  }
19
+ /**
20
+ * Parameters for {@link copySafe}.
21
+ */
22
+ export interface CopySafeParams {
23
+ /**
24
+ * The application instance.
25
+ */
26
+ readonly app: App;
27
+ /**
28
+ * The new path to copy the file to.
29
+ */
30
+ readonly newPath: string;
31
+ /**
32
+ * The old path or file to copy.
33
+ */
34
+ readonly oldPathOrFile: PathOrFile;
35
+ }
36
+ /**
37
+ * Parameters for {@link getAbstractFilePathSafe}.
38
+ */
39
+ export interface GetAbstractFilePathSafeParams {
40
+ /**
41
+ * The application instance.
42
+ */
43
+ readonly app: App;
44
+ /**
45
+ * The path of the file or folder to get a safe path for.
46
+ */
47
+ readonly path: string;
48
+ /**
49
+ * The type of the file system object.
50
+ */
51
+ readonly type: FileSystemType;
52
+ }
53
+ /**
54
+ * Parameters for {@link getOrCreateAbstractFileSafe}.
55
+ */
56
+ export interface GetOrCreateAbstractFileSafeParams {
57
+ /**
58
+ * The application instance.
59
+ */
60
+ readonly app: App;
61
+ /**
62
+ * The path of the abstract file to get or create.
63
+ */
64
+ readonly path: string;
65
+ /**
66
+ * The type of the abstract file to get or create.
67
+ */
68
+ readonly type: FileSystemType;
69
+ }
70
+ /**
71
+ * Parameters for {@link getSafeRenamePath}.
72
+ */
73
+ export interface GetSafeRenamePathParams {
74
+ /**
75
+ * The application instance.
76
+ */
77
+ readonly app: App;
78
+ /**
79
+ * The new path to rename the abstract file to.
80
+ */
81
+ readonly newPath: string;
82
+ /**
83
+ * The old path or abstract file to rename.
84
+ */
85
+ readonly oldPathOrAbstractFile: PathOrAbstractFile;
86
+ }
87
+ /**
88
+ * Parameters for {@link invokeWithFileSystemLock}.
89
+ */
90
+ export interface InvokeWithFileSystemLockParams {
91
+ /**
92
+ * The application instance.
93
+ */
94
+ readonly app: App;
95
+ /**
96
+ * The function to execute.
97
+ *
98
+ * @param content - The content of the file.
99
+ */
100
+ fn(this: void, content: string): void;
101
+ /**
102
+ * The path or file to execute the function with the file system lock of.
103
+ */
104
+ readonly pathOrFile: PathOrFile;
105
+ }
106
+ /**
107
+ * Parameters for {@link isChildOrSelf}.
108
+ */
109
+ export interface IsChildOrSelfParams {
110
+ /**
111
+ * The application instance.
112
+ */
113
+ readonly app: App;
114
+ /**
115
+ * The path or file to check whether it is a child or self.
116
+ */
117
+ readonly childPathOrFile: PathOrAbstractFile;
118
+ /**
119
+ * The path or file to check whether it is a parent or self.
120
+ */
121
+ readonly parentPathOrFile: PathOrAbstractFile;
122
+ }
123
+ /**
124
+ * Parameters for {@link isChild}.
125
+ */
126
+ export interface IsChildParams {
127
+ /**
128
+ * The application instance.
129
+ */
130
+ readonly app: App;
131
+ /**
132
+ * The path or file to check whether it is a child.
133
+ */
134
+ readonly childPathOrFile: PathOrAbstractFile;
135
+ /**
136
+ * The path or file to check whether it is a parent.
137
+ */
138
+ readonly parentPathOrFile: PathOrAbstractFile;
139
+ }
19
140
  /**
20
141
  * Options for {@link process}.
21
142
  */
22
143
  export interface ProcessOptions extends RetryOptions {
23
144
  /**
24
- * Whether to fail if the file is missing or deleted. Default is `true`.
145
+ * Whether to fail if the file is missing or deleted.
146
+ *
147
+ * @default `true`
25
148
  */
26
149
  readonly shouldFailOnMissingFile?: boolean;
27
150
  /**
28
- * Whether to lock the editor while processing the file. Applicable only for markdown files. Default is `true`.
151
+ * Whether to lock the editor while processing the file. Applicable only for markdown files.
152
+ *
153
+ * @default `true`
29
154
  */
30
155
  readonly shouldLockEditorWhileProcessing?: boolean;
31
156
  /**
32
- * Whether to show a timeout notice. Default is `true`.
157
+ * Whether to show a timeout notice.
158
+ *
159
+ * @default `true`
33
160
  */
34
161
  readonly shouldShowTimeoutNotice?: boolean;
35
162
  }
163
+ /**
164
+ * Parameters for {@link process}.
165
+ */
166
+ export interface ProcessParams extends ProcessOptions {
167
+ /**
168
+ * The application instance, typically used for accessing the vault.
169
+ */
170
+ readonly app: App;
171
+ /**
172
+ * A value provider that returns the new content based on the old content of the file.
173
+ * It can be a string or a function that takes the old content as an argument and returns the new content.
174
+ * If function is provided, it should return `null` if the process should be retried.
175
+ */
176
+ readonly newContentProvider: ValueProvider<null | string, ContentArgs>;
177
+ /**
178
+ * The path or file to be processed. It can be a string representing the path or a file object.
179
+ */
180
+ readonly pathOrFile: PathOrFile;
181
+ }
182
+ /**
183
+ * Parameters for {@link renameSafe}.
184
+ */
185
+ export interface RenameSafeParams {
186
+ /**
187
+ * The application instance.
188
+ */
189
+ readonly app: App;
190
+ /**
191
+ * The new path to rename the file to.
192
+ */
193
+ readonly newPath: string;
194
+ /**
195
+ * The old path or abstract file to rename.
196
+ */
197
+ readonly oldPathOrAbstractFile: PathOrAbstractFile;
198
+ }
36
199
  /**
37
200
  * Copies a file safely in the vault.
38
201
  *
39
- * @param app - The application instance.
40
- * @param oldPathOrFile - The old path or file to copy.
41
- * @param newPath - The new path to copy the file to.
202
+ * @param params - The parameters for copying the file.
42
203
  * @returns A {@link Promise} that resolves to the new path of the copied file.
43
204
  */
44
- export declare function copySafe(app: App, oldPathOrFile: PathOrFile, newPath: string): Promise<string>;
205
+ export declare function copySafe(params: CopySafeParams): Promise<string>;
45
206
  /**
46
207
  * Creates a folder safely in the specified path.
47
208
  *
@@ -86,12 +247,10 @@ export declare function deleteEmptyFolderHierarchy(app: App, pathOrFolder: null
86
247
  /**
87
248
  * Gets a safe path for a file or folder.
88
249
  *
89
- * @param app - The application instance.
90
- * @param path - The path of the file or folder to get a safe path for.
91
- * @param type - The type of the file system object.
250
+ * @param params - The parameters for getting a safe path.
92
251
  * @returns The safe path for the file or folder.
93
252
  */
94
- export declare function getAbstractFilePathSafe(app: App, path: string, type: FileSystemType): string;
253
+ export declare function getAbstractFilePathSafe(params: GetAbstractFilePathSafeParams): string;
95
254
  /**
96
255
  * Gets an available path for a file in the vault.
97
256
  *
@@ -136,12 +295,10 @@ export declare function getNoteFilesSorted(app: App): TFile[];
136
295
  * If the file already exists, it will be returned.
137
296
  * If the file does not exist, it will be created and returned.
138
297
  *
139
- * @param app - The application instance.
140
- * @param path - The path of the abstract file to get or create.
141
- * @param type - The type of the abstract file to get or create.
298
+ * @param params - The parameters for getting or creating the abstract file.
142
299
  * @returns A {@link Promise} that resolves to the abstract file.
143
300
  */
144
- export declare function getOrCreateAbstractFileSafe(app: App, path: string, type: FileSystemType): Promise<TAbstractFile>;
301
+ export declare function getOrCreateAbstractFileSafe(params: GetOrCreateAbstractFileSafeParams): Promise<TAbstractFile>;
145
302
  /**
146
303
  * Gets or creates a file safely in the specified path.
147
304
  *
@@ -167,38 +324,31 @@ export declare function getOrCreateFolderSafe(app: App, path: string): Promise<T
167
324
  /**
168
325
  * Gets a safe rename path for a file.
169
326
  *
170
- * @param app - The application instance.
171
- * @param oldPathOrAbstractFile - The old path or abstract file to rename.
172
- * @param newPath - The new path to rename the abstract file to.
327
+ * @param params - The parameters for getting a safe rename path.
173
328
  * @returns The safe rename path for the abstract file.
174
329
  */
175
- export declare function getSafeRenamePath(app: App, oldPathOrAbstractFile: PathOrAbstractFile, newPath: string): string;
330
+ export declare function getSafeRenamePath(params: GetSafeRenamePathParams): string;
176
331
  /**
177
332
  * Invokes a function with the file system lock.
178
333
  *
179
- * @param app - The application instance.
180
- * @param pathOrFile - The path or file to execute the function with the file system lock of.
181
- * @param fn - The function to execute.
334
+ * @param params - The parameters for invoking the function with the file system lock.
335
+ * @returns A {@link Promise} that resolves when the function is invoked.
182
336
  */
183
- export declare function invokeWithFileSystemLock(app: App, pathOrFile: PathOrFile, fn: (content: string) => void): Promise<void>;
337
+ export declare function invokeWithFileSystemLock(params: InvokeWithFileSystemLockParams): Promise<void>;
184
338
  /**
185
339
  * Checks if a path or file is a child of another path or file.
186
340
  *
187
- * @param app - The application instance.
188
- * @param a - The first path or file.
189
- * @param b - The second path or file.
190
- * @returns A boolean indicating whether the first path or file is a child of the second path or file.
341
+ * @param params - The parameters for checking whether the child path or file is a child of the parent path or file.
342
+ * @returns A boolean indicating whether the child path or file is a child of the parent path or file.
191
343
  */
192
- export declare function isChild(app: App, a: PathOrAbstractFile, b: PathOrAbstractFile): boolean;
344
+ export declare function isChild(params: IsChildParams): boolean;
193
345
  /**
194
346
  * Checks if a path or file is a child or self of another path or file.
195
347
  *
196
- * @param app - The application instance.
197
- * @param a - The first path or file.
198
- * @param b - The second path or file.
199
- * @returns A boolean indicating whether the first path or file is a child or self of the second path or file.
348
+ * @param params - The parameters for checking whether the child path or file is a child or self of the parent path or file.
349
+ * @returns A boolean indicating whether the child path or file is a child or self of the parent path or file.
200
350
  */
201
- export declare function isChildOrSelf(app: App, a: PathOrAbstractFile, b: PathOrAbstractFile): boolean;
351
+ export declare function isChildOrSelf(params: IsChildOrSelfParams): boolean;
202
352
  /**
203
353
  * Checks if a folder is empty.
204
354
  *
@@ -218,18 +368,13 @@ export declare function listSafe(app: App, pathOrFolder: PathOrFolder): Promise<
218
368
  /**
219
369
  * Processes a file with retry logic, updating its content based on a provided value or function.
220
370
  *
221
- * @param app - The application instance, typically used for accessing the vault.
222
- * @param pathOrFile - The path or file to be processed. It can be a string representing the path or a file object.
223
- * @param newContentProvider - A value provider that returns the new content based on the old content of the file.
224
- * It can be a string or a function that takes the old content as an argument and returns the new content.
225
- * If function is provided, it should return `null` if the process should be retried.
226
- * @param options - Optional options for processing/retrying the operation.
371
+ * @param params - The parameters for processing the file.
227
372
  *
228
373
  * @returns A {@link Promise} that resolves once the process is complete.
229
374
  *
230
375
  * @throws Will throw an error if the process fails after the specified number of retries or timeout.
231
376
  */
232
- export declare function process(app: App, pathOrFile: PathOrFile, newContentProvider: ValueProvider<null | string, ContentArgs>, options?: ProcessOptions): Promise<void>;
377
+ export declare function process(params: ProcessParams): Promise<void>;
233
378
  /**
234
379
  * Reads the content of a file safely from the vault.
235
380
  *
@@ -244,12 +389,10 @@ export declare function readSafe(app: App, pathOrFile: PathOrFile): Promise<null
244
389
  * Renames a file safely in the vault.
245
390
  * If the new path already exists, the file will be renamed to an available path.
246
391
  *
247
- * @param app - The application instance.
248
- * @param oldPathOrAbstractFile - The old path or file to rename.
249
- * @param newPath - The new path to rename the file to.
392
+ * @param params - The parameters for renaming the file.
250
393
  * @returns A {@link Promise} that resolves to the new path of the file.
251
394
  */
252
- export declare function renameSafe(app: App, oldPathOrAbstractFile: PathOrAbstractFile, newPath: string): Promise<string>;
395
+ export declare function renameSafe(params: RenameSafeParams): Promise<string>;
253
396
  /**
254
397
  * Saves the specified note in the Obsidian app.
255
398
  *