obsidian-dev-utils 19.0.0 → 19.1.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 (173) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/README.md +0 -3
  3. package/dist/lib/@types/debug.d.mts +1 -16
  4. package/dist/lib/Async.d.mts +1 -153
  5. package/dist/lib/Blob.d.mts +1 -40
  6. package/dist/lib/CssClass.d.mts +1 -97
  7. package/dist/lib/Debug.d.mts +1 -41
  8. package/dist/lib/DebugController.d.mts +1 -85
  9. package/dist/lib/Enum.d.mts +1 -20
  10. package/dist/lib/Error.d.mts +1 -45
  11. package/dist/lib/Function.d.mts +1 -28
  12. package/dist/lib/HTMLElement.d.mts +1 -49
  13. package/dist/lib/Library.cjs +1 -1
  14. package/dist/lib/Library.d.mts +1 -16
  15. package/dist/lib/Library.mjs +1 -1
  16. package/dist/lib/Object.d.mts +1 -211
  17. package/dist/lib/Path.d.mts +1 -133
  18. package/dist/lib/RegExp.d.mts +1 -18
  19. package/dist/lib/ScriptUtils/CliUtils.d.mts +1 -70
  20. package/dist/lib/ScriptUtils/CodeGenerator.d.mts +1 -12
  21. package/dist/lib/ScriptUtils/ESLint/@types/@guardian__eslint-plugin-tsdoc-required.d.mts +1 -13
  22. package/dist/lib/ScriptUtils/ESLint/@types/eslint-plugin-modules-newlines.d.mts +1 -13
  23. package/dist/lib/ScriptUtils/ESLint/@types/eslint-plugin-verify-tsdoc.d.mts +1 -13
  24. package/dist/lib/ScriptUtils/ESLint/ESLint.d.mts +1 -13
  25. package/dist/lib/ScriptUtils/ESLint/eslint.config.d.mts +1 -16
  26. package/dist/lib/ScriptUtils/ESLint/index.d.mts +1 -2
  27. package/dist/lib/ScriptUtils/Exec.d.mts +1 -83
  28. package/dist/lib/ScriptUtils/Fs.d.mts +1 -72
  29. package/dist/lib/ScriptUtils/JSON.d.mts +1 -64
  30. package/dist/lib/ScriptUtils/NodeModules.d.mts +1 -14
  31. package/dist/lib/ScriptUtils/Npm.d.mts +1 -151
  32. package/dist/lib/ScriptUtils/NpmPublish.d.mts +1 -9
  33. package/dist/lib/ScriptUtils/ObsidianDevUtilsRepoPaths.d.mts +1 -88
  34. package/dist/lib/ScriptUtils/Root.d.mts +1 -67
  35. package/dist/lib/ScriptUtils/build.d.mts +1 -41
  36. package/dist/lib/ScriptUtils/cli.d.mts +1 -14
  37. package/dist/lib/ScriptUtils/esbuild/Dependency.d.mts +1 -18
  38. package/dist/lib/ScriptUtils/esbuild/ObsidianPluginBuilder.d.mts +1 -53
  39. package/dist/lib/ScriptUtils/esbuild/changeExtensionPlugin.d.mts +1 -12
  40. package/dist/lib/ScriptUtils/esbuild/copyToObsidianPluginsFolderPlugin.d.mts +1 -18
  41. package/dist/lib/ScriptUtils/esbuild/fixEsmPlugin.d.mts +1 -11
  42. package/dist/lib/ScriptUtils/esbuild/fixSourceMapsPlugin.d.mts +1 -17
  43. package/dist/lib/ScriptUtils/esbuild/index.d.mts +1 -9
  44. package/dist/lib/ScriptUtils/esbuild/preprocessPlugin.d.mts +1 -23
  45. package/dist/lib/ScriptUtils/esbuild/renameCssPlugin.d.mts +1 -8
  46. package/dist/lib/ScriptUtils/esbuild/svelteWrapperPlugin.d.mts +1 -8
  47. package/dist/lib/ScriptUtils/format.d.mts +1 -10
  48. package/dist/lib/ScriptUtils/index.d.mts +1 -17
  49. package/dist/lib/ScriptUtils/spellcheck.d.mts +1 -14
  50. package/dist/lib/ScriptUtils/version.d.mts +1 -171
  51. package/dist/lib/String.d.mts +1 -138
  52. package/dist/lib/Transformers/DateTransformer.d.mts +1 -35
  53. package/dist/lib/Transformers/DurationTransformer.d.mts +1 -34
  54. package/dist/lib/Transformers/GroupTransformer.d.mts +1 -65
  55. package/dist/lib/Transformers/SkipPrivatePropertyTransformer.d.mts +1 -32
  56. package/dist/lib/Transformers/Transformer.d.mts +1 -67
  57. package/dist/lib/Transformers/TypedTransformer.d.mts +1 -37
  58. package/dist/lib/Transformers/index.d.mts +1 -6
  59. package/dist/lib/ValueProvider.d.mts +1 -22
  60. package/dist/lib/codemirror/StateFieldSpec.d.mts +1 -68
  61. package/dist/lib/codemirror/index.d.mts +1 -1
  62. package/dist/lib/index.d.mts +1 -20
  63. package/dist/lib/obsidian/@types/Dataview/api/data-array.d.mts +1 -136
  64. package/dist/lib/obsidian/@types/Dataview/api/extensions.d.mts +1 -15
  65. package/dist/lib/obsidian/@types/Dataview/api/inline-api.d.mts +1 -186
  66. package/dist/lib/obsidian/@types/Dataview/api/plugin-api.d.mts +1 -209
  67. package/dist/lib/obsidian/@types/Dataview/api/result.d.mts +1 -38
  68. package/dist/lib/obsidian/@types/Dataview/data-import/common.d.mts +1 -3
  69. package/dist/lib/obsidian/@types/Dataview/data-import/csv.d.mts +1 -3
  70. package/dist/lib/obsidian/@types/Dataview/data-import/inline-field.d.mts +1 -42
  71. package/dist/lib/obsidian/@types/Dataview/data-import/markdown-file.d.mts +1 -52
  72. package/dist/lib/obsidian/@types/Dataview/data-import/persister.d.mts +1 -32
  73. package/dist/lib/obsidian/@types/Dataview/data-import/web-worker/import-entry.d.mts +1 -1
  74. package/dist/lib/obsidian/@types/Dataview/data-import/web-worker/import-impl.d.mts +1 -6
  75. package/dist/lib/obsidian/@types/Dataview/data-import/web-worker/import-manager.d.mts +1 -37
  76. package/dist/lib/obsidian/@types/Dataview/data-index/index.d.mts +1 -186
  77. package/dist/lib/obsidian/@types/Dataview/data-index/resolver.d.mts +1 -23
  78. package/dist/lib/obsidian/@types/Dataview/data-index/source.d.mts +1 -71
  79. package/dist/lib/obsidian/@types/Dataview/data-model/markdown.d.mts +1 -115
  80. package/dist/lib/obsidian/@types/Dataview/data-model/serialized/markdown.d.mts +1 -106
  81. package/dist/lib/obsidian/@types/Dataview/data-model/transferable.d.mts +1 -7
  82. package/dist/lib/obsidian/@types/Dataview/data-model/value.d.mts +1 -175
  83. package/dist/lib/obsidian/@types/Dataview/expression/binaryop.d.mts +1 -43
  84. package/dist/lib/obsidian/@types/Dataview/expression/context.d.mts +1 -49
  85. package/dist/lib/obsidian/@types/Dataview/expression/field.d.mts +1 -82
  86. package/dist/lib/obsidian/@types/Dataview/expression/functions.d.mts +1 -149
  87. package/dist/lib/obsidian/@types/Dataview/expression/parse.d.mts +1 -163
  88. package/dist/lib/obsidian/@types/Dataview/index.d.mts +1 -55
  89. package/dist/lib/obsidian/@types/Dataview/main.d.mts +1 -52
  90. package/dist/lib/obsidian/@types/Dataview/query/engine.d.mts +1 -103
  91. package/dist/lib/obsidian/@types/Dataview/query/parse.d.mts +1 -44
  92. package/dist/lib/obsidian/@types/Dataview/query/query.d.mts +1 -95
  93. package/dist/lib/obsidian/@types/Dataview/settings.d.mts +1 -60
  94. package/dist/lib/obsidian/@types/Dataview/typings/obsidian-ex.d.mts +1 -28
  95. package/dist/lib/obsidian/@types/Dataview/typings/workers.d.mts +1 -4
  96. package/dist/lib/obsidian/@types/Dataview/ui/export/markdown.d.mts +1 -15
  97. package/dist/lib/obsidian/@types/Dataview/ui/lp-render.d.mts +1 -37
  98. package/dist/lib/obsidian/@types/Dataview/ui/markdown.d.mts +1 -86
  99. package/dist/lib/obsidian/@types/Dataview/ui/refreshable-view.d.mts +1 -18
  100. package/dist/lib/obsidian/@types/Dataview/ui/render.d.mts +1 -33
  101. package/dist/lib/obsidian/@types/Dataview/ui/views/calendar-view.d.mts +1 -17
  102. package/dist/lib/obsidian/@types/Dataview/ui/views/inline-field-live-preview.d.mts +1 -42
  103. package/dist/lib/obsidian/@types/Dataview/ui/views/inline-view.d.mts +1 -28
  104. package/dist/lib/obsidian/@types/Dataview/ui/views/js-view.d.mts +1 -23
  105. package/dist/lib/obsidian/@types/Dataview/ui/views/list-view.d.mts +1 -25
  106. package/dist/lib/obsidian/@types/Dataview/ui/views/table-view.d.mts +1 -28
  107. package/dist/lib/obsidian/@types/Dataview/ui/views/task-view.d.mts +1 -51
  108. package/dist/lib/obsidian/@types/Dataview/util/hash.d.mts +1 -1
  109. package/dist/lib/obsidian/@types/Dataview/util/locale.d.mts +1 -2
  110. package/dist/lib/obsidian/@types/Dataview/util/media.d.mts +1 -6
  111. package/dist/lib/obsidian/@types/Dataview/util/normalize.d.mts +1 -44
  112. package/dist/lib/obsidian/App.d.mts +1 -30
  113. package/dist/lib/obsidian/AttachmentPath.d.mts +1 -54
  114. package/dist/lib/obsidian/Backlink.d.mts +1 -60
  115. package/dist/lib/obsidian/Callout.d.mts +1 -55
  116. package/dist/lib/obsidian/Components/DateComponent.d.mts +1 -36
  117. package/dist/lib/obsidian/Components/DateTimeComponent.d.mts +1 -36
  118. package/dist/lib/obsidian/Components/EmailComponent.d.mts +1 -29
  119. package/dist/lib/obsidian/Components/FileComponent.d.mts +1 -41
  120. package/dist/lib/obsidian/Components/MonthComponent.d.mts +1 -49
  121. package/dist/lib/obsidian/Components/MultipleDropdownComponent.d.mts +1 -73
  122. package/dist/lib/obsidian/Components/MultipleEmailComponent.d.mts +1 -36
  123. package/dist/lib/obsidian/Components/MultipleFileComponent.d.mts +1 -41
  124. package/dist/lib/obsidian/Components/MultipleTextComponent.d.mts +1 -67
  125. package/dist/lib/obsidian/Components/NumberComponent.d.mts +1 -29
  126. package/dist/lib/obsidian/Components/TimeComponent.d.mts +1 -37
  127. package/dist/lib/obsidian/Components/TypedRangeTextComponent.d.mts +1 -31
  128. package/dist/lib/obsidian/Components/TypedTextComponent.d.mts +1 -84
  129. package/dist/lib/obsidian/Components/UrlComponent.d.mts +1 -29
  130. package/dist/lib/obsidian/Components/ValidatorComponent.d.mts +1 -22
  131. package/dist/lib/obsidian/Components/ValueComponentWithChangeTracking.d.mts +1 -17
  132. package/dist/lib/obsidian/Components/WeekComponent.d.mts +1 -49
  133. package/dist/lib/obsidian/Components/index.d.mts +1 -17
  134. package/dist/lib/obsidian/Dataview.d.mts +1 -215
  135. package/dist/lib/obsidian/DataviewLink.d.mts +1 -23
  136. package/dist/lib/obsidian/FileChange.d.mts +1 -68
  137. package/dist/lib/obsidian/FileManager.d.mts +1 -38
  138. package/dist/lib/obsidian/FileSystem.d.mts +1 -185
  139. package/dist/lib/obsidian/Frontmatter.d.mts +1 -69
  140. package/dist/lib/obsidian/Link.d.mts +1 -366
  141. package/dist/lib/obsidian/Logger.d.mts +1 -13
  142. package/dist/lib/obsidian/Loop.d.mts +1 -36
  143. package/dist/lib/obsidian/Markdown.d.mts +1 -24
  144. package/dist/lib/obsidian/MarkdownCodeBlockProcessor.d.mts +1 -23
  145. package/dist/lib/obsidian/MarkdownView.d.mts +1 -12
  146. package/dist/lib/obsidian/MetadataCache.d.mts +1 -87
  147. package/dist/lib/obsidian/Modals/Alert.d.mts +1 -39
  148. package/dist/lib/obsidian/Modals/Confirm.d.mts +1 -43
  149. package/dist/lib/obsidian/Modals/ModalBase.d.mts +1 -35
  150. package/dist/lib/obsidian/Modals/Prompt.d.mts +1 -50
  151. package/dist/lib/obsidian/Modals/SelectItem.d.mts +1 -41
  152. package/dist/lib/obsidian/Modals/index.d.mts +1 -5
  153. package/dist/lib/obsidian/ObsidianSettings.d.mts +1 -17
  154. package/dist/lib/obsidian/Pdf.d.mts +1 -24
  155. package/dist/lib/obsidian/Plugin/EmptySettings.d.mts +1 -14
  156. package/dist/lib/obsidian/Plugin/ObsidianPluginRepoPaths.d.mts +1 -55
  157. package/dist/lib/obsidian/Plugin/Plugin.d.mts +1 -21
  158. package/dist/lib/obsidian/Plugin/PluginBase.d.mts +1 -108
  159. package/dist/lib/obsidian/Plugin/PluginContext.d.mts +1 -12
  160. package/dist/lib/obsidian/Plugin/PluginId.d.mts +1 -20
  161. package/dist/lib/obsidian/Plugin/PluginSettingsBase.d.mts +1 -31
  162. package/dist/lib/obsidian/Plugin/PluginSettingsTabBase.d.mts +1 -99
  163. package/dist/lib/obsidian/Plugin/index.d.mts +1 -8
  164. package/dist/lib/obsidian/Queue.d.mts +1 -30
  165. package/dist/lib/obsidian/Reference.d.mts +1 -21
  166. package/dist/lib/obsidian/RenameDeleteHandler.d.mts +1 -49
  167. package/dist/lib/obsidian/ResourceUrl.d.mts +1 -14
  168. package/dist/lib/obsidian/SettingEx.d.mts +1 -124
  169. package/dist/lib/obsidian/Vault.d.mts +1 -130
  170. package/dist/lib/obsidian/VaultEx.d.mts +1 -27
  171. package/dist/lib/obsidian/index.d.mts +1 -29
  172. package/dist/lib/url.d.mts +1 -11
  173. package/package.json +11 -11
@@ -1,31 +1 @@
1
- /**
2
- * @packageDocumentation TypedRangeTextComponent
3
- * Contains a component that displays and edits a text-based value with a range.
4
- */
5
- import { TypedTextComponent } from './TypedTextComponent.mjs';
6
- /**
7
- * A component that displays and edits a text-based value with a range.
8
- */
9
- export declare abstract class TypedRangeTextComponent<T> extends TypedTextComponent<T> {
10
- /**
11
- * Sets the maximum value of the component.
12
- *
13
- * @param max - The maximum value.
14
- * @returns The component.
15
- */
16
- setMax(max: T): this;
17
- /**
18
- * Sets the minimum value of the component.
19
- *
20
- * @param min - The minimum value.
21
- * @returns The component.
22
- */
23
- setMin(min: T): this;
24
- /**
25
- * Sets the step value of the component.
26
- *
27
- * @param step - The step value.
28
- * @returns The component.
29
- */
30
- setStep(step: number): this;
31
- }
1
+ export * from './TypedRangeTextComponent.cjs';
@@ -1,84 +1 @@
1
- /**
2
- * @packageDocumentation TypedTextComponent
3
- * Contains a component that displays and edits a text-based value.
4
- */
5
- import { ValueComponent } from 'obsidian';
6
- import type { MaybePromise } from '../../Async.mjs';
7
- import type { ValidatorElement } from '../../HTMLElement.mjs';
8
- import type { ValidatorComponent } from './ValidatorComponent.mjs';
9
- import type { ValueComponentWithChangeTracking } from './ValueComponentWithChangeTracking.mjs';
10
- import { CssClass } from '../../CssClass.mjs';
11
- /**
12
- * A component that displays and edits a text-based value.
13
- */
14
- export declare abstract class TypedTextComponent<T> extends ValueComponent<T> implements ValidatorComponent, ValueComponentWithChangeTracking<T> {
15
- /**
16
- * The input element of the component.
17
- */
18
- readonly inputEl: HTMLInputElement;
19
- /**
20
- * The validator element of the component.
21
- */
22
- get validatorEl(): ValidatorElement;
23
- private readonly textComponent;
24
- /**
25
- * Creates a new typed text component.
26
- *
27
- * @param containerEl - The container element of the component.
28
- * @param type - The type of the input element.
29
- * @param cssClass - The CSS class of the component.
30
- */
31
- constructor(containerEl: HTMLElement, type: string, cssClass: CssClass);
32
- /**
33
- * Gets the value of the component.
34
- *
35
- * @returns The value of the component.
36
- */
37
- getValue(): T;
38
- /**
39
- * Sets the callback function to be called when the component is changed.
40
- *
41
- * @param callback - The callback function to be called when the component is changed.
42
- * @returns The component.
43
- */
44
- onChange(callback: (value: T) => MaybePromise<void>): this;
45
- /**
46
- * Called when the component is changed.
47
- */
48
- onChanged(): void;
49
- /**
50
- * Sets the disabled state of the component.
51
- *
52
- * @param disabled - Whether the component is disabled.
53
- * @returns The component.
54
- */
55
- setDisabled(disabled: boolean): this;
56
- /**
57
- * Sets the placeholder of the component.
58
- *
59
- * @param placeholder - The placeholder to set.
60
- * @returns The component.
61
- */
62
- setPlaceholder(placeholder: string): this;
63
- /**
64
- * Sets the value of the component.
65
- *
66
- * @param value - The value to set.
67
- * @returns The component.
68
- */
69
- setValue(value: T): this;
70
- /**
71
- * Converts a string to a value.
72
- *
73
- * @param str - The string to convert.
74
- * @returns The value.
75
- */
76
- abstract valueFromString(str: string): T;
77
- /**
78
- * Converts a value to a string.
79
- *
80
- * @param value - The value to convert.
81
- * @returns The string.
82
- */
83
- valueToString(value: T): string;
84
- }
1
+ export * from './TypedTextComponent.cjs';
@@ -1,29 +1 @@
1
- /**
2
- * @packageDocumentation UrlComponent
3
- * Contains a component that displays and edits an url.
4
- */
5
- import { TypedTextComponent } from './TypedTextComponent.mjs';
6
- /**
7
- * A component that displays and edits an url.
8
- *
9
- * You can add this component using {@link SettingEx.addUrl}.
10
- *
11
- * In order to add the styles for the component, use {@link initPluginContext} in your plugin's `onload()` function.
12
- *
13
- * Alternatively, you can copy styles from {@link https://github.com/mnaoumov/obsidian-dev-utils/releases/latest/download/styles.css}.
14
- */
15
- export declare class UrlComponent extends TypedTextComponent<string> {
16
- /**
17
- * Creates a new Url component.
18
- *
19
- * @param containerEl - The container element of the component.
20
- */
21
- constructor(containerEl: HTMLElement);
22
- /**
23
- * Converts a string to an url.
24
- *
25
- * @param str - The string to convert.
26
- * @returns The url.
27
- */
28
- valueFromString(str: string): string;
29
- }
1
+ export * from './UrlComponent.cjs';
@@ -1,22 +1 @@
1
- /**
2
- * @packageDocumentation ValidatorComponent
3
- * Contains a component that has a validator element.
4
- */
5
- import type { BaseComponent } from 'obsidian';
6
- import type { ValidatorElement } from '../../HTMLElement.mjs';
7
- /**
8
- * A component that has a validator element.
9
- */
10
- export interface ValidatorComponent {
11
- /**
12
- * The validator element of the component.
13
- */
14
- readonly validatorEl: ValidatorElement;
15
- }
16
- /**
17
- * Gets a validator component related to the base component
18
- *
19
- * @param baseComponent - A base component
20
- * @returns related validator component or `null` if no related validator component is found
21
- */
22
- export declare function getValidatorComponent(baseComponent: BaseComponent): null | ValidatorComponent;
1
+ export * from './ValidatorComponent.cjs';
@@ -1,17 +1 @@
1
- /**
2
- * @packageDocumentation ValueComponentWithChangeTracking
3
- * Contains a type that extends ValueComponent to allow for change tracking.
4
- */
5
- import { ValueComponent } from 'obsidian';
6
- import type { MaybePromise } from '../../Async.mjs';
7
- /**
8
- * A ValueComponent that can track changes.
9
- */
10
- export interface ValueComponentWithChangeTracking<T> extends ValueComponent<T> {
11
- /**
12
- * Sets a callback function to be called when the value of the component changes.
13
- *
14
- * @param callback - A callback function that is called when the value of the component changes.
15
- */
16
- onChange(callback: (newValue: T) => MaybePromise<void>): this;
17
- }
1
+ export * from './ValueComponentWithChangeTracking.cjs';
@@ -1,49 +1 @@
1
- /**
2
- * @packageDocumentation WeekComponent
3
- * Contains a component that displays and edits a week.
4
- */
5
- import { TypedRangeTextComponent } from './TypedRangeTextComponent.mjs';
6
- /**
7
- * Represents an ISO 8601 week date.
8
- */
9
- export interface IsoWeek {
10
- /**
11
- * The ISO 8601 week number (1-53).
12
- */
13
- weekNumber: number;
14
- /**
15
- * The year (1-9999).
16
- */
17
- year: number;
18
- }
19
- /**
20
- * A component that displays and edits a Week.
21
- *
22
- * You can add this component using {@link SettingEx.addWeek}.
23
- *
24
- * In order to add the styles for the component, use {@link initPluginContext} in your plugin's `onload()` function.
25
- *
26
- * Alternatively, you can copy styles from {@link https://github.com/mnaoumov/obsidian-dev-utils/releases/latest/download/styles.css}.
27
- */
28
- export declare class WeekComponent extends TypedRangeTextComponent<IsoWeek> {
29
- /**
30
- * Creates a new Week component.
31
- *
32
- * @param containerEl - The container element of the component.
33
- */
34
- constructor(containerEl: HTMLElement);
35
- /**
36
- * Converts a string to a Week.
37
- *
38
- * @param str - The string to convert.
39
- * @returns The week.
40
- */
41
- valueFromString(str: string): IsoWeek;
42
- /**
43
- * Converts a week to a string.
44
- *
45
- * @param value - The week to convert.
46
- * @returns The string.
47
- */
48
- valueToString(value: IsoWeek): string;
49
- }
1
+ export * from './WeekComponent.cjs';
@@ -1,17 +1 @@
1
- export * as DateComponent from './DateComponent.mjs';
2
- export * as DateTimeComponent from './DateTimeComponent.mjs';
3
- export * as EmailComponent from './EmailComponent.mjs';
4
- export * as FileComponent from './FileComponent.mjs';
5
- export * as MonthComponent from './MonthComponent.mjs';
6
- export * as MultipleDropdownComponent from './MultipleDropdownComponent.mjs';
7
- export * as MultipleEmailComponent from './MultipleEmailComponent.mjs';
8
- export * as MultipleFileComponent from './MultipleFileComponent.mjs';
9
- export * as MultipleTextComponent from './MultipleTextComponent.mjs';
10
- export * as NumberComponent from './NumberComponent.mjs';
11
- export * as TimeComponent from './TimeComponent.mjs';
12
- export * as TypedRangeTextComponent from './TypedRangeTextComponent.mjs';
13
- export * as TypedTextComponent from './TypedTextComponent.mjs';
14
- export * as UrlComponent from './UrlComponent.mjs';
15
- export * as ValidatorComponent from './ValidatorComponent.mjs';
16
- export * as ValueComponentWithChangeTracking from './ValueComponentWithChangeTracking.mjs';
17
- export * as WeekComponent from './WeekComponent.mjs';
1
+ export * from './index.cjs';
@@ -1,215 +1 @@
1
- /**
2
- * @packageDocumentation Dataview
3
- * This module provides utility functions for working with Dataview in Obsidian.
4
- */
5
- import type { MaybePromise } from '../Async.mjs';
6
- import type { DataviewInlineApi as DataviewInlineApiOriginal } from './@types/Dataview/api/inline-api.d.mjs';
7
- import type { DataArray, DataviewApi, SMarkdownPage } from './@types/Dataview/index.d.mjs';
8
- import type { PathOrFile } from './FileSystem.mjs';
9
- import type { CombinedFrontmatter } from './Frontmatter.mjs';
10
- /**
11
- * Export DateTime and Link types from the Dataview API.
12
- */
13
- export type { DateTime, Link } from './@types/Dataview/index.d.mjs';
14
- declare global {
15
- /**
16
- * The DataviewAPI object represents the API for interacting with Dataview in Obsidian.
17
- */
18
- var DataviewAPI: DataviewApi | undefined;
19
- }
20
- /**
21
- * The combined page type, which includes the front matter and the SMarkdownPage.
22
- */
23
- export type CombinedPage<CustomFrontmatter = unknown> = CombinedFrontmatter<CustomFrontmatter> & SMarkdownPage;
24
- /**
25
- * Extended interface for the Dataview Inline API, providing additional methods for custom page types and array handling.
26
- *
27
- * @typeParam CustomPage - The type of the custom page. Defaults to `SMarkdownPage`.
28
- */
29
- export interface DataviewInlineApi extends DataviewInlineApiOriginal {
30
- /**
31
- * Wraps an array of items into a `DataArray` object.
32
- *
33
- * @typeParam T - The type of the items in the array.
34
- * @param arr - The array of items to wrap.
35
- * @returns A `DataArray` containing the items.
36
- */
37
- array<T>(arr: T[]): DataArray<T>;
38
- /**
39
- * Retrieves the current page, with an optional custom page type.
40
- *
41
- * @typeParam CustomPage - The type of the custom page. Defaults to `SMarkdownPage`.
42
- * @returns The current page.
43
- */
44
- current<CustomFrontmatter = unknown>(): CombinedPage<CustomFrontmatter>;
45
- /**
46
- * Retrieves pages based on an optional query, with an optional custom page type.
47
- *
48
- * @typeParam CustomPage - The type of the custom page. Defaults to `SMarkdownPage`.
49
- * @param query - An optional string query to filter the pages.
50
- * @returns A `DataArray` of pages matching the query.
51
- */
52
- pages<CustomFrontmatter = unknown>(query?: string): DataArray<CombinedPage<CustomFrontmatter>>;
53
- /**
54
- * Creates a paragraph HTML element with the provided text and optional DOM element options.
55
- *
56
- * @param text - The content of the paragraph.
57
- * @param options - Optional DOM element options, including an optional container.
58
- * @returns The created HTML paragraph element.
59
- */
60
- paragraph(text: unknown, options?: DomElementInfoWithContainer): HTMLParagraphElement;
61
- }
62
- /**
63
- * DomElementInfo with an optional container.
64
- */
65
- export type DomElementInfoWithContainer = {
66
- container?: HTMLElement;
67
- } & DomElementInfo;
68
- /**
69
- * The combined file type, which includes the front matter and the SMarkdownFile.
70
- */
71
- export type PageFile = SMarkdownPage['file'];
72
- /**
73
- * List of page files.
74
- */
75
- export type PageFiles = ArrayOrDataArray<PageFile>;
76
- /**
77
- * Reloads the current file cache using the Dataview API.
78
- *
79
- * @param dv - The DataviewInlineApi instance.
80
- * @returns A promise that resolves when the cache is reloaded.
81
- */
82
- export declare function reloadCurrentFileCache(dv: DataviewInlineApi): Promise<void>;
83
- /**
84
- * Array or DataArray type.
85
- */
86
- export type ArrayOrDataArray<T> = DataArray<T> | T[];
87
- /**
88
- * Options for rendering an iframe in the Dataview container.
89
- */
90
- export interface RenderIframeOptions {
91
- /**
92
- * The DataviewInlineApi instance.
93
- */
94
- dv: DataviewInlineApi;
95
- /**
96
- * The height of the iframe.
97
- */
98
- height: string;
99
- /**
100
- * The relative path to the resource to be displayed in the iframe.
101
- */
102
- relativePathOrFile: PathOrFile;
103
- /**
104
- * The width of the iframe.
105
- */
106
- width: string;
107
- }
108
- /**
109
- * Options for rendering a paginated list using the Dataview API.
110
- */
111
- export interface RenderPaginatedListOptions<T> {
112
- /**
113
- * The DataviewInlineApi instance.
114
- */
115
- dv: DataviewInlineApi;
116
- /**
117
- * Options for items per page. Defaults to `[10, 20, 50, 100]`.
118
- */
119
- itemsPerPageOptions?: number[];
120
- /**
121
- * The list of items to paginate.
122
- */
123
- rows: ArrayOrDataArray<T>;
124
- }
125
- /**
126
- * Options for rendering a paginated element using the Dataview API.
127
- */
128
- export interface RenderPaginatedOptions<T> {
129
- /**
130
- * The DataviewInlineApi instance.
131
- */
132
- dv: DataviewInlineApi;
133
- /**
134
- * Options for items per page.
135
- */
136
- itemsPerPageOptions: number[];
137
- /**
138
- * The renderer function to display the paginated content.
139
- * @param rowsForOnePage - The rows to render.
140
- * @returns A promise that resolves when the content is rendered.
141
- */
142
- renderer: (rowsForOnePage: ArrayOrDataArray<T>) => MaybePromise<void>;
143
- /**
144
- * The rows to paginate.
145
- */
146
- rows: ArrayOrDataArray<T>;
147
- }
148
- /**
149
- * Options for rendering a paginated table using the Dataview API.
150
- */
151
- export interface RenderPaginatedTableOptions<T> {
152
- /**
153
- * The DataviewInlineApi instance.
154
- */
155
- dv: DataviewInlineApi;
156
- /**
157
- * The headers of the table.
158
- */
159
- headers: string[];
160
- /**
161
- * Options for items per page. Defaults to `[10, 20, 50, 100]`.
162
- */
163
- itemsPerPageOptions?: number[];
164
- /**
165
- * The rows of the table to paginate.
166
- */
167
- rows: ArrayOrDataArray<T>;
168
- }
169
- /**
170
- * Renders the content using the provided renderer function in a temporary container,
171
- * and then returns the container.
172
- *
173
- * @param dv - The DataviewInlineApi instance.
174
- * @param renderer - The function responsible for rendering the content.
175
- * @returns A promise that resolves to the HTML paragraph element
176
- * that was used as the temporary container.
177
- */
178
- export declare function getRenderedContainer(dv: DataviewInlineApi, renderer: () => MaybePromise<void>): Promise<HTMLParagraphElement>;
179
- /**
180
- * Inserts a code block into the specified Dataview instance using the provided language and code.
181
- *
182
- * @param dv - The DataviewInlineApi instance to insert the code block into.
183
- * @param language - The language identifier for the code block.
184
- * @param code - The code content to be inserted into the code block.
185
- * @returns This function does not return a value.
186
- */
187
- export declare function insertCodeBlock(dv: DataviewInlineApi, language: string, code: string): void;
188
- /**
189
- * Renders an iframe in the Dataview container with the specified relative path, width, and height.
190
- *
191
- * @param options - The options for rendering the iframe.
192
- *
193
- * @returns This function does not return a value.
194
- */
195
- export declare function renderIframe(options: RenderIframeOptions): void;
196
- /**
197
- * Renders a paginated list using the provided DataviewInlineApi instance.
198
- *
199
- * @typeParam T - The type of items in the list.
200
- *
201
- * @param options - The options for rendering the paginated list.
202
- *
203
- * @returns A promise that resolves when the list is rendered.
204
- */
205
- export declare function renderPaginatedList<T>(options: RenderPaginatedListOptions<T>): Promise<void>;
206
- /**
207
- * Renders a paginated table using the provided DataviewInlineApi instance.
208
- *
209
- * @typeParam T - The type of items in the table rows.
210
- *
211
- * @param options - The options for rendering the paginated table.
212
- *
213
- * @returns A promise that resolves when the table is rendered.
214
- */
215
- export declare function renderPaginatedTable<T extends unknown[]>(options: RenderPaginatedTableOptions<T>): Promise<void>;
1
+ export * from './Dataview.cjs';
@@ -1,23 +1 @@
1
- /**
2
- * @packageDocumentation DataviewLink
3
- * This module provides utility functions for working with Dataview links in Obsidian
4
- */
5
- import type { DataviewInlineApi, Link } from './Dataview.mjs';
6
- import type { PathOrFile } from './FileSystem.mjs';
7
- /**
8
- * Fixes the title of a file or folder note by generating a `Link` object with a proper title.
9
- *
10
- * @param dv - The DataviewInlineApi instance used to create the file link.
11
- * @param pathOrFile - The file path for which the title is to be fixed.
12
- * @param isFolderNote - A boolean indicating whether the file is a folder note. Defaults to `false`.
13
- * If true, the title is derived from the folder name. Defaults to `false`.
14
- * @returns A Link object with the corrected title.
15
- */
16
- export declare function fixTitle(dv: DataviewInlineApi, pathOrFile: PathOrFile, isFolderNote?: boolean): Link;
17
- /**
18
- * Generates a string representation of a `Link` object that includes both the link text and the file path.
19
- *
20
- * @param link - The Link object to be converted to a string with its path.
21
- * @returns A string representing the link in the format: "linkText (linkPath)".
22
- */
23
- export declare function makeLinkWithPath(link: Link): string;
1
+ export * from './DataviewLink.cjs';
@@ -1,68 +1 @@
1
- /**
2
- * @packageDocumentation FileChange
3
- * Contains utility types and functions for handling file changes in Obsidian.
4
- */
5
- import type { App } from 'obsidian';
6
- import type { ValueProvider } from '../ValueProvider.mjs';
7
- import type { PathOrFile } from './FileSystem.mjs';
8
- import type { ProcessOptions } from './Vault.mjs';
9
- /**
10
- * Represents a content body change in the Vault.
11
- */
12
- export interface ContentChange extends FileChange {
13
- /**
14
- * The end index of the change in the file content.
15
- */
16
- endIndex: number;
17
- /**
18
- * The start index of the change in the file content.
19
- */
20
- startIndex: number;
21
- }
22
- /**
23
- * Represents a file change in the Vault.
24
- */
25
- export interface FileChange {
26
- /**
27
- * The new content to replace the old content.
28
- */
29
- newContent: string;
30
- /**
31
- * The old content that will be replaced.
32
- */
33
- oldContent: string;
34
- }
35
- /**
36
- * Represents a frontmatter change in the Vault.
37
- */
38
- export interface FrontmatterChange extends FileChange {
39
- /**
40
- * The key in the frontmatter to use for the link.
41
- */
42
- frontmatterKey: string;
43
- }
44
- /**
45
- * Applies a series of file changes to the specified file or path within the application.
46
- *
47
- * @param app - The application instance where the file changes will be applied.
48
- * @param pathOrFile - The path or file to which the changes should be applied.
49
- * @param changesProvider - A provider that returns an array of file changes to apply.
50
- * @param processOptions - Optional options for processing/retrying the operation.
51
- *
52
- * @returns A promise that resolves when the file changes have been successfully applied.
53
- */
54
- export declare function applyFileChanges(app: App, pathOrFile: PathOrFile, changesProvider: ValueProvider<FileChange[]>, processOptions?: ProcessOptions): Promise<void>;
55
- /**
56
- * Checks if a file change is a content change.
57
- *
58
- * @param fileChange - The file change to check.
59
- * @returns A boolean indicating whether the file change is a content change.
60
- */
61
- export declare function isContentChange(fileChange: FileChange): fileChange is ContentChange;
62
- /**
63
- * Checks if a file change is a frontmatter change.
64
- *
65
- * @param fileChange - The file change to check.
66
- * @returns A boolean indicating whether the file change is a frontmatter change.
67
- */
68
- export declare function isFrontmatterChange(fileChange: FileChange): fileChange is FrontmatterChange;
1
+ export * from './FileChange.cjs';
@@ -1,38 +1 @@
1
- /**
2
- * @packageDocumentation FileManager
3
- * Contains utility functions for managing files in Obsidian.
4
- */
5
- import type { App } from 'obsidian';
6
- import type { MaybePromise } from '../Async.mjs';
7
- import type { PathOrFile } from './FileSystem.mjs';
8
- import type { CombinedFrontmatter } from './Frontmatter.mjs';
9
- import type { ProcessOptions } from './Vault.mjs';
10
- /**
11
- * Adds an alias to the front matter of a given file if it does not already exist.
12
- *
13
- * @param app - The Obsidian app instance.
14
- * @param pathOrFile - The path or TFile object representing the note.
15
- * @param alias - The alias to add.
16
- * @returns A promise that resolves when the alias has been added.
17
- */
18
- export declare function addAlias(app: App, pathOrFile: PathOrFile, alias?: string): Promise<void>;
19
- /**
20
- * Deletes an alias from the front matter of a given file if it exists.
21
- *
22
- * @param app - The Obsidian app instance.
23
- * @param pathOrFile - The path or TFile object representing the note.
24
- * @param alias - The alias to delete.
25
- * @returns A promise that resolves when the alias has been deleted.
26
- */
27
- export declare function deleteAlias(app: App, pathOrFile: PathOrFile, alias?: string): Promise<void>;
28
- /**
29
- * Processes the front matter of a given file, allowing modifications via a provided function.
30
- *
31
- * @typeParam CustomFrontmatter - The type of custom front matter.
32
- * @param app - The Obsidian app instance.
33
- * @param pathOrFile - The path or TFile object representing the note.
34
- * @param frontmatterFn - A function that modifies the front matter.
35
- * @param processOptions - Optional. Configuration options for retrying the process. If not provided, default options will be used.
36
- * @returns A promise that resolves when the front matter has been processed and saved.
37
- */
38
- export declare function processFrontmatter<CustomFrontmatter = unknown>(app: App, pathOrFile: PathOrFile, frontmatterFn: (frontmatter: CombinedFrontmatter<CustomFrontmatter>) => MaybePromise<null | void>, processOptions?: ProcessOptions): Promise<void>;
1
+ export * from './FileManager.cjs';