import { App } from 'obsidian';
import { Component } from 'obsidian';
import { ComponentChildren } from 'preact';
import { CSSProperties } from 'preact/compat';
import { DateTime } from 'luxon';
import { Duration } from 'luxon';
import { EventRef } from 'obsidian';
import { Events } from 'obsidian';
import { FileManager } from 'obsidian';
import * as hooks from 'preact/hooks';
import { HTMLAttributes } from 'preact/compat';
import { JSX as JSX_2 } from 'preact/compat';
import { JSX as JSX_3 } from 'preact/jsx-runtime';
import { JSX as JSX_4 } from 'preact';
import * as luxon_2 from 'luxon';
import { MarkdownPostProcessorContext } from 'obsidian';
import { MarkdownRenderChild } from 'obsidian';
import { MetadataCache } from 'obsidian';
import { Plugin as Plugin_2 } from 'obsidian';
import * as preact_2 from 'preact';
import { PropsWithChildren } from 'preact/compat';
import { Queue } from '@datastructures-js/queue';
import { default as React_2 } from 'preact/compat';
import { ReactNode } from 'preact/compat';
import { TFile } from 'obsidian';
import { Vault } from 'obsidian';
import { VNode } from 'preact';

/** Arithmetic operators which yield numbers and other values. */
export declare type ArithmeticOp = "+" | "-" | "*" | "/" | "%" | "&" | "|";

/** @public A function which compares two types. */
export declare type ArrayComparator<T> = (a: T, b: T) => number;

/** @public A function which maps an array element to some value. */
export declare type ArrayFunc<T, O> = (elem: T, index: number, arr: T[]) => O;

/** Shared metadata for all canvas cards. */
export declare abstract class BaseCanvasCard implements Indexable, Linkable {
    abstract $types: string[];
    abstract $typename: string;
    abstract readonly $type: string;
    $revision?: number | undefined;
    $id: string;
    $position: CardPos;
    $dimensions: CardDimensions;
    $parent?: Indexable;
    $file: string;
    $color?: string;
    constructor(init: Partial<BaseCanvasCard>);
    get $link(): Link;
    /** @internal */
    json(): JsonBaseCanvasCard;
}

/** All valid binary operators. */
export declare type BinaryOp = CompareOp | ArithmeticOp | LogicalOp;

/** A binary operator expression which combines two subnodes somehow. */
export declare interface BinaryOpExpression {
    type: "binaryop";
    left: Expression;
    right: Expression;
    op: BinaryOp;
}

/** Provides implementations for binary operators on two types using a registry. */
declare class BinaryOpHandler {
    private map;
    private handleDefaultNulls;
    static create(): BinaryOpHandler;
    constructor();
    register<T extends LiteralTypeOrAll, U extends LiteralTypeOrAll>(left: T, op: BinaryOp, right: U, func: BinaryOpImpl<LiteralReprAll<T>, LiteralReprAll<U>>): BinaryOpHandler;
    registerResult<T extends LiteralTypeOrAll, U extends LiteralTypeOrAll>(left: T, op: BinaryOp, right: U, func: BinaryOpResultImpl<LiteralReprAll<T>, LiteralReprAll<U>>): BinaryOpHandler;
    registerComm<T extends LiteralTypeOrAll, U extends LiteralTypeOrAll>(left: T, op: BinaryOp, right: U, func: BinaryOpImpl<LiteralReprAll<T>, LiteralReprAll<U>>): BinaryOpHandler;
    /** If enabled, all null (op) null operations produce null. */
    withDefaultNullHandling(): BinaryOpHandler;
    /** Implement a comparison function. */
    compare<T extends LiteralTypeOrAll>(type: T, compare: CompareImpl<LiteralReprAll<T>>): BinaryOpHandler;
    /** Attempt to evaluate the given binary operator on the two literal fields. */
    evaluate(op: BinaryOp, left: Literal, right: Literal, ctx: Evaluator): Result<Literal, string>;
    /** Create a string representation of the given triplet for unique lookup in the map. */
    static repr(op: BinaryOp, left: LiteralTypeOrAll, right: LiteralTypeOrAll): string;
}

/** An implementation for a binary operator. */
declare type BinaryOpImpl<A extends Literal, B extends Literal> = (first: A, second: B, ctx: Evaluator) => Literal;

/** Binary operator which can fail and produce an error. */
declare type BinaryOpResultImpl<A extends Literal, B extends Literal> = (first: A, second: B, ctx: Evaluator) => Result<Literal, string>;

/**
 * Wrapper for a regular HTML button with some default classes.
 * @group Components
 */
export declare function Button(props: {
    className?: string;
    intent?: Intent;
    children: ComponentChildren;
} & React_2.ComponentProps<"button">): React_2.JSX.Element;

/** A piece of data that has been cached for a specific version and time. */
declare interface Cached<T> {
    /** The version of the plugin that the data was written to cache with. */
    version: string;
    /** The UNIX epoch time in milliseconds that the data was written to cache. */
    time: number;
    /** The data that was cached. */
    data: T;
}

/**
 * @group Components
 * @param props {@inheritDoc CalloutProps}
     */
 export declare function Callout({ collapsible, open: openProp, initialOpen, onOpenChange, title, icon, children, type, }: PropsWithChildren<CalloutProps>): JSX_4.Element;

 /** General properties for configuring a callout.
  * @group Props
  */
 export declare interface CalloutProps {
     /** Title of the callout. */
     title: string | VNode;
     /** Arbitrary icon to show at the left side of the title in the callout. */
     icon?: VNode;
     /** The type of the callout. */
     type?: string;
     /** Whether the callout is collapsible (defaults to true). */
     collapsible?: boolean;
     /** Controlled prop for setting whether the callout is open. */
     open: boolean;
     /** Whether the callout is initially open if uncontrolled. */
     initialOpen?: boolean;
     /** Called whenever the open state of the callout changes due to user action. */
     onOpenChange?: (value: boolean) => void;
 }

 /** A canvas file, consisting of a set of canvas cards. */
 export declare class Canvas implements Linkable, File_2, Linkbearing, Taggable, Indexable, Fieldbearing {
     static TYPES: string[];
     $types: string[];
     $typename: string;
     /** Time that the file was created on the file system. */
     $ctime: DateTime;
     /** The that the file was last modified on the file system. */
     $mtime: DateTime;
     /** File extension - for canvas files, generally always 'canvas'. */
     $extension: string;
     /** The full path of the canvas file. */
     get $file(): string;
     get $id(): string;
     /** A link object pointing to the canvas file. */
     get $link(): Link;
     $path: string;
     $cards: BaseCanvasCard[];
     $size: number;
     $tags: string[];
     $links: Link[];
     $infields: Record<string, InlineField>;
     private constructor();
     get fields(): Field[];
     field(key: string): Field | undefined;
     json(): JsonCanvas;
     static from(raw: JsonCanvas, normalizer?: LinkNormalizer): Canvas;
     private static FIELD_DEF;
 }

 /** All supported canvas card types. */
 export declare type CanvasCard = CanvasTextCard | CanvasFileCard | CanvasWebCard;

 /** Canvas card that is just a file embedding. */
 export declare class CanvasFileCard extends BaseCanvasCard implements Indexable {
     static TYPES: string[];
     $types: string[];
     $typename: string;
     private constructor();
     readonly $type: string;
     $linkedFile: string;
     /** @internal */
     json(): JsonCanvasFileCard;
     /** @internal */
     static from(raw: JsonCanvasFileCard): CanvasFileCard;
 }

 /** Canvas card with markdown text in it. */
 export declare class CanvasTextCard extends BaseCanvasCard implements Linkbearing, Taggable, Indexable, Fieldbearing {
     static TYPES: string[];
     $types: string[];
     $typename: string;
     $type: string;
     $id: string;
     $file: string;
     $links: Link[];
     $tags: string[];
     $title: string;
     $parent?: Indexable;
     $revision?: number;
     $infields: Record<string, InlineField>;
     $frontmatter?: Record<string, FrontmatterEntry>;
     $dimensions: CardDimensions;
     $sections: MarkdownSection[];
     private constructor();
     get fields(): Field[];
     field(key: string): Field | undefined;
     /** @internal */
     json(): JsonCanvasTextCard;
     /** @internal */
     static from(raw: JsonCanvasTextCard, file: string, normalizer?: LinkNormalizer): CanvasTextCard;
     static FIELD_DEF: FieldExtractor<CanvasTextCard>;
 }

 export declare class CanvasWebCard extends BaseCanvasCard implements Indexable {
     static TYPES: string[];
     $types: string[];
     readonly $type: string;
     $typename: string;
     $url: string;
     private constructor();
     /** @internal */
     json(): JsonCanvasWebCard;
     /** @internal */
     static from(raw: JsonCanvasWebCard, file: string): CanvasWebCard;
 }

 /**
  * A card with a title and content
  *
  * @group Components
  */
 export declare function Card<T>(props: CardProps<T>): JSX_4.Element;

 /** 2D dimensions of a canvas card in logical units. */
 export declare interface CardDimensions {
     width: number;
     height: number;
 }

 /** Absolute x, y position of a card on the canvas in logical units. */
 export declare interface CardPos {
     x: number;
     y: number;
 }

 /**
  * Props for the card component
  *
  * @group Props
  */
 export declare interface CardProps<T> {
     /** the actual value held in this card. */
     value: T;
     /** The title of the card. */
     title: Literal | ((val: T) => Literal | VNode);
     /** The raw content of the card. */
     content: Literal | ((val: T) => Literal | VNode);
     /** optional footer (because why not?) */
     footer?: Literal | ((val: T) => Literal | VNode);
     /** If true, the title will be rendered centered. */
     centerTitle?: boolean;
 }

 /**
  * A checkbox that can be checked and unchecked.
  * @group Components
  */
 export declare function Checkbox(props: {
     className?: string;
     disabled?: boolean;
     checked?: boolean;
     defaultChecked?: boolean;
     onCheckChange?: (checked: boolean) => void;
     children?: ComponentChildren;
 } & React_2.ComponentProps<"input">): React_2.JSX.Element;

 declare namespace Coerce {
     /** Coerces common types to string or otherwise undefined. */
     function string(value: Literal): string | undefined;
     /** Coerces booleans and string-booleans. */
     function boolean(value: Literal): boolean | undefined;
     /** Coerces numbers and strings to numbers. */
     function number(value: Literal): number | undefined;
     /** Coerces dates and strings into dates. */
     function date(value: Literal): DateTime | undefined;
     /** Coerces durations and strings into durations. */
     function duration(value: Literal): Duration | undefined;
     /** Coerces links and strings into links. */
     function link(value: Literal): Link | undefined;
     /** Coerces anything into an array, by converting non-arrays into unit length arrays. */
     function array(value: Literal): Literal[] | undefined;
 }

 /**
  * Appends additional classes to a basic fixed class.
  * @group Utilities
  * */
 export declare function combineClasses(fixed: string, ...rest: (string | undefined)[]): string;

 /** An implementation of a comparator (returning a number) which then automatically defines all of the comparison operators. */
 declare type CompareImpl<T extends Literal> = (first: T, second: T, ctx: Evaluator) => number;

 /** Comparison operators which yield true/false. */
 export declare type CompareOp = ">" | ">=" | "<=" | "<" | "=" | "!=";

 /**
  * @public Proxied interface which allows manipulating array-based data. All functions on a data array produce a NEW array
  * (i.e., the arrays are immutable).
  */
 export declare interface DataArray<T> {
     /** The total number of elements in the array. */
     length: number;
     /** Applies the given function to the entire data array. Allows using function chaining while applying an arbitrary intermediate function. */
     chain<U>(op: (arr: DataArray<T>) => DataArray<U>): DataArray<U>;
     /** Filter the data array down to just elements which match the given predicate. */
     where(predicate: ArrayFunc<T, boolean>): DataArray<T>;
     /** Alias for 'where' for people who want array semantics. */
     filter(predicate: ArrayFunc<T, boolean>): DataArray<T>;
     /** Map elements in the data array by applying a function to each. */
     map<U>(f: ArrayFunc<T, U>): DataArray<U>;
     /** Map elements in the data array by applying a function to each, then flatten the results to produce a new array. */
     flatMap<U>(f: ArrayFunc<T, U[]>): DataArray<U>;
     /** Mutably change each value in the array, returning the same array which you can further chain off of. */
     mutate(f: ArrayFunc<T, void>): DataArray<T>;
     /** Limit the total number of entries in the array to the given value. */
     limit(count: number): DataArray<T>;
     /**
      * Take a slice of the array. If `start` is undefined, it is assumed to be 0; if `end` is undefined, it is assumbed
      * to be the end of the array.
      */
     slice(start?: number, end?: number): DataArray<T>;
     /** Concatenate the values in this data array with those of another iterable / data array / array. */
     concat(other: Iterable<T>): DataArray<T>;
     /** Return the first index of the given (optionally starting the search) */
     indexOf(element: T, fromIndex?: number): number;
     /** Return the first element that satisfies the given predicate. */
     find(pred: ArrayFunc<T, boolean>): T | undefined;
     /** Find the index of the first element that satisfies the given predicate. Returns -1 if nothing was found. */
     findIndex(pred: ArrayFunc<T, boolean>, fromIndex?: number): number;
     /** Returns true if the array contains the given element, and false otherwise. */
     includes(element: T): boolean;
     /**
      * Return a string obtained by converting each element in the array to a string, and joining it with the
      * given separator (which defaults to ', ').
      */
     join(sep?: string): string;
     /**
      * Return a sorted array sorted by the given key; an optional comparator can be provided, which will
      * be used to compare the keys in leiu of the default dataview comparator.
      */
     sort<U>(key: ArrayFunc<T, U>, direction?: "asc" | "desc", comparator?: ArrayComparator<U>): DataArray<T>;
     /**
      * Mutably modify the current array with an in place sort; this is less flexible than a regular sort in exchange
      * for being a little more performant. Only use this is performance is a serious consideration.
      */
     sortInPlace<U>(key: (v: T) => U, direction?: "asc" | "desc", comparator?: ArrayComparator<U>): DataArray<T>;
     /**
      * Return an array where elements are grouped by the given key; the resulting array will have objects of the form
      * \`{ key: \<key value\>, rows: DataArray }`.
      */
     groupBy<U>(key: ArrayFunc<T, U>, comparator?: ArrayComparator<U>): DataArray<{
         key: U;
         rows: T[];
     }>;
     /**
      * If the array is not grouped, groups it as `groupBy` does; otherwise, groups the elements inside each current
      * group. This allows for top-down recursive grouping which may be easier than bottom-up grouping.
      */
     groupIn<U>(key: ArrayFunc<LowestKey<T>, U>, comparator?: ArrayComparator<U>): DataArray<Ingrouped<U, T>>;
     /**
      * Return distinct entries. If a key is provided, then rows with distinct keys are returned.
      */
     distinct<U>(key?: ArrayFunc<T, U>, comparator?: ArrayComparator<U>): DataArray<T>;
     /** Return true if the predicate is true for all values. */
     every(f: ArrayFunc<T, boolean>): boolean;
     /** Return true if the predicate is true for at least one value. */
     some(f: ArrayFunc<T, boolean>): boolean;
     /** Return true if the predicate is FALSE for all values. */
     none(f: ArrayFunc<T, boolean>): boolean;
     /** Return the first element in the data array. Returns undefined if the array is empty. */
     first(): T | undefined;
     /** Return the last element in the data array. Returns undefined if the array is empty. */
     last(): T | undefined;
     /** Map every element in this data array to the given key, and then flatten it.*/
     to(key: string): DataArray<any>;
     /** Map every element in this data array to the given key; unlike to(), does not flatten the result. */
     into(key: string): DataArray<any>;
     /**
      * Recursively expand the given key, flattening a tree structure based on the key into a flat array. Useful for handling
      * heirarchical data like tasks with 'subtasks'.
      */
     expand(key: string): DataArray<any>;
     /** Run a lambda on each element in the array. */
     forEach(f: ArrayFunc<T, void>): void;
     /** Convert this to a plain javascript array. */
     array(): T[];
     /** Allow iterating directly over the array. */
     [Symbol.iterator](): Iterator<T>;
     /** Map indexes to values. */
     [index: number]: any;
     /** Automatic flattening of fields. Equivalent to implicitly calling `array.to("field")` */
     [field: string]: any;
 }

 /** @public Provides utility functions for generating data arrays. */
 export declare namespace DataArray {
     /** Create a new Dataview data array. */
     export function wrap<T>(raw: T[] | DataArray<T>): DataArray<T>;
     /** Create a new DataArray from an iterable object. */
     export function from<T>(raw: Iterable<T>): DataArray<T>;
     /** Return true if the given object is a data array. */
     export function isDataArray(obj: any): obj is DataArray<any>;
 }

 /** Central API object; handles initialization, events, debouncing, and access to datacore functionality. */
 export declare class Datacore extends Component {
     app: App;
     version: string;
     settings: Settings;
     /** Access to the obsidian vault. */
     vault: Vault;
     /** Provides access to per-(markdown)-file metadata. */
     metadataCache: MetadataCache;
     /** Datacore events, mainly used to update downstream views. This object is shadowed by the Datacore object itself. */
     events: Events;
     /** @internal In-memory index over all stored metadata. */
     datastore: Datastore;
     /** @internal Asynchronous multi-threaded file importer with throttling. */
     importer: FileImporter;
     /** @internal Queue of asynchronous read requests; ensures we limit the maximum number of concurrent file loads. */
     reads: EmbedQueue;
     /** @internal Local-storage backed cache of metadata objects. */
     persister: LocalStorageCache;
     /** @internal Only set when datacore is in the midst of initialization; tracks current progress. */
     initializer?: DatacoreInitializer;
     /** If true, datacore is fully hydrated and all files have been indexed. */
     initialized: boolean;
     constructor(app: App, version: string, settings: Settings);
     /** Obtain the current index revision, for determining if anything has changed. */
     get revision(): number;
     /** Initialize datacore by scanning persisted caches and all available files, and queueing parses as needed. */
     initialize(): void;
     /** Starts the background initializer. */
     index(): void;
     private rename;
     /**
      * Read a file from the Obsidian cache efficiently, limiting the number of concurrent request and debouncing
      * multiple requests for the same file.
      */
     read(file: TFile): Promise<string>;
     /** Queue a file for reloading; this is done asynchronously in the background and may take a few seconds. */
     reload(file: TFile): Promise<Indexable>;
     /** Store a canvas document. */
     storeCanvas(data: Canvas): void;
     /** Store a markdown document. */
     storeMarkdown(data: MarkdownPage): void;
     /** Called whenever the index updates to a new revision. This is the broadest possible datacore event. */
     on(evt: "update", callback: (revision: number) => any, context?: any): EventRef;
     /** Called whenever datacore records a file rename and has finished reindexing the rename. */
     on(evt: "rename", callback: (newPath: string, oldPath: string) => any, context?: any): EventRef;
     /** Called when datacore has initialized and is querable. */
     on(evt: "initialized", callback: () => any, context?: any): EventRef;
     /** Unsubscribe from an event using the event and original callback. */
     off(evt: string, callback: (...data: any) => any): void;
     /** Unsubscribe from an event using the event reference.  */
     offref(ref: EventRef): void;
     /** Trigger an update event. */
     private trigger;
 }

 /**
  * Exterally visible API for datacore.
  * @public
  */
 export declare class DatacoreApi {
     core: Datacore;
     constructor(core: Datacore);
     /** Get access to luxon functions. */
     get luxon(): typeof luxon_2;
     /** Get access to preact functions. */
     get preact(): typeof preact_2;
     /** Central Obsidian app object. */
     get app(): App;
     /** Construct a local API for the file at the given path. */
     local(path: string): DatacoreLocalApi;
     /** Load a markdown file by full path or link. */
     page(path: string | Link): MarkdownPage | undefined;
     /** Execute a textual or typed index query, returning all results. */
     query(query: string | IndexQuery): Indexable[];
     /** Execute a textual or typed index query, returning all results. */
     tryQuery(query: string | IndexQuery): Result<Indexable[], string>;
     /** Execute a textual or typed index query, returning results plus performance metadata. */
     fullquery(query: string | IndexQuery): SearchResult<Indexable>;
     /** Execute a textual or typed index query, returning results plus performance metadata. */
     tryFullQuery(query: string | IndexQuery): Result<SearchResult<Indexable>, string>;
     /** Utilities for coercing types into one specific type for easier programming. */
     coerce: typeof Coerce;
     /** Resolve a local or absolute path or link to an absolute path. */
     resolvePath(path: string | Link, sourcePath?: string): string;
     /** Try to parse the given query, returning a monadic success/failure result. */
     tryParseQuery(query: string | IndexQuery): Result<IndexQuery, string>;
     /** Try to parse the given query, throwing an error if it is invalid. */
     parseQuery(query: string | IndexQuery): IndexQuery;
     /** Create a file link pointing to the given path. */
     fileLink(path: string): Link;
     /** Create a link to a header with the given name. */
     headerLink(path: string, header: string): Link;
     /** Create a link to a block with the given path and block ID. */
     blockLink(path: string, block: string): Link;
     /** Try to parse the given link, throwing an error if it is invalid. */
     parseLink(linktext: string): Link;
     /** Try to parse a link, returning a monadic success/failure result. */
     tryParseLink(linktext: string): Result<Link, string>;
     /** Create a data array from a regular array. */
     array<T>(input: T[] | DataArray<T>): DataArray<T>;
     /** Evaluate an expression and return it's evaluated value, throwing an exception on failure. */
     evaluate(expression: string | Expression, variables?: Record<string, Literal> | any, sourcePath?: string): Literal;
     /** Evaluate an expression and return it's evaluated value. */
     tryEvaluate(expression: string | Expression, variables?: Record<string, Literal> | any, sourcePath?: string): Result<Literal, string>;
     /**
      * Run the given DatacoreJS script, rendering it into the given container. This function
      * will return quickly; actual rendering is done asynchronously in the background.
      *
      * Returns a markdown render child representing the rendered object.
      */
     executeJs(source: string, container: HTMLElement, component: Component | MarkdownPostProcessorContext, sourcePath: string): MarkdownRenderChild;
     /**
      * Similar to `executeJs`, but for JSX scripts. If you are unsure if your input will be JS
      * or JSX, use this one, as it also supports regular javascript (albeit at at a mild performance
      * hit to rendering).
      */
     executeJsx(source: string, container: HTMLElement, component: Component | MarkdownPostProcessorContext, sourcePath: string): MarkdownRenderChild;
     /**
      * Similar to `executeJs`, but for TypeScript scripts. Use the TSX variant for TSX supprot.
      */
     executeTs(source: string, container: HTMLElement, component: Component | MarkdownPostProcessorContext, sourcePath: string): MarkdownRenderChild;
     /**
      * Similar to `executeTs`, but for TSX scripts. If you are unsure if your input will be TS
      * or TSX, use this one, as it also supports regular javascript (albeit at at a mild performance
      * hit to rendering).
      *
      * This generally will also work if you are unsure if your input is javascript or typescript,
      * though beware there are a few niche cases where javascript and typescript diverge in syntax.
      */
     executeTsx(source: string, container: HTMLElement, component: Component | MarkdownPostProcessorContext, sourcePath: string): MarkdownRenderChild;
     /** Shared logic for rendering any JS/TS script. */
     private _renderJavascript;
 }

 /** Lifecycle-respecting file queue which will import files, reading them from the file cache if needed. */
 declare class DatacoreInitializer extends Component {
     core: Datacore;
     /** Number of concurrent operations the initializer will perform. */
     static BATCH_SIZE: number;
     /** Whether the initializer should continue to run. */
     active: boolean;
     /** Queue of files to still import. */
     queue: TFile[];
     /** The files actively being imported. */
     current: TFile[];
     /** Deferred promise which resolves when importing is done. */
     done: Deferred<InitializationStats>;
     /** The total number of target files to import. */
     targetTotal: number;
     /** The time that init started in milliseconds. */
     start: number;
     /** Total number of files to import. */
     files: number;
     /** Total number of imported files so far. */
     initialized: number;
     /** Total number of imported files. */
     imported: number;
     /** Total number of skipped files. */
     skipped: number;
     /** Total number of cached files. */
     cached: number;
     constructor(core: Datacore);
     onload(): Promise<void>;
     /** Promise which resolves when the initialization completes. */
     finished(): Promise<InitializationStats>;
     /** Cancel initialization. */
     onunload(): void;
     /** Poll for another task to execute from the queue. */
     private runNext;
     /** Process the result of an initialization and queue more runs. */
     private handleResult;
     /** Initialize a specific file. */
     private init;
 }

 /**
  * Local API provided to specific codeblocks when they are executing.
  * @public
  */
 export declare class DatacoreLocalApi {
     api: DatacoreApi;
     path: string;
     /**
      * The cache of all currently loaded scripts in this context.
      * @private
      * @internal
      */
     private scriptCache;
     constructor(api: DatacoreApi, path: string);
     /** The current file path for the local API. */
     currentPath(): string;
     /** The full markdown file metadata for the current file. */
     currentFile(): MarkdownPage;
     /** Get acess to luxon functions. */
     get luxon(): typeof luxon_2;
     /** Get access to preact functions. */
     get preact(): typeof preact_2;
     /** Central Obsidian app object. */
     get app(): App;
     /** The internal plugin central datastructure. */
     get core(): Datacore;
     /**
      * Asynchronously load a javascript block from the given path or link; you can either load from JS/TS/JSX/TSX files
      * directly, or from codeblocks by loading from the section the codeblock is inside of. There are a few stipulations
      * to loading:
      * - You cannot load cyclical dependencies.
      * - This is similar to vanilla js `require()`, not `import ... `. Your scripts you are requiring need to explicitly
      *   return the things they are exporting, like the example below. The `export` keyword does not work.
      *
      * ```js
      * function MyElement() {
      *  ...
      * }
      *
      * return { MyElement };
      * ```
      */
     require(path: string | Link): Promise<any>;
     /** Utilities for coercing types into one specific type for easier programming. */
     coerce: typeof Coerce;
     /** Resolve a local or absolute path or link to an absolute path. */
     resolvePath(path: string | Link, sourcePath?: string): string;
     /** Try to parse the given query, returning a monadic success/failure result. */
     tryParseQuery(query: string | IndexQuery): Result<IndexQuery, string>;
     /** Try to parse the given query, throwing an error if it is invalid. */
     parseQuery(query: string | IndexQuery): IndexQuery;
     /** Create a file link pointing to the given path. */
     fileLink(path: string): Link;
     /** Create a link to a header with the given name. */
     headerLink(path: string, header: string): Link;
     /** Create a link to a block with the given path and block ID. */
     blockLink(path: string, block: string): Link;
     /** Try to parse the given link, throwing an error if it is invalid. */
     parseLink(linktext: string): Link;
     /** Try to parse a link, returning a monadic success/failure result. */
     tryParseLink(linktext: string): Result<Link, string>;
     /** Create a data array from a regular array. */
     array<T>(input: T[] | DataArray<T>): DataArray<T>;
     /** Evaluate an expression and return it's evaluated value. */
     evaluate(expression: string | Expression, variables?: Record<string, Literal> | any, sourcePath?: string): Literal;
     /** Evaluate an expression and return it's evaluated value, throwing an exception on failure. */
     tryEvaluate(expression: string | Expression, variables?: Record<string, Literal> | any, sourcePath?: string): Result<Literal, string>;
     /** Execute a textual or typed index query, returning all results. */
     query(query: string | IndexQuery): Indexable[];
     /** Execute a textual or typed index query, returning all results. */
     tryQuery(query: string | IndexQuery): Result<Indexable[], string>;
     /** Execute a textual or typed index query, returning results plus performance metadata. */
     fullquery(query: string | IndexQuery): SearchResult<Indexable>;
     /** Execute a textual or typed index query, returning results plus performance metadata. */
     tryFullQuery(query: string | IndexQuery): Result<SearchResult<Indexable>, string>;
     /** See the preact or react 'useState' hook. */
     useState: typeof hooks.useState;
     /** See the preact or react 'useCallback' hook. */
     useCallback: typeof hooks.useCallback;
     /** Se the preact or react 'useReducer' hook. */
     useReducer: typeof hooks.useReducer;
     /** See the preact or react 'useMemo' hook. */
     useMemo: typeof hooks.useMemo;
     /** See the preact or react 'useEffect' hook. */
     useEffect: typeof hooks.useEffect;
     /** See the preact or react 'createContext' function. */
     createContext: typeof preact_2.createContext;
     /** See the preact or react 'useContext' function. */
     useContext: typeof hooks.useContext;
     /** See the preact or react 'useRef' function. */
     useRef: typeof hooks.useRef;
     /**
      * Calls a function to obtain a value; returns the same exact _instance_ of that value as long
      * as calls to the function return an equivalent value. Interning is a useful performance concept
      * for reducing the total number of unique objects in memory and for making better use of
      * React's reference-equality-based caching.
      */
     useInterning: typeof useInterning;
     /** Memoize the input automatically and process it using a DataArray; returns a vanilla array back. */
     useArray<T, U>(input: T[] | DataArray<T>, process: (data: DataArray<T>) => DataArray<U>, deps?: any[]): U[];
     /** Use the file metadata for the current file. Automatically updates the view when the current file metadata changes. */
     useCurrentFile(settings?: {
         debounce?: number;
     }): MarkdownPage;
     /** Use the current path. Automatically updates the view if the path changes (though that would be weird). */
     useCurrentPath(settings?: {
         debounce?: number;
     }): string;
     /** Use the file metadata for a specific file. Automatically updates the view when the file changes. */
     useFile(path: string, settings?: {
         debounce?: number;
     }): Indexable | undefined;
     /** Automatically refresh the view whenever the index updates; returns the latest index revision ID. */
     useIndexUpdates(settings?: {
         debounce?: number;
     }): number;
     /**
      * Run a query, automatically re-running it whenever the vault changes. Returns more information about the query
      * execution, such as index revision and total search duration.
      */
     useFullQuery(query: string | IndexQuery, settings?: {
         debounce?: number;
     }): SearchResult<Indexable>;
     /** Run a query, automatically re-running it whenever the vault changes. */
     useQuery(query: string | IndexQuery, settings?: {
         debounce?: number;
     }): Indexable[];
     /** Vertical flexbox container; good for putting items together in a column. */
     Stack: typeof Stack;
     /** Horizontal flexbox container; good for putting items together in a row. */
     Group: typeof Group;
     /** Renders a literal value in a pretty way that respects settings. */
     Literal: any;
     /** Renders markdown using the Obsidian markdown renderer, optionally attaching additional styles. */
     Markdown: any;
     /** Renders an obsidian-style link directly and more efficiently than rendering markdown. */
     Link: ({ link, sourcePath: maybeSourcePath }: {
         link: string | Link;
         sourcePath?: string | undefined;
     }) => preact_2.JSX.Element;
     /** Create a vanilla Obsidian embed for the given link. */
     LinkEmbed: any;
     /** Create an explicit 'span' embed which extracts a span of lines from a markdown file. */
     SpanEmbed: any;
     /** Renders an obsidian lucide icon. */
     Icon: typeof Icon;
     /**
      * Generate an embed of the given markdown element. Useful to pass to the 'renderer' prop of various views
      * to efficiently render embeds of various elements.
      *
      * For example, `dc.embed(<file>)` will produce a file embedding, and `dc.embed(<section>)` will produce a section embedding.
      */
     embed: any;
     /** @deprecated - Use just `Table` instead. */
     VanillaTable: typeof TableView;
     /** A simple and configurable table view that supports rendering paged and grouped data. */
     Table: typeof TableView;
     /** A simple and configurable list view that supports rendering paged and grouped data. */
     List: typeof ListView;
     /** A single card which can be composed into a grid view. */
     Card: typeof Card;
     Button: typeof Button;
     Textbox: typeof Textbox;
     Callout: typeof Callout;
     Checkbox: typeof Checkbox;
     Slider: typeof Slider;
     Switch: typeof Switch;
     VanillaSelect: typeof VanillaSelect;
 }

 /** Reactive data engine for your Obsidian.md vault. */
 export declare class DatacorePlugin extends Plugin_2 {
     /** Plugin-wide default settings. */
     settings: Settings;
     /** Central internal state. */
     core: Datacore;
     /** Externally visible API for querying. */
     api: DatacoreApi;
     onload(): Promise<void>;
     onunload(): void;
     /** Register codeblock highlighting and return a closure which unregisters. */
     registerCodeblockHighlighting(): () => void;
     /** Update the given settings to new values. */
     updateSettings(settings: Partial<Settings>): Promise<void>;
 }

 /** Shorthand for a mapping from keys to values. */
 export declare type DataObject = Record<string, any>;

 /**
  * Central, index storage for datacore values.
  * @internal
  */
 export declare class Datastore {
     vault: Vault;
     metadataCache: MetadataCache;
     settings: Settings;
     /** The current store revision. */
     revision: number;
     /**
      * Master collection of all object IDs. This is technically redundant with objects.keys() but this is a fast set
      * compared to an iterator.
      */
     private ids;
     /** The master collection of ALL indexed objects, mapping ID -> the object. */
     private objects;
     /** Map parent object to it's direct child objects. */
     private children;
     /** Global map of object type -> list of all objects of that type. */
     private types;
     /** Tracks exact tag occurence in objects. */
     private etags;
     /** Tracks tag occurence in objects. */
     private tags;
     /** Maps link strings to the object IDs that link to those links. */
     private links;
     /** Tracks the existence of fields (indexed by normalized key name). */
     private fields;
     /**
      * Quick searches for objects in folders. This index only tracks top-level objects - it is expanded recursively to
      * find child objects.
      */
     private folder;
     constructor(vault: Vault, metadataCache: MetadataCache, settings: Settings);
     /** Return the total number of objects in the store. */
     get size(): number;
     /** Update the revision of the datastore due to an external update. */
     touch(): void;
     /** Load an object by ID. */
     load(id: string): Indexable | undefined;
     /** Load a list of objects by ID. */
     load(ids: string[]): Indexable[];
     /** Sets up sane field defaults for several indexable fields. */
     private _initializeFields;
     /**
      * Store the given object, making it immediately queryable. Storing an object
      * takes ownership over it, and index-specific variables (prefixed via '$') may be
      * added to the object.
      */
     store<T extends Indexable>(object: T | T[], substorer?: Substorer<T>): void;
     /** Recursively store objects using a potential subindexer. */
     private _recursiveStore;
     /** Delete an object by ID from the index, recursively deleting any child objects as well. */
     delete(id: string): boolean;
     /** Internal method that does not bump the revision. */
     private _deleteRecursive;
     /** Add the given indexable to the appropriate indices. */
     private _index;
     /** Remove the given indexable from all indices. */
     private _unindex;
     /** Completely clear the datastore of all values. */
     clear(): void;
     /** Find the corresponding object for a given link. */
     resolveLink(rawLink: string | Link, sourcePath?: string): Indexable | undefined;
     /**
      * Search the datastore for all documents matching the given query, returning them
      * as a list of indexed objects along with performance metadata.
      */
     search(query: IndexQuery, settings?: SearchSettings): Result<SearchResult<Indexable>, string>;
     /** Create an expression evaluator backed by this datastore. */
     evaluator(sourcePath?: string, globals?: Record<string, Literal>): Evaluator;
     /** Internal search which yields a filter of results. */
     private _search;
     private _resolveSource;
     /** Resolve leaf nodes in a search AST, yielding raw sets of results. */
     private _resolvePrimitive;
     /** Filter documents by field values, using the fast lookup if it returns a result and otherwise filtering over every document using the slow predicate. */
     private _filterFields;
     /**
      * Does Breadth-first Search to find all linked files within distance <distance>. This includes all source nodes,
      * so remove them afterwards if you do not want them.
      */
     private _traverseLinked;
     /** Iterate all linked objects for the given object. */
     private _iterateAdjacentLinked;
     /** Iterator which produces all parents of the given object. */
     private _iterateParents;
     /** Iterative which produces all children (recursively) of the given object. */
     private _iterateChildren;
 }

 /** A promise that can be resolved directly. */
 declare type Deferred<T> = Promise<T> & {
     resolve: (value: T) => void;
     reject: (error: any) => void;
 };

 /** Queues up loads of files to reduce the maximum number of concurrent loads. */
 declare class EmbedQueue extends Component {
     vault: Vault;
     concurrency: () => number;
     /** Set of pending loads. */
     private queue;
     /** Set of promises waiting on each path. */
     private promises;
     /** Active set of loads. */
     private active;
     /** If true, prevent any further loads. */
     private shutdown;
     constructor(vault: Vault, concurrency: () => number);
     /** Read a file asynchronously, controlling concurrency to prevent too many files being loaded simultaneously. */
     read(file: TFile): Promise<string>;
     /** Schedule more loads from the queue into the active set if there is available space. */
     private schedule;
     /** Communicate the result of a loaded file and then schedule more files to be loaded. */
     private finish;
     /** Cancell all outstanding loads on unload. */
     onunload(): void;
 }

 /**
  * Evaluation context that expressions can be evaluated in. Includes global state, as well as available functions and a handler
  * for binary operators.
  */
 declare class Evaluator {
     linkHandler: LinkHandler;
     settings: Settings;
     globals: Record<string, Literal>;
     binaryOps: BinaryOpHandler;
     functions: Record<string, FunctionImpl>;
     /**
      * Create a new context with the given namespace of globals, as well as optionally with custom binary operator, function,
      * and link handlers.
      */
     constructor(linkHandler: LinkHandler, settings: Settings, globals?: Record<string, Literal>, binaryOps?: BinaryOpHandler, functions?: Record<string, FunctionImpl>);
     /** Set a global value in this context. */
     set(name: string, value: Literal): Evaluator;
     /** Get the value of a global variable by name. Returns null if not present. */
     get(name: string): Literal;
     /** Try to evaluate an arbitrary expression in this context, raising an exception on failure. */
     tryEvaluate(expr: Expression, variables?: Variables): Literal;
     /** Evaluate an arbitrary expression in this context. */
     evaluate(expr: Expression, variables?: Variables): Result<Literal, string>;
     /** General logic for making a function call. */
     private evaluateFunctionCall;
 }

 export declare type Expression = LiteralExpression | VariableExpression | ListExpression | ObjectExpression | BinaryOpExpression | FunctionExpression | MethodExpression | LambdaExpression | NegatedExpression;

 export declare namespace Expressions {
     /** The implicit field referencing the current field. */
     const ROW: string;
     export function variable(name: string): VariableExpression;
     export function literal(value: Literal): LiteralExpression;
     export function binaryOp(left: Expression, op: BinaryOp, right: Expression): Expression;
     export function index(obj: Expression, index: Expression): Expression;
     /** Converts a string in dot-notation-format into a variable which indexes. */
     export function indexVariable(name: string): Expression;
     export function lambda(args: string[], value: Expression): LambdaExpression;
     export function method(target: Expression, func: string, args: Expression[]): MethodExpression;
     export function func(func: Expression, args: Expression[]): FunctionExpression;
     export function list(values: Expression[]): ListExpression;
     export function object(values: Record<string, Expression>): ObjectExpression;
     export function negate(child: Expression): NegatedExpression;
     export function isCompareOp(op: BinaryOp): op is CompareOp;
     /** Returns a set of all unbound variables (i.e., variables not provided by `row`, lambdas, or similar.) */
     export function unboundVariables(expr: Expression, bound?: Set<string>): Set<string>;
     /** Render an expression as a string. */
     export function toString(expr: Expression): string;
     const NULL: LiteralExpression;
 }

 /** Quick utilities for generating fields and doing searches over them.
  * @hidden
  */
 export declare namespace Extractors {
     /** Generate a list of fields for the given object, returning them as a list. */
     export function intrinsics<T extends Record<string, any>>(except?: Set<string>): FieldExtractor<T>;
     /** Field extractor which extracts frontmatter fields. */
     export function frontmatter<T extends Indexable>(front: (object: T) => Record<string, FrontmatterEntry> | undefined): FieldExtractor<T>;
     /** Field extractor which shows all inline fields. */
     export function inlineFields<T extends Indexable>(inlineMap: (object: T) => Record<string, InlineField> | undefined): FieldExtractor<T>;
     /** Merge multiple field extractors into one; if multiple extractors produce identical keys, keys from the earlier extractor will be preferred. */
     export function merge<T extends Fieldbearing>(...extractors: FieldExtractor<T>[]): FieldExtractor<T>;
 }

 /** Functional return type for error handling.
  * @hidden
  */
 export declare class Failure<T, E> {
     error: E;
     successful: false;
     constructor(error: E);
     map<U>(_f: (a: T) => U): Result<U, E>;
     flatMap<U>(_f: (a: T) => Result<U, E>): Result<U, E>;
     mapErr<U>(f: (e: E) => U): Result<T, U>;
     bimap<T2, E2>(_succ: (a: T) => T2, fail: (b: E) => E2): Result<T2, E2>;
     orElse(value: T): T;
     cast<U>(): Result<U, E>;
     orElseThrow(message?: (e: E) => string): T;
 }

 /**
  * General definition for a field. Provides the field key, value, as well as information on it's source and how it can be edited.
  * @group Common Types
  * */
 export declare interface Field {
     /** The canonical key name for the field (i.e., as it actually shows up in the data structure). */
     key: string;
     /** The value of the field. */
     value: Literal;
     /** The raw value of the field before parsing, if relevant. */
     raw?: string;
     /** If present, describes where the field came from in precise detail, allowing the field to be edited. */
     provenance?: Provenance;
 }

 export declare interface Fieldbearing {
     /** Return a list of all fields. This may be computed eagerly, so cache this value for repeated operations. */
     fields: Field[];
     /** Fetch a field with the given name if it is present on this object. */
     field(key: string): Field | undefined;
 }

 /** Metadata for objects which are annotated with fields. */
 export declare const FIELDBEARING_TYPE = "fields";

 export declare namespace Fieldbearings {
     export function isFieldbearing(object: any): object is Fieldbearing;
     /** Get a key from a generic map or fieldbearing object. */
     export function get(object: Fieldbearing | Record<string, Literal>, key: string): Literal | undefined;
 }

 /**
  * Generic function which extract fields. If no argument is provided, it should return all fields; otherwise,
  * it should return the field matching the given key.
  *
  * Keys are case-insensitive to match Obsidian standard behavior.
  */
 export declare type FieldExtractor<T> = (object: T, key?: string) => Field[];

 /**
  * {@inheritDoc FILE_TYPE}
  */
 declare interface File_2 extends Linkable {
     /** The path this file exists at. */
     $path: string;
     /** Obsidian-provided date this page was created. */
     $ctime: DateTime;
     /** Obsidian-provided date this page was modified. */
     $mtime: DateTime;
     /** Obsidian-provided size of this page in bytes. */
     $size: number;
     /** The extension of the file. */
     $extension: string;
 }
 export { File_2 as File }

 /** General metadata for any file. */
 export declare const FILE_TYPE = "file";

 /** Multi-threaded file parser which debounces rapid file requests automatically. */
 declare class FileImporter extends Component {
     vault: Vault;
     fileManager: FileManager;
     metadataCache: MetadataCache;
     workers: Map<number, PoolWorker>;
     /** The next worker ID to hand out. */
     nextWorkerId: number;
     /** If true, the importer is now inactive and will not process further files. */
     shutdown: boolean;
     /** List of files which have been queued for a reload. */
     queue: Queue<[TFile, Deferred<any>]>;
     /** Outstanding loads indexed by path. */
     outstanding: Map<string, Promise<any>>;
     /** Throttle settings. */
     throttle: () => ImportThrottle;
     constructor(vault: Vault, fileManager: FileManager, metadataCache: MetadataCache, throttle?: () => ImportThrottle);
     /**
      * Queue the given file for importing. Multiple import requests for the same file in a short time period will be de-bounced
      * and all be resolved by a single actual file reload.
      */
     import<T>(file: TFile): Promise<T>;
     /** Reset any active throttles on the importer (such as if the utilization changes). */
     unthrottle(): void;
     /** Poll from the queue and execute if there is an available worker. */
     private schedule;
     /** Finish the parsing of a file, potentially queueing a new file. */
     private finish;
     /** Obtain an available worker, returning undefined if one does not exist. */
     private availableWorker;
     /** Create a new worker bound to this importer. */
     private newWorker;
     /** Reject all outstanding promises and close all workers on close. */
     onunload(): void;
 }

 /** An entry in the frontmatter; includes the raw value, parsed value, and raw key (before lower-casing). */
 export declare interface FrontmatterEntry {
     /** The actual string in frontmatter with exact casing. */
     key: string;
     /** The parsed value of the frontmatter entry (date, duration, etc.). */
     value: Literal;
     /** The raw value of the frontmatter entry before parsing; generally a string or number. */
     raw: string;
 }

 /** A function expression which calls a function on 0 or more arguments. */
 export declare interface FunctionExpression {
     type: "function";
     /** Either the name of the function being called or a Function object. */
     func: Expression;
     /** The list of arguments being passed to the function. */
     arguments: Expression[];
 }

 /**
  * A function implementation which takes in a function context and a variable number of arguments. Throws an error if an
  * invalid number/type of arguments are passed.
  */
 declare type FunctionImpl = (context: Evaluator, ...rest: Literal[]) => Literal;

 /** @internal Recursively gather links from a literal object. */
 export declare function gatherLinks(input: Literal): Link[];

 /** @internal Gather tags from a datablock. */
 export declare function gatherTags(data: Record<string, FrontmatterEntry>): string[];

 /** Datacore representation of a generic file with no additional parsing. */
 export declare class GenericFile implements File_2, Indexable, Fieldbearing, Linkable {
     static TYPES: string[];
     $types: string[];
     $typename: string;
     $path: string;
     /** Obsidian-provided date this page was created. */
     $ctime: DateTime;
     /** Obsidian-provided date this page was modified. */
     $mtime: DateTime;
     /** Obsidian-provided size of this page in bytes. */
     $size: number;
     /** The extension of the file. */
     $extension: string;
     constructor(path: string, ctime: DateTime, mtime: DateTime, size: number);
     get fields(): Field[];
     field(key: string): Field;
     /** Get the value for the given field. */
     value(key: string): Literal | undefined;
     /** Unique ID for this object. */
     get $id(): string;
     /** The file for the file is the file. */
     get $file(): string;
     /** A link to the file. */
     get $link(): Link;
     private static FIELD_DEF;
 }

 /** Creates a horizontal flexbox "grouping" of elements.
  *
  * @group Components
  */
 export declare function Group(props: HTMLAttributes<HTMLDivElement> & {
     className?: string;
     justify?: string;
     align?: string;
     style?: string;
 }): JSX_2.Element;

 /** A grouping on a type which supports recursively-nested groups.
  * @group Common Types
  */
 export declare type GroupElement<T> = {
     key: Literal;
     rows: Grouping<T>;
 };

 /**
  * A grouping, which can be either:
  * - an array of elements of type `T`, or
  * - an array of {@link Groupelement}s
  *
  * @group Common Types
  */
 export declare type Grouping<T> = T[] | GroupElement<T>[];

 /**
  * Metadata for configuring how groupings in the data should be handled.
  * @group Props
  */
 declare interface GroupingConfig<T> {
     /** How a grouping with the given key and set of rows should be handled. */
     render?: (key: Literal, rows: Grouping<T>) => Literal | ReactNode;
 }

 /**
  * Metadata for configuring how groupings in the data should be handled.
  * @group Props
  */
 declare interface GroupingConfig_2<T> {
     /** How a grouping with the given key and set of rows should be rendered. */
     render?: (key: Literal, rows: Grouping<T>) => Literal | VNode;
 }

 /**
  * @hidden
  */
 export declare namespace Groupings {
     /** Determines if the given group entry is a standalone value, or a grouping of sub-entries. */
     export function isElementGroup<T>(entry: any): entry is GroupElement<T>;
     /** Determines if the given array is a grouping array. */
     export function isGrouping<T>(entry: Grouping<T>): entry is GroupElement<T>[];
     /** Determines if the given array is a leaf and has no subgroupings. */
     export function isLeaf<T>(entry: Grouping<T>): entry is T[];
     /** Count the total number of elements in a recursive grouping. */
     export function count<T>(elements: Grouping<T> | GroupElement<T>): number;
     /** Recursively slice a grouping, preserving the group structure that contains elements [start...end). */
     export function slice<T>(elements: Grouping<T>, start: number, end: number): Grouping<T>;
 }

 /**
  * A component that renders an SVG icon.
  * @group Components
  */
 export declare function Icon(props: {
     className?: string;
     icon: string;
 }): React_2.JSX.Element;

 /** Settings for throttling import. */
 declare interface ImportThrottle {
     /** The number of workers to use for imports. */
     workers: number;
     /** A number between 0.1 and 1 which indicates total cpu utilization target; 0.1 means spend 10% of time  */
     utilization: number;
 }

 /** Constant index query which matches all. */
 export declare const INDEX_ALL: IndexQuery;

 /** Constant index query which matches nothing. */
 export declare const INDEX_NONE: IndexQuery;

 /** Any indexable field, which must have a few index-relevant properties. */
 export declare interface Indexable {
     /** The object types that this indexable is. */
     $types: string[];
     /** Textual description of the object, such as `Page` or `Section`. Used in visualizations. */
     $typename: string;
     /** The unique index ID for this object. */
     $id: string;
     /**
      * The indexable object that is the parent of this object. Only set after the object is actually indexed.
      */
     $parent?: Indexable;
     /** If present, the revision in the index of this object. */
     $revision?: number;
     /** The file that this indexable was derived from, if file-backed. */
     $file?: string;
 }

 /**
  * All supported extensions. This should probably become a dynamic lookup table and not just
  * a fixed list at some point, especially if we add the ability to turn indexing on/off.
  */
 export declare const INDEXABLE_EXTENSIONS: Set<string>;

 /** AND two or more datastore queries together. */
 export declare interface IndexAnd {
     type: "and";
     elements: IndexQuery[];
 }

 /**
  * Fetch documents which are the children of documents matching the given other filter.
  */
 export declare interface IndexChildOf {
     type: "child-of";
     /** Filter which should produce the list of parent objects that the given document should be a child of. */
     parents: IndexQuery;
     /** If true, then include the parent objects itself as valid matches. */
     inclusive?: boolean;
 }

 /** Pure combinators for combining queries. */
 export declare type IndexCombinator = IndexAnd | IndexOr | IndexNot;

 /** Valid index-value comparisons. */
 export declare type IndexComparison = "=" | "!=" | ">" | "<" | ">=" | "<=";

 /** Return all results (true) or no results (false). */
 export declare interface IndexConstant {
     type: "constant";
     constant: boolean;
 }

 /**
  * Execute arbitrary expressions against the document, returning true if the expression evaluates to true.
  *
  * This is the most general form of query; it will implicitly require that all fields in the expression are
  * defined on the page.
  */
 export declare interface IndexExpression {
     type: "expression";
     /** The expression to evaluate against each object. */
     expression: Expression;
 }

 /**
  * Fetch documents which have the given field defined (even if it's value is null).
  */
 export declare interface IndexField {
     type: "field";
     /** The name of the field that must exist. This is case sensitive. */
     value: string;
 }

 /** Fetch the document with the given ID. */
 export declare interface IndexId {
     type: "id";
     /** The ID of the object to retrieve. */
     value: string;
 }

 /** Secondary index sources which take in another index source, modify it somehow, and return a new set of matches. */
 export declare type IndexIntermediate = IndexChildOf | IndexParentOf | IndexLinked;

 /** Fetch a document referenced by the given link. */
 export declare interface IndexLink {
     type: "link";
     /** The link being referenced. */
     value: Link;
 }

 /**
  * Start by finding all documents matching `source`, then follow file links in the desired directions (incoming, outgoing,
  * or both) for the given distance. The simple use of this operator is to just find inlinks/outlinks for a given file,
  * but it is more general and can look for local groups of files.
  */
 export declare interface IndexLinked {
     type: "linked";
     /** The source pages to search for connections from. */
     source: IndexQuery;
     /** Whether to look for only outgoing pages, incoming pages, or both incoming and outgoing pages. */
     direction: "outgoing" | "incoming" | "both";
     /** How far to look (defaults to 1 if not set). */
     distance?: number;
     /** If true, then include the source objects themselves as valid matches. */
     inclusive?: boolean;
 }

 /** NOT a datastore query, returning all pages not matching. */
 export declare interface IndexNot {
     type: "not";
     element: IndexQuery;
 }

 /** OR two or more datastore queries together. */
 export declare interface IndexOr {
     type: "or";
     elements: IndexQuery[];
 }

 /**
  * Fetch documents which are parents of documents matching the given filter.
  */
 export declare interface IndexParentOf {
     type: "parent-of";
     /** Filter which should produce the list of child objects that the given document should be a parent of. */
     children: IndexQuery;
     /** If true, then include the child objects themselves as valid matches. */
     inclusive?: boolean;
 }

 /** Fetch documents at the given path (potentially exactly). Also supports matching on specific files. */
 export declare interface IndexPath {
     type: "path";
     /** The folder that things should be contained within, potentially exactly. */
     value: string;
     /**
      * Whether the folder should match exactly. If exact, only files DIRECTLY in the folder (and not in subfolders)
      * will be matched.
      */
     exact?: boolean;
 }

 /** Primary index sources which just directly produce sets of matches. */
 export declare type IndexPrimitive = IndexId | IndexLink | IndexConstant | IndexTyped | IndexTagged | IndexPath | IndexField | IndexValueEquals;

 /** A full query AST. */
 export declare type IndexQuery = IndexCombinator | IndexExpression | IndexSource;

 /** Anything that produces sets of matching values. */
 export declare type IndexSource = IndexIntermediate | IndexPrimitive;

 /** Fetch documents with the given tag (potentially exactly). */
 export declare interface IndexTagged {
     type: "tagged";
     /** The tag. Should be prefixed with a '#'. */
     value: string;
     /** Whether the tag should match exactly. If exact, searching for #foo will NOT produce a page with #foo/bar. */
     exact?: boolean;
 }

 /** Fetch documents with the given type. */
 export declare interface IndexTyped {
     type: "typed";
     /** The type, such as 'markdown' or 'section'. */
     value: string;
 }

 /**
  * Fetch documents whose field value is equal to one of the given values. This will only work for specially indexed fields
  * which can be compared against, such as task 'completed', and the 'date' field of date-labelled pages.
  */
 export declare interface IndexValueEquals {
     type: "equal-value";
     /** The field whose value we are checking. */
     field: string;
     /** The set of acceptable values. */
     values: Literal[];
 }

 /** @public A ridiculous type which properly types the result of the 'groupIn' command. */
 export declare type Ingrouped<U, T> = T extends {
     key: any;
     rows: any;
 } ? {
     key: T["key"];
     rows: Ingrouped<U, T["rows"][0]>;
 } : {
     key: U;
     rows: T[];
 };

 /** Statistics about a successful vault initialization. */
 declare interface InitializationStats {
     /** How long initializaton took in miliseconds. */
     durationMs: number;
     /** Total number of files that were imported */
     files: number;
     /** The number of files that were loaded and imported via background workers. */
     imported: number;
     /** The number of files that were skipped due to no longer existing or not being ready. */
     skipped: number;
     /** The number of files loaded from the IndexedDB cache. */
     cached: number;
 }

 /** Full inline field metadata for an object. */
 export declare interface InlineField {
     /** The actual key describing the inline field. */
     key: string;
     /** The raw value of the inline field. */
     raw: string;
     /** The parsed value. */
     value: Literal;
     /** Full position information for where the inline field is located in the document. */
     position: {
         /** The line number the inline field appears on. */
         line: number;
         /** The start column of the field. */
         start: number;
         /** The start column of the *value* for the field. Immediately after the '::'. */
         startValue: number;
         /** The end column of the field. */
         end: number;
     };
     /** If this inline field was defined via a wrapping ('[' or '(' or 'link'), then the wrapping that was used. */
     wrapping?: string;
 }

 /** Various intents for buttons and other interactive elements. */
 export declare type Intent = "error" | "warn" | "info" | "success";

 /** CSS classes for each level of intent. */
 export declare const INTENT_CLASSES: Record<Intent, string>;

 /** Common metadata for all canvas cards. */
 declare interface JsonBaseCanvasCard {
     /** Path of the canvas file this card comes from. */
     $file: string;
     /** In-canvas ID of the card. */
     $id: string;
     /** Position of the card in the canvas. */
     $position: CardPos;
     /** Size of the card in the canvas. */
     $dimensions: CardDimensions;
     /** The background color of the card. */
     $color?: string;
     /** A direct link to the card. */
     $link: JsonLink;
 }

 /** JSON representation of all canvas metadata. */
 declare interface JsonCanvas {
     /** All of the cards in the canvas. */
     $cards: JsonCanvasCard[];
     /** Total byte size of the canvas. */
     $size: number;
     /** Path to the canvas file. */
     $path: string;
     /** Created time as a UNIX epoch time in milliseconds. */
     $ctime: number;
     /** Last modified time as a UNIX epoch time in milliseconds. */
     $mtime: number;
     /** All tags in the canvas. */
     $tags: string[];
     /** All links in the canvas. */
     $links: JsonLink[];
     /** All inline fields in the canvas. */
     $infields: Record<string, JsonInlineField>;
 }

 /** A canvas card in an Obsidian canvas. */
 declare type JsonCanvasCard = JsonCanvasTextCard | JsonCanvasFileCard | JsonCanvasWebCard;

 /** An embedded file card in a canvas. */
 declare interface JsonCanvasFileCard extends JsonBaseCanvasCard {
     $linkedFile: string;
     $type: "file-card";
 }

 /** A canvas text card. */
 declare interface JsonCanvasTextCard extends JsonBaseCanvasCard {
     $type: "text-card";
     $tags: string[];
     $links: JsonLink[];
     $infields: Record<string, JsonInlineField>;
     $sections: JsonMarkdownSection[];
     $frontmatter?: Record<string, JsonFrontmatterEntry>;
 }

 /** An embedded web link in a canvas. */
 declare interface JsonCanvasWebCard extends JsonBaseCanvasCard {
     $url: string;
     $type: "web-card";
 }

 /** An entry in the frontmatter; includes the raw value, parsed value, and raw key (before lower-casing). */
 declare interface JsonFrontmatterEntry {
     /** The actual string in frontmatter with exact casing. */
     key: string;
     /** The parsed value of the frontmatter entry (date, duration, etc.). */
     value: JsonLiteral;
     /** The raw value of the frontmatter entry before parsing; generally a string or number. */
     raw: string;
 }

 /** @internal Convert a regular frontmatter entry into a JSON frontmatter entry. */
 export declare function jsonFrontmatterEntry(raw: FrontmatterEntry): JsonFrontmatterEntry;

 /** JSON, serializable representation of an inline field. */
 declare interface JsonInlineField {
     /** The actual key describing the inline field. */
     key: string;
     /** The raw value of the inline field. */
     raw: string;
     /** The parsed value. */
     value: JsonLiteral;
     /** Full position information for where the inline field is located in the document. */
     position: {
         /** The line number the inline field appears on. */
         line: number;
         /** The start column of the field. */
         start: number;
         /** The start column of the *value* for the field. Immediately after the '::'. */
         startValue: number;
         /** The end column of the field. */
         end: number;
     };
     /** If this inline field was defined via a wrapping ('[' or '(' or 'link'), then the wrapping that was used. */
     wrapping?: string;
 }

 /** @hidden Serialized form of a link. */
 declare interface JsonLink {
     /** The file path this link points to. */
     path: string;
     /** The display name associated with the link. */
     display?: string;
     /** The block ID or header this link points to within a file, if relevant. */
     subpath?: string;
     /** Is this link an embedded link (of form '![[hello]]')? */
     embed: boolean;
     /** The type of this link, which determines what 'subpath' refers to, if anything. */
     type: "file" | "header" | "block";
 }

 /** JSON-serialized equivalents for literals. */
 declare type JsonLiteral = boolean | number | string | {
     $_type: "date";
     value: string;
 } | {
     $_type: "duration";
     value: string;
 } | {
     $_type: "link";
     value: JsonLink;
 } | Array<JsonLiteral> | Record<string, any> | null;

 declare interface JsonMarkdownBlock {
     /** The index of this block in the file. */
     $ordinal: number;
     /** The position/extent of the block. */
     $position: LineSpan;
     /** All tags on the block. */
     $tags: string[];
     /** All links in the file. */
     $links: JsonLink[];
     /** Map of all distinct inline fields in the document, from key name -> metadata. */
     $infields: Record<string, JsonInlineField>;
     /** If present, the distinct block ID for this block. */
     $blockId?: string;
     /** The type of block - paragraph, list, and so on. */
     $type: string;
 }

 declare interface JsonMarkdownCodeblock extends JsonMarkdownBlock {
     /** The language of the code block. May be empty. */
     $languages: string[];
     /** The start and end line of codeblock. */
     $contentPosition: {
         start: number;
         end: number;
     };
     /** Whether the codeblock is defined via ``` fences or a 4-character indent. */
     $style: "indent" | "fenced";
     $type: "codeblock";
 }

 declare interface JsonMarkdownDatablock extends JsonMarkdownBlock {
     /** The raw data in the object. */
     $data: Record<string, JsonFrontmatterEntry>;
     $type: "datablock";
 }

 declare interface JsonMarkdownListBlock extends JsonMarkdownBlock {
     /** The list items inside of this block. */
     $elements: JsonMarkdownListItem[];
     $type: "list";
 }

 declare interface JsonMarkdownListItem {
     /** The position of the list item in the file. */
     $position: LineSpan;
     /** Child elements of this list item. */
     $elements: JsonMarkdownListItem[];
     /** The type of list item that this element is. */
     $type: string;
     /** Exact tags on this list item. */
     $tags: string[];
     /** Map of all distinct inline fields in the document, from key name -> metadata. */
     $infields: Record<string, JsonInlineField>;
     /** All links in the file. */
     $links: JsonLink[];
     /** The block ID of this list item if present. */
     $blockId?: string;
     /**
      * The line number of the parent of this list item.
      * If a positive number, then this list element is a child
      * of the list element at that line.
      *
      * If a negative number, then this list element is a root element
      * of a list starting at that line (negated). I.e., -7 means
      * this is a root element of the list starting at line 7.
      */
     $parentLine: number;
     /** The symbol at the start of the list item (such as '+' or '-' or '1.'). */
     $symbol?: string;
     /** The contents of the list item. May be undefined if the list item could not be parsed. */
     $text?: string;
 }

 /** Stores just the minimal information needed to create a markdown file; used for saving and loading these files. */
 declare interface JsonMarkdownPage {
     /** The path this file exists at. */
     $path: string;
     /** Obsidian-provided date this page was created. */
     $ctime: number;
     /** Obsidian-provided date this page was modified. */
     $mtime: number;
     /** The extension; for markdown files, almost always '.md'. */
     $extension: string;
     /** Obsidian-provided size of this page in bytes. */
     $size: number;
     /** The full extent of the file (start 0, end the number of lines in the file.) */
     $position: LineSpan;
     /** The exact tags in the file. */
     $tags: string[];
     /** All links in the file. */
     $links: JsonLink[];
     /** Frontmatter values in the file, if present. Maps lower case frontmatter key -> entry. */
     $frontmatter?: Record<string, JsonFrontmatterEntry>;
     /** Map of all distinct inline fields in the document. Maps lower case key name -> full metadata. */
     $infields: Record<string, JsonInlineField>;
     /**
      * All child markdown sections of this markdown file. The initial section before any content is special and is
      * named with the title of the file.
      */
     $sections: JsonMarkdownSection[];
 }

 /** Minimal information required for markdown sections. */
 declare interface JsonMarkdownSection {
     /** The index of this section in the file. */
     $ordinal: number;
     /** The title of the section; the root (implicit) section will have the title of the page. */
     $title: string;
     /** The indentation level of the section (1 - 6). */
     $level: number;
     /** The span of lines indicating the position of the section. */
     $position: LineSpan;
     /** All tags on the file. */
     $tags: string[];
     /** All links in the file. */
     $links: JsonLink[];
     /** All of the markdown blocks in this section. */
     $blocks: JsonMarkdownBlock[];
     /** Map of all distinct inline fields in the document, from key name -> metadata. */
     $infields: Record<string, JsonInlineField>;
 }

 declare interface JsonMarkdownTaskItem extends JsonMarkdownListItem {
     $type: "task";
     /** The text inside of the task marker (usually '*' for checked tasks). */
     $status: string;
 }

 /** An inline function accepting one or more arguments and producing a value. */
 export declare interface LambdaExpression {
     type: "lambda";
     /** An ordered list of named arguments. */
     arguments: string[];
     /** The field which will be evaluated using the arguments in context. */
     value: Expression;
 }

 /** A span of contiguous lines. */
 declare interface LineSpan {
     /** The inclusive start line. */
     start: number;
     /** The exclusive end line. */
     end: number;
 }

 /**
  * The Obsidian 'link', used for uniquely describing a file, header, or block.
  * @group Common Types
  */
 export declare class Link {
     /** The file path this link points to. */
     path: string;
     /** The display name associated with the link. */
     display?: string;
     /** The block ID or header this link points to within a file, if relevant. */
     subpath?: string;
     /** Is this link an embedded link (of form '![[hello]]')? */
     embed: boolean;
     /** The type of this link, which determines what 'subpath' refers to, if anything. */
     type: "file" | "header" | "block";
     /** Create a link to a specific file. */
     static file(path: string, embed?: boolean, display?: string): Link;
     /** Infer the type of the link from the full internal link path. */
     static infer(linkpath: string, embed?: boolean, display?: string): Link;
     /** Create a link to a specific file and header in that file. */
     static header(path: string, header: string, embed?: boolean, display?: string): Link;
     /** Create a link to a specific file and block in that file. */
     static block(path: string, blockId: string, embed?: boolean, display?: string): Link;
     /** Load a link from it's raw JSON representation. */
     static fromObject(object: JsonLink): Link;
     /** Create a link by parsing it's interior part (inside of the '[[]]'). */
     static parseInner(rawlink: string): Link;
     private constructor();
     /** Update this link with a new path. */
     withPath(path: string): Link;
     /** Return a new link which points to the same location but with a new display value. */
     withDisplay(display?: string): Link;
     /** Return a new link which has the given embedded status. */
     withEmbed(embed: boolean): Link;
     /** Convert a file link into a link to a specific header. */
     withHeader(header: string): Link;
     /** Convert a file link into a link to a specificb lock. */
     withBlock(block: string): Link;
     /** Checks for link equality (i.e., that the links are pointing to the same exact location). */
     equals(other: Link): boolean;
     /** Convert this link to it's markdown representation. */
     toString(): string;
     /** Convert this link to a raw object which is serialization-friendly. */
     toObject(): JsonLink;
     /** Convert any link into a link to its file. */
     toFile(): Link;
     /** Convert this link into an embedded link. */
     toEmbed(): Link;
     /** Convert this link into a non-embedded link. */
     fromEmbed(): Link;
     /** Convert this link to markdown so it can be rendered. */
     markdown(): string;
     /** Obtain the display for this link if present, or return a simple default display. */
     displayOrDefault(): string;
     /** Convert the inner part of the link to something that Obsidian can open / understand. */
     obsidianLink(): string;
     /** The stripped name of the file this link points to. */
     fileName(): string;
 }

 /**
  * {@inheritDoc LINKABLE_TYPE}
  */
 export declare interface Linkable {
     /** A link to this linkable object. */
     $link: Link;
 }

 /** Metadata for objects which support linking. */
 export declare const LINKABLE_TYPE = "linkable";

 /**
  * {@inheritDoc LINKBEARING_TYPE}
  */
 export declare interface Linkbearing {
     /** The links in this file. */
     $links: Link[];
 }

 /** Metadata for objects which can link to other things. */
 export declare const LINKBEARING_TYPE = "links";

 /** Handles link resolution and normalization inside of a context. */
 declare interface LinkHandler {
     /** Resolve a link to the metadata it contains. */
     resolve(path: string | Link): DataObject | null;
     /**
      * Normalize a link to it's fully-qualified path for comparison purposes.
      * If the path does not exist, returns it unchanged.
      */
     normalize(path: string): string;
     /** Return true if the given path actually exists, false otherwise. */
     exists(path: string): boolean;
 }

 /** A link normalizer which takes in a raw link and produces a normalized link. */
 export declare type LinkNormalizer = (link: Link) => Link;

 /** A list literal, which is an ordered collection of fields. */
 export declare interface ListExpression {
     type: "list";
     values: Expression[];
 }

 /**
  * A simple and responsive list view.
  * @group Components
  */
 export declare function ListView<T>(props: ListViewProps<T>): JSX_4.Element;

 /**
  * State for a {@link ListView}
  * @typeParam T - the type of the items contained in the list
  * @group States
  */
 export declare interface ListViewProps<T> {
     /**
      * Whether the list should be ordered, unordered, or block.
      *
      * Block lists do not use an actual list element and instead just render a series of contiguous
      * div elements with no other annotations.
      */
     type?: "ordered" | "unordered" | "block";
     /** The full collection of elements in the list. */
     rows: Grouping<T>;
     /** Allows for grouping header lines to be overridden with custom rendering/logic. */
     groupings?: GroupingConfig_2<T> | GroupingConfig_2<T>[] | ((key: Literal, rows: Grouping<T>) => Literal | VNode);
     /**
      * Custom render function to use for rendering each leaf element. Can produce either JSX or a plain value which will be
      * rendered as a literal.
      */
     renderer?: (row: T) => React.ReactNode | Literal;
     /** Controls whether paging is enabled for this element. If true, uses default page size. If a number, paging is enabled with the given page size. */
     paging?: boolean | number;
     /**
      * Whether the view will scroll to the top automatically on page changes. If true, will always scroll on page changes.
      * If a number, will scroll only if the number is greater than the current page size.
      **/
     scrollOnPaging?: boolean | number;
     /** Maximum level of children that will be rendered; a level of 0 means no children expansion will occur. */
     maxChildDepth?: number;
     /**
      * Property name, list of property names, or function to be applied to obtain children for a given entry.
      * Defaults to the `$children` and `children` props.
      *
      * If null, child extraction is disabled and no children will be fetched. If undefined, uses the default.
      */
     childSource?: null | string | string[] | ((row: T) => T[]);
 }

 /** The render type of the list view. */
 export declare type ListViewType = "ordered" | "unordered" | "block";

 /** Intelligently render an arbitrary literal value. */
 export declare const Lit: typeof RawLit;

 /** The raw values that a literal can take on. */
 export declare type Literal = boolean | number | string | DateTime | Duration | Link | Array<Literal> | DataObject | Function | null;

 /** Literal representation of some field type. */
 export declare interface LiteralExpression {
     type: "literal";
     value: Literal;
 }

 /** Maps the string type to it's external, API-facing representation. */
 export declare type LiteralRepr<T extends LiteralType> = T extends "boolean" ? boolean : T extends "number" ? number : T extends "string" ? string : T extends "duration" ? Duration : T extends "date" ? DateTime : T extends "null" ? null : T extends "link" ? Link : T extends "array" ? Array<Literal> : T extends "object" ? DataObject : T extends "function" ? Function : any;

 /** Maps a literal type or the catch-all '*'. */
 declare type LiteralReprAll<T extends LiteralTypeOrAll> = T extends "*" ? Literal : T extends LiteralType ? LiteralRepr<T> : any;

 /**
  * @hidden
  *  Utility library for handling literal values. */
 export declare namespace Literals {
     /** Settings used when formatting literal values to text. */
     export interface ToStringSettings {
         /** What a null will render as. */
         nullRepresentation: string;
         /** Date format. */
         dateFormat: string;
         /** Date-time format. */
         dateTimeFormat: string;
     }
     /** Sane, English-based defaults for date formats. */
     const DEFAULT_TO_STRING: ToStringSettings;
     /** Convert an arbitrary value into a reasonable, Markdown-friendly string if possible. */
     export function toString(field: any, setting?: ToStringSettings, recursive?: boolean): string;
     /** Wrap a literal value so you can switch on it easily. */
     export function wrapValue(val: Literal): WrappedLiteral | undefined;
     /** Recursively map complex objects at the leaves. */
     export function mapLeaves(val: Literal, func: (t: Literal) => Literal): Literal;
     /** Check if two arbitrary literals are equal. */
     export function equals(first: Literal | undefined, second: Literal | undefined): boolean;
     /** Compare two arbitrary JavaScript values. Produces a total ordering over ANY possible datacore value. */
     export function compare(val1: Literal | undefined, val2: Literal | undefined, linkNormalizer?: (link: string) => string): number;
     /** Find the corresponding datacore type for an arbitrary value. */
     export function typeOf(val: any): LiteralType | undefined;
     /** Determine if the given value is "truthy" (i.e., is non-null and has data in it). */
     export function isTruthy(field: Literal): boolean;
     /** Deep copy a field. */
     export function deepCopy<T extends Literal>(field: T): T;
     /** Determine if the value is a string. */
     export function isString(val: any): val is string;
     /** Determine if the value is a number. */
     export function isNumber(val: any): val is number;
     /** Determine if the value is a date. */
     export function isDate(val: any): val is DateTime;
     /** Determine if the value is a duration. */
     export function isDuration(val: any): val is Duration;
     /** Determine if the value is null or undefined. */
     export function isNull(val: any): val is null | undefined;
     /** Determine if the value is an array. */
     export function isArray(val: any): val is any[];
     /** Determine if the value is a boolean. */
     export function isBoolean(val: any): val is boolean;
     /** Determine if the value is a link. */
     export function isLink(val: any): val is Link;
     /** Checks if the given value is an object (and not any other datacore-recognized object-like type). */
     export function isObject(val: any): val is Record<string, any>;
     /** Determines if the given value is a javascript function. */
     export function isFunction(val: any): val is Function;
 }

 /** The literal types supported by the query engine. */
 export declare type LiteralType = "boolean" | "number" | "string" | "date" | "duration" | "link" | "array" | "object" | "function" | "null";

 /** A literal type or a catch-all '*'. */
 declare type LiteralTypeOrAll = LiteralType | "*";

 /** Combines a textual type and value; primarily useful for switching on.
  * @hidden
  */
 export declare interface LiteralWrapper<T extends LiteralType> {
     type: T;
     value: LiteralRepr<T>;
 }

 /** Simpler wrapper for a file-backed cache for arbitrary metadata. */
 declare class LocalStorageCache {
     appId: string;
     version: string;
     persister: LocalForage;
     constructor(appId: string, version: string);
     /** Drop the entire cache instance and re-create a new fresh instance. */
     recreate(): Promise<void>;
     /** Load file metadata by path. */
     loadFile(path: string): Promise<Cached<Partial<any>> | null | undefined>;
     /** Store file metadata by path. */
     storeFile(path: string, data: Partial<any>): Promise<void>;
     /** Drop old file keys that no longer exist. */
     synchronize(existing: string[] | Set<string>): Promise<Set<string>>;
     /** Obtain a list of all metadata keys. */
     allKeys(): Promise<string[]>;
     /** Obtain a list of all persisted files. */
     allFiles(): Promise<string[]>;
     /** Get a unique key for a given file path. */
     fileKey(path: string): string;
 }

 /** Index a value into another value. */
 export declare type LogicalOp = "index";

 /** @public Finds the value of the lowest value type in a grouping. */
 export declare type LowestKey<T> = T extends {
     key: any;
     rows: any;
 } ? LowestKey<T["rows"][0]> : T;

 /** Hacky preact component which wraps Obsidian's markdown renderer into a neat component. */
 export declare const Markdown: typeof RawMarkdown;

 /** Base class for all markdown blocks. */
 export declare class MarkdownBlock implements Indexable, Linkbearing, Taggable, Fieldbearing {
     static TYPES: string[];
     $types: string[];
     $typename: string;
     $id: string;
     $file: string;
     /** The index of this block in the file. */
     $ordinal: number;
     /** The position/extent of the block. */
     $position: LineSpan;
     /** All tags on the block. */
     $tags: string[];
     /** All links in the file. */
     $links: Link[];
     /** Map of all distinct inline fields in the document, from key name -> metadata. */
     $infields: Record<string, InlineField>;
     /** If present, the distinct block ID for this block. */
     $blockId?: string;
     /** The type of block - paragraph, list, and so on. */
     $type: string;
     /** @internal */
     static from(object: JsonMarkdownBlock, file: string, normalizer?: LinkNormalizer): MarkdownBlock;
     protected constructor(init: Partial<MarkdownBlock>);
     /** If this block has a block ID, the link to this block. */
     get $link(): Link | undefined;
     /** All of the indexed fields in this object. */
     get fields(): Field[];
     /** Fetch a specific field by key. */
     field(key: string): Field;
     value(key: string): Literal | undefined;
     /** @internal */
     json(): JsonMarkdownBlock;
     static FIELD_DEF: FieldExtractor<MarkdownBlock>;
     /** Generate a readable ID for this block using the ordinal of the block. */
     static readableId(file: string, ordinal: number): string;
 }

 /** A block containing markdown code. */
 export declare class MarkdownCodeblock extends MarkdownBlock implements Indexable, Fieldbearing, Linkbearing {
     static TYPES: string[];
     $types: string[];
     $languages: string[];
     $contentPosition: {
         start: number;
         end: number;
     };
     $style: "fenced" | "indent";
     constructor(init: Partial<MarkdownCodeblock>);
     /** @internal */
     static from(object: JsonMarkdownCodeblock, file: string, normalizer?: LinkNormalizer): MarkdownCodeblock;
     /** All of the indexed fields in this object. */
     get fields(): Field[];
     /** Fetch a specific field by key. */
     field(key: string): Field;
     /** Fetch the value of a specific field. */
     value(key: string): Literal | undefined;
     /** @internal */
     json(): JsonMarkdownCodeblock;
     static readableId(file: string, line: number): string;
     static SUB_FIELD_DEF: FieldExtractor<MarkdownCodeblock>;
 }

 /** A data-annotated YAML codeblock. */
 export declare class MarkdownDatablock extends MarkdownBlock implements Indexable, Fieldbearing, Linkbearing {
     static TYPES: string[];
     $types: string[];
     $data: Record<string, FrontmatterEntry>;
     constructor(init: Partial<MarkdownDatablock>);
     /** @internal */
     static from(object: JsonMarkdownDatablock, file: string, normalizer?: LinkNormalizer): MarkdownDatablock;
     /** All of the indexed fields in this object. */
     get fields(): Field[];
     /** Fetch a specific field by key. */
     field(key: string): Field;
     value(key: string): Literal | undefined;
     /** @internal */
     json(): JsonMarkdownDatablock;
     static readableId(file: string, line: number): string;
     static SUB_FIELD_DEF: FieldExtractor<MarkdownDatablock>;
 }

 /** Special block for markdown lists (of either plain list entries or tasks). */
 export declare class MarkdownListBlock extends MarkdownBlock implements Taggable, Linkbearing {
     static TYPES: string[];
     $types: string[];
     $typename: string;
     /** The list items inside of this block. */
     $elements: MarkdownListItem[];
     /** @internal Create a list block from a serialized value. */
     static from(object: JsonMarkdownListBlock, file: string, normalizer?: LinkNormalizer): MarkdownListBlock;
     /** @internal */
     json(): JsonMarkdownListBlock;
     constructor(init: Partial<MarkdownListBlock>);
 }

 /** A specific list item in a list. */
 export declare class MarkdownListItem implements Indexable, Linkbearing, Taggable, Fieldbearing {
     static TYPES: string[];
     $types: string[];
     $typename: string;
     $id: string;
     $file: string;
     /** The position of the list item in the file. */
     $position: LineSpan;
     /** Child elements of this list item. */
     $elements: MarkdownListItem[];
     /** The type of list item that this element is. */
     $type: string;
     /** Exact tags on this list item. */
     $tags: string[];
     /** Map of all distinct inline fields in the document, from key name -> metadata. */
     $infields: Record<string, InlineField>;
     /** All links in the file. */
     $links: Link[];
     /** The block ID of this list item if present. */
     $blockId?: string;
     /**
      * The line number of the parent of this list item.
      * If a positive number, then this list element is a child
      * of the list element at that line.
      *
      * If a negative number, then this list element is a root element
      * of a list starting at that line (negated). I.e., -7 means
      * this is a root element of the list starting at line 7.
      */
     $parentLine: number;
     /** The marker used to start the list item (such as - or + or *). On a malformed task, may be undefined. */
     $symbol?: string;
     /** The text contents of the list item. */
     $text?: string;
     /** @internal Create a list item from a serialized object. */
     static from(object: JsonMarkdownListItem, file: string, normalizer?: LinkNormalizer): MarkdownListItem;
     protected constructor(init: Partial<MarkdownListItem>);
     /** Get the line that this list item starts on. */
     get $line(): number;
     /** The number of lines in this list item. */
     get $lineCount(): number;
     /** Cleaned text that is garaunteed to be non-null and has indenation and inline fields removed. */
     get $cleantext(): string;
     /** All of the indexed fields in this object. */
     get fields(): Field[];
     /** Fetch a specific field by key. */
     field(key: string): Field;
     value(key: string): Literal | undefined;
     /** @internal */
     json(): JsonMarkdownListItem;
     private static FIELD_DEF;
     /** Generate a readable ID for this item using the line number. */
     static readableId(file: string, line: number): string;
 }

 /** A markdown file in the vault; the source of most metadata. */
 export declare class MarkdownPage implements File_2, Linkbearing, Taggable, Indexable, Fieldbearing {
     /** All of the types that a markdown file is. */
     static TYPES: string[];
     $types: string[];
     $typename: string;
     get $id(): string;
     get $file(): string;
     /** Frontmatter values in the file, if present. Maps lower case frontmatter key -> entry. */
     $frontmatter?: Record<string, FrontmatterEntry>;
     /** Map of all distinct inline fields in the document. Maps lower case key name -> full metadata. */
     $infields: Record<string, InlineField>;
     /** The path this file exists at. */
     $path: string;
     /** Obsidian-provided date this page was created. */
     $ctime: DateTime;
     /** Obsidian-provided date this page was modified. */
     $mtime: DateTime;
     /** The extension; for markdown files, almost always '.md'. */
     $extension: string;
     /** Obsidian-provided size of this page in bytes. */
     $size: number;
     /** The full extent of the file (start 0, end the number of lines in the file.) */
     $position: LineSpan;
     /** The exact tags in the file. */
     $tags: string[];
     /** All links in the file. */
     $links: Link[];
     /**
      * All child markdown sections of this markdown file. The initial section before any content is special and is
      * named with the title of the file.
      */
     $sections: MarkdownSection[];
     /** @internal Create a markdown file from the given raw values. */
     static from(raw: JsonMarkdownPage, normalizer?: LinkNormalizer): MarkdownPage;
     private constructor();
     /** Return the number of lines in the document. */
     get $lineCount(): number;
     /** The name of the file. */
     get $name(): string;
     /** A link to this file. */
     get $link(): Link;
     /** All of the indexed fields in this object. */
     get fields(): Field[];
     /** Get the full field definition for the given field. */
     field(key: string): Field | undefined;
     /** Get the value for the given field. */
     value(key: string): Literal | undefined;
     /** @internal Convert this page into it's partial representation for saving. */
     json(): JsonMarkdownPage;
     private static FIELD_DEF;
 }

 export declare class MarkdownSection implements Indexable, Taggable, Linkable, Linkbearing, Fieldbearing {
     /** All of the types that a markdown section is. */
     static TYPES: string[];
     /** Path of the file that this section is in. */
     $types: string[];
     $typename: string;
     $id: string;
     $file: string;
     /** The index of this section in the file. */
     $ordinal: number;
     /** The title of the section; the root (implicit) section will have the title of the page. */
     $title: string;
     /** The indentation level of the section (1 - 6). */
     $level: number;
     /** The span of lines indicating the position of the section. */
     $position: LineSpan;
     /** All tags on the file. */
     $tags: string[];
     /** All links in the file. */
     $links: Link[];
     /** All of the markdown blocks in this section. */
     $blocks: MarkdownBlock[];
     /** Map of all distinct inline fields in the document, from key name -> metadata. */
     $infields: Record<string, InlineField>;
     /** @internal Convert raw markdown section data to the appropriate class. */
     static from(raw: JsonMarkdownSection, file: string, normalizer?: LinkNormalizer): MarkdownSection;
     private constructor();
     /** Obtain the number of lines in the section. */
     get $lineCount(): number;
     /** Alias for title which allows searching over pages and sections by 'name'. */
     get $name(): string;
     /** Return a link to this section. */
     get $link(): Link;
     /** All of the indexed fields in this object. */
     get fields(): Field[];
     /** Fetch a specific field by key. */
     field(key: string): Field;
     value(key: string): Literal | undefined;
     /** @internal */
     json(): JsonMarkdownSection;
     private static FIELD_DEF;
     /** Generate a readable ID for this section using the first 8 characters of the string and the ordinal. */
     static readableId(file: string, title: string, ordinal: number): string;
 }

 /** A specific task inside of a markdown list. */
 export declare class MarkdownTaskItem extends MarkdownListItem implements Indexable, Linkbearing, Taggable, Fieldbearing {
     static TYPES: string[];
     $types: string[];
     $typename: string;
     /** The text inside of the task item. */
     $status: string;
     /** @internal */
     static from(object: JsonMarkdownTaskItem, file: string, normalizer: LinkNormalizer): MarkdownTaskItem;
     constructor(init: Partial<MarkdownTaskItem>);
     /** @internal */
     json(): JsonMarkdownListItem;
     /** Determine if the given task is completed. */
     get $completed(): boolean;
 }

 /** A method call of the form `expr.function()`. Checks if the expression is an object which has that function; otherwise, falls back to a function call. */
 export declare interface MethodExpression {
     type: "method";
     /** The target the method is being called on. */
     target: Expression;
     /** The name of the function being called. */
     func: string;
     /** The list of arguments being passed to the function call. */
     arguments: Expression[];
 }

 /** An expression which negates the value of the original field. */
 export declare interface NegatedExpression {
     type: "negated";
     /** The child field to negate. */
     child: Expression;
 }

 export declare const NOOP_NORMALIZER: LinkNormalizer;

 /** @internal Normalize links deeply in the object. */
 export declare function normalizeLinks<T extends Literal>(input: T, normalizer: LinkNormalizer): T;

 /** An object literal, which is a mapping of name to field. */
 export declare interface ObjectExpression {
     type: "object";
     values: Record<string, Expression>;
 }

 /** Get variables from a plain object. */
 declare class ObjectVariables implements Variables {
     object: DataObject;
     constructor(object: DataObject);
     all(): DataObject;
     resolve(name: string): Literal | undefined;
 }

 /** A worker in the pool of executing workers. */
 declare interface PoolWorker {
     /** The id of this worker. */
     id: number;
     /** The raw underlying worker. */
     worker: Worker;
     /** UNIX time indicating the next time this worker is available for execution according to target utilization. */
     availableAt: number;
     /** The active promise this worker is working on, if any. */
     active?: [TFile, Deferred<any>, number];
 }

 /** The source of a field, used when determining what files to overwrite and how. */
 export declare type Provenance = {
     type: "frontmatter";
     file: string;
     key: string;
 } | {
     type: "inline-field";
     file: string;
     line: number;
     key: string;
 };

 /** Intelligently render an arbitrary literal value. */
 declare function RawLit({ value, sourcePath: maybeSourcePath, inline, depth, }: PropsWithChildren<{
     value: Literal | undefined;
     sourcePath?: string;
     inline?: boolean;
     depth?: number;
 }>): JSX_4.Element;

 declare function RawMarkdown({ content, sourcePath: maybeSourcePath, inline, style, cls, onClick, }: {
     content: string;
     sourcePath?: string;
     inline?: boolean;
     style?: CSSProperties;
     cls?: string;
     onClick?: (event: MouseEvent) => any;
 }): JSX_4.Element;

 /**
  * A monadic result type which stores either "success" or "failure". An alternative handling exceptional behavior
  * by using the return value instead of an exception.
  */
 export declare type Result<T, E> = Success<T, E> | Failure<T, E>;

 /**
  * @hidden
  * Monadic 'Result' type which encapsulates whether a procedure succeeded or failed, as well as it's return value.
  */
 export declare namespace Result {
     /** Construct a new success result wrapping the given value. */
     export function success<T, E>(value: T): Result<T, E>;
     /** Construct a new failure value wrapping the given error. */
     export function failure<T, E>(error: E): Result<T, E>;
     /** Join two results with a bi-function and return a new result. */
     export 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>;
     /** Join two results with a bi-function and return a new result. */
     export function map2<T1, T2, O, E>(first: Result<T1, E>, second: Result<T2, E>, f: (a: T1, b: T2) => O): Result<O, E>;
     /** Map a failable function over all elements in the list, returning early on failure. */
     export function mapAll<T, O, E>(input: Iterable<T>, func: (input: T) => Result<O, E>): Result<O[], E>;
     /** Catch any errors in a call, returning a result instead. */
     export function trying<T>(call: () => T): Result<T, Error>;
     /** Convert a promise which may throw into a promise which returns a result of the successful value or an error. */
     export function async<T>(promise: Promise<T>): Promise<Result<T, Error>>;
 }

 /** The result of searching given an index query. */
 export declare interface SearchResult<O> {
     /** The query used to search. */
     query: IndexQuery;
     /** All of the returned results. */
     results: O[];
     /** The amount of time in seconds that the search took. */
     duration: number;
     /** The maximum revision of any document in the result, which is useful for diffing. */
     revision: number;
 }

 /** Extra settings that can be provided to a search. */
 declare interface SearchSettings {
     /** The path to run from when resolving links and `this` sections. */
     sourcePath?: string;
 }

 /** All datacore settings. */
 export declare interface Settings {
     /** The number of threads the importer will use for importing. */
     importerNumThreads: number;
     /** The CPU utilization (between 0.1 and 1.0) that importer threads should use. */
     importerUtilization: number;
     /** Are JS views enabled? */
     enableJs: boolean;
     /**
      * Whether views are paged by default. This is an important performance optimization,
      * since showing hundreds or thousands of results can be fairly slow!
      */
     defaultPagingEnabled: boolean;
     /** Default paging size for all views (number of entries per page.) */
     defaultPageSize: number;
     /** If set, views will scroll to the top of the view on page changes. */
     scrollOnPageChange: boolean;
     /**
      * Maximum depth that objects will be rendered to (i.e., how many levels of subproperties
      * will be rendered by default). This avoids infinite recursion due to self referential objects
      * and also ensures that rendering objects is acceptably performant.
      */
     maxRecursiveRenderDepth: number;
     /** The default format that dates are rendered in (using luxon's moment-like formatting). */
     defaultDateFormat: string;
     /** The default format that date-times are rendered in (using luxons moment-like formatting). */
     defaultDateTimeFormat: string;
     /** Markdown text for how to render null values in tables or similar. */
     renderNullAs: string;
     /** Whether to index inline fields by default. Inline field parsing requires a full scan of the document, which can make indexing take 2-3x longer. */
     indexInlineFields: boolean;
     /** Whether to index list and task item text and states. Indexing lists & tasks requires some additional regex parsing which makes indexing modestly slower. */
     indexListItems: boolean;
 }

 /**
  * Wrapper for a slider (range input) with some default classes.
  * @group Components
  */
 export declare function Slider(props: {
     className?: string;
     min?: number;
     max?: number;
     step?: number;
     value?: number;
     defaultValue?: number;
     onValueChange?: (value: number) => void;
 } & React_2.ComponentProps<"input">): React_2.JSX.Element;

 /** Creates a vertical flexbox "stack" of elements.
  *
  * @group Components
  */
 export declare function Stack(props: HTMLAttributes<HTMLDivElement> & {
     className?: string;
     justify?: string;
     align?: string;
     style?: string;
 }): JSX_2.Element;

 /** A general function for storing sub-objects in a given object. */
 declare type Substorer<T extends Indexable> = (object: T, add: <U extends Indexable>(object: U | U[], subindex?: Substorer<U>) => void) => void;

 /**
  * @module api
  */
 /**
  *  Functional return type for error handling.
  * @hidden
  * */
 export declare class Success<T, E> {
     value: T;
     successful: true;
     constructor(value: T);
     map<U>(f: (a: T) => U): Result<U, E>;
     flatMap<U>(f: (a: T) => Result<U, E>): Result<U, E>;
     mapErr<U>(f: (e: E) => U): Result<T, U>;
     bimap<T2, E2>(succ: (a: T) => T2, _fail: (b: E) => E2): Result<T2, E2>;
     orElse(_value: T): T;
     cast<U>(): Result<U, E>;
     orElseThrow(_message?: (e: E) => string): T;
 }

 /**
  * Wrapper for a switch (toggle) component with some default classes.
  * @group Components
  */
 export declare function Switch(props: {
     className?: string;
     disabled?: boolean;
     checked?: boolean;
     defaultChecked?: boolean;
     onToggleChange?: (checked: boolean) => void;
 } & React_2.ComponentProps<"input">): React_2.JSX.Element;

 /**
  * A simple column definition which allows for custom renderers and titles.
  * @group Props
  * @typeParam T - the type of each row
  * @typeParam V - the type of the value in this column
  */
 export declare interface TableColumn<T, V = Literal> {
     /** The unique ID of this table column; you cannot have multiple columns with the same ID in a given table. */
     id: string;
     /** The title which will display at the top of the column if present. */
     title?: string | ReactNode | (() => string | ReactNode);
     /** If present, the CSS width to apply to the column. 'minimum' will set the column size to it's smallest possible value, while 'maximum' will do the opposite. */
     width?: "minimum" | "maximum" | string;
     /** Value function which maps the row to the value being rendered. */
     value: (object: T) => V;
     /** Called to render the given column value. Can depend on both the specific value and the row object. */
     render?: (value: V, object: T) => Literal | ReactNode;
 }

 /**
  * A simple table which supports grouping, sorting, paging, and custom columns.
  * @group Components
  * @param props
  */
 export declare function TableView<T>(props: TableViewProps<T>): JSX_3.Element;

 /**
  * All available props for a table.
  * @group Props
  */
 export declare interface TableViewProps<T> {
     /** The columns to render in the table. */
     columns: TableColumn<T>[];
     /** The rows to render; may potentially be grouped or just a plain array. */
     rows: Grouping<T>;
     /** Allows for grouping header columns to be overridden with custom rendering/logic. */
     groupings?: GroupingConfig<T> | GroupingConfig<T>[] | ((key: Literal, rows: Grouping<T>) => Literal | ReactNode);
     /**
      * If set to a boolean - enables or disables paging.
      * If set to a number, paging will be enabled with the given number of rows per page.
      */
     paging?: boolean | number;
     /**
      * Whether the view will scroll to the top automatically on page changes. If true, will always scroll on page changes.
      * If a number, will scroll only if the number is greater than the current page size.
      **/
     scrollOnPaging?: boolean | number;
 }

 /**
  * {@inheritDoc TAGGABLE_TYPE}
  */
 export declare interface Taggable {
     /** The exact tags on this object. (#a/b/c or #foo/bar). */
     $tags: string[];
 }

 /** Metadata for taggable objects. */
 export declare const TAGGABLE_TYPE = "taggable";

 /**
  * A simple textbox which accepts text.
  * @group Components
  */
 export declare function Textbox(props: React_2.ComponentProps<"input"> & {
     className?: string;
 }): React_2.JSX.Element;

 /**
  * "Interns" the incoming value, returning the oldest equal instance. This is a trick to improve React diffing
  *  behavior, as two objects which are equals via equality(a, b) will return the same object reference after being
  *  interned.
  *
  * @group Hooks
  */
 declare function useInterning<T>(value: T, equality: (a: T, b: T) => boolean): T;

 /** @internal Convert a json frontmatter entry to a regular frontmatter entry. */
 export declare function valueFrontmatterEntry(raw: JsonFrontmatterEntry): FrontmatterEntry;

 /**
  * Wrapper for a select component with some default classes.
  * @group Components
  */
 export declare function VanillaSelect(props: {
     className?: string;
     options: {
         value: string;
         label: string;
     }[];
     value?: string;
     defaultValue?: string;
     onValueChange?: (value: string) => void;
 } & React_2.ComponentProps<"select">): React_2.JSX.Element;

 /** A variable field for a variable with a given name. */
 export declare interface VariableExpression {
     type: "variable";
     name: string;
 }

 /** Source of variables which can be referenced in the evaluator. */
 declare interface Variables {
     /** Render the entire variable store to a key-value map. */
     all(): DataObject;
     /** Resolve a variable by name. */
     resolve(name: string): Literal | undefined;
 }

 /** Default utility functions for making variable stores. */
 declare namespace Variables {
     function empty(): ObjectVariables;
     function infer(object: any): Variables;
     function lambda(parent: Variables, locals: Record<string, Literal>): Variables;
 }

 /** A wrapped literal value which can be switched on. */
 export declare type WrappedLiteral = LiteralWrapper<"string"> | LiteralWrapper<"number"> | LiteralWrapper<"boolean"> | LiteralWrapper<"date"> | LiteralWrapper<"duration"> | LiteralWrapper<"link"> | LiteralWrapper<"array"> | LiteralWrapper<"object"> | LiteralWrapper<"function"> | LiteralWrapper<"null">;

 export { }
