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.
- package/CHANGELOG.md +5 -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 +7 -7
@@ -1,149 +1 @@
|
|
1
|
-
|
2
|
-
import type { Literal } from '../data-model/value.d.mjs';
|
3
|
-
import type {
|
4
|
-
LiteralReprAll,
|
5
|
-
LiteralTypeOrAll
|
6
|
-
} from './binaryop.d.mjs';
|
7
|
-
import type { Context } from './context.d.mjs';
|
8
|
-
/**
|
9
|
-
* A function implementation which takes in a function context and a variable number of arguments. Throws an error if an
|
10
|
-
* invalid number/type of arguments are passed.
|
11
|
-
*/
|
12
|
-
export type FunctionImpl = (context: Context, ...rest: Literal[]) => Literal;
|
13
|
-
/** A "bound" function implementation which has already had a function context passed to it. */
|
14
|
-
export type BoundFunctionImpl = (...args: Literal[]) => Literal;
|
15
|
-
/** A function variant used in the function builder which holds the argument types. */
|
16
|
-
interface FunctionVariant {
|
17
|
-
args: LiteralTypeOrAll[];
|
18
|
-
varargs: boolean;
|
19
|
-
/** The implementing function for this specific variant. */
|
20
|
-
impl: FunctionImpl;
|
21
|
-
}
|
22
|
-
/**
|
23
|
-
* Allows for the creation of functions that check the number and type of their arguments, and dispatch
|
24
|
-
* to different implementations based on the types of the inputs.
|
25
|
-
*/
|
26
|
-
export declare class FunctionBuilder {
|
27
|
-
name: string;
|
28
|
-
variants: FunctionVariant[];
|
29
|
-
vectorized: Record<number, number[]>;
|
30
|
-
constructor(name: string);
|
31
|
-
/** Add a general function variant which accepts any number of arguments of any type. */
|
32
|
-
vararg(impl: FunctionImpl): FunctionBuilder;
|
33
|
-
/** Add a function variant which takes in a single argument. */
|
34
|
-
add1<T extends LiteralTypeOrAll>(argType: T, impl: (a: LiteralReprAll<T>, context: Context) => Literal): FunctionBuilder;
|
35
|
-
/** Add a function variant which takes in two typed arguments. */
|
36
|
-
add2<T extends LiteralTypeOrAll, U extends LiteralTypeOrAll>(
|
37
|
-
arg1: T,
|
38
|
-
arg2: U,
|
39
|
-
impl: (a: LiteralReprAll<T>, b: LiteralReprAll<U>, context: Context) => Literal
|
40
|
-
): FunctionBuilder;
|
41
|
-
/** Add a function variant which takes in three typed arguments. */
|
42
|
-
add3<T extends LiteralTypeOrAll, U extends LiteralTypeOrAll, V extends LiteralTypeOrAll>(
|
43
|
-
arg1: T,
|
44
|
-
arg2: U,
|
45
|
-
arg3: V,
|
46
|
-
impl: (a: LiteralReprAll<T>, b: LiteralReprAll<U>, c: LiteralReprAll<V>, context: Context) => Literal
|
47
|
-
): FunctionBuilder;
|
48
|
-
/** Add vectorized variants which accept the given number of arguments and delegate. */
|
49
|
-
vectorize(numArgs: number, positions: number[]): FunctionBuilder;
|
50
|
-
/** Return a function which checks the number and type of arguments, passing them on to the first matching variant. */
|
51
|
-
build(): FunctionImpl;
|
52
|
-
}
|
53
|
-
/** Utilities for managing function implementations. */
|
54
|
-
export declare namespace Functions {
|
55
|
-
/** Bind a context to a function implementation, yielding a function which does not need the context argument. */
|
56
|
-
function bind(func: FunctionImpl, context: Context): BoundFunctionImpl;
|
57
|
-
/** Bind a context to all functions in the given map, yielding a new map of bound functions. */
|
58
|
-
function bindAll(funcs: Record<string, FunctionImpl>, context: Context): Record<string, BoundFunctionImpl>;
|
59
|
-
}
|
60
|
-
/**
|
61
|
-
* Collection of all defined functions; defined here so that they can be called from within dataview,
|
62
|
-
* and test code.
|
63
|
-
*/
|
64
|
-
export declare namespace DefaultFunctions {
|
65
|
-
const typeOf: FunctionImpl;
|
66
|
-
/** Compute the length of a data type. */
|
67
|
-
const length: FunctionImpl;
|
68
|
-
/** List constructor function. */
|
69
|
-
const list: FunctionImpl;
|
70
|
-
/** Object constructor function. */
|
71
|
-
const object: FunctionImpl;
|
72
|
-
/** Internal link constructor function. */
|
73
|
-
const link: FunctionImpl;
|
74
|
-
/** Embed and un-embed a link. */
|
75
|
-
const embed: FunctionImpl;
|
76
|
-
/** External link constructor function. */
|
77
|
-
const elink: FunctionImpl;
|
78
|
-
/** Date constructor function. */
|
79
|
-
const date: FunctionImpl;
|
80
|
-
/** Duration constructor function. */
|
81
|
-
const dur: FunctionImpl;
|
82
|
-
/** Format a date using a luxon/moment-style date format. */
|
83
|
-
const dateformat: FunctionImpl;
|
84
|
-
const durationformat: FunctionImpl;
|
85
|
-
const localtime: FunctionImpl;
|
86
|
-
/** Number constructor function. */
|
87
|
-
const number: FunctionImpl;
|
88
|
-
/** Format a number using a standard currency format. */
|
89
|
-
const currencyformat: FunctionImpl;
|
90
|
-
/**
|
91
|
-
* Convert any value to a reasonable internal string representation. Most useful for dates, strings, numbers, and
|
92
|
-
* so on.
|
93
|
-
*/
|
94
|
-
const string: FunctionImpl;
|
95
|
-
const round: FunctionImpl;
|
96
|
-
const trunc: FunctionImpl;
|
97
|
-
const floor: FunctionImpl;
|
98
|
-
const ceil: FunctionImpl;
|
99
|
-
const min: FunctionImpl;
|
100
|
-
const max: FunctionImpl;
|
101
|
-
const minby: FunctionImpl;
|
102
|
-
const maxby: FunctionImpl;
|
103
|
-
const striptime: FunctionImpl;
|
104
|
-
const contains: FunctionImpl;
|
105
|
-
const icontains: FunctionImpl;
|
106
|
-
const econtains: FunctionImpl;
|
107
|
-
const containsword: FunctionImpl;
|
108
|
-
/** Extract 0 or more keys from a given object via indexing. */
|
109
|
-
const extract: FunctionImpl;
|
110
|
-
const reverse: FunctionImpl;
|
111
|
-
const sort: FunctionImpl;
|
112
|
-
const regextest: FunctionImpl;
|
113
|
-
const regexmatch: FunctionImpl;
|
114
|
-
const regexreplace: FunctionImpl;
|
115
|
-
const lower: FunctionImpl;
|
116
|
-
const upper: FunctionImpl;
|
117
|
-
const replace: FunctionImpl;
|
118
|
-
/** Split a string on a given string. */
|
119
|
-
const split: FunctionImpl;
|
120
|
-
const startswith: FunctionImpl;
|
121
|
-
const endswith: FunctionImpl;
|
122
|
-
const padleft: FunctionImpl;
|
123
|
-
const padright: FunctionImpl;
|
124
|
-
const substring: FunctionImpl;
|
125
|
-
const truncate: FunctionImpl;
|
126
|
-
const fdefault: FunctionImpl;
|
127
|
-
const ldefault: FunctionImpl;
|
128
|
-
const choice: FunctionImpl;
|
129
|
-
const hash: FunctionImpl;
|
130
|
-
const reduce: FunctionImpl;
|
131
|
-
const sum: FunctionImpl;
|
132
|
-
const average: FunctionImpl;
|
133
|
-
const product: FunctionImpl;
|
134
|
-
const join: FunctionImpl;
|
135
|
-
const any: FunctionImpl;
|
136
|
-
const all: FunctionImpl;
|
137
|
-
const none: FunctionImpl;
|
138
|
-
const filter: FunctionImpl;
|
139
|
-
const unique: FunctionImpl;
|
140
|
-
const map: FunctionImpl;
|
141
|
-
const nonnull: FunctionImpl;
|
142
|
-
/** Gets an object containing a link's own properties */
|
143
|
-
const meta: FunctionImpl;
|
144
|
-
const flat: FunctionImpl;
|
145
|
-
const slice: FunctionImpl;
|
146
|
-
}
|
147
|
-
/** Default function implementations for the expression evaluator. */
|
148
|
-
export declare const DEFAULT_FUNCTIONS: Record<string, FunctionImpl>;
|
149
|
-
export {};
|
1
|
+
export * from './functions.cjs';
|
@@ -1,163 +1 @@
|
|
1
|
-
|
2
|
-
DateTime,
|
3
|
-
Duration
|
4
|
-
} from 'luxon';
|
5
|
-
import * as P from 'parsimmon';
|
6
|
-
import type { Result } from '../api/result.d.mjs';
|
7
|
-
import type {
|
8
|
-
CsvSource,
|
9
|
-
FolderSource,
|
10
|
-
NegatedSource,
|
11
|
-
Source,
|
12
|
-
TagSource
|
13
|
-
} from '../data-index/source.d.mjs';
|
14
|
-
import type {
|
15
|
-
Link,
|
16
|
-
Literal
|
17
|
-
} from '../data-model/value.d.mjs';
|
18
|
-
import type {
|
19
|
-
BinaryOp,
|
20
|
-
Field,
|
21
|
-
LambdaField,
|
22
|
-
ListField,
|
23
|
-
LiteralField,
|
24
|
-
ObjectField,
|
25
|
-
VariableField
|
26
|
-
} from './field.d.mjs';
|
27
|
-
/** Provides a lookup table for unit durations of the given type. */
|
28
|
-
export declare const DURATION_TYPES: {
|
29
|
-
year: Duration;
|
30
|
-
years: Duration;
|
31
|
-
yr: Duration;
|
32
|
-
yrs: Duration;
|
33
|
-
month: Duration;
|
34
|
-
months: Duration;
|
35
|
-
mo: Duration;
|
36
|
-
mos: Duration;
|
37
|
-
week: Duration;
|
38
|
-
weeks: Duration;
|
39
|
-
wk: Duration;
|
40
|
-
wks: Duration;
|
41
|
-
w: Duration;
|
42
|
-
day: Duration;
|
43
|
-
days: Duration;
|
44
|
-
d: Duration;
|
45
|
-
hour: Duration;
|
46
|
-
hours: Duration;
|
47
|
-
hr: Duration;
|
48
|
-
hrs: Duration;
|
49
|
-
h: Duration;
|
50
|
-
minute: Duration;
|
51
|
-
minutes: Duration;
|
52
|
-
min: Duration;
|
53
|
-
mins: Duration;
|
54
|
-
m: Duration;
|
55
|
-
second: Duration;
|
56
|
-
seconds: Duration;
|
57
|
-
sec: Duration;
|
58
|
-
secs: Duration;
|
59
|
-
s: Duration;
|
60
|
-
};
|
61
|
-
/** Shorthand for common dates (relative to right now). */
|
62
|
-
export declare const DATE_SHORTHANDS: {
|
63
|
-
now: () => DateTime;
|
64
|
-
today: () => DateTime;
|
65
|
-
yesterday: () => DateTime;
|
66
|
-
tomorrow: () => DateTime;
|
67
|
-
sow: () => DateTime;
|
68
|
-
'start-of-week': () => DateTime;
|
69
|
-
eow: () => DateTime;
|
70
|
-
'end-of-week': () => DateTime;
|
71
|
-
soy: () => DateTime;
|
72
|
-
'start-of-year': () => DateTime;
|
73
|
-
eoy: () => DateTime;
|
74
|
-
'end-of-year': () => DateTime;
|
75
|
-
som: () => DateTime;
|
76
|
-
'start-of-month': () => DateTime;
|
77
|
-
eom: () => DateTime;
|
78
|
-
'end-of-month': () => DateTime;
|
79
|
-
};
|
80
|
-
/**
|
81
|
-
* Keywords which cannot be used as variables directly. Use `row.<thing>` if it is a variable you have defined and want
|
82
|
-
* to access.
|
83
|
-
*/
|
84
|
-
export declare const KEYWORDS: string[];
|
85
|
-
/** Attempt to parse the inside of a link to pull out display name, subpath, etc. */
|
86
|
-
export declare function parseInnerLink(rawlink: string): Link;
|
87
|
-
/** Create a left-associative binary parser which parses the given sub-element and separator. Handles whitespace. */
|
88
|
-
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>;
|
89
|
-
export declare function chainOpt<T>(base: P.Parser<T>, ...funcs: ((r: T) => P.Parser<T>)[]): P.Parser<T>;
|
90
|
-
export type PostfixFragment = {
|
91
|
-
type: 'dot';
|
92
|
-
field: string;
|
93
|
-
} | {
|
94
|
-
type: 'index';
|
95
|
-
field: Field;
|
96
|
-
} | {
|
97
|
-
type: 'function';
|
98
|
-
fields: Field[];
|
99
|
-
};
|
100
|
-
export interface ExpressionLanguage {
|
101
|
-
number: number;
|
102
|
-
string: string;
|
103
|
-
escapeCharacter: string;
|
104
|
-
bool: boolean;
|
105
|
-
tag: string;
|
106
|
-
identifier: string;
|
107
|
-
link: Link;
|
108
|
-
embedLink: Link;
|
109
|
-
rootDate: DateTime;
|
110
|
-
dateShorthand: keyof typeof DATE_SHORTHANDS;
|
111
|
-
date: DateTime;
|
112
|
-
datePlus: DateTime;
|
113
|
-
durationType: keyof typeof DURATION_TYPES;
|
114
|
-
duration: Duration;
|
115
|
-
rawNull: string;
|
116
|
-
binaryPlusMinus: BinaryOp;
|
117
|
-
binaryMulDiv: BinaryOp;
|
118
|
-
binaryCompareOp: BinaryOp;
|
119
|
-
binaryBooleanOp: BinaryOp;
|
120
|
-
tagSource: TagSource;
|
121
|
-
csvSource: CsvSource;
|
122
|
-
folderSource: FolderSource;
|
123
|
-
parensSource: Source;
|
124
|
-
atomSource: Source;
|
125
|
-
linkIncomingSource: Source;
|
126
|
-
linkOutgoingSource: Source;
|
127
|
-
negateSource: NegatedSource;
|
128
|
-
binaryOpSource: Source;
|
129
|
-
source: Source;
|
130
|
-
variableField: VariableField;
|
131
|
-
numberField: LiteralField;
|
132
|
-
boolField: LiteralField;
|
133
|
-
stringField: LiteralField;
|
134
|
-
dateField: LiteralField;
|
135
|
-
durationField: LiteralField;
|
136
|
-
linkField: LiteralField;
|
137
|
-
nullField: LiteralField;
|
138
|
-
listField: ListField;
|
139
|
-
objectField: ObjectField;
|
140
|
-
atomInlineField: Literal;
|
141
|
-
inlineFieldList: Literal[];
|
142
|
-
inlineField: Literal;
|
143
|
-
negatedField: Field;
|
144
|
-
atomField: Field;
|
145
|
-
indexField: Field;
|
146
|
-
lambdaField: LambdaField;
|
147
|
-
dotPostfix: PostfixFragment;
|
148
|
-
indexPostfix: PostfixFragment;
|
149
|
-
functionPostfix: PostfixFragment;
|
150
|
-
binaryMulDivField: Field;
|
151
|
-
binaryPlusMinusField: Field;
|
152
|
-
binaryCompareField: Field;
|
153
|
-
binaryBooleanField: Field;
|
154
|
-
binaryOpField: Field;
|
155
|
-
parensField: Field;
|
156
|
-
field: Field;
|
157
|
-
}
|
158
|
-
export declare const EXPRESSION: P.TypedLanguage<ExpressionLanguage>;
|
159
|
-
/**
|
160
|
-
* Attempt to parse a field from the given text, returning a string error if the
|
161
|
-
* parse failed.
|
162
|
-
*/
|
163
|
-
export declare function parseField(text: string): Result<Field, string>;
|
1
|
+
export * from './parse.cjs';
|
@@ -1,55 +1 @@
|
|
1
|
-
export
|
2
|
-
DateTime,
|
3
|
-
Duration
|
4
|
-
} from 'luxon';
|
5
|
-
export type { DataArray } from './api/data-array.d.mjs';
|
6
|
-
export type { DataviewApi } from './api/plugin-api.d.mjs';
|
7
|
-
export type {
|
8
|
-
Failure,
|
9
|
-
Result,
|
10
|
-
Success
|
11
|
-
} from './api/result.d.mjs';
|
12
|
-
export type {
|
13
|
-
FullIndex,
|
14
|
-
IndexMap,
|
15
|
-
PrefixIndex
|
16
|
-
} from './data-index/index.d.mjs';
|
17
|
-
export type {
|
18
|
-
ListItem,
|
19
|
-
PageMetadata
|
20
|
-
} from './data-model/markdown.d.mjs';
|
21
|
-
export type {
|
22
|
-
SListEntry,
|
23
|
-
SMarkdownPage,
|
24
|
-
STask
|
25
|
-
} from './data-model/serialized/markdown.d.mjs';
|
26
|
-
export type {
|
27
|
-
DataObject,
|
28
|
-
Link,
|
29
|
-
Literal,
|
30
|
-
LiteralRepr,
|
31
|
-
LiteralType,
|
32
|
-
LiteralWrapper,
|
33
|
-
Widget,
|
34
|
-
WrappedLiteral
|
35
|
-
} from './data-model/value.d.mjs';
|
36
|
-
export type {
|
37
|
-
DATE_SHORTHANDS,
|
38
|
-
DURATION_TYPES,
|
39
|
-
EXPRESSION,
|
40
|
-
ExpressionLanguage,
|
41
|
-
KEYWORDS,
|
42
|
-
parseField
|
43
|
-
} from './expression/parse.d.mjs';
|
44
|
-
export type { QUERY_LANGUAGE } from './query/parse.d.mjs';
|
45
|
-
export type { Query } from './query/query.d.mjs';
|
46
|
-
import type { DataviewApi } from './api/plugin-api.d.mjs';
|
47
|
-
import 'obsidian';
|
48
|
-
import type { App } from 'obsidian';
|
49
|
-
/**
|
50
|
-
* Get the current Dataview API from the app if provided; if not, it is inferred from the global API object installed
|
51
|
-
* on the window.
|
52
|
-
*/
|
53
|
-
export declare const getAPI: (app?: App) => DataviewApi | undefined;
|
54
|
-
/** Determine if Dataview is enabled in the given application. */
|
55
|
-
export declare const isPluginEnabled: (app: App) => boolean;
|
1
|
+
export * from './index.cjs';
|
@@ -1,52 +1 @@
|
|
1
|
-
|
2
|
-
Component,
|
3
|
-
MarkdownPostProcessorContext,
|
4
|
-
Plugin
|
5
|
-
} from 'obsidian';
|
6
|
-
import type { DataviewInlineApi } from './api/inline-api.d.mjs';
|
7
|
-
import type { DataviewApi } from './api/plugin-api.d.mjs';
|
8
|
-
import type { FullIndex } from './data-index/index.d.mjs';
|
9
|
-
import type { DataviewSettings } from './settings.d.mjs';
|
10
|
-
export default class DataviewPlugin extends Plugin {
|
11
|
-
/** Plugin-wide default settings. */
|
12
|
-
settings: DataviewSettings;
|
13
|
-
/** The index that stores all dataview data. */
|
14
|
-
index: FullIndex;
|
15
|
-
/** External-facing plugin API. */
|
16
|
-
api: DataviewApi;
|
17
|
-
/** CodeMirror 6 extensions that dataview installs. Tracked via array to allow for dynamic updates. */
|
18
|
-
private cmExtension;
|
19
|
-
onload(): Promise<void>;
|
20
|
-
registerDataviewjsCodeHighlighting(): void;
|
21
|
-
unregisterDataviewjsCodeHighlighting(): void;
|
22
|
-
private debouncedRefresh;
|
23
|
-
private updateRefreshSettings;
|
24
|
-
onunload(): void;
|
25
|
-
/** Register a markdown post processor with the given priority. */
|
26
|
-
registerPriorityMarkdownPostProcessor(priority: number, processor: (el: HTMLElement, ctx: MarkdownPostProcessorContext) => Promise<void>): void;
|
27
|
-
/** Register a markdown codeblock post processor with the given priority. */
|
28
|
-
registerPriorityCodeblockPostProcessor(
|
29
|
-
language: string,
|
30
|
-
priority: number,
|
31
|
-
processor: (source: string, el: HTMLElement, ctx: MarkdownPostProcessorContext) => Promise<void>
|
32
|
-
): void;
|
33
|
-
updateEditorExtensions(): void;
|
34
|
-
/**
|
35
|
-
* Based on the source, generate a dataview view. This works by doing an initial parsing pass, and then adding
|
36
|
-
* a long-lived view object to the given component for life-cycle management.
|
37
|
-
*/
|
38
|
-
dataview(source: string, el: HTMLElement, component: Component | MarkdownPostProcessorContext, sourcePath: string): Promise<void>;
|
39
|
-
/** Generate a DataviewJS view running the given source in the given element. */
|
40
|
-
dataviewjs(source: string, el: HTMLElement, component: Component | MarkdownPostProcessorContext, sourcePath: string): Promise<void>;
|
41
|
-
/** Render all dataview inline expressions in the given element. */
|
42
|
-
dataviewInline(el: HTMLElement, component: Component | MarkdownPostProcessorContext, sourcePath: string): Promise<void>;
|
43
|
-
/** Update plugin settings. */
|
44
|
-
updateSettings(settings: Partial<DataviewSettings>): Promise<void>;
|
45
|
-
/** @deprecated Call the given callback when the dataview API has initialized. */
|
46
|
-
withApi(callback: (api: DataviewApi) => void): void;
|
47
|
-
/**
|
48
|
-
* Create an API element localized to the given path, with lifecycle management managed by the given component.
|
49
|
-
* The API will output results to the given HTML element.
|
50
|
-
*/
|
51
|
-
localApi(path: string, component: Component, el: HTMLElement): DataviewInlineApi;
|
52
|
-
}
|
1
|
+
export * from './main.cjs';
|
@@ -1,103 +1 @@
|
|
1
|
-
|
2
|
-
* Takes a full query and a set of indices, and (hopefully quickly) returns all relevant files.
|
3
|
-
*/
|
4
|
-
import type { DateTime } from 'luxon';
|
5
|
-
import type { Result } from '../api/result.d.mjs';
|
6
|
-
import type { FullIndex } from '../data-index/index.d.mjs';
|
7
|
-
import type { Datarow } from '../data-index/resolver.d.mjs';
|
8
|
-
import type { SListItem } from '../data-model/serialized/markdown.d.mjs';
|
9
|
-
import type {
|
10
|
-
DataObject,
|
11
|
-
Grouping,
|
12
|
-
Link,
|
13
|
-
Literal
|
14
|
-
} from '../data-model/value.d.mjs';
|
15
|
-
import type {
|
16
|
-
Context,
|
17
|
-
LinkHandler
|
18
|
-
} from '../expression/context.d.mjs';
|
19
|
-
import type { Field } from '../expression/field.d.mjs';
|
20
|
-
import type {
|
21
|
-
Query,
|
22
|
-
QueryOperation
|
23
|
-
} from '../query/query.d.mjs';
|
24
|
-
import type { QuerySettings } from '../settings.d.mjs';
|
25
|
-
/** Operation diagnostics collected during the execution of each query step. */
|
26
|
-
export interface OperationDiagnostics {
|
27
|
-
timeMs: number;
|
28
|
-
incomingRows: number;
|
29
|
-
outgoingRows: number;
|
30
|
-
errors: {
|
31
|
-
index: number;
|
32
|
-
message: string;
|
33
|
-
}[];
|
34
|
-
}
|
35
|
-
/** The meaning of the 'id' field for a data row - i.e., where it came from. */
|
36
|
-
export type IdentifierMeaning = {
|
37
|
-
type: 'group';
|
38
|
-
name: string;
|
39
|
-
on: IdentifierMeaning;
|
40
|
-
} | {
|
41
|
-
type: 'path';
|
42
|
-
};
|
43
|
-
/** A data row over an object. */
|
44
|
-
export type Pagerow = Datarow<DataObject>;
|
45
|
-
/** An error during execution. */
|
46
|
-
export type ExecutionError = {
|
47
|
-
index: number;
|
48
|
-
message: string;
|
49
|
-
};
|
50
|
-
/** The result of executing query operations over incoming data rows; includes timing and error information. */
|
51
|
-
export interface CoreExecution {
|
52
|
-
data: Pagerow[];
|
53
|
-
idMeaning: IdentifierMeaning;
|
54
|
-
timeMs: number;
|
55
|
-
ops: QueryOperation[];
|
56
|
-
diagnostics: OperationDiagnostics[];
|
57
|
-
}
|
58
|
-
/** Shared execution code which just takes in arbitrary data, runs operations over it, and returns it + per-row errors. */
|
59
|
-
export declare function executeCore(rows: Pagerow[], context: Context, ops: QueryOperation[]): Result<CoreExecution, string>;
|
60
|
-
/** Expanded version of executeCore which adds an additional "extraction" step to the pipeline. */
|
61
|
-
export declare function executeCoreExtract(
|
62
|
-
rows: Pagerow[],
|
63
|
-
context: Context,
|
64
|
-
ops: QueryOperation[],
|
65
|
-
fields: Record<string, Field>
|
66
|
-
): Result<CoreExecution, string>;
|
67
|
-
export interface ListExecution {
|
68
|
-
core: CoreExecution;
|
69
|
-
data: Literal[];
|
70
|
-
primaryMeaning: IdentifierMeaning;
|
71
|
-
}
|
72
|
-
/** Execute a list-based query, returning the final results. */
|
73
|
-
export declare function executeList(query: Query, index: FullIndex, origin: string, settings: QuerySettings): Promise<Result<ListExecution, string>>;
|
74
|
-
/** Result of executing a table query. */
|
75
|
-
export interface TableExecution {
|
76
|
-
core: CoreExecution;
|
77
|
-
names: string[];
|
78
|
-
data: Literal[][];
|
79
|
-
idMeaning: IdentifierMeaning;
|
80
|
-
}
|
81
|
-
/** Execute a table query. */
|
82
|
-
export declare function executeTable(query: Query, index: FullIndex, origin: string, settings: QuerySettings): Promise<Result<TableExecution, string>>;
|
83
|
-
/** The result of executing a task query. */
|
84
|
-
export interface TaskExecution {
|
85
|
-
core: CoreExecution;
|
86
|
-
tasks: Grouping<SListItem>;
|
87
|
-
}
|
88
|
-
/** Execute a task query, returning all matching tasks. */
|
89
|
-
export declare function executeTask(query: Query, origin: string, index: FullIndex, settings: QuerySettings): Promise<Result<TaskExecution, string>>;
|
90
|
-
/** Execute a single field inline a file, returning the evaluated result. */
|
91
|
-
export declare function executeInline(field: Field, origin: string, index: FullIndex, settings: QuerySettings): Result<Literal, string>;
|
92
|
-
/** The default link resolver used when creating contexts. */
|
93
|
-
export declare function defaultLinkHandler(index: FullIndex, origin: string): LinkHandler;
|
94
|
-
/** Execute a calendar-based query, returning the final results. */
|
95
|
-
export declare function executeCalendar(query: Query, index: FullIndex, origin: string, settings: QuerySettings): Promise<Result<CalendarExecution, string>>;
|
96
|
-
export interface CalendarExecution {
|
97
|
-
core: CoreExecution;
|
98
|
-
data: {
|
99
|
-
date: DateTime;
|
100
|
-
link: Link;
|
101
|
-
value?: Literal[];
|
102
|
-
}[];
|
103
|
-
}
|
1
|
+
export * from './engine.cjs';
|
@@ -1,44 +1 @@
|
|
1
|
-
|
2
|
-
import type { Result } from '../api/result.d.mjs';
|
3
|
-
import type { Source } from '../data-index/source.d.mjs';
|
4
|
-
import type {
|
5
|
-
Comment,
|
6
|
-
FlattenStep,
|
7
|
-
GroupStep,
|
8
|
-
LimitStep,
|
9
|
-
NamedField,
|
10
|
-
Query,
|
11
|
-
QueryHeader,
|
12
|
-
QueryOperation,
|
13
|
-
QuerySortBy,
|
14
|
-
QueryType,
|
15
|
-
SortByStep,
|
16
|
-
WhereStep
|
17
|
-
} from './query.d.mjs';
|
18
|
-
/** Typings for the outputs of all of the parser combinators. */
|
19
|
-
interface QueryLanguageTypes {
|
20
|
-
queryType: QueryType;
|
21
|
-
comment: Comment;
|
22
|
-
explicitNamedField: NamedField;
|
23
|
-
namedField: NamedField;
|
24
|
-
sortField: QuerySortBy;
|
25
|
-
headerClause: QueryHeader;
|
26
|
-
fromClause: Source;
|
27
|
-
whereClause: WhereStep;
|
28
|
-
sortByClause: SortByStep;
|
29
|
-
limitClause: LimitStep;
|
30
|
-
flattenClause: FlattenStep;
|
31
|
-
groupByClause: GroupStep;
|
32
|
-
clause: QueryOperation;
|
33
|
-
query: Query;
|
34
|
-
}
|
35
|
-
/** Return a new parser which executes the underlying parser and returns it's raw string representation. */
|
36
|
-
export declare function captureRaw<T>(base: P.Parser<T>): P.Parser<[T, string]>;
|
37
|
-
/** A parsimmon-powered parser-combinator implementation of the query language. */
|
38
|
-
export declare const QUERY_LANGUAGE: P.TypedLanguage<QueryLanguageTypes>;
|
39
|
-
/**
|
40
|
-
* Attempt to parse a query from the given query text, returning a string error
|
41
|
-
* if the parse failed.
|
42
|
-
*/
|
43
|
-
export declare function parseQuery(text: string): Result<Query, string>;
|
44
|
-
export {};
|
1
|
+
export * from './parse.cjs';
|
@@ -1,95 +1 @@
|
|
1
|
-
|
2
|
-
import type { Source } from '../data-index/source.d.mjs';
|
3
|
-
import type { Field } from '../expression/field.d.mjs';
|
4
|
-
/** The supported query types (corresponding to view types). */
|
5
|
-
export type QueryType = 'list' | 'table' | 'task' | 'calendar';
|
6
|
-
/** A single-line comment. */
|
7
|
-
export type Comment = string;
|
8
|
-
/** Fields used in the query portion. */
|
9
|
-
export interface NamedField {
|
10
|
-
/** The effective name of this field. */
|
11
|
-
name: string;
|
12
|
-
/** The value of this field. */
|
13
|
-
field: Field;
|
14
|
-
}
|
15
|
-
/** A query sort by field, for determining sort order. */
|
16
|
-
export interface QuerySortBy {
|
17
|
-
/** The field to sort on. */
|
18
|
-
field: Field;
|
19
|
-
/** The direction to sort in. */
|
20
|
-
direction: 'ascending' | 'descending';
|
21
|
-
}
|
22
|
-
/** Utility functions for quickly creating fields. */
|
23
|
-
export declare namespace QueryFields {
|
24
|
-
function named(name: string, field: Field): NamedField;
|
25
|
-
function sortBy(field: Field, dir: 'ascending' | 'descending'): QuerySortBy;
|
26
|
-
}
|
27
|
-
/** A query which should render a list of elements. */
|
28
|
-
export interface ListQuery {
|
29
|
-
type: 'list';
|
30
|
-
/** What should be rendered in the list. */
|
31
|
-
format?: Field;
|
32
|
-
/** If true, show the default DI field; otherwise, don't. */
|
33
|
-
showId: boolean;
|
34
|
-
}
|
35
|
-
/** A query which renders a table of elements. */
|
36
|
-
export interface TableQuery {
|
37
|
-
type: 'table';
|
38
|
-
/** The fields (computed or otherwise) to select. */
|
39
|
-
fields: NamedField[];
|
40
|
-
/** If true, show the default ID field; otherwise, don't. */
|
41
|
-
showId: boolean;
|
42
|
-
}
|
43
|
-
/** A query which renders a collection of tasks. */
|
44
|
-
export interface TaskQuery {
|
45
|
-
type: 'task';
|
46
|
-
}
|
47
|
-
/** A query which renders a collection of notes in a calendar view. */
|
48
|
-
export interface CalendarQuery {
|
49
|
-
type: 'calendar';
|
50
|
-
/** The date field that we'll be grouping notes by for the calendar view */
|
51
|
-
field: NamedField;
|
52
|
-
}
|
53
|
-
export type QueryHeader = ListQuery | TableQuery | TaskQuery | CalendarQuery;
|
54
|
-
/** A step which only retains rows whose 'clause' field is truthy. */
|
55
|
-
export interface WhereStep {
|
56
|
-
type: 'where';
|
57
|
-
clause: Field;
|
58
|
-
}
|
59
|
-
/** A step which sorts all current rows by the given list of sorts. */
|
60
|
-
export interface SortByStep {
|
61
|
-
type: 'sort';
|
62
|
-
fields: QuerySortBy[];
|
63
|
-
}
|
64
|
-
/** A step which truncates the number of rows to the given amount. */
|
65
|
-
export interface LimitStep {
|
66
|
-
type: 'limit';
|
67
|
-
amount: Field;
|
68
|
-
}
|
69
|
-
/** A step which flattens rows into multiple child rows. */
|
70
|
-
export interface FlattenStep {
|
71
|
-
type: 'flatten';
|
72
|
-
field: NamedField;
|
73
|
-
}
|
74
|
-
/** A step which groups rows into groups by the given field. */
|
75
|
-
export interface GroupStep {
|
76
|
-
type: 'group';
|
77
|
-
field: NamedField;
|
78
|
-
}
|
79
|
-
/** A virtual step which extracts an array of values from each row. */
|
80
|
-
export interface ExtractStep {
|
81
|
-
type: 'extract';
|
82
|
-
fields: Record<string, Field>;
|
83
|
-
}
|
84
|
-
export type QueryOperation = WhereStep | SortByStep | LimitStep | FlattenStep | GroupStep | ExtractStep;
|
85
|
-
/**
|
86
|
-
* A query over the Obsidian database. Queries have a specific and deterministic execution order:
|
87
|
-
*/
|
88
|
-
export interface Query {
|
89
|
-
/** The view type to render this query in. */
|
90
|
-
header: QueryHeader;
|
91
|
-
/** The source that file candidates will come from. */
|
92
|
-
source: Source;
|
93
|
-
/** The operations to apply to the data to produce the final result that will be rendered. */
|
94
|
-
operations: QueryOperation[];
|
95
|
-
}
|
1
|
+
export * from './query.cjs';
|