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.
- package/CHANGELOG.md +9 -0
- package/README.md +0 -3
- package/dist/lib/@types/debug.d.mts +1 -16
- package/dist/lib/Async.d.mts +1 -153
- package/dist/lib/Blob.d.mts +1 -40
- package/dist/lib/CssClass.d.mts +1 -97
- package/dist/lib/Debug.d.mts +1 -41
- package/dist/lib/DebugController.d.mts +1 -85
- package/dist/lib/Enum.d.mts +1 -20
- package/dist/lib/Error.d.mts +1 -45
- package/dist/lib/Function.d.mts +1 -28
- package/dist/lib/HTMLElement.d.mts +1 -49
- package/dist/lib/Library.cjs +1 -1
- package/dist/lib/Library.d.mts +1 -16
- package/dist/lib/Library.mjs +1 -1
- package/dist/lib/Object.d.mts +1 -211
- package/dist/lib/Path.d.mts +1 -133
- package/dist/lib/RegExp.d.mts +1 -18
- package/dist/lib/ScriptUtils/CliUtils.d.mts +1 -70
- package/dist/lib/ScriptUtils/CodeGenerator.d.mts +1 -12
- package/dist/lib/ScriptUtils/ESLint/@types/@guardian__eslint-plugin-tsdoc-required.d.mts +1 -13
- package/dist/lib/ScriptUtils/ESLint/@types/eslint-plugin-modules-newlines.d.mts +1 -13
- package/dist/lib/ScriptUtils/ESLint/@types/eslint-plugin-verify-tsdoc.d.mts +1 -13
- package/dist/lib/ScriptUtils/ESLint/ESLint.d.mts +1 -13
- package/dist/lib/ScriptUtils/ESLint/eslint.config.d.mts +1 -16
- package/dist/lib/ScriptUtils/ESLint/index.d.mts +1 -2
- package/dist/lib/ScriptUtils/Exec.d.mts +1 -83
- package/dist/lib/ScriptUtils/Fs.d.mts +1 -72
- package/dist/lib/ScriptUtils/JSON.d.mts +1 -64
- package/dist/lib/ScriptUtils/NodeModules.d.mts +1 -14
- package/dist/lib/ScriptUtils/Npm.d.mts +1 -151
- package/dist/lib/ScriptUtils/NpmPublish.d.mts +1 -9
- package/dist/lib/ScriptUtils/ObsidianDevUtilsRepoPaths.d.mts +1 -88
- package/dist/lib/ScriptUtils/Root.d.mts +1 -67
- package/dist/lib/ScriptUtils/build.d.mts +1 -41
- package/dist/lib/ScriptUtils/cli.d.mts +1 -14
- package/dist/lib/ScriptUtils/esbuild/Dependency.d.mts +1 -18
- package/dist/lib/ScriptUtils/esbuild/ObsidianPluginBuilder.d.mts +1 -53
- package/dist/lib/ScriptUtils/esbuild/changeExtensionPlugin.d.mts +1 -12
- package/dist/lib/ScriptUtils/esbuild/copyToObsidianPluginsFolderPlugin.d.mts +1 -18
- package/dist/lib/ScriptUtils/esbuild/fixEsmPlugin.d.mts +1 -11
- package/dist/lib/ScriptUtils/esbuild/fixSourceMapsPlugin.d.mts +1 -17
- package/dist/lib/ScriptUtils/esbuild/index.d.mts +1 -9
- package/dist/lib/ScriptUtils/esbuild/preprocessPlugin.d.mts +1 -23
- package/dist/lib/ScriptUtils/esbuild/renameCssPlugin.d.mts +1 -8
- package/dist/lib/ScriptUtils/esbuild/svelteWrapperPlugin.d.mts +1 -8
- package/dist/lib/ScriptUtils/format.d.mts +1 -10
- package/dist/lib/ScriptUtils/index.d.mts +1 -17
- package/dist/lib/ScriptUtils/spellcheck.d.mts +1 -14
- package/dist/lib/ScriptUtils/version.d.mts +1 -171
- package/dist/lib/String.d.mts +1 -138
- package/dist/lib/Transformers/DateTransformer.d.mts +1 -35
- package/dist/lib/Transformers/DurationTransformer.d.mts +1 -34
- package/dist/lib/Transformers/GroupTransformer.d.mts +1 -65
- package/dist/lib/Transformers/SkipPrivatePropertyTransformer.d.mts +1 -32
- package/dist/lib/Transformers/Transformer.d.mts +1 -67
- package/dist/lib/Transformers/TypedTransformer.d.mts +1 -37
- package/dist/lib/Transformers/index.d.mts +1 -6
- package/dist/lib/ValueProvider.d.mts +1 -22
- package/dist/lib/codemirror/StateFieldSpec.d.mts +1 -68
- package/dist/lib/codemirror/index.d.mts +1 -1
- package/dist/lib/index.d.mts +1 -20
- package/dist/lib/obsidian/@types/Dataview/api/data-array.d.mts +1 -136
- package/dist/lib/obsidian/@types/Dataview/api/extensions.d.mts +1 -15
- package/dist/lib/obsidian/@types/Dataview/api/inline-api.d.mts +1 -186
- package/dist/lib/obsidian/@types/Dataview/api/plugin-api.d.mts +1 -209
- package/dist/lib/obsidian/@types/Dataview/api/result.d.mts +1 -38
- package/dist/lib/obsidian/@types/Dataview/data-import/common.d.mts +1 -3
- package/dist/lib/obsidian/@types/Dataview/data-import/csv.d.mts +1 -3
- package/dist/lib/obsidian/@types/Dataview/data-import/inline-field.d.mts +1 -42
- package/dist/lib/obsidian/@types/Dataview/data-import/markdown-file.d.mts +1 -52
- package/dist/lib/obsidian/@types/Dataview/data-import/persister.d.mts +1 -32
- package/dist/lib/obsidian/@types/Dataview/data-import/web-worker/import-entry.d.mts +1 -1
- package/dist/lib/obsidian/@types/Dataview/data-import/web-worker/import-impl.d.mts +1 -6
- package/dist/lib/obsidian/@types/Dataview/data-import/web-worker/import-manager.d.mts +1 -37
- package/dist/lib/obsidian/@types/Dataview/data-index/index.d.mts +1 -186
- package/dist/lib/obsidian/@types/Dataview/data-index/resolver.d.mts +1 -23
- package/dist/lib/obsidian/@types/Dataview/data-index/source.d.mts +1 -71
- package/dist/lib/obsidian/@types/Dataview/data-model/markdown.d.mts +1 -115
- package/dist/lib/obsidian/@types/Dataview/data-model/serialized/markdown.d.mts +1 -106
- package/dist/lib/obsidian/@types/Dataview/data-model/transferable.d.mts +1 -7
- package/dist/lib/obsidian/@types/Dataview/data-model/value.d.mts +1 -175
- package/dist/lib/obsidian/@types/Dataview/expression/binaryop.d.mts +1 -43
- package/dist/lib/obsidian/@types/Dataview/expression/context.d.mts +1 -49
- package/dist/lib/obsidian/@types/Dataview/expression/field.d.mts +1 -82
- package/dist/lib/obsidian/@types/Dataview/expression/functions.d.mts +1 -149
- package/dist/lib/obsidian/@types/Dataview/expression/parse.d.mts +1 -163
- package/dist/lib/obsidian/@types/Dataview/index.d.mts +1 -55
- package/dist/lib/obsidian/@types/Dataview/main.d.mts +1 -52
- package/dist/lib/obsidian/@types/Dataview/query/engine.d.mts +1 -103
- package/dist/lib/obsidian/@types/Dataview/query/parse.d.mts +1 -44
- package/dist/lib/obsidian/@types/Dataview/query/query.d.mts +1 -95
- package/dist/lib/obsidian/@types/Dataview/settings.d.mts +1 -60
- package/dist/lib/obsidian/@types/Dataview/typings/obsidian-ex.d.mts +1 -28
- package/dist/lib/obsidian/@types/Dataview/typings/workers.d.mts +1 -4
- package/dist/lib/obsidian/@types/Dataview/ui/export/markdown.d.mts +1 -15
- package/dist/lib/obsidian/@types/Dataview/ui/lp-render.d.mts +1 -37
- package/dist/lib/obsidian/@types/Dataview/ui/markdown.d.mts +1 -86
- package/dist/lib/obsidian/@types/Dataview/ui/refreshable-view.d.mts +1 -18
- package/dist/lib/obsidian/@types/Dataview/ui/render.d.mts +1 -33
- package/dist/lib/obsidian/@types/Dataview/ui/views/calendar-view.d.mts +1 -17
- package/dist/lib/obsidian/@types/Dataview/ui/views/inline-field-live-preview.d.mts +1 -42
- package/dist/lib/obsidian/@types/Dataview/ui/views/inline-view.d.mts +1 -28
- package/dist/lib/obsidian/@types/Dataview/ui/views/js-view.d.mts +1 -23
- package/dist/lib/obsidian/@types/Dataview/ui/views/list-view.d.mts +1 -25
- package/dist/lib/obsidian/@types/Dataview/ui/views/table-view.d.mts +1 -28
- package/dist/lib/obsidian/@types/Dataview/ui/views/task-view.d.mts +1 -51
- package/dist/lib/obsidian/@types/Dataview/util/hash.d.mts +1 -1
- package/dist/lib/obsidian/@types/Dataview/util/locale.d.mts +1 -2
- package/dist/lib/obsidian/@types/Dataview/util/media.d.mts +1 -6
- package/dist/lib/obsidian/@types/Dataview/util/normalize.d.mts +1 -44
- package/dist/lib/obsidian/App.d.mts +1 -30
- package/dist/lib/obsidian/AttachmentPath.d.mts +1 -54
- package/dist/lib/obsidian/Backlink.d.mts +1 -60
- package/dist/lib/obsidian/Callout.d.mts +1 -55
- package/dist/lib/obsidian/Components/DateComponent.d.mts +1 -36
- package/dist/lib/obsidian/Components/DateTimeComponent.d.mts +1 -36
- package/dist/lib/obsidian/Components/EmailComponent.d.mts +1 -29
- package/dist/lib/obsidian/Components/FileComponent.d.mts +1 -41
- package/dist/lib/obsidian/Components/MonthComponent.d.mts +1 -49
- package/dist/lib/obsidian/Components/MultipleDropdownComponent.d.mts +1 -73
- package/dist/lib/obsidian/Components/MultipleEmailComponent.d.mts +1 -36
- package/dist/lib/obsidian/Components/MultipleFileComponent.d.mts +1 -41
- package/dist/lib/obsidian/Components/MultipleTextComponent.d.mts +1 -67
- package/dist/lib/obsidian/Components/NumberComponent.d.mts +1 -29
- package/dist/lib/obsidian/Components/TimeComponent.d.mts +1 -37
- package/dist/lib/obsidian/Components/TypedRangeTextComponent.d.mts +1 -31
- package/dist/lib/obsidian/Components/TypedTextComponent.d.mts +1 -84
- package/dist/lib/obsidian/Components/UrlComponent.d.mts +1 -29
- package/dist/lib/obsidian/Components/ValidatorComponent.d.mts +1 -22
- package/dist/lib/obsidian/Components/ValueComponentWithChangeTracking.d.mts +1 -17
- package/dist/lib/obsidian/Components/WeekComponent.d.mts +1 -49
- package/dist/lib/obsidian/Components/index.d.mts +1 -17
- package/dist/lib/obsidian/Dataview.d.mts +1 -215
- package/dist/lib/obsidian/DataviewLink.d.mts +1 -23
- package/dist/lib/obsidian/FileChange.d.mts +1 -68
- package/dist/lib/obsidian/FileManager.d.mts +1 -38
- package/dist/lib/obsidian/FileSystem.d.mts +1 -185
- package/dist/lib/obsidian/Frontmatter.d.mts +1 -69
- package/dist/lib/obsidian/Link.d.mts +1 -366
- package/dist/lib/obsidian/Logger.d.mts +1 -13
- package/dist/lib/obsidian/Loop.d.mts +1 -36
- package/dist/lib/obsidian/Markdown.d.mts +1 -24
- package/dist/lib/obsidian/MarkdownCodeBlockProcessor.d.mts +1 -23
- package/dist/lib/obsidian/MarkdownView.d.mts +1 -12
- package/dist/lib/obsidian/MetadataCache.d.mts +1 -87
- package/dist/lib/obsidian/Modals/Alert.d.mts +1 -39
- package/dist/lib/obsidian/Modals/Confirm.d.mts +1 -43
- package/dist/lib/obsidian/Modals/ModalBase.d.mts +1 -35
- package/dist/lib/obsidian/Modals/Prompt.d.mts +1 -50
- package/dist/lib/obsidian/Modals/SelectItem.d.mts +1 -41
- package/dist/lib/obsidian/Modals/index.d.mts +1 -5
- package/dist/lib/obsidian/ObsidianSettings.d.mts +1 -17
- package/dist/lib/obsidian/Pdf.d.mts +1 -24
- package/dist/lib/obsidian/Plugin/EmptySettings.d.mts +1 -14
- package/dist/lib/obsidian/Plugin/ObsidianPluginRepoPaths.d.mts +1 -55
- package/dist/lib/obsidian/Plugin/Plugin.d.mts +1 -21
- package/dist/lib/obsidian/Plugin/PluginBase.d.mts +1 -108
- package/dist/lib/obsidian/Plugin/PluginContext.d.mts +1 -12
- package/dist/lib/obsidian/Plugin/PluginId.d.mts +1 -20
- package/dist/lib/obsidian/Plugin/PluginSettingsBase.d.mts +1 -31
- package/dist/lib/obsidian/Plugin/PluginSettingsTabBase.d.mts +1 -99
- package/dist/lib/obsidian/Plugin/index.d.mts +1 -8
- package/dist/lib/obsidian/Queue.d.mts +1 -30
- package/dist/lib/obsidian/Reference.d.mts +1 -21
- package/dist/lib/obsidian/RenameDeleteHandler.d.mts +1 -49
- package/dist/lib/obsidian/ResourceUrl.d.mts +1 -14
- package/dist/lib/obsidian/SettingEx.d.mts +1 -124
- package/dist/lib/obsidian/Vault.d.mts +1 -130
- package/dist/lib/obsidian/VaultEx.d.mts +1 -27
- package/dist/lib/obsidian/index.d.mts +1 -29
- package/dist/lib/url.d.mts +1 -11
- package/package.json +11 -11
@@ -1,209 +1 @@
|
|
1
|
-
|
2
|
-
import type { CompareOperator } from 'compare-versions';
|
3
|
-
import type {
|
4
|
-
DateTime,
|
5
|
-
Duration
|
6
|
-
} from 'luxon';
|
7
|
-
import * as Luxon from 'luxon';
|
8
|
-
import type {
|
9
|
-
App,
|
10
|
-
Component,
|
11
|
-
MarkdownPostProcessorContext
|
12
|
-
} from 'obsidian';
|
13
|
-
import type { Result } from '../api/result.d.mjs';
|
14
|
-
import type { FullIndex } from '../data-index/index.d.mjs';
|
15
|
-
import type { SListItem } from '../data-model/serialized/markdown.d.mjs';
|
16
|
-
import type {
|
17
|
-
DataObject,
|
18
|
-
Grouping,
|
19
|
-
Link,
|
20
|
-
Literal,
|
21
|
-
Values,
|
22
|
-
Widgets
|
23
|
-
} from '../data-model/value.d.mjs';
|
24
|
-
import type { Context } from '../expression/context.d.mjs';
|
25
|
-
import type { BoundFunctionImpl } from '../expression/functions.d.mjs';
|
26
|
-
import type { IdentifierMeaning } from '../query/engine.d.mjs';
|
27
|
-
import type { Query } from '../query/query.d.mjs';
|
28
|
-
import type {
|
29
|
-
DataviewSettings,
|
30
|
-
ExportSettings
|
31
|
-
} from '../settings.d.mjs';
|
32
|
-
import type { DataArray } from './data-array.d.mjs';
|
33
|
-
/** Asynchronous API calls related to file / system IO. */
|
34
|
-
export declare class DataviewIOApi {
|
35
|
-
api: DataviewApi;
|
36
|
-
constructor(api: DataviewApi);
|
37
|
-
/** Load the contents of a CSV asynchronously, returning a data array of rows (or undefined if it does not exist). */
|
38
|
-
csv(path: Link | string, originFile?: string): Promise<DataArray<DataObject> | undefined>;
|
39
|
-
/** Asynchronously load the contents of any link or path in an Obsidian vault. */
|
40
|
-
load(path: Link | string, originFile?: string): Promise<string | undefined>;
|
41
|
-
/** Normalize a link or path relative to an optional origin file. Returns a textual fully-qualified-path. */
|
42
|
-
normalize(path: Link | string, originFile?: string): string;
|
43
|
-
}
|
44
|
-
/** Global API for accessing the Dataview API, executing dataview queries, and */
|
45
|
-
export declare class DataviewApi {
|
46
|
-
app: App;
|
47
|
-
index: FullIndex;
|
48
|
-
settings: DataviewSettings;
|
49
|
-
private verNum;
|
50
|
-
/** Evaluation context which expressions can be evaluated in. */
|
51
|
-
evaluationContext: Context;
|
52
|
-
/** IO API which supports asynchronous loading of data directly. */
|
53
|
-
io: DataviewIOApi;
|
54
|
-
/** Dataview functions which can be called from DataviewJS. */
|
55
|
-
func: Record<string, BoundFunctionImpl>;
|
56
|
-
/** Value utility functions for comparisons and type-checking. */
|
57
|
-
value: typeof Values;
|
58
|
-
/** Widget utility functions for creating built-in widgets. */
|
59
|
-
widget: typeof Widgets;
|
60
|
-
/** Re-exporting of luxon for people who can't easily require it. Sorry! */
|
61
|
-
luxon: typeof Luxon;
|
62
|
-
constructor(app: App, index: FullIndex, settings: DataviewSettings, verNum: string);
|
63
|
-
/** Utilities to check the current Dataview version and compare it to SemVer version ranges. */
|
64
|
-
version: {
|
65
|
-
current: string;
|
66
|
-
compare: (op: CompareOperator, ver: string) => boolean;
|
67
|
-
satisfies: (range: string) => boolean;
|
68
|
-
};
|
69
|
-
/** Return an array of paths (as strings) corresponding to pages which match the query. */
|
70
|
-
pagePaths(query?: string, originFile?: string): DataArray<string>;
|
71
|
-
/** Map a page path to the actual data contained within that page. */
|
72
|
-
page(path: string | Link, originFile?: string): Record<string, Literal> | undefined;
|
73
|
-
/** Return an array of page objects corresponding to pages which match the source query. */
|
74
|
-
pages(query?: string, originFile?: string): DataArray<Record<string, Literal>>;
|
75
|
-
/** Remaps important metadata to add data arrays. */
|
76
|
-
private _addDataArrays;
|
77
|
-
/**
|
78
|
-
* Convert an input element or array into a Dataview data-array. If the input is already a data array,
|
79
|
-
* it is returned unchanged.
|
80
|
-
*/
|
81
|
-
array(raw: unknown): DataArray<any>;
|
82
|
-
/** Return true if the given value is a javascript array OR a dataview data array. */
|
83
|
-
isArray(raw: unknown): raw is DataArray<any> | Array<any>;
|
84
|
-
/** Return true if the given value is a dataview data array; this returns FALSE for plain JS arrays. */
|
85
|
-
isDataArray(raw: unknown): raw is DataArray<any>;
|
86
|
-
/** Create a dataview file link to the given path. */
|
87
|
-
fileLink(path: string, embed?: boolean, display?: string): Link;
|
88
|
-
/** Create a dataview section link to the given path. */
|
89
|
-
sectionLink(path: string, section: string, embed?: boolean, display?: string): Link;
|
90
|
-
/** Create a dataview block link to the given path. */
|
91
|
-
blockLink(path: string, blockId: string, embed?: boolean, display?: string): Link;
|
92
|
-
/** Attempt to extract a date from a string, link or date. */
|
93
|
-
date(pathlike: string | Link | DateTime): DateTime | null;
|
94
|
-
/** Attempt to extract a duration from a string or duration. */
|
95
|
-
duration(str: string | Duration): Duration | null;
|
96
|
-
/** Parse a raw textual value into a complex Dataview type, if possible. */
|
97
|
-
parse(value: string): Literal;
|
98
|
-
/** Convert a basic JS type into a Dataview type by parsing dates, links, durations, and so on. */
|
99
|
-
literal(value: any): Literal;
|
100
|
-
/** Deep clone the given literal, returning a new literal which is independent of the original. */
|
101
|
-
clone(value: Literal): Literal;
|
102
|
-
/**
|
103
|
-
* Compare two arbitrary JavaScript values using Dataview's default comparison rules. Returns a negative value if
|
104
|
-
* a < b, 0 if a = b, and a positive value if a > b.
|
105
|
-
*/
|
106
|
-
compare(a: any, b: any): number;
|
107
|
-
/** Return true if the two given JavaScript values are equal using Dataview's default comparison rules. */
|
108
|
-
equal(a: any, b: any): boolean;
|
109
|
-
/**
|
110
|
-
* Execute an arbitrary Dataview query, returning a query result which:
|
111
|
-
*
|
112
|
-
* 1. Indicates the type of query,
|
113
|
-
* 2. Includes the raw AST of the parsed query.
|
114
|
-
* 3. Includes the output in the form relevant to that query type.
|
115
|
-
*
|
116
|
-
* List queries will return a list of objects ({ id, value }); table queries return a header array
|
117
|
-
* and a 2D array of values; and task arrays return a Grouping<Task> type which allows for recursive
|
118
|
-
* task nesting.
|
119
|
-
*/
|
120
|
-
query(source: string | Query, originFile?: string, settings?: QueryApiSettings): Promise<Result<QueryResult, string>>;
|
121
|
-
/** Error-throwing version of {@link query}. */
|
122
|
-
tryQuery(source: string, originFile?: string, settings?: QueryApiSettings): Promise<QueryResult>;
|
123
|
-
/** Execute an arbitrary dataview query, returning the results in well-formatted markdown. */
|
124
|
-
queryMarkdown(source: string | Query, originFile?: string, settings?: Partial<QueryApiSettings & ExportSettings>): Promise<Result<string, string>>;
|
125
|
-
/** Error-throwing version of {@link queryMarkdown}. */
|
126
|
-
tryQueryMarkdown(source: string | Query, originFile?: string, settings?: Partial<QueryApiSettings & ExportSettings>): Promise<string>;
|
127
|
-
/**
|
128
|
-
* Evaluate a dataview expression (like '2 + 2' or 'link("hello")'), returning the evaluated result.
|
129
|
-
* This takes an optional second argument which provides definitions for variables, such as:
|
130
|
-
*
|
131
|
-
* ```
|
132
|
-
* dv.evaluate("x + 6", { x: 2 }) = 8
|
133
|
-
* dv.evaluate('link(target)', { target: "Okay" }) = [[Okay]]
|
134
|
-
* ```
|
135
|
-
*
|
136
|
-
* This method returns a Result type instead of throwing an error; you can check the result of the
|
137
|
-
* execution via `result.successful` and obtain `result.value` or `result.error` accordingly. If
|
138
|
-
* you'd rather this method throw on an error, use `dv.tryEvaluate`.
|
139
|
-
*/
|
140
|
-
evaluate(expression: string, context?: DataObject, originFile?: string): Result<Literal, string>;
|
141
|
-
/** Error-throwing version of `dv.evaluate`. */
|
142
|
-
tryEvaluate(expression: string, context?: DataObject, originFile?: string): Literal;
|
143
|
-
/** Evaluate an expression in the context of the given file. */
|
144
|
-
evaluateInline(expression: string, origin: string): Result<Literal, string>;
|
145
|
-
/**
|
146
|
-
* Execute the given query, rendering results into the given container using the components lifecycle.
|
147
|
-
* Your component should be a *real* component which calls onload() on it's child components at some point,
|
148
|
-
* or a MarkdownPostProcessorContext!
|
149
|
-
*
|
150
|
-
* Note that views made in this way are live updating and will automatically clean themselves up when
|
151
|
-
* the component is unloaded or the container is removed.
|
152
|
-
*/
|
153
|
-
execute(source: string, container: HTMLElement, component: Component | MarkdownPostProcessorContext, filePath: string): Promise<void>;
|
154
|
-
/**
|
155
|
-
* Execute the given DataviewJS query, rendering results into the given container using the components lifecycle.
|
156
|
-
* See {@link execute} for general rendering semantics.
|
157
|
-
*/
|
158
|
-
executeJs(code: string, container: HTMLElement, component: Component | MarkdownPostProcessorContext, filePath: string): Promise<void>;
|
159
|
-
/** Render a dataview list of the given values. */
|
160
|
-
list(values: any[] | DataArray<any> | undefined, container: HTMLElement, component: Component, filePath: string): Promise<void>;
|
161
|
-
/** Render a dataview table with the given headers, and the 2D array of values. */
|
162
|
-
table(headers: string[], values: any[][] | DataArray<any> | undefined, container: HTMLElement, component: Component, filePath: string): Promise<void>;
|
163
|
-
/** Render a dataview task view with the given tasks. */
|
164
|
-
taskList(tasks: Grouping<SListItem>, groupByFile: boolean | undefined, container: HTMLElement, component: Component, filePath?: string): Promise<void>;
|
165
|
-
/** Render an arbitrary value into a container. */
|
166
|
-
renderValue(value: any, container: HTMLElement, component: Component, filePath: string, inline?: boolean): Promise<void>;
|
167
|
-
/** Render data to a markdown table. */
|
168
|
-
markdownTable(headers: string[] | undefined, values: any[][] | DataArray<any> | undefined, settings?: Partial<ExportSettings>): string;
|
169
|
-
/** Render data to a markdown list. */
|
170
|
-
markdownList(values: any[] | DataArray<any> | undefined, settings?: Partial<ExportSettings>): string;
|
171
|
-
/** Render tasks or list items to a markdown task list. */
|
172
|
-
markdownTaskList(values: Grouping<SListItem>, settings?: Partial<ExportSettings>): string;
|
173
|
-
}
|
174
|
-
/** The result of executing a table query. */
|
175
|
-
export type TableResult = {
|
176
|
-
type: 'table';
|
177
|
-
headers: string[];
|
178
|
-
values: Literal[][];
|
179
|
-
idMeaning: IdentifierMeaning;
|
180
|
-
};
|
181
|
-
/** The result of executing a list query. */
|
182
|
-
export type ListResult = {
|
183
|
-
type: 'list';
|
184
|
-
values: Literal[];
|
185
|
-
primaryMeaning: IdentifierMeaning;
|
186
|
-
};
|
187
|
-
/** The result of executing a task query. */
|
188
|
-
export type TaskResult = {
|
189
|
-
type: 'task';
|
190
|
-
values: Grouping<SListItem>;
|
191
|
-
};
|
192
|
-
/** The result of executing a calendar query. */
|
193
|
-
export type CalendarResult = {
|
194
|
-
type: 'calendar';
|
195
|
-
values: {
|
196
|
-
date: DateTime;
|
197
|
-
link: Link;
|
198
|
-
value?: Literal[];
|
199
|
-
}[];
|
200
|
-
};
|
201
|
-
/** The result of executing a query of some sort. */
|
202
|
-
export type QueryResult = TableResult | ListResult | TaskResult | CalendarResult;
|
203
|
-
/** Settings when querying the dataview API. */
|
204
|
-
export type QueryApiSettings = {
|
205
|
-
/** If present, then this forces queries to include/exclude the implicit id field (such as with `WITHOUT ID`). */
|
206
|
-
forceId?: boolean;
|
207
|
-
};
|
208
|
-
/** Determines if source-path has a `?no-dataview` annotation that disables dataview. */
|
209
|
-
export declare function isDataviewDisabled(sourcePath: string): boolean;
|
1
|
+
export * from './plugin-api.cjs';
|
@@ -1,38 +1 @@
|
|
1
|
-
|
2
|
-
export declare class Success<T, E> {
|
3
|
-
value: T;
|
4
|
-
successful: true;
|
5
|
-
constructor(value: T);
|
6
|
-
map<U>(f: (a: T) => U): Result<U, E>;
|
7
|
-
flatMap<U>(f: (a: T) => Result<U, E>): Result<U, E>;
|
8
|
-
mapErr<U>(f: (e: E) => U): Result<T, U>;
|
9
|
-
bimap<T2, E2>(succ: (a: T) => T2, _fail: (b: E) => E2): Result<T2, E2>;
|
10
|
-
orElse(_value: T): T;
|
11
|
-
cast<U>(): Result<U, E>;
|
12
|
-
orElseThrow(_message?: (e: E) => string): T;
|
13
|
-
}
|
14
|
-
/** Functional return type for error handling. */
|
15
|
-
export declare class Failure<T, E> {
|
16
|
-
error: E;
|
17
|
-
successful: false;
|
18
|
-
constructor(error: E);
|
19
|
-
map<U>(_f: (a: T) => U): Result<U, E>;
|
20
|
-
flatMap<U>(_f: (a: T) => Result<U, E>): Result<U, E>;
|
21
|
-
mapErr<U>(f: (e: E) => U): Result<T, U>;
|
22
|
-
bimap<T2, E2>(_succ: (a: T) => T2, fail: (b: E) => E2): Result<T2, E2>;
|
23
|
-
orElse(value: T): T;
|
24
|
-
cast<U>(): Result<U, E>;
|
25
|
-
orElseThrow(message?: (e: E) => string): T;
|
26
|
-
}
|
27
|
-
export type Result<T, E> = Success<T, E> | Failure<T, E>;
|
28
|
-
/** Monadic 'Result' type which encapsulates whether a procedure succeeded or failed, as well as it's return value. */
|
29
|
-
export declare namespace Result {
|
30
|
-
/** Construct a new success result wrapping the given value. */
|
31
|
-
function success<T, E>(value: T): Result<T, E>;
|
32
|
-
/** Construct a new failure value wrapping the given error. */
|
33
|
-
function failure<T, E>(error: E): Result<T, E>;
|
34
|
-
/** Join two results with a bi-function and return a new result. */
|
35
|
-
function flatMap2<T1, T2, O, E>(first: Result<T1, E>, second: Result<T2, E>, f: (a: T1, b: T2) => Result<O, E>): Result<O, E>;
|
36
|
-
/** Join two results with a bi-function and return a new result. */
|
37
|
-
function map2<T1, T2, O, E>(first: Result<T1, E>, second: Result<T2, E>, f: (a: T1, b: T2) => O): Result<O, E>;
|
38
|
-
}
|
1
|
+
export * from './result.cjs';
|
@@ -1,42 +1 @@
|
|
1
|
-
|
2
|
-
import type { Literal } from '../data-model/value.d.mjs';
|
3
|
-
/** A parsed inline field. */
|
4
|
-
export interface InlineField {
|
5
|
-
/** The raw parsed key. */
|
6
|
-
key: string;
|
7
|
-
/** The raw value of the field. */
|
8
|
-
value: string;
|
9
|
-
/** The start column of the field. */
|
10
|
-
start: number;
|
11
|
-
/** The start column of the *value* for the field. */
|
12
|
-
startValue: number;
|
13
|
-
/** The end column of the field. */
|
14
|
-
end: number;
|
15
|
-
/** If this inline field was defined via a wrapping ('[' or '('), then the wrapping that was used. */
|
16
|
-
wrapping?: string;
|
17
|
-
}
|
18
|
-
/** The wrapper characters that can be used to define an inline field. */
|
19
|
-
export declare const INLINE_FIELD_WRAPPERS: Readonly<Record<string, string>>;
|
20
|
-
/** Parse a textual inline field value into something we can work with. */
|
21
|
-
export declare function parseInlineValue(value: string): Literal;
|
22
|
-
/** Extracts inline fields of the form '[key:: value]' from a line of text. This is done in a relatively
|
23
|
-
* "robust" way to avoid failing due to bad nesting or other interfering Markdown symbols:
|
24
|
-
*
|
25
|
-
* - Look for any wrappers ('[' and '(') in the line, trying to parse whatever comes after it as an inline key::.
|
26
|
-
* - If successful, scan until you find a matching end bracket, and parse whatever remains as an inline value.
|
27
|
-
*/
|
28
|
-
export declare function extractInlineFields(line: string, includeTaskFields?: boolean): InlineField[];
|
29
|
-
/** Attempt to extract a full-line field (Key:: Value consuming the entire content line). */
|
30
|
-
export declare function extractFullLineField(text: string): InlineField | undefined;
|
31
|
-
export declare const CREATED_DATE_REGEX: RegExp;
|
32
|
-
export declare const DUE_DATE_REGEX: RegExp;
|
33
|
-
export declare const DONE_DATE_REGEX: RegExp;
|
34
|
-
export declare const SCHEDULED_DATE_REGEX: RegExp;
|
35
|
-
export declare const START_DATE_REGEX: RegExp;
|
36
|
-
export declare const EMOJI_REGEXES: {
|
37
|
-
regex: RegExp;
|
38
|
-
key: string;
|
39
|
-
}[];
|
40
|
-
/** Sets or replaces the value of an inline field; if the value is 'undefined', deletes the key. */
|
41
|
-
export declare function setInlineField(source: string, key: string, value?: string): string;
|
42
|
-
export declare function setEmojiShorthandCompletionField(source: string, value?: string): string;
|
1
|
+
export * from './inline-field.cjs';
|
@@ -1,52 +1 @@
|
|
1
|
-
|
2
|
-
import type {
|
3
|
-
CachedMetadata,
|
4
|
-
FileStats,
|
5
|
-
FrontMatterCache,
|
6
|
-
HeadingCache
|
7
|
-
} from 'obsidian';
|
8
|
-
import type { InlineField } from '../data-import/inline-field.d.mjs';
|
9
|
-
import type {
|
10
|
-
ListItem,
|
11
|
-
PageMetadata
|
12
|
-
} from '../data-model/markdown.d.mjs';
|
13
|
-
import type {
|
14
|
-
Link,
|
15
|
-
Literal
|
16
|
-
} from '../data-model/value.d.mjs';
|
17
|
-
/** Extract markdown metadata from the given Obsidian markdown file. */
|
18
|
-
export declare function parsePage(path: string, contents: string, stat: FileStats, metadata: CachedMetadata): PageMetadata;
|
19
|
-
/** Extract tags intelligently from frontmatter. Handles arrays, numbers, and strings. */
|
20
|
-
export declare function extractTags(metadata: FrontMatterCache): string[];
|
21
|
-
/** Extract aliases intelligently from frontmatter. Handles arrays, numbers, and strings. */
|
22
|
-
export declare function extractAliases(metadata: FrontMatterCache): string[];
|
23
|
-
/** Split a frontmatter list into separate elements; handles actual lists, comma separated lists, and single elements. */
|
24
|
-
export declare function splitFrontmatterTagOrAlias(data: any, on: RegExp): string[];
|
25
|
-
/** Parse raw (newline-delimited) markdown, returning inline fields, list items, and other metadata. */
|
26
|
-
export declare function parseMarkdown(path: string, contents: string[], metadata: CachedMetadata, linksByLine: Record<number, Link[]>): {
|
27
|
-
fields: Map<string, Literal[]>;
|
28
|
-
lists: ListItem[];
|
29
|
-
};
|
30
|
-
export declare const LIST_ITEM_REGEX: RegExp;
|
31
|
-
/**
|
32
|
-
* Parse list items from the page + metadata. This requires some additional parsing above whatever Obsidian provides,
|
33
|
-
* since Obsidian only gives line numbers.
|
34
|
-
*/
|
35
|
-
export declare function parseLists(
|
36
|
-
path: string,
|
37
|
-
content: string[],
|
38
|
-
metadata: CachedMetadata,
|
39
|
-
linksByLine: Record<number, Link[]>
|
40
|
-
): [ListItem[], Map<string, Literal[]>];
|
41
|
-
/** Recursively convert frontmatter into fields. We have to dance around YAML structure. */
|
42
|
-
export declare function parseFrontmatter(value: any): Literal;
|
43
|
-
/** Add a parsed inline field to the output map. */
|
44
|
-
export declare function addRawInlineField(field: InlineField, output: Map<string, Literal[]>): void;
|
45
|
-
/** Add a raw inline field to an output map, canonicalizing as needed. */
|
46
|
-
export declare function addInlineField(key: string, value: Literal, output: Map<string, Literal[]>): void;
|
47
|
-
/** Given a raw list of inline field values, add normalized keys and squash them. */
|
48
|
-
export declare function finalizeInlineFields(fields: Map<string, Literal[]>): Map<string, Literal>;
|
49
|
-
/** Copy all fields of 'source' into 'target'. */
|
50
|
-
export declare function mergeFieldGroups(target: Map<string, Literal[]>, source: Map<string, Literal[]>): void;
|
51
|
-
/** Find the header that is most immediately above the given line number. */
|
52
|
-
export declare function findPreviousHeader(line: number, headers: HeadingCache[]): string | undefined;
|
1
|
+
export * from './markdown-file.cjs';
|
@@ -1,32 +1 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
import type { PageMetadata } from '../data-model/markdown.d.mjs';
|
4
|
-
/** A piece of data that has been cached for a specific version and time. */
|
5
|
-
export interface Cached<T> {
|
6
|
-
/** The version of Dataview that the data was written to cache with. */
|
7
|
-
version: string;
|
8
|
-
/** The time that the data was written to cache. */
|
9
|
-
time: number;
|
10
|
-
/** The data that was cached. */
|
11
|
-
data: T;
|
12
|
-
}
|
13
|
-
/** Simpler wrapper for a file-backed cache for arbitrary metadata. */
|
14
|
-
export declare class LocalStorageCache {
|
15
|
-
appId: string;
|
16
|
-
version: string;
|
17
|
-
persister: LocalForage;
|
18
|
-
constructor(appId: string, version: string);
|
19
|
-
/** Drop the entire cache instance and re-create a new fresh instance. */
|
20
|
-
recreate(): Promise<void>;
|
21
|
-
/** Load file metadata by path. */
|
22
|
-
loadFile(path: string): Promise<Cached<Partial<PageMetadata>> | null | undefined>;
|
23
|
-
/** Store file metadata by path. */
|
24
|
-
storeFile(path: string, data: Partial<PageMetadata>): Promise<void>;
|
25
|
-
/** Drop old file keys that no longer exist. */
|
26
|
-
synchronize(existing: string[] | Set<string>): Promise<Set<string>>;
|
27
|
-
/** Obtain a list of all metadata keys. */
|
28
|
-
allKeys(): Promise<string[]>;
|
29
|
-
/** Obtain a list of all persisted files. */
|
30
|
-
allFiles(): Promise<string[]>;
|
31
|
-
fileKey(path: string): string;
|
32
|
-
}
|
1
|
+
export * from './persister.cjs';
|
@@ -1 +1 @@
|
|
1
|
-
export
|
1
|
+
export * from './import-entry.cjs';
|
@@ -1,6 +1 @@
|
|
1
|
-
|
2
|
-
CachedMetadata,
|
3
|
-
FileStats
|
4
|
-
} from 'obsidian';
|
5
|
-
import type { PageMetadata } from '../../data-model/markdown.d.mjs';
|
6
|
-
export declare function runImport(path: string, contents: string, stats: FileStats, metadata: CachedMetadata): Partial<PageMetadata>;
|
1
|
+
export * from './import-impl.cjs';
|
@@ -1,37 +1 @@
|
|
1
|
-
|
2
|
-
import type {
|
3
|
-
Component,
|
4
|
-
MetadataCache,
|
5
|
-
TFile,
|
6
|
-
Vault
|
7
|
-
} from 'obsidian';
|
8
|
-
/** Callback when a file is resolved. */
|
9
|
-
type FileCallback = (p: any) => void;
|
10
|
-
/** Multi-threaded file parser which debounces rapid file requests automatically. */
|
11
|
-
export declare class FileImporter extends Component {
|
12
|
-
numWorkers: number;
|
13
|
-
vault: Vault;
|
14
|
-
metadataCache: MetadataCache;
|
15
|
-
workers: Worker[];
|
16
|
-
/** Tracks which workers are actively parsing a file, to make sure we properly delegate results. */
|
17
|
-
busy: boolean[];
|
18
|
-
/** List of files which have been queued for a reload. */
|
19
|
-
reloadQueue: TFile[];
|
20
|
-
/** Fast-access set which holds the list of files queued to be reloaded; used for debouncing. */
|
21
|
-
reloadSet: Set<string>;
|
22
|
-
/** Paths -> promises for file reloads which have not yet been queued. */
|
23
|
-
callbacks: Map<string, [FileCallback, FileCallback][]>;
|
24
|
-
constructor(numWorkers: number, vault: Vault, metadataCache: MetadataCache);
|
25
|
-
/**
|
26
|
-
* Queue the given file for reloading. Multiple reload requests for the same file in a short time period will be de-bounced
|
27
|
-
* and all be resolved by a single actual file reload.
|
28
|
-
*/
|
29
|
-
reload<T>(file: TFile): Promise<T>;
|
30
|
-
/** Finish the parsing of a file, potentially queueing a new file. */
|
31
|
-
private finish;
|
32
|
-
/** Send a new task to the given worker ID. */
|
33
|
-
private send;
|
34
|
-
/** Find the next available, non-busy worker; return undefined if all workers are busy. */
|
35
|
-
private nextAvailableWorker;
|
36
|
-
}
|
37
|
-
export {};
|
1
|
+
export * from './import-manager.cjs';
|
@@ -1,186 +1 @@
|
|
1
|
-
|
2
|
-
import type { DateTime } from 'luxon';
|
3
|
-
import type {
|
4
|
-
App,
|
5
|
-
Component,
|
6
|
-
MetadataCache,
|
7
|
-
TAbstractFile,
|
8
|
-
TFile,
|
9
|
-
Vault
|
10
|
-
} from 'obsidian';
|
11
|
-
import type { Result } from '../api/result.d.mjs';
|
12
|
-
import type { LocalStorageCache } from '../data-import/persister.d.mjs';
|
13
|
-
import type { FileImporter } from '../data-import/web-worker/import-manager.d.mjs';
|
14
|
-
import type { PageMetadata } from '../data-model/markdown.d.mjs';
|
15
|
-
import type { DataObject } from '../data-model/value.d.mjs';
|
16
|
-
/** Aggregate index which has several sub-indices and will initialize all of them. */
|
17
|
-
export declare class FullIndex extends Component {
|
18
|
-
app: App;
|
19
|
-
indexVersion: string;
|
20
|
-
onChange: () => void;
|
21
|
-
/** Generate a full index from the given vault. */
|
22
|
-
static create(app: App, indexVersion: string, onChange: () => void): FullIndex;
|
23
|
-
/** Whether all files in the vault have been indexed at least once. */
|
24
|
-
initialized: boolean;
|
25
|
-
/** I/O access to the Obsidian vault contents. */
|
26
|
-
vault: Vault;
|
27
|
-
/** Access to in-memory metadata, useful for parsing and metadata lookups. */
|
28
|
-
metadataCache: MetadataCache;
|
29
|
-
/** Persistent IndexedDB backing store, used for faster startup. */
|
30
|
-
persister: LocalStorageCache;
|
31
|
-
pages: Map<string, PageMetadata>;
|
32
|
-
/** Map files -> tags in that file, and tags -> files. This version includes subtags. */
|
33
|
-
tags: ValueCaseInsensitiveIndexMap;
|
34
|
-
/** Map files -> exact tags in that file, and tags -> files. This version does not automatically add subtags. */
|
35
|
-
etags: ValueCaseInsensitiveIndexMap;
|
36
|
-
/** Map files -> linked files in that file, and linked file -> files that link to it. */
|
37
|
-
links: IndexMap;
|
38
|
-
/** Search files by path prefix. */
|
39
|
-
prefix: PrefixIndex;
|
40
|
-
/** Allows for efficient lookups of whether a file is starred or not. */
|
41
|
-
starred: StarredCache;
|
42
|
-
/** Caches data in CSV files. */
|
43
|
-
csv: CsvCache;
|
44
|
-
/**
|
45
|
-
* The current "revision" of the index, which monotonically increases for every index change. Use this to determine
|
46
|
-
* if you are up to date.
|
47
|
-
*/
|
48
|
-
revision: number;
|
49
|
-
/** Asynchronously parses files in the background using web workers. */
|
50
|
-
importer: FileImporter;
|
51
|
-
/** Construct a new index using the app data and a current data version. */
|
52
|
-
private constructor();
|
53
|
-
/** Trigger a metadata event on the metadata cache. */
|
54
|
-
private trigger;
|
55
|
-
/** "Touch" the index, incrementing the revision number and causing downstream views to reload. */
|
56
|
-
touch(): void;
|
57
|
-
/** Runs through the whole vault to set up initial file metadata. */
|
58
|
-
initialize(): void;
|
59
|
-
/** Drops the local storage cache and re-indexes all files; this should generally be used if you expect cache issues. */
|
60
|
-
reinitialize(): Promise<void>;
|
61
|
-
/** Internal asynchronous initializer. */
|
62
|
-
private _initialize;
|
63
|
-
rename(file: TAbstractFile, oldPath: string): void;
|
64
|
-
/** Queue a file for reloading; this is done asynchronously in the background and may take a few seconds. */
|
65
|
-
reload(file: TFile): Promise<{
|
66
|
-
cached: boolean;
|
67
|
-
skipped: boolean;
|
68
|
-
}>;
|
69
|
-
/** Import a file directly from disk, skipping the cache. */
|
70
|
-
private import;
|
71
|
-
/** Finish the reloading of file metadata by adding it to in memory indexes. */
|
72
|
-
private finish;
|
73
|
-
}
|
74
|
-
/** Indexes files by their full prefix - essentially a simple prefix tree. */
|
75
|
-
export declare class PrefixIndex extends Component {
|
76
|
-
vault: Vault;
|
77
|
-
updateRevision: () => void;
|
78
|
-
static create(vault: Vault, updateRevision: () => void): PrefixIndex;
|
79
|
-
constructor(vault: Vault, updateRevision: () => void);
|
80
|
-
private walk;
|
81
|
-
/** Get the list of all files under the given path. */
|
82
|
-
get(prefix: string, filter?: (path: string) => boolean): Set<string>;
|
83
|
-
/** Determines if the given path exists in the prefix index. */
|
84
|
-
pathExists(path: string): boolean;
|
85
|
-
/** Determines if the given prefix exists in the prefix index. */
|
86
|
-
nodeExists(prefix: string): boolean;
|
87
|
-
/**
|
88
|
-
* Use the in-memory prefix index to convert a relative path to an absolute one.
|
89
|
-
*/
|
90
|
-
resolveRelative(path: string, origin?: string): string;
|
91
|
-
}
|
92
|
-
/** Simple path filters which filter file types. */
|
93
|
-
export declare namespace PathFilters {
|
94
|
-
function csv(path: string): boolean;
|
95
|
-
function markdown(path: string): boolean;
|
96
|
-
}
|
97
|
-
/**
|
98
|
-
* Caches in-use CSVs to make high-frequency reloads (such as actively looking at a document
|
99
|
-
* that uses CSV) fast.
|
100
|
-
*/
|
101
|
-
export declare class CsvCache extends Component {
|
102
|
-
vault: Vault;
|
103
|
-
static CACHE_EXPIRY_SECONDS: number;
|
104
|
-
cache: Map<string, {
|
105
|
-
data: DataObject[];
|
106
|
-
loadTime: DateTime;
|
107
|
-
}>;
|
108
|
-
cacheClearInterval: number;
|
109
|
-
constructor(vault: Vault);
|
110
|
-
/** Load a CSV file from the cache, doing a fresh load if it has not been loaded. */
|
111
|
-
get(path: string): Promise<Result<DataObject[], string>>;
|
112
|
-
/** Do the actual raw loading of a CSV path (which is either local or an HTTP request). */
|
113
|
-
private loadInternal;
|
114
|
-
/** Clear old entries in the cache (as measured by insertion time). */
|
115
|
-
private clearOldEntries;
|
116
|
-
}
|
117
|
-
export type StarredEntry = {
|
118
|
-
type: 'group';
|
119
|
-
items: StarredEntry[];
|
120
|
-
title: string;
|
121
|
-
} | {
|
122
|
-
type: 'file';
|
123
|
-
path: string;
|
124
|
-
title: string;
|
125
|
-
} | {
|
126
|
-
type: 'folder';
|
127
|
-
} | {
|
128
|
-
type: 'query';
|
129
|
-
};
|
130
|
-
/** Optional connector to the Obsidian 'Starred' plugin which allows for efficiently querying if a file is starred or not. */
|
131
|
-
export declare class StarredCache extends Component {
|
132
|
-
app: App;
|
133
|
-
onUpdate: () => void;
|
134
|
-
/** Initial delay before checking the cache; we need to wait for it to asynchronously load the initial stars. */
|
135
|
-
static INITIAL_DELAY: number;
|
136
|
-
/** How frequently to check for star updates. */
|
137
|
-
static REFRESH_INTERVAL: number;
|
138
|
-
/** Set of all starred file paths. */
|
139
|
-
private stars;
|
140
|
-
constructor(app: App, onUpdate: () => void);
|
141
|
-
/** Determines if the given path is starred. */
|
142
|
-
starred(path: string): boolean;
|
143
|
-
private reload;
|
144
|
-
/** Fetch all starred files from the stars plugin, if present. */
|
145
|
-
private static fetch;
|
146
|
-
}
|
147
|
-
/** A generic index which indexes variables of the form key -> value[], allowing both forward and reverse lookups. */
|
148
|
-
export declare class IndexMap {
|
149
|
-
/** Maps key -> values for that key. */
|
150
|
-
map: Map<string, Set<string>>;
|
151
|
-
/** Cached inverse map; maps value -> keys that reference that value. */
|
152
|
-
invMap: Map<string, Set<string>>;
|
153
|
-
/** Create a new, empty index map. */
|
154
|
-
constructor();
|
155
|
-
/** Returns all values for the given key. */
|
156
|
-
get(key: string): Set<string>;
|
157
|
-
/** Returns all keys that reference the given key. Mutating the returned set is not allowed. */
|
158
|
-
getInverse(value: string): Readonly<Set<string>>;
|
159
|
-
/** Sets the key to the given values; this will delete the old mapping for the key if one was present. */
|
160
|
-
set(key: string, values: Set<string>): this;
|
161
|
-
/** Clears all values for the given key so they can be re-added. */
|
162
|
-
delete(key: string): boolean;
|
163
|
-
/** Rename all references to the given key to a new value. */
|
164
|
-
rename(oldKey: string, newKey: string): boolean;
|
165
|
-
/** Clear the entire index. */
|
166
|
-
clear(): void;
|
167
|
-
static EMPTY_SET: Readonly<Set<string>>;
|
168
|
-
}
|
169
|
-
/** Index map wrapper which is case-insensitive in the key. */
|
170
|
-
export declare class ValueCaseInsensitiveIndexMap {
|
171
|
-
delegate: IndexMap;
|
172
|
-
/** Create a new, empty case insensitive index map. */
|
173
|
-
constructor(delegate?: IndexMap);
|
174
|
-
/** Returns all values for the given key. */
|
175
|
-
get(key: string): Set<string>;
|
176
|
-
/** Returns all keys that reference the given value. Mutating the returned set is not allowed. */
|
177
|
-
getInverse(value: string): Readonly<Set<string>>;
|
178
|
-
/** Sets the key to the given values; this will delete the old mapping for the key if one was present. */
|
179
|
-
set(key: string, values: Set<string>): this;
|
180
|
-
/** Clears all values for the given key so they can be re-added. */
|
181
|
-
delete(key: string): boolean;
|
182
|
-
/** Rename all references to the given key to a new value. */
|
183
|
-
rename(oldKey: string, newKey: string): boolean;
|
184
|
-
/** Clear the entire index. */
|
185
|
-
clear(): void;
|
186
|
-
}
|
1
|
+
export * from './index.cjs';
|
@@ -1,23 +1 @@
|
|
1
|
-
|
2
|
-
import type { Result } from '../api/result.d.mjs';
|
3
|
-
import type { FullIndex } from '../data-index/index.d.mjs';
|
4
|
-
import type {
|
5
|
-
DataObject,
|
6
|
-
Literal
|
7
|
-
} from '../data-model/value.d.mjs';
|
8
|
-
import type { Source } from './source.d.mjs';
|
9
|
-
/** A data row which has an ID and associated data (like page link / page data). */
|
10
|
-
export type Datarow<T> = {
|
11
|
-
id: Literal;
|
12
|
-
data: T;
|
13
|
-
};
|
14
|
-
/** Find source paths which match the given source. */
|
15
|
-
export declare function matchingSourcePaths(source: Source, index: FullIndex, originFile?: string): Result<Set<string>, string>;
|
16
|
-
/** Convert a path to the data for that path; usually markdown pages, but could also be other file types (like CSV). */
|
17
|
-
export declare function resolvePathData(path: string, index: FullIndex): Promise<Result<Datarow<DataObject>[], string>>;
|
18
|
-
/** Convert a CSV path to the data in the CSV (in dataview format). */
|
19
|
-
export declare function resolveCsvData(path: string, index: FullIndex): Promise<Result<Datarow<DataObject>[], string>>;
|
20
|
-
/** Convert a path pointing to a markdown page, into the associated metadata. */
|
21
|
-
export declare function resolveMarkdownData(path: string, index: FullIndex): Result<Datarow<DataObject>[], string>;
|
22
|
-
/** Resolve a source to the collection of data rows that it matches. */
|
23
|
-
export declare function resolveSource(source: Source, index: FullIndex, originFile?: string): Promise<Result<Datarow<DataObject>[], string>>;
|
1
|
+
export * from './resolver.cjs';
|