@mnaoumov/obsidian-lib 1.0.1 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (210) hide show
  1. package/dist/lib/cjs/__merged.cjs +15 -1
  2. package/dist/lib/cjs/__merged.d.cts +5 -3
  3. package/dist/lib/cjs/app.cjs +1 -1
  4. package/dist/lib/cjs/attachment-path.cjs +62 -9
  5. package/dist/lib/cjs/attachment-path.d.cts +21 -43
  6. package/dist/lib/cjs/attachment-unit-folder.cjs +1 -1
  7. package/dist/lib/cjs/attachment-unit-folder.d.cts +8 -9
  8. package/dist/lib/cjs/components/plugin-notice-component.cjs +7 -2
  9. package/dist/lib/cjs/components/plugin-notice-component.d.cts +3 -0
  10. package/dist/lib/cjs/components/release-notes-component.cjs +3 -2
  11. package/dist/lib/cjs/components/settings-migration-component.cjs +5 -5
  12. package/dist/lib/cjs/components/settings-migration-component.d.cts +6 -4
  13. package/dist/lib/cjs/dataview.cjs +1 -1
  14. package/dist/lib/cjs/dataview.d.cts +9 -3
  15. package/dist/lib/cjs/demo-vault-helper.cjs +3 -2
  16. package/dist/lib/cjs/desktop-demo-vault-opener.cjs +9 -8
  17. package/dist/lib/cjs/file-system.cjs +6 -1
  18. package/dist/lib/cjs/file-system.d.cts +7 -0
  19. package/dist/lib/cjs/generated-during-build.cjs +2 -2
  20. package/dist/lib/cjs/metadata-cache.cjs +25 -7
  21. package/dist/lib/cjs/metadata-cache.d.cts +8 -19
  22. package/dist/lib/cjs/plugin/index.cjs +4 -1
  23. package/dist/lib/cjs/plugin/index.d.cts +1 -0
  24. package/dist/lib/cjs/plugin/plugin-api-schema.cjs +171 -0
  25. package/dist/lib/cjs/plugin/plugin-api-schema.d.cts +59 -0
  26. package/dist/lib/cjs/plugin/plugin-api.cjs +7 -1
  27. package/dist/lib/cjs/plugin/plugin-api.d.cts +83 -10
  28. package/dist/lib/cjs/plugin/settings-migration-api.cjs +30 -1
  29. package/dist/lib/cjs/plugin/settings-migration-api.d.cts +16 -3
  30. package/dist/lib/esm/__merged.d.mts +5 -3
  31. package/dist/lib/esm/__merged.mjs +15 -1
  32. package/dist/lib/esm/app.mjs +1 -1
  33. package/dist/lib/esm/attachment-path.d.mts +21 -43
  34. package/dist/lib/esm/attachment-path.mjs +65 -9
  35. package/dist/lib/esm/attachment-unit-folder.d.mts +8 -9
  36. package/dist/lib/esm/attachment-unit-folder.mjs +1 -1
  37. package/dist/lib/esm/components/plugin-notice-component.d.mts +3 -0
  38. package/dist/lib/esm/components/plugin-notice-component.mjs +7 -2
  39. package/dist/lib/esm/components/release-notes-component.mjs +6 -2
  40. package/dist/lib/esm/components/settings-migration-component.d.mts +6 -4
  41. package/dist/lib/esm/components/settings-migration-component.mjs +5 -5
  42. package/dist/lib/esm/dataview.d.mts +9 -3
  43. package/dist/lib/esm/dataview.mjs +1 -1
  44. package/dist/lib/esm/demo-vault-helper.mjs +3 -2
  45. package/dist/lib/esm/desktop-demo-vault-opener.mjs +12 -8
  46. package/dist/lib/esm/file-system.d.mts +7 -0
  47. package/dist/lib/esm/file-system.mjs +5 -1
  48. package/dist/lib/esm/generated-during-build.mjs +2 -2
  49. package/dist/lib/esm/metadata-cache.d.mts +8 -19
  50. package/dist/lib/esm/metadata-cache.mjs +30 -8
  51. package/dist/lib/esm/plugin/index.d.mts +1 -0
  52. package/dist/lib/esm/plugin/index.mjs +3 -1
  53. package/dist/lib/esm/plugin/plugin-api-schema.d.mts +59 -0
  54. package/dist/lib/esm/plugin/plugin-api-schema.mjs +73 -0
  55. package/dist/lib/esm/plugin/plugin-api.d.mts +83 -10
  56. package/dist/lib/esm/plugin/plugin-api.mjs +6 -1
  57. package/dist/lib/esm/plugin/settings-migration-api.d.mts +16 -3
  58. package/dist/lib/esm/plugin/settings-migration-api.mjs +25 -1
  59. package/dist/styles.css +4 -1
  60. package/package.json +4 -135
  61. package/plugin/plugin-api-schema/package.json +6 -0
  62. package/@types/dataview/api/data-array/package.json +0 -4
  63. package/@types/dataview/api/extensions/package.json +0 -4
  64. package/@types/dataview/api/inline-api/package.json +0 -4
  65. package/@types/dataview/api/plugin-api/package.json +0 -4
  66. package/@types/dataview/api/result/package.json +0 -4
  67. package/@types/dataview/data-import/common/package.json +0 -4
  68. package/@types/dataview/data-import/csv/package.json +0 -4
  69. package/@types/dataview/data-import/inline-field/package.json +0 -4
  70. package/@types/dataview/data-import/markdown-file/package.json +0 -4
  71. package/@types/dataview/data-import/persister/package.json +0 -4
  72. package/@types/dataview/data-import/web-worker/import-entry/package.json +0 -4
  73. package/@types/dataview/data-import/web-worker/import-impl/package.json +0 -4
  74. package/@types/dataview/data-import/web-worker/import-manager/package.json +0 -4
  75. package/@types/dataview/data-index/index/package.json +0 -4
  76. package/@types/dataview/data-index/package.json +0 -4
  77. package/@types/dataview/data-index/resolver/package.json +0 -4
  78. package/@types/dataview/data-index/source/package.json +0 -4
  79. package/@types/dataview/data-model/markdown/package.json +0 -4
  80. package/@types/dataview/data-model/serialized/markdown/package.json +0 -4
  81. package/@types/dataview/data-model/transferable/package.json +0 -4
  82. package/@types/dataview/data-model/value/package.json +0 -4
  83. package/@types/dataview/expression/binaryop/package.json +0 -4
  84. package/@types/dataview/expression/context/package.json +0 -4
  85. package/@types/dataview/expression/field/package.json +0 -4
  86. package/@types/dataview/expression/functions/package.json +0 -4
  87. package/@types/dataview/expression/parse/package.json +0 -4
  88. package/@types/dataview/index/package.json +0 -4
  89. package/@types/dataview/main/package.json +0 -4
  90. package/@types/dataview/package.json +0 -4
  91. package/@types/dataview/query/engine/package.json +0 -4
  92. package/@types/dataview/query/parse/package.json +0 -4
  93. package/@types/dataview/query/query/package.json +0 -4
  94. package/@types/dataview/settings/package.json +0 -4
  95. package/@types/dataview/typings/obsidian-ex/package.json +0 -4
  96. package/@types/dataview/typings/workers/package.json +0 -4
  97. package/@types/dataview/ui/export/markdown/package.json +0 -4
  98. package/@types/dataview/ui/lp-render/package.json +0 -4
  99. package/@types/dataview/ui/markdown/package.json +0 -4
  100. package/@types/dataview/ui/refreshable-view/package.json +0 -4
  101. package/@types/dataview/ui/render/package.json +0 -4
  102. package/@types/dataview/ui/views/calendar-view/package.json +0 -4
  103. package/@types/dataview/ui/views/inline-field-live-preview/package.json +0 -4
  104. package/@types/dataview/ui/views/inline-view/package.json +0 -4
  105. package/@types/dataview/ui/views/js-view/package.json +0 -4
  106. package/@types/dataview/ui/views/list-view/package.json +0 -4
  107. package/@types/dataview/ui/views/table-view/package.json +0 -4
  108. package/@types/dataview/ui/views/task-view/package.json +0 -4
  109. package/@types/dataview/util/hash/package.json +0 -4
  110. package/@types/dataview/util/locale/package.json +0 -4
  111. package/@types/dataview/util/media/package.json +0 -4
  112. package/@types/dataview/util/normalize/package.json +0 -4
  113. package/dist/lib/cjs/@types/dataview/api/data-array.d.cts +0 -137
  114. package/dist/lib/cjs/@types/dataview/api/extensions.d.cts +0 -16
  115. package/dist/lib/cjs/@types/dataview/api/inline-api.d.cts +0 -187
  116. package/dist/lib/cjs/@types/dataview/api/plugin-api.d.cts +0 -210
  117. package/dist/lib/cjs/@types/dataview/api/result.d.cts +0 -39
  118. package/dist/lib/cjs/@types/dataview/data-import/common.d.cts +0 -4
  119. package/dist/lib/cjs/@types/dataview/data-import/csv.d.cts +0 -4
  120. package/dist/lib/cjs/@types/dataview/data-import/inline-field.d.cts +0 -43
  121. package/dist/lib/cjs/@types/dataview/data-import/markdown-file.d.cts +0 -53
  122. package/dist/lib/cjs/@types/dataview/data-import/persister.d.cts +0 -33
  123. package/dist/lib/cjs/@types/dataview/data-import/web-worker/import-entry.d.cts +0 -2
  124. package/dist/lib/cjs/@types/dataview/data-import/web-worker/import-impl.d.cts +0 -7
  125. package/dist/lib/cjs/@types/dataview/data-import/web-worker/import-manager.d.cts +0 -38
  126. package/dist/lib/cjs/@types/dataview/data-index/index.d.cts +0 -187
  127. package/dist/lib/cjs/@types/dataview/data-index/resolver.d.cts +0 -24
  128. package/dist/lib/cjs/@types/dataview/data-index/source.d.cts +0 -72
  129. package/dist/lib/cjs/@types/dataview/data-model/markdown.d.cts +0 -116
  130. package/dist/lib/cjs/@types/dataview/data-model/serialized/markdown.d.cts +0 -107
  131. package/dist/lib/cjs/@types/dataview/data-model/transferable.d.cts +0 -8
  132. package/dist/lib/cjs/@types/dataview/data-model/value.d.cts +0 -176
  133. package/dist/lib/cjs/@types/dataview/expression/binaryop.d.cts +0 -44
  134. package/dist/lib/cjs/@types/dataview/expression/context.d.cts +0 -50
  135. package/dist/lib/cjs/@types/dataview/expression/field.d.cts +0 -83
  136. package/dist/lib/cjs/@types/dataview/expression/functions.d.cts +0 -150
  137. package/dist/lib/cjs/@types/dataview/expression/parse.d.cts +0 -164
  138. package/dist/lib/cjs/@types/dataview/index.d.cts +0 -56
  139. package/dist/lib/cjs/@types/dataview/main.d.cts +0 -53
  140. package/dist/lib/cjs/@types/dataview/query/engine.d.cts +0 -104
  141. package/dist/lib/cjs/@types/dataview/query/parse.d.cts +0 -45
  142. package/dist/lib/cjs/@types/dataview/query/query.d.cts +0 -96
  143. package/dist/lib/cjs/@types/dataview/settings.d.cts +0 -61
  144. package/dist/lib/cjs/@types/dataview/typings/obsidian-ex.d.cts +0 -29
  145. package/dist/lib/cjs/@types/dataview/typings/workers.d.cts +0 -5
  146. package/dist/lib/cjs/@types/dataview/ui/export/markdown.d.cts +0 -16
  147. package/dist/lib/cjs/@types/dataview/ui/lp-render.d.cts +0 -38
  148. package/dist/lib/cjs/@types/dataview/ui/markdown.d.cts +0 -87
  149. package/dist/lib/cjs/@types/dataview/ui/refreshable-view.d.cts +0 -19
  150. package/dist/lib/cjs/@types/dataview/ui/render.d.cts +0 -34
  151. package/dist/lib/cjs/@types/dataview/ui/views/calendar-view.d.cts +0 -18
  152. package/dist/lib/cjs/@types/dataview/ui/views/inline-field-live-preview.d.cts +0 -43
  153. package/dist/lib/cjs/@types/dataview/ui/views/inline-view.d.cts +0 -29
  154. package/dist/lib/cjs/@types/dataview/ui/views/js-view.d.cts +0 -24
  155. package/dist/lib/cjs/@types/dataview/ui/views/list-view.d.cts +0 -26
  156. package/dist/lib/cjs/@types/dataview/ui/views/table-view.d.cts +0 -29
  157. package/dist/lib/cjs/@types/dataview/ui/views/task-view.d.cts +0 -52
  158. package/dist/lib/cjs/@types/dataview/util/hash.d.cts +0 -2
  159. package/dist/lib/cjs/@types/dataview/util/locale.d.cts +0 -3
  160. package/dist/lib/cjs/@types/dataview/util/media.d.cts +0 -7
  161. package/dist/lib/cjs/@types/dataview/util/normalize.d.cts +0 -45
  162. package/dist/lib/esm/@types/dataview/api/data-array.d.mts +0 -137
  163. package/dist/lib/esm/@types/dataview/api/extensions.d.mts +0 -16
  164. package/dist/lib/esm/@types/dataview/api/inline-api.d.mts +0 -187
  165. package/dist/lib/esm/@types/dataview/api/plugin-api.d.mts +0 -210
  166. package/dist/lib/esm/@types/dataview/api/result.d.mts +0 -39
  167. package/dist/lib/esm/@types/dataview/data-import/common.d.mts +0 -4
  168. package/dist/lib/esm/@types/dataview/data-import/csv.d.mts +0 -4
  169. package/dist/lib/esm/@types/dataview/data-import/inline-field.d.mts +0 -43
  170. package/dist/lib/esm/@types/dataview/data-import/markdown-file.d.mts +0 -53
  171. package/dist/lib/esm/@types/dataview/data-import/persister.d.mts +0 -33
  172. package/dist/lib/esm/@types/dataview/data-import/web-worker/import-entry.d.mts +0 -2
  173. package/dist/lib/esm/@types/dataview/data-import/web-worker/import-impl.d.mts +0 -7
  174. package/dist/lib/esm/@types/dataview/data-import/web-worker/import-manager.d.mts +0 -38
  175. package/dist/lib/esm/@types/dataview/data-index/index.d.mts +0 -187
  176. package/dist/lib/esm/@types/dataview/data-index/resolver.d.mts +0 -24
  177. package/dist/lib/esm/@types/dataview/data-index/source.d.mts +0 -72
  178. package/dist/lib/esm/@types/dataview/data-model/markdown.d.mts +0 -116
  179. package/dist/lib/esm/@types/dataview/data-model/serialized/markdown.d.mts +0 -107
  180. package/dist/lib/esm/@types/dataview/data-model/transferable.d.mts +0 -8
  181. package/dist/lib/esm/@types/dataview/data-model/value.d.mts +0 -176
  182. package/dist/lib/esm/@types/dataview/expression/binaryop.d.mts +0 -44
  183. package/dist/lib/esm/@types/dataview/expression/context.d.mts +0 -50
  184. package/dist/lib/esm/@types/dataview/expression/field.d.mts +0 -83
  185. package/dist/lib/esm/@types/dataview/expression/functions.d.mts +0 -150
  186. package/dist/lib/esm/@types/dataview/expression/parse.d.mts +0 -164
  187. package/dist/lib/esm/@types/dataview/index.d.mts +0 -56
  188. package/dist/lib/esm/@types/dataview/main.d.mts +0 -53
  189. package/dist/lib/esm/@types/dataview/query/engine.d.mts +0 -104
  190. package/dist/lib/esm/@types/dataview/query/parse.d.mts +0 -45
  191. package/dist/lib/esm/@types/dataview/query/query.d.mts +0 -96
  192. package/dist/lib/esm/@types/dataview/settings.d.mts +0 -61
  193. package/dist/lib/esm/@types/dataview/typings/obsidian-ex.d.mts +0 -29
  194. package/dist/lib/esm/@types/dataview/typings/workers.d.mts +0 -5
  195. package/dist/lib/esm/@types/dataview/ui/export/markdown.d.mts +0 -16
  196. package/dist/lib/esm/@types/dataview/ui/lp-render.d.mts +0 -38
  197. package/dist/lib/esm/@types/dataview/ui/markdown.d.mts +0 -87
  198. package/dist/lib/esm/@types/dataview/ui/refreshable-view.d.mts +0 -19
  199. package/dist/lib/esm/@types/dataview/ui/render.d.mts +0 -34
  200. package/dist/lib/esm/@types/dataview/ui/views/calendar-view.d.mts +0 -18
  201. package/dist/lib/esm/@types/dataview/ui/views/inline-field-live-preview.d.mts +0 -43
  202. package/dist/lib/esm/@types/dataview/ui/views/inline-view.d.mts +0 -29
  203. package/dist/lib/esm/@types/dataview/ui/views/js-view.d.mts +0 -24
  204. package/dist/lib/esm/@types/dataview/ui/views/list-view.d.mts +0 -26
  205. package/dist/lib/esm/@types/dataview/ui/views/table-view.d.mts +0 -29
  206. package/dist/lib/esm/@types/dataview/ui/views/task-view.d.mts +0 -52
  207. package/dist/lib/esm/@types/dataview/util/hash.d.mts +0 -2
  208. package/dist/lib/esm/@types/dataview/util/locale.d.mts +0 -3
  209. package/dist/lib/esm/@types/dataview/util/media.d.mts +0 -7
  210. package/dist/lib/esm/@types/dataview/util/normalize.d.mts +0 -45
@@ -1,164 +0,0 @@
1
- /// <reference path="../../../library.d.cts" />
2
- import type {
3
- DateTime,
4
- Duration
5
- } from 'luxon';
6
- import * as P from 'parsimmon';
7
- import type { Result } from '../api/result.d.cjs';
8
- import type {
9
- CsvSource,
10
- FolderSource,
11
- NegatedSource,
12
- Source,
13
- TagSource
14
- } from '../data-index/source.d.cjs';
15
- import type {
16
- Link,
17
- Literal
18
- } from '../data-model/value.d.cjs';
19
- import type {
20
- BinaryOp,
21
- Field,
22
- LambdaField,
23
- ListField,
24
- LiteralField,
25
- ObjectField,
26
- VariableField
27
- } from './field.d.cjs';
28
- /** Provides a lookup table for unit durations of the given type. */
29
- export declare const DURATION_TYPES: {
30
- year: Duration;
31
- years: Duration;
32
- yr: Duration;
33
- yrs: Duration;
34
- month: Duration;
35
- months: Duration;
36
- mo: Duration;
37
- mos: Duration;
38
- week: Duration;
39
- weeks: Duration;
40
- wk: Duration;
41
- wks: Duration;
42
- w: Duration;
43
- day: Duration;
44
- days: Duration;
45
- d: Duration;
46
- hour: Duration;
47
- hours: Duration;
48
- hr: Duration;
49
- hrs: Duration;
50
- h: Duration;
51
- minute: Duration;
52
- minutes: Duration;
53
- min: Duration;
54
- mins: Duration;
55
- m: Duration;
56
- second: Duration;
57
- seconds: Duration;
58
- sec: Duration;
59
- secs: Duration;
60
- s: Duration;
61
- };
62
- /** Shorthand for common dates (relative to right now). */
63
- export declare const DATE_SHORTHANDS: {
64
- now: () => DateTime;
65
- today: () => DateTime;
66
- yesterday: () => DateTime;
67
- tomorrow: () => DateTime;
68
- sow: () => DateTime;
69
- 'start-of-week': () => DateTime;
70
- eow: () => DateTime;
71
- 'end-of-week': () => DateTime;
72
- soy: () => DateTime;
73
- 'start-of-year': () => DateTime;
74
- eoy: () => DateTime;
75
- 'end-of-year': () => DateTime;
76
- som: () => DateTime;
77
- 'start-of-month': () => DateTime;
78
- eom: () => DateTime;
79
- 'end-of-month': () => DateTime;
80
- };
81
- /**
82
- * Keywords which cannot be used as variables directly. Use `row.<thing>` if it is a variable you have defined and want
83
- * to access.
84
- */
85
- export declare const KEYWORDS: string[];
86
- /** Attempt to parse the inside of a link to pull out display name, subpath, etc. */
87
- export declare function parseInnerLink(rawlink: string): Link;
88
- /** Create a left-associative binary parser which parses the given sub-element and separator. Handles whitespace. */
89
- export declare function createBinaryParser<T, U>(child: P.Parser<T>, sep: P.Parser<U>, combine: (a: T, b: U, c: T) => T): P.Parser<T>;
90
- export declare function chainOpt<T>(base: P.Parser<T>, ...funcs: ((r: T) => P.Parser<T>)[]): P.Parser<T>;
91
- export type PostfixFragment = {
92
- type: 'dot';
93
- field: string;
94
- } | {
95
- type: 'index';
96
- field: Field;
97
- } | {
98
- type: 'function';
99
- fields: Field[];
100
- };
101
- export interface ExpressionLanguage {
102
- number: number;
103
- string: string;
104
- escapeCharacter: string;
105
- bool: boolean;
106
- tag: string;
107
- identifier: string;
108
- link: Link;
109
- embedLink: Link;
110
- rootDate: DateTime;
111
- dateShorthand: keyof typeof DATE_SHORTHANDS;
112
- date: DateTime;
113
- datePlus: DateTime;
114
- durationType: keyof typeof DURATION_TYPES;
115
- duration: Duration;
116
- rawNull: string;
117
- binaryPlusMinus: BinaryOp;
118
- binaryMulDiv: BinaryOp;
119
- binaryCompareOp: BinaryOp;
120
- binaryBooleanOp: BinaryOp;
121
- tagSource: TagSource;
122
- csvSource: CsvSource;
123
- folderSource: FolderSource;
124
- parensSource: Source;
125
- atomSource: Source;
126
- linkIncomingSource: Source;
127
- linkOutgoingSource: Source;
128
- negateSource: NegatedSource;
129
- binaryOpSource: Source;
130
- source: Source;
131
- variableField: VariableField;
132
- numberField: LiteralField;
133
- boolField: LiteralField;
134
- stringField: LiteralField;
135
- dateField: LiteralField;
136
- durationField: LiteralField;
137
- linkField: LiteralField;
138
- nullField: LiteralField;
139
- listField: ListField;
140
- objectField: ObjectField;
141
- atomInlineField: Literal;
142
- inlineFieldList: Literal[];
143
- inlineField: Literal;
144
- negatedField: Field;
145
- atomField: Field;
146
- indexField: Field;
147
- lambdaField: LambdaField;
148
- dotPostfix: PostfixFragment;
149
- indexPostfix: PostfixFragment;
150
- functionPostfix: PostfixFragment;
151
- binaryMulDivField: Field;
152
- binaryPlusMinusField: Field;
153
- binaryCompareField: Field;
154
- binaryBooleanField: Field;
155
- binaryOpField: Field;
156
- parensField: Field;
157
- field: Field;
158
- }
159
- export declare const EXPRESSION: P.TypedLanguage<ExpressionLanguage>;
160
- /**
161
- * Attempt to parse a field from the given text, returning a string error if the
162
- * parse failed.
163
- */
164
- export declare function parseField(text: string): Result<Field, string>;
@@ -1,56 +0,0 @@
1
- /// <reference path="../../library.d.cts" />
2
- export type {
3
- DateTime,
4
- Duration
5
- } from 'luxon';
6
- export type { DataArray } from './api/data-array.d.cjs';
7
- export type { DataviewApi } from './api/plugin-api.d.cjs';
8
- export type {
9
- Failure,
10
- Result,
11
- Success
12
- } from './api/result.d.cjs';
13
- export type {
14
- FullIndex,
15
- IndexMap,
16
- PrefixIndex
17
- } from './data-index/index.d.cjs';
18
- export type {
19
- ListItem,
20
- PageMetadata
21
- } from './data-model/markdown.d.cjs';
22
- export type {
23
- SListEntry,
24
- SMarkdownPage,
25
- STask
26
- } from './data-model/serialized/markdown.d.cjs';
27
- export type {
28
- DataObject,
29
- Link,
30
- Literal,
31
- LiteralRepr,
32
- LiteralType,
33
- LiteralWrapper,
34
- Widget,
35
- WrappedLiteral
36
- } from './data-model/value.d.cjs';
37
- export type {
38
- DATE_SHORTHANDS,
39
- DURATION_TYPES,
40
- EXPRESSION,
41
- ExpressionLanguage,
42
- KEYWORDS,
43
- parseField
44
- } from './expression/parse.d.cjs';
45
- export type { QUERY_LANGUAGE } from './query/parse.d.cjs';
46
- export type { Query } from './query/query.d.cjs';
47
- import type { DataviewApi } from './api/plugin-api.d.cjs';
48
- import 'obsidian';
49
- import type { App } from 'obsidian' with { 'resolution-mode': 'import' };
50
- /**
51
- * Get the current Dataview API from the app if provided; if not, it is inferred from the global API object installed
52
- * on the window.
53
- */
54
- export declare const getAPI: (app?: App) => DataviewApi | undefined;
55
- /** Determine if Dataview is enabled in the given application. */
56
- export declare const isPluginEnabled: (app: App) => boolean;
@@ -1,53 +0,0 @@
1
- /// <reference path="../../library.d.cts" />
2
- import type {
3
- Component,
4
- MarkdownPostProcessorContext,
5
- Plugin
6
- } from 'obsidian';
7
- import type { DataviewInlineApi } from './api/inline-api.d.cjs';
8
- import type { DataviewApi } from './api/plugin-api.d.cjs';
9
- import type { FullIndex } from './data-index/index.d.cjs';
10
- import type { DataviewSettings } from './settings.d.cjs';
11
- export default class DataviewPlugin extends Plugin {
12
- /** Plugin-wide default settings. */
13
- settings: DataviewSettings;
14
- /** The index that stores all dataview data. */
15
- index: FullIndex;
16
- /** External-facing plugin API. */
17
- api: DataviewApi;
18
- /** CodeMirror 6 extensions that dataview installs. Tracked via array to allow for dynamic updates. */
19
- private cmExtension;
20
- onload(): Promise<void>;
21
- registerDataviewjsCodeHighlighting(): void;
22
- unregisterDataviewjsCodeHighlighting(): void;
23
- private debouncedRefresh;
24
- private updateRefreshSettings;
25
- onunload(): void;
26
- /** Register a markdown post processor with the given priority. */
27
- registerPriorityMarkdownPostProcessor(priority: number, processor: (el: HTMLElement, ctx: MarkdownPostProcessorContext) => Promise<void>): void;
28
- /** Register a markdown codeblock post processor with the given priority. */
29
- registerPriorityCodeblockPostProcessor(
30
- language: string,
31
- priority: number,
32
- processor: (source: string, el: HTMLElement, ctx: MarkdownPostProcessorContext) => Promise<void>
33
- ): void;
34
- updateEditorExtensions(): void;
35
- /**
36
- * Based on the source, generate a dataview view. This works by doing an initial parsing pass, and then adding
37
- * a long-lived view object to the given component for life-cycle management.
38
- */
39
- dataview(source: string, el: HTMLElement, component: Component | MarkdownPostProcessorContext, sourcePath: string): Promise<void>;
40
- /** Generate a DataviewJS view running the given source in the given element. */
41
- dataviewjs(source: string, el: HTMLElement, component: Component | MarkdownPostProcessorContext, sourcePath: string): Promise<void>;
42
- /** Render all dataview inline expressions in the given element. */
43
- dataviewInline(el: HTMLElement, component: Component | MarkdownPostProcessorContext, sourcePath: string): Promise<void>;
44
- /** Update plugin settings. */
45
- updateSettings(settings: Partial<DataviewSettings>): Promise<void>;
46
- /** @deprecated Call the given callback when the dataview API has initialized. */
47
- withApi(callback: (api: DataviewApi) => void): void;
48
- /**
49
- * Create an API element localized to the given path, with lifecycle management managed by the given component.
50
- * The API will output results to the given HTML element.
51
- */
52
- localApi(path: string, component: Component, el: HTMLElement): DataviewInlineApi;
53
- }
@@ -1,104 +0,0 @@
1
- /// <reference path="../../../library.d.cts" />
2
- /**
3
- * Takes a full query and a set of indices, and (hopefully quickly) returns all relevant files.
4
- */
5
- import type { DateTime } from 'luxon' with { 'resolution-mode': 'import' };
6
- import type { Result } from '../api/result.d.cjs';
7
- import type { FullIndex } from '../data-index/index.d.cjs';
8
- import type { Datarow } from '../data-index/resolver.d.cjs';
9
- import type { SListItem } from '../data-model/serialized/markdown.d.cjs';
10
- import type {
11
- DataObject,
12
- Grouping,
13
- Link,
14
- Literal
15
- } from '../data-model/value.d.cjs';
16
- import type {
17
- Context,
18
- LinkHandler
19
- } from '../expression/context.d.cjs';
20
- import type { Field } from '../expression/field.d.cjs';
21
- import type { QuerySettings } from '../settings.d.cjs';
22
- import type {
23
- Query,
24
- QueryOperation
25
- } from './query.d.cjs';
26
- /** Operation diagnostics collected during the execution of each query step. */
27
- export interface OperationDiagnostics {
28
- timeMs: number;
29
- incomingRows: number;
30
- outgoingRows: number;
31
- errors: {
32
- index: number;
33
- message: string;
34
- }[];
35
- }
36
- /** The meaning of the 'id' field for a data row - i.e., where it came from. */
37
- export type IdentifierMeaning = {
38
- type: 'group';
39
- name: string;
40
- on: IdentifierMeaning;
41
- } | {
42
- type: 'path';
43
- };
44
- /** A data row over an object. */
45
- export type Pagerow = Datarow<DataObject>;
46
- /** An error during execution. */
47
- export type ExecutionError = {
48
- index: number;
49
- message: string;
50
- };
51
- /** The result of executing query operations over incoming data rows; includes timing and error information. */
52
- export interface CoreExecution {
53
- data: Pagerow[];
54
- idMeaning: IdentifierMeaning;
55
- timeMs: number;
56
- ops: QueryOperation[];
57
- diagnostics: OperationDiagnostics[];
58
- }
59
- /** Shared execution code which just takes in arbitrary data, runs operations over it, and returns it + per-row errors. */
60
- export declare function executeCore(rows: Pagerow[], context: Context, ops: QueryOperation[]): Result<CoreExecution, string>;
61
- /** Expanded version of executeCore which adds an additional "extraction" step to the pipeline. */
62
- export declare function executeCoreExtract(
63
- rows: Pagerow[],
64
- context: Context,
65
- ops: QueryOperation[],
66
- fields: Record<string, Field>
67
- ): Result<CoreExecution, string>;
68
- export interface ListExecution {
69
- core: CoreExecution;
70
- data: Literal[];
71
- primaryMeaning: IdentifierMeaning;
72
- }
73
- /** Execute a list-based query, returning the final results. */
74
- export declare function executeList(query: Query, index: FullIndex, origin: string, settings: QuerySettings): Promise<Result<ListExecution, string>>;
75
- /** Result of executing a table query. */
76
- export interface TableExecution {
77
- core: CoreExecution;
78
- names: string[];
79
- data: Literal[][];
80
- idMeaning: IdentifierMeaning;
81
- }
82
- /** Execute a table query. */
83
- export declare function executeTable(query: Query, index: FullIndex, origin: string, settings: QuerySettings): Promise<Result<TableExecution, string>>;
84
- /** The result of executing a task query. */
85
- export interface TaskExecution {
86
- core: CoreExecution;
87
- tasks: Grouping<SListItem>;
88
- }
89
- /** Execute a task query, returning all matching tasks. */
90
- export declare function executeTask(query: Query, origin: string, index: FullIndex, settings: QuerySettings): Promise<Result<TaskExecution, string>>;
91
- /** Execute a single field inline a file, returning the evaluated result. */
92
- export declare function executeInline(field: Field, origin: string, index: FullIndex, settings: QuerySettings): Result<Literal, string>;
93
- /** The default link resolver used when creating contexts. */
94
- export declare function defaultLinkHandler(index: FullIndex, origin: string): LinkHandler;
95
- /** Execute a calendar-based query, returning the final results. */
96
- export declare function executeCalendar(query: Query, index: FullIndex, origin: string, settings: QuerySettings): Promise<Result<CalendarExecution, string>>;
97
- export interface CalendarExecution {
98
- core: CoreExecution;
99
- data: {
100
- date: DateTime;
101
- link: Link;
102
- value?: Literal[];
103
- }[];
104
- }
@@ -1,45 +0,0 @@
1
- /// <reference path="../../../library.d.cts" />
2
- import * as P from 'parsimmon';
3
- import type { Result } from '../api/result.d.cjs';
4
- import type { Source } from '../data-index/source.d.cjs';
5
- import type {
6
- Comment,
7
- FlattenStep,
8
- GroupStep,
9
- LimitStep,
10
- NamedField,
11
- Query,
12
- QueryHeader,
13
- QueryOperation,
14
- QuerySortBy,
15
- QueryType,
16
- SortByStep,
17
- WhereStep
18
- } from './query.d.cjs';
19
- /** Typings for the outputs of all of the parser combinators. */
20
- interface QueryLanguageTypes {
21
- queryType: QueryType;
22
- comment: Comment;
23
- explicitNamedField: NamedField;
24
- namedField: NamedField;
25
- sortField: QuerySortBy;
26
- headerClause: QueryHeader;
27
- fromClause: Source;
28
- whereClause: WhereStep;
29
- sortByClause: SortByStep;
30
- limitClause: LimitStep;
31
- flattenClause: FlattenStep;
32
- groupByClause: GroupStep;
33
- clause: QueryOperation;
34
- query: Query;
35
- }
36
- /** Return a new parser which executes the underlying parser and returns it's raw string representation. */
37
- export declare function captureRaw<T>(base: P.Parser<T>): P.Parser<[T, string]>;
38
- /** A parsimmon-powered parser-combinator implementation of the query language. */
39
- export declare const QUERY_LANGUAGE: P.TypedLanguage<QueryLanguageTypes>;
40
- /**
41
- * Attempt to parse a query from the given query text, returning a string error
42
- * if the parse failed.
43
- */
44
- export declare function parseQuery(text: string): Result<Query, string>;
45
- export {};
@@ -1,96 +0,0 @@
1
- /// <reference path="../../../library.d.cts" />
2
- /** Provides an AST for complex queries. */
3
- import type { Source } from '../data-index/source.d.cjs';
4
- import type { Field } from '../expression/field.d.cjs';
5
- /** The supported query types (corresponding to view types). */
6
- export type QueryType = 'list' | 'table' | 'task' | 'calendar';
7
- /** A single-line comment. */
8
- export type Comment = string;
9
- /** Fields used in the query portion. */
10
- export interface NamedField {
11
- /** The effective name of this field. */
12
- name: string;
13
- /** The value of this field. */
14
- field: Field;
15
- }
16
- /** A query sort by field, for determining sort order. */
17
- export interface QuerySortBy {
18
- /** The field to sort on. */
19
- field: Field;
20
- /** The direction to sort in. */
21
- direction: 'ascending' | 'descending';
22
- }
23
- /** Utility functions for quickly creating fields. */
24
- export declare namespace QueryFields {
25
- function named(name: string, field: Field): NamedField;
26
- function sortBy(field: Field, dir: 'ascending' | 'descending'): QuerySortBy;
27
- }
28
- /** A query which should render a list of elements. */
29
- export interface ListQuery {
30
- type: 'list';
31
- /** What should be rendered in the list. */
32
- format?: Field;
33
- /** If true, show the default DI field; otherwise, don't. */
34
- showId: boolean;
35
- }
36
- /** A query which renders a table of elements. */
37
- export interface TableQuery {
38
- type: 'table';
39
- /** The fields (computed or otherwise) to select. */
40
- fields: NamedField[];
41
- /** If true, show the default ID field; otherwise, don't. */
42
- showId: boolean;
43
- }
44
- /** A query which renders a collection of tasks. */
45
- export interface TaskQuery {
46
- type: 'task';
47
- }
48
- /** A query which renders a collection of notes in a calendar view. */
49
- export interface CalendarQuery {
50
- type: 'calendar';
51
- /** The date field that we'll be grouping notes by for the calendar view */
52
- field: NamedField;
53
- }
54
- export type QueryHeader = ListQuery | TableQuery | TaskQuery | CalendarQuery;
55
- /** A step which only retains rows whose 'clause' field is truthy. */
56
- export interface WhereStep {
57
- type: 'where';
58
- clause: Field;
59
- }
60
- /** A step which sorts all current rows by the given list of sorts. */
61
- export interface SortByStep {
62
- type: 'sort';
63
- fields: QuerySortBy[];
64
- }
65
- /** A step which truncates the number of rows to the given amount. */
66
- export interface LimitStep {
67
- type: 'limit';
68
- amount: Field;
69
- }
70
- /** A step which flattens rows into multiple child rows. */
71
- export interface FlattenStep {
72
- type: 'flatten';
73
- field: NamedField;
74
- }
75
- /** A step which groups rows into groups by the given field. */
76
- export interface GroupStep {
77
- type: 'group';
78
- field: NamedField;
79
- }
80
- /** A virtual step which extracts an array of values from each row. */
81
- export interface ExtractStep {
82
- type: 'extract';
83
- fields: Record<string, Field>;
84
- }
85
- export type QueryOperation = WhereStep | SortByStep | LimitStep | FlattenStep | GroupStep | ExtractStep;
86
- /**
87
- * A query over the Obsidian database. Queries have a specific and deterministic execution order:
88
- */
89
- export interface Query {
90
- /** The view type to render this query in. */
91
- header: QueryHeader;
92
- /** The source that file candidates will come from. */
93
- source: Source;
94
- /** The operations to apply to the data to produce the final result that will be rendered. */
95
- operations: QueryOperation[];
96
- }
@@ -1,61 +0,0 @@
1
- /// <reference path="../../library.d.cts" />
2
- export interface QuerySettings {
3
- /** What to render 'null' as in tables. Defaults to '-'. */
4
- renderNullAs: string;
5
- /** If enabled, tasks in Dataview views will automatically have their completion date appended when they are checked. */
6
- taskCompletionTracking: boolean;
7
- /** If enabled, automatic completions will use emoji shorthand ✅ YYYY-MM-DD instead of [completion:: date]. */
8
- taskCompletionUseEmojiShorthand: boolean;
9
- /** 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. */
10
- taskCompletionText: string;
11
- /** Date format of the task's completion timestamp. Only used if completionTracking is enabled and emojiShorthand is not. */
12
- taskCompletionDateFormat: string;
13
- /** Whether or not subtasks should be recursively completed in addition to their parent task. */
14
- recursiveSubTaskCompletion: boolean;
15
- /** If true, render a modal which shows no results were returned. */
16
- warnOnEmptyResult: boolean;
17
- /** Whether or not automatic view refreshing is enabled. */
18
- refreshEnabled: boolean;
19
- /** The interval that views are refreshed, by default. */
20
- refreshInterval: number;
21
- /** The default format that dates are rendered in (using luxon's moment-like formatting). */
22
- defaultDateFormat: string;
23
- /** The default format that date-times are rendered in (using luxon's moment-like formatting). */
24
- defaultDateTimeFormat: string;
25
- /** Maximum depth that objects will be expanded when being rendered recursively. */
26
- maxRecursiveRenderDepth: number;
27
- /** The name of the default ID field ('File'). */
28
- tableIdColumnName: string;
29
- /** The name of default ID fields on grouped data ('Group'). */
30
- tableGroupColumnName: string;
31
- /** Include the result count as part of the output. */
32
- showResultCount: boolean;
33
- }
34
- export declare const DEFAULT_QUERY_SETTINGS: QuerySettings;
35
- export interface ExportSettings {
36
- /** Whether or not HTML should be used for formatting in exports. */
37
- allowHtml: boolean;
38
- }
39
- export declare const DEFAULT_EXPORT_SETTINGS: ExportSettings;
40
- export interface DataviewSettings extends QuerySettings, ExportSettings {
41
- /** The prefix for inline queries by default. */
42
- inlineQueryPrefix: string;
43
- /** The prefix for inline JS queries by default. */
44
- inlineJsQueryPrefix: string;
45
- /** If true, inline queries are also evaluated in full codeblocks. */
46
- inlineQueriesInCodeblocks: boolean;
47
- /** Enable or disable executing DataviewJS queries. */
48
- enableDataviewJs: boolean;
49
- /** Enable or disable regular inline queries. */
50
- enableInlineDataview: boolean;
51
- /** Enable or disable executing inline DataviewJS queries. */
52
- enableInlineDataviewJs: boolean;
53
- /** Enable or disable rendering inline fields prettily in Reading View. */
54
- prettyRenderInlineFields: boolean;
55
- /** Enable or disable rendering inline fields prettily in Live Preview. */
56
- prettyRenderInlineFieldsInLivePreview: boolean;
57
- /** The keyword for DataviewJS blocks. */
58
- dataviewJsKeyword: string;
59
- }
60
- /** Default settings for dataview on install. */
61
- export declare const DEFAULT_SETTINGS: DataviewSettings;
@@ -1,29 +0,0 @@
1
- /// <reference path="../../../library.d.cts" />
2
- import type { Plugin } from 'obsidian' with { 'resolution-mode': 'import' };
3
- import type { DataviewApi } from '../api/plugin-api.d.cjs';
4
-
5
- declare module 'obsidian' {
6
- interface MetadataCache {
7
- trigger(...args: Parameters<MetadataCache['on']>): void;
8
- trigger(name: string, ...data: any[]): void;
9
- }
10
-
11
- interface Workspace {
12
- /** Sent to rendered dataview components to tell them to possibly refresh */
13
- on(name: 'dataview:refresh-views', callback: () => void, ctx?: any): EventRef;
14
- }
15
- }
16
-
17
- declare global {
18
- interface Window {
19
- DataviewAPI?: DataviewApi;
20
- }
21
- }
22
-
23
- declare module '@obsidian-typings/obsidian-public-latest' {
24
- interface PluginsPluginsRecord {
25
- dataview?: Plugin & {
26
- api: DataviewApi;
27
- };
28
- }
29
- }
@@ -1,5 +0,0 @@
1
- /// <reference path="../../../library.d.cts" />
2
- declare module 'web-worker:*' {
3
- const WorkerFactory: new (options: any) => Worker;
4
- export default WorkerFactory;
5
- }
@@ -1,16 +0,0 @@
1
- /// <reference path="../../../../library.d.cts" />
2
- import type { SListItem } from '../../data-model/serialized/markdown.d.cjs';
3
- import type {
4
- Grouping,
5
- Literal
6
- } from '../../data-model/value.d.cjs';
7
- import type {
8
- ExportSettings,
9
- QuerySettings
10
- } from '../../settings.d.cjs';
11
- /** Render a table of literals to Markdown. */
12
- export declare function markdownTable(headers: string[], values: Literal[][], settings?: QuerySettings & ExportSettings): string;
13
- /** Render a list of literal elements to a markdown list. */
14
- export declare function markdownList(values: Literal[], settings?: QuerySettings & ExportSettings): string;
15
- /** Render the result of a task query to markdown. */
16
- export declare function markdownTaskList(tasks: Grouping<SListItem>, settings?: QuerySettings & ExportSettings, depth?: number): string;
@@ -1,38 +0,0 @@
1
- /// <reference path="../../../library.d.cts" />
2
- import type {
3
- EditorSelection,
4
- Range
5
- } from '@codemirror/state';
6
- import type {
7
- Decoration,
8
- DecorationSet,
9
- EditorView,
10
- ViewPlugin,
11
- ViewUpdate
12
- } from '@codemirror/view';
13
- import type { SyntaxNode } from '@lezer/common' with { 'resolution-mode': 'import' };
14
- import type {
15
- App,
16
- Component,
17
- TFile
18
- } from 'obsidian';
19
- import type { DataviewApi } from '../api/plugin-api.d.cjs';
20
- import type { FullIndex } from '../data-index/index.d.cjs';
21
- import type { DataviewSettings } from '../settings.d.cjs';
22
- export declare function selectionAndRangeOverlap(selection: EditorSelection, rangeFrom: number, rangeTo: number): boolean;
23
- export declare function inlinePlugin(app: App, index: FullIndex, settings: DataviewSettings, api: DataviewApi): ViewPlugin<{
24
- decorations: DecorationSet;
25
- component: Component;
26
- update(update: ViewUpdate): void;
27
- updateTree(view: EditorView): void;
28
- removeDeco(node: SyntaxNode): void;
29
- addDeco(node: SyntaxNode, view: EditorView): void;
30
- renderNode(view: EditorView, node: SyntaxNode): {
31
- render: boolean;
32
- isQuery: boolean;
33
- };
34
- isInlineQuery(view: EditorView, start: number, end: number): boolean;
35
- inlineRender(view: EditorView): DecorationSet | undefined;
36
- renderWidget(node: SyntaxNode, view: EditorView, currentFile: TFile): Range<Decoration> | undefined;
37
- destroy(): void;
38
- }>;