obsidian-dev-utils 19.0.0 → 19.0.1

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 +5 -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 +7 -7
@@ -1,60 +1 @@
1
- export interface QuerySettings {
2
- /** What to render 'null' as in tables. Defaults to '-'. */
3
- renderNullAs: string;
4
- /** If enabled, tasks in Dataview views will automatically have their completion date appended when they are checked. */
5
- taskCompletionTracking: boolean;
6
- /** If enabled, automatic completions will use emoji shorthand ✅ YYYY-MM-DD instead of [completion:: date]. */
7
- taskCompletionUseEmojiShorthand: boolean;
8
- /** The name of the inline field to be added as a task's completion when checked. Only used if completionTracking is enabled and emojiShorthand is not. */
9
- taskCompletionText: string;
10
- /** Date format of the task's completion timestamp. Only used if completionTracking is enabled and emojiShorthand is not. */
11
- taskCompletionDateFormat: string;
12
- /** Whether or not subtasks should be recursively completed in addition to their parent task. */
13
- recursiveSubTaskCompletion: boolean;
14
- /** If true, render a modal which shows no results were returned. */
15
- warnOnEmptyResult: boolean;
16
- /** Whether or not automatic view refreshing is enabled. */
17
- refreshEnabled: boolean;
18
- /** The interval that views are refreshed, by default. */
19
- refreshInterval: number;
20
- /** The default format that dates are rendered in (using luxon's moment-like formatting). */
21
- defaultDateFormat: string;
22
- /** The default format that date-times are rendered in (using luxon's moment-like formatting). */
23
- defaultDateTimeFormat: string;
24
- /** Maximum depth that objects will be expanded when being rendered recursively. */
25
- maxRecursiveRenderDepth: number;
26
- /** The name of the default ID field ('File'). */
27
- tableIdColumnName: string;
28
- /** The name of default ID fields on grouped data ('Group'). */
29
- tableGroupColumnName: string;
30
- /** Include the result count as part of the output. */
31
- showResultCount: boolean;
32
- }
33
- export declare const DEFAULT_QUERY_SETTINGS: QuerySettings;
34
- export interface ExportSettings {
35
- /** Whether or not HTML should be used for formatting in exports. */
36
- allowHtml: boolean;
37
- }
38
- export declare const DEFAULT_EXPORT_SETTINGS: ExportSettings;
39
- export interface DataviewSettings extends QuerySettings, ExportSettings {
40
- /** The prefix for inline queries by default. */
41
- inlineQueryPrefix: string;
42
- /** The prefix for inline JS queries by default. */
43
- inlineJsQueryPrefix: string;
44
- /** If true, inline queries are also evaluated in full codeblocks. */
45
- inlineQueriesInCodeblocks: boolean;
46
- /** Enable or disable executing DataviewJS queries. */
47
- enableDataviewJs: boolean;
48
- /** Enable or disable regular inline queries. */
49
- enableInlineDataview: boolean;
50
- /** Enable or disable executing inline DataviewJS queries. */
51
- enableInlineDataviewJs: boolean;
52
- /** Enable or disable rendering inline fields prettily in Reading View. */
53
- prettyRenderInlineFields: boolean;
54
- /** Enable or disable rendering inline fields prettily in Live Preview. */
55
- prettyRenderInlineFieldsInLivePreview: boolean;
56
- /** The keyword for DataviewJS blocks. */
57
- dataviewJsKeyword: string;
58
- }
59
- /** Default settings for dataview on install. */
60
- export declare const DEFAULT_SETTINGS: DataviewSettings;
1
+ export * from './settings.cjs';
@@ -1,28 +1 @@
1
- import type { Plugin } from 'obsidian';
2
- import type { DataviewApi } from '../api/plugin-api.d.mjs';
3
-
4
- declare module 'obsidian' {
5
- interface MetadataCache {
6
- trigger(...args: Parameters<MetadataCache['on']>): void;
7
- trigger(name: string, ...data: any[]): void;
8
- }
9
-
10
- interface Workspace {
11
- /** Sent to rendered dataview components to tell them to possibly refresh */
12
- on(name: 'dataview:refresh-views', callback: () => void, ctx?: any): EventRef;
13
- }
14
- }
15
-
16
- declare global {
17
- interface Window {
18
- DataviewAPI?: DataviewApi;
19
- }
20
- }
21
-
22
- declare module 'obsidian-typings' {
23
- interface PluginsPluginsRecord {
24
- dataview?: Plugin & {
25
- api: DataviewApi;
26
- };
27
- }
28
- }
1
+ export * from './obsidian-ex.cjs';
@@ -1,4 +1 @@
1
- declare module 'web-worker:*' {
2
- const WorkerFactory: new (options: any) => Worker;
3
- export default WorkerFactory;
4
- }
1
+ export * from './workers.cjs';
@@ -1,15 +1 @@
1
- import type { SListItem } from '../../data-model/serialized/markdown.d.mjs';
2
- import type {
3
- Grouping,
4
- Literal
5
- } from '../../data-model/value.d.mjs';
6
- import type {
7
- ExportSettings,
8
- QuerySettings
9
- } from '../../settings.d.mjs';
10
- /** Render a table of literals to Markdown. */
11
- export declare function markdownTable(headers: string[], values: Literal[][], settings?: QuerySettings & ExportSettings): string;
12
- /** Render a list of literal elements to a markdown list. */
13
- export declare function markdownList(values: Literal[], settings?: QuerySettings & ExportSettings): string;
14
- /** Render the result of a task query to markdown. */
15
- export declare function markdownTaskList(tasks: Grouping<SListItem>, settings?: QuerySettings & ExportSettings, depth?: number): string;
1
+ export * from './markdown.cjs';
@@ -1,37 +1 @@
1
- import type {
2
- EditorSelection,
3
- Range
4
- } from '@codemirror/state';
5
- import type {
6
- Decoration,
7
- DecorationSet,
8
- EditorView,
9
- ViewPlugin,
10
- ViewUpdate
11
- } from '@codemirror/view';
12
- import type { SyntaxNode } from '@lezer/common';
13
- import type {
14
- App,
15
- Component,
16
- TFile
17
- } from 'obsidian';
18
- import type { DataviewApi } from '../api/plugin-api.d.mjs';
19
- import type { FullIndex } from '../data-index/index.d.mjs';
20
- import type { DataviewSettings } from '../settings.d.mjs';
21
- export declare function selectionAndRangeOverlap(selection: EditorSelection, rangeFrom: number, rangeTo: number): boolean;
22
- export declare function inlinePlugin(app: App, index: FullIndex, settings: DataviewSettings, api: DataviewApi): ViewPlugin<{
23
- decorations: DecorationSet;
24
- component: Component;
25
- update(update: ViewUpdate): void;
26
- updateTree(view: EditorView): void;
27
- removeDeco(node: SyntaxNode): void;
28
- addDeco(node: SyntaxNode, view: EditorView): void;
29
- renderNode(view: EditorView, node: SyntaxNode): {
30
- render: boolean;
31
- isQuery: boolean;
32
- };
33
- isInlineQuery(view: EditorView, start: number, end: number): boolean;
34
- inlineRender(view: EditorView): DecorationSet | undefined;
35
- renderWidget(node: SyntaxNode, view: EditorView, currentFile: TFile): Range<Decoration> | undefined;
36
- destroy(): void;
37
- }>;
1
+ export * from './lp-render.cjs';
@@ -1,86 +1 @@
1
- /** Provides core preact / rendering utilities for all view types. */
2
- import type {
3
- App,
4
- MarkdownRenderChild
5
- } from 'obsidian';
6
- import type { Component } from 'obsidian';
7
- import type {
8
- ComponentChildren,
9
- h
10
- } from 'preact';
11
- import React from 'preact/compat';
12
- import type { FullIndex } from '../data-index/index.d.mjs';
13
- import type { Literal } from '../data-model/value.d.mjs';
14
- import type { DataviewSettings } from '../settings.d.mjs';
15
- export type MarkdownProps = {
16
- contents: string;
17
- sourcePath: string;
18
- };
19
- export type MarkdownContext = {
20
- component: Component;
21
- };
22
- /** Context need to create dataviews. */
23
- export type DataviewInit = {
24
- app: App;
25
- index: FullIndex;
26
- settings: DataviewSettings;
27
- container: HTMLElement;
28
- };
29
- /** Shared context for dataview views and objects. */
30
- export type DataviewContexts = DataviewInit & {
31
- component: Component;
32
- };
33
- export declare const DataviewContext: React.Context<DataviewContexts>;
34
- /** Hacky preact component which wraps Obsidian's markdown renderer into a neat component. */
35
- export declare function RawMarkdown({ content, sourcePath, inline, style, cls, onClick }: {
36
- content: string;
37
- sourcePath: string;
38
- inline?: boolean;
39
- style?: string;
40
- cls?: string;
41
- onClick?: (e: preact.JSX.TargetedMouseEvent<HTMLElement>) => void;
42
- }): h.JSX.Element;
43
- /** Hacky preact component which wraps Obsidian's markdown renderer into a neat component. */
44
- export declare const Markdown: typeof RawMarkdown;
45
- /** Embeds an HTML element in the react DOM. */
46
- export declare function RawEmbedHtml({ element }: {
47
- element: HTMLElement;
48
- }): h.JSX.Element;
49
- /** Embeds an HTML element in the react DOM. */
50
- export declare const EmbedHtml: typeof RawEmbedHtml;
51
- /** Intelligently render an arbitrary literal value. */
52
- export declare function RawLit({ value, sourcePath, inline, depth }: {
53
- value: Literal | undefined;
54
- sourcePath: string;
55
- inline?: boolean;
56
- depth?: number;
57
- }): h.JSX.Element;
58
- /** Intelligently render an arbitrary literal value. */
59
- export declare const Lit: typeof RawLit;
60
- /** Render a simple nice looking error box in a code style. */
61
- export declare function ErrorPre(props: {
62
- children: ComponentChildren;
63
- }, {}: {}): h.JSX.Element;
64
- /** Render a pretty centered error message in a box. */
65
- export declare function ErrorMessage({ message }: {
66
- message: string;
67
- }): h.JSX.Element;
68
- /**
69
- * Complex convenience hook which calls `compute` every time the index updates, updating the current state.
70
- */
71
- export declare function useIndexBackedState<T>(
72
- container: HTMLElement,
73
- app: App,
74
- settings: DataviewSettings,
75
- index: FullIndex,
76
- initial: T,
77
- compute: () => Promise<T>
78
- ): T;
79
- /** A trivial wrapper which allows a react component to live for the duration of a `MarkdownRenderChild`. */
80
- export declare class ReactRenderer extends MarkdownRenderChild {
81
- init: DataviewInit;
82
- element: h.JSX.Element;
83
- constructor(init: DataviewInit, element: h.JSX.Element);
84
- onload(): void;
85
- onunload(): void;
86
- }
1
+ export * from './markdown.cjs';
@@ -1,18 +1 @@
1
- import type {
2
- App,
3
- MarkdownRenderChild
4
- } from 'obsidian';
5
- import type { FullIndex } from '../data-index/index.d.mjs';
6
- import type { DataviewSettings } from '../settings.d.mjs';
7
- /** Generic code for embedded Dataviews. */
8
- export declare abstract class DataviewRefreshableRenderer extends MarkdownRenderChild {
9
- container: HTMLElement;
10
- index: FullIndex;
11
- app: App;
12
- settings: DataviewSettings;
13
- private lastReload;
14
- constructor(container: HTMLElement, index: FullIndex, app: App, settings: DataviewSettings);
15
- abstract render(): Promise<void>;
16
- onload(): void;
17
- maybeRefresh: () => void;
18
- }
1
+ export * from './refreshable-view.cjs';
@@ -1,33 +1 @@
1
- import type {
2
- App,
3
- Component
4
- } from 'obsidian';
5
- import type { Literal } from '../data-model/value.d.mjs';
6
- import type { QuerySettings } from '../settings.d.mjs';
7
- /** Render simple fields compactly, removing wrapping content like paragraph and span. */
8
- export declare function renderCompactMarkdown(
9
- app: App,
10
- markdown: string,
11
- container: HTMLElement,
12
- sourcePath: string,
13
- component: Component,
14
- isInlineFieldLivePreview?: boolean
15
- ): Promise<void>;
16
- /** Render a pre block with an error in it; returns the element to allow for dynamic updating. */
17
- export declare function renderErrorPre(container: HTMLElement, error: string): HTMLElement;
18
- /** Render a static codeblock. */
19
- export declare function renderCodeBlock(container: HTMLElement, source: string, language?: string): HTMLElement;
20
- export type ValueRenderContext = 'root' | 'list';
21
- /** Prettily render a value into a container with the given settings. */
22
- export declare function renderValue(
23
- app: App,
24
- field: Literal,
25
- container: HTMLElement,
26
- originFile: string,
27
- component: Component,
28
- settings: QuerySettings,
29
- expandList?: boolean,
30
- context?: ValueRenderContext,
31
- depth?: number,
32
- isInlineFieldLivePreview?: boolean
33
- ): Promise<void>;
1
+ export * from './render.cjs';
@@ -1,17 +1 @@
1
- import type { App } from 'obsidian';
2
- import type { FullIndex } from '../../data-index/index.d.mjs';
3
- import type { Query } from '../../query/query.d.mjs';
4
- import type { DataviewSettings } from '../../settings.d.mjs';
5
- import type { DataviewRefreshableRenderer } from '../../ui/refreshable-view.d.mjs';
6
- export declare class DataviewCalendarRenderer extends DataviewRefreshableRenderer {
7
- query: Query;
8
- container: HTMLElement;
9
- index: FullIndex;
10
- origin: string;
11
- settings: DataviewSettings;
12
- app: App;
13
- private calendar;
14
- constructor(query: Query, container: HTMLElement, index: FullIndex, origin: string, settings: DataviewSettings, app: App);
15
- render(): Promise<void>;
16
- onClose(): Promise<void>;
17
- }
1
+ export * from './calendar-view.cjs';
@@ -1,42 +1 @@
1
- import type {
2
- RangeSet,
3
- RangeValue,
4
- StateField
5
- } from '@codemirror/state';
6
- import type {
7
- DecorationSet,
8
- EditorView,
9
- ViewPlugin,
10
- ViewUpdate
11
- } from '@codemirror/view';
12
- import type {
13
- App,
14
- Component,
15
- TFile
16
- } from 'obsidian';
17
- import type { InlineField } from '../../data-import/inline-field.d.mjs';
18
- import type { DataviewSettings } from '../../settings.d.mjs';
19
- declare class InlineFieldValue extends RangeValue {
20
- field: InlineField;
21
- constructor(field: InlineField);
22
- eq(other: InlineFieldValue): boolean;
23
- }
24
- /** A state field that stores the inline fields and their positions as a range set. */
25
- export declare const inlineFieldsField: StateField<RangeSet<InlineFieldValue>>;
26
- /** Create a view plugin that renders inline fields in live preview just as in the reading view. */
27
- export declare const replaceInlineFieldsInLivePreview: (app: App, settings: DataviewSettings) => ViewPlugin<{
28
- decorations: DecorationSet;
29
- component: Component;
30
- destroy(): void;
31
- buildDecorations(view: EditorView): DecorationSet;
32
- update(update: ViewUpdate): void;
33
- updateDecorations(view: EditorView): void;
34
- removeDeco(start: number, end: number): void;
35
- addDeco(start: number, end: number, field: InlineField, file: TFile, view: EditorView): void;
36
- }>;
37
- /**
38
- * A state effect that represents the workspace's layout change.
39
- * Mainly intended to detect when the user switches between live preview and source mode.
40
- */
41
- export declare const workspaceLayoutChangeEffect: import('@codemirror/state').StateEffectType<null>;
42
- export {};
1
+ export * from './inline-field-live-preview.cjs';
@@ -1,28 +1 @@
1
- import type { App } from 'obsidian';
2
- import type { FullIndex } from '../../data-index/index.d.mjs';
3
- import type { Field } from '../../expression/field.d.mjs';
4
- import type { DataviewSettings } from '../../settings.d.mjs';
5
- import type { DataviewRefreshableRenderer } from '../../ui/refreshable-view.d.mjs';
6
- /** Refreshable renderer which renders inline instead of in a div. */
7
- export declare class DataviewInlineRenderer extends DataviewRefreshableRenderer {
8
- field: Field;
9
- fieldText: string;
10
- container: HTMLElement;
11
- target: HTMLElement;
12
- index: FullIndex;
13
- origin: string;
14
- settings: DataviewSettings;
15
- app: App;
16
- errorbox?: HTMLElement;
17
- constructor(
18
- field: Field,
19
- fieldText: string,
20
- container: HTMLElement,
21
- target: HTMLElement,
22
- index: FullIndex,
23
- origin: string,
24
- settings: DataviewSettings,
25
- app: App
26
- );
27
- render(): Promise<void>;
28
- }
1
+ export * from './inline-view.cjs';
@@ -1,23 +1 @@
1
- import type { DataviewApi } from '../../api/plugin-api.d.mjs';
2
- import type { DataviewRefreshableRenderer } from '../../ui/refreshable-view.d.mjs';
3
- export declare class DataviewJSRenderer extends DataviewRefreshableRenderer {
4
- api: DataviewApi;
5
- script: string;
6
- container: HTMLElement;
7
- origin: string;
8
- static PREAMBLE: string;
9
- constructor(api: DataviewApi, script: string, container: HTMLElement, origin: string);
10
- render(): Promise<void>;
11
- }
12
- /** Inline JS renderer accessible using '=$' by default. */
13
- export declare class DataviewInlineJSRenderer extends DataviewRefreshableRenderer {
14
- api: DataviewApi;
15
- script: string;
16
- container: HTMLElement;
17
- target: HTMLElement;
18
- origin: string;
19
- static PREAMBLE: string;
20
- errorbox?: HTMLElement;
21
- constructor(api: DataviewApi, script: string, container: HTMLElement, target: HTMLElement, origin: string);
22
- render(): Promise<void>;
23
- }
1
+ export * from './js-view.cjs';
@@ -1,25 +1 @@
1
- import type { MarkdownRenderChild } from 'obsidian';
2
- import type { h } from 'preact';
3
- import type { Literal } from '../../data-model/value.d.mjs';
4
- import type { Query } from '../../query/query.d.mjs';
5
- import type { DataviewInit } from '../../ui/markdown.d.mjs';
6
- export declare function ListGrouping({ items, sourcePath }: {
7
- items: Literal[];
8
- sourcePath: string;
9
- }): h.JSX.Element;
10
- export type ListViewState = {
11
- state: 'loading';
12
- } | {
13
- state: 'error';
14
- error: string;
15
- } | {
16
- state: 'ready';
17
- items: Literal[];
18
- };
19
- /** Pure view over list elements. */
20
- export declare function ListView({ query, sourcePath }: {
21
- query: Query;
22
- sourcePath: string;
23
- }): h.JSX.Element;
24
- export declare function createListView(init: DataviewInit, query: Query, sourcePath: string): MarkdownRenderChild;
25
- export declare function createFixedListView(init: DataviewInit, elements: Literal[], sourcePath: string): MarkdownRenderChild;
1
+ export * from './list-view.cjs';
@@ -1,28 +1 @@
1
- import type { MarkdownRenderChild } from 'obsidian';
2
- import type { h } from 'preact';
3
- import type { Literal } from '../../data-model/value.d.mjs';
4
- import type { Query } from '../../query/query.d.mjs';
5
- import type { DataviewInit } from '../../ui/markdown.d.mjs';
6
- /** Simple table over headings and corresponding values. */
7
- export declare function TableGrouping({ headings, values, sourcePath }: {
8
- headings: string[];
9
- values: Literal[][];
10
- sourcePath: string;
11
- }): h.JSX.Element;
12
- export type TableViewState = {
13
- state: 'loading';
14
- } | {
15
- state: 'error';
16
- error: string;
17
- } | {
18
- state: 'ready';
19
- headings: string[];
20
- values: Literal[][];
21
- };
22
- /** Pure view over list elements. */
23
- export declare function TableView({ query, sourcePath }: {
24
- query: Query;
25
- sourcePath: string;
26
- }): h.JSX.Element;
27
- export declare function createTableView(init: DataviewInit, query: Query, sourcePath: string): MarkdownRenderChild;
28
- export declare function createFixedTableView(init: DataviewInit, headings: string[], values: Literal[][], sourcePath: string): MarkdownRenderChild;
1
+ export * from './table-view.cjs';
@@ -1,51 +1 @@
1
- import type {
2
- MarkdownRenderChild,
3
- Vault
4
- } from 'obsidian';
5
- import type { h } from 'preact';
6
- import type {
7
- SListItem,
8
- STask
9
- } from '../../data-model/serialized/markdown.d.mjs';
10
- import type { Grouping } from '../../data-model/value.d.mjs';
11
- import type { Query } from '../../query/query.d.mjs';
12
- import type { DataviewInit } from '../../ui/markdown.d.mjs';
13
- export type TaskViewState = {
14
- state: 'loading';
15
- } | {
16
- state: 'error';
17
- error: string;
18
- } | {
19
- state: 'ready';
20
- items: Grouping<SListItem>;
21
- };
22
- /**
23
- * Pure view over (potentially grouped) tasks and list items which allows for checking/unchecking tasks and manipulating
24
- * the task view.
25
- */
26
- export declare function TaskView({ query, sourcePath }: {
27
- query: Query;
28
- sourcePath: string;
29
- }): h.JSX.Element;
30
- export declare function createTaskView(init: DataviewInit, query: Query, sourcePath: string): MarkdownRenderChild;
31
- export declare function createFixedTaskView(init: DataviewInit, items: Grouping<SListItem>, sourcePath: string): MarkdownRenderChild;
32
- /**
33
- * Removes tasks from a list if they are already present by being a child of another task. Fixes child pointers.
34
- * Retains original order of input list.
35
- */
36
- export declare function nestItems(raw: SListItem[]): [SListItem[], Set<string>];
37
- /**
38
- * Recursively removes tasks from each subgroup if they are already present by being a child of another task.
39
- * Fixes child pointers. Retains original order of input list.
40
- */
41
- export declare function nestGroups(raw: Grouping<SListItem>): Grouping<SListItem>;
42
- /** Set the task completion key on check. */
43
- export declare function setTaskCompletion(
44
- originalText: string,
45
- useEmojiShorthand: boolean,
46
- completionKey: string,
47
- completionDateFormat: string,
48
- complete: boolean
49
- ): string;
50
- /** Rewrite a task with the given completion status and new text. */
51
- export declare function rewriteTask(vault: Vault, task: STask, desiredStatus: string, desiredText?: string): Promise<void>;
1
+ export * from './task-view.cjs';
@@ -1 +1 @@
1
- export declare function cyrb53(str: string, seed?: number): number;
1
+ export * from './hash.cjs';
@@ -1,2 +1 @@
1
- /** Test-environment-friendly function which fetches the current system locale. */
2
- export declare function currentLocale(): string;
1
+ export * from './locale.cjs';
@@ -1,6 +1 @@
1
- import type { Link } from '../data-model/value.d.mjs';
2
- export declare const IMAGE_EXTENSIONS: Readonly<Set<string>>;
3
- /** Determines if the given link points to an embedded image. */
4
- export declare function isImageEmbed(link: Link): boolean;
5
- /** Extract text of the form 'WxH' or 'W' from the display of a link. */
6
- export declare function extractImageDimensions(link: Link): [number, number] | [number] | undefined;
1
+ export * from './media.cjs';
@@ -1,44 +1 @@
1
- import type {
2
- DateTime,
3
- Duration
4
- } from 'luxon';
5
- import type { Result } from '../api/result.d.mjs';
6
- import type { QuerySettings } from '../settings.d.mjs';
7
- /** Normalize a duration to all of the proper units. */
8
- export declare function normalizeDuration(dur: Duration): Duration;
9
- /** Strip the time components of a date time object. */
10
- export declare function stripTime(dt: DateTime): DateTime;
11
- /** Try to extract a YYYYMMDD date from a string. */
12
- export declare function extractDate(str: string): DateTime | undefined;
13
- /** Get the folder containing the given path (i.e., like computing 'path/..'). */
14
- export declare function getParentFolder(path: string): string;
15
- /** Get the file name for the file referenced in the given path, by stripping the parent folders. */
16
- export declare function getFileName(path: string): string;
17
- /** Get the "title" for a file, by stripping other parts of the path as well as the extension. */
18
- export declare function getFileTitle(path: string): string;
19
- /** Get the extension of a file from the file path. */
20
- export declare function getExtension(path: string): string;
21
- /** Parse all subtags out of the given tag. I.e., #hello/i/am would yield [#hello/i/am, #hello/i, #hello]. */
22
- export declare function extractSubtags(tag: string): string[];
23
- /** Try calling the given function; on failure, return the error message. */
24
- export declare function tryOrPropogate<T>(func: () => Result<T, string>): Result<T, string>;
25
- /** Try asynchronously calling the given function; on failure, return the error message. */
26
- export declare function asyncTryOrPropogate<T>(func: () => Promise<Result<T, string>>): Promise<Result<T, string>>;
27
- /**
28
- * Escape regex characters in a string.
29
- * See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions.
30
- */
31
- export declare function escapeRegex(str: string): string;
32
- /** Convert an arbitrary variable name into something JS/query friendly. */
33
- export declare function canonicalizeVarName(name: string): string;
34
- /**
35
- * Normalizes the text in a header to be something that is actually linkable to. This mimics
36
- * how Obsidian does it's normalization, collapsing repeated spaces and stripping out control characters.
37
- */
38
- export declare function normalizeHeaderForLink(header: string): string;
39
- /** Render a DateTime in a minimal format to save space. */
40
- export declare function renderMinimalDate(time: DateTime, settings: QuerySettings, locale: string): string;
41
- /** Render a duration in a minimal format to save space. */
42
- export declare function renderMinimalDuration(dur: Duration): string;
43
- /** Determine if two sets are equal in contents. */
44
- export declare function setsEqual<T>(first: Set<T>, second: Set<T>): boolean;
1
+ export * from './normalize.cjs';
@@ -1,30 +1 @@
1
- /**
2
- * @packageDocumentation App
3
- * Provides a utility to retrieve the Obsidian `App` instance.
4
- */
5
- import type { App } from 'obsidian';
6
- /**
7
- * Wrapper type for storing shared state in the Obsidian app.
8
- */
9
- export declare class ValueWrapper<T> {
10
- value: T;
11
- constructor(value: T);
12
- }
13
- /**
14
- * Retrieves the Obsidian `App` instance.
15
- *
16
- * @returns The `App` instance.
17
- * @throws Will throw an error if the `App` instance cannot be found.
18
- *
19
- * @see {@link https://github.com/mnaoumov/obsidian-codescript-toolkit?tab=readme-ov-file#obsidianapp-module}
20
- */
21
- export declare function getApp(): App;
22
- /**
23
- * Retrieves or creates a shared state wrapper object for a given key in the Obsidian app.
24
- *
25
- * @param app - The Obsidian app instance.
26
- * @param key - The key to store or retrieve the shared state.
27
- * @param defaultValue - The default value to use if the shared state does not exist.
28
- * @returns The ValueWrapper object that stores the shared state.
29
- */
30
- export declare function getObsidianDevUtilsState<T>(app: App, key: string, defaultValue: T): ValueWrapper<T>;
1
+ export * from './App.cjs';