obsidian-typings 4.27.0 → 4.28.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6,9 +6,10 @@ import type { ChangeDesc, Extension, Transaction } from '@codemirror/state';
6
6
  import type { EditorView, ViewUpdate } from '@codemirror/view';
7
7
  import type { Tree as LezerTree } from '@lezer/common';
8
8
  import type { App as App$1, BrowserWindow } from 'electron';
9
+ import moment$1 from 'moment';
9
10
  import type { default as moment$1 } from 'moment';
10
11
  import type { FSWatcher } from 'node:fs';
11
- import type { App, BlockCache, CacheItem, CachedMetadata, CloseableComponent, ColorComponent, Command, Component, DataAdapter, Debouncer, EditableFileView, Editor, EditorPosition, EditorRange, EditorRangeOrCaret, EditorSuggest, EmbedCache, EventRef, Events, FileStats, FileView, FrontmatterLinkCache, FuzzySuggestModal, HoverLinkSource, HoverPopover, IconName, ItemView, KeymapInfo, LinkCache, MarkdownEditView, MarkdownFileInfo, MarkdownPostProcessorContext, MarkdownPreviewView, MarkdownView, Menu, Modal, PaneType, Plugin as Plugin, PluginManifest, PluginSettingTab, Reference, ReferenceCache, Scope, SearchComponent, SearchResult, Setting, SettingTab, SplitDirection, TAbstractFile, TFile, TFolder, TextComponent, TextFileView, Vault, View, ViewCreator, ViewState, Workspace, WorkspaceLeaf, WorkspaceTabs } from 'obsidian';
12
+ import type { App, BlockCache, CacheItem, CachedMetadata, CloseableComponent, ColorComponent, Command, Component, DataAdapter, Debouncer, EditableFileView, Editor, EditorPosition, EditorRange, EditorRangeOrCaret, EditorSuggest, EmbedCache, EventRef, Events, FileStats, FileView, FrontmatterLinkCache, FuzzySuggestModal, HoverLinkSource, HoverPopover, IconName, ItemView, KeymapInfo, LinkCache, MarkdownEditView, MarkdownFileInfo, MarkdownPostProcessorContext, MarkdownPreviewView, MarkdownView, Menu, Modal, PaneType, Plugin as Plugin, PluginManifest, PluginSettingTab, PopoverSuggest, Reference, ReferenceCache, Scope, SearchComponent, SearchResult, Setting, SettingTab, SplitDirection, TAbstractFile, TFile, TFolder, TextComponent, TextFileView, Vault, View, ViewCreator, ViewState, Workspace, WorkspaceLeaf, WorkspaceTabs } from 'obsidian';
12
13
  import type { Application, Container, Graphics, ICanvas, Sprite, Text as Text$1, TextStyle } from 'pixi.js';
13
14
 
14
15
  /**
@@ -572,21 +573,20 @@ export interface AddOverlayOptions {
572
573
  query: RegExp;
573
574
  }
574
575
  /**
575
- * @todo Documentation incomplete.
576
+ * Property widget component for aliases.
577
+ *
576
578
  * @public
577
579
  * @unofficial
578
580
  */
579
- export interface AliasesPropertyWidgetComponent extends PropertyWidgetComponentBase {
580
- /** @todo Documentation incomplete. */
581
+ export interface AliasesPropertyWidgetComponent extends PropertyWidgetComponentBase<string | string[]> {
582
+ /** The render context for the property widget. */
581
583
  ctx: PropertyRenderContext;
582
- /** @todo Documentation incomplete. */
584
+ /** The hover popover for the property widget. */
583
585
  hoverPopover: HoverPopover | null;
584
- /** @todo Documentation incomplete. */
586
+ /** The multiselect component for the property widget. */
585
587
  multiselect: Multiselect;
586
- /** @todo Documentation incomplete. */
588
+ /** The type of the property widget. */
587
589
  type: "aliases";
588
- /** @todo Documentation incomplete. */
589
- setValue(value: string | string[]): void;
590
590
  }
591
591
  /**
592
592
  * @todo Documentation incomplete.
@@ -1322,101 +1322,6 @@ export interface BacklinkView extends InfoFileView {
1322
1322
  */
1323
1323
  export interface BacklinkViewConstructor extends TypedViewConstructor<BacklinkView> {
1324
1324
  }
1325
- /**
1326
- * @remark `BaseEditor` is never used in the Obsidian codebase, but is exposed in the Obsidian module as `Editor`.
1327
- * However, most editor components actually make use of the extended `Editor`, so this interface is purposely.
1328
- * named to `BaseEditor` to not require any casting for most purposes (or overriding the `editor` property type.
1329
- * for all components).
1330
- * @todo Potential risk of confusion when `Editor` is constructed from the Obsidian module, as it only has the.
1331
- * methods from `BaseEditor`, *not* `Editor`.
1332
- */
1333
- /**
1334
- * @todo Documentation incomplete.
1335
- * @public
1336
- * @unofficial
1337
- */
1338
- export interface BaseEditor {
1339
- /**
1340
- * CodeMirror editor instance.
1341
- */
1342
- cm: EditorView;
1343
- /**
1344
- * HTML instance the CM editor is attached to.
1345
- */
1346
- containerEl: HTMLElement;
1347
- /**
1348
- * Clean-up function executed after indenting lists.
1349
- */
1350
- afterIndent(): void;
1351
- /**
1352
- * Expand text.
1353
- */
1354
- expandText(): void;
1355
- /**
1356
- * Indents a list by one level.
1357
- */
1358
- indentList(): void;
1359
- /**
1360
- * Insert a template callout at the current cursor position.
1361
- */
1362
- insertCallout(): void;
1363
- /**
1364
- * Insert a template code block at the current cursor position.
1365
- */
1366
- insertCodeblock(): void;
1367
- /**
1368
- * Insert a markdown link at the current cursor position.
1369
- */
1370
- insertLink(): void;
1371
- /**
1372
- * Insert a mathjax equation block at the current cursor position.
1373
- */
1374
- insertMathJax(): void;
1375
- /**
1376
- * Insert specified text at the current cursor position.
1377
- *
1378
- * @remark Might be broken, inserts at the end of the document.
1379
- */
1380
- insertText(text: string): void;
1381
- /**
1382
- * Inserts a new line and continues a markdown bullet point list at the same level.
1383
- */
1384
- newlineAndIndentContinueMarkdownList(): void;
1385
- /**
1386
- * Inserts a new line at the same indent level.
1387
- */
1388
- newlineAndIndentOnly(): void;
1389
- /**
1390
- * Get the character position at a mouse event.
1391
- */
1392
- posAtMouse(e: MouseEvent): EditorPosition;
1393
- /**
1394
- * Toggles blockquote syntax on paragraph under cursor.
1395
- */
1396
- toggleBlockquote(): void;
1397
- /**
1398
- * Toggle bullet point list syntax on paragraph under cursor.
1399
- */
1400
- toggleBulletList(): void;
1401
- /**
1402
- * Toggle checkbox syntax on paragraph under cursor.
1403
- */
1404
- toggleCheckList(): void;
1405
- /**
1406
- * Toggle numbered list syntax on paragraph under cursor.
1407
- */
1408
- toggleNumberList(): void;
1409
- /**
1410
- * Convert word under cursor into a wikilink.
1411
- *
1412
- * @param embed - Whether to embed the link or not.
1413
- */
1414
- triggerWikiLink(embed: boolean): void;
1415
- /**
1416
- * Unindents a list by one level.
1417
- */
1418
- unindentList(): void;
1419
- }
1420
1325
  /**
1421
1326
  * @todo Documentation incomplete.
1422
1327
  * @public
@@ -2986,17 +2891,16 @@ export interface CapacitorFileEntry extends Partial<FileStats> {
2986
2891
  export interface CeilFunction extends BasesFunction, HasGetDisplayName {
2987
2892
  }
2988
2893
  /**
2989
- * @todo Documentation incomplete.
2894
+ * Property widget component for checkboxes.
2895
+ *
2990
2896
  * @public
2991
2897
  * @unofficial
2992
2898
  */
2993
- export interface CheckboxPropertyWidgetComponent extends PropertyWidgetComponentBase {
2994
- /** @todo Documentation incomplete. */
2899
+ export interface CheckboxPropertyWidgetComponent extends PropertyWidgetComponentBase<boolean> {
2900
+ /** The checkbox element for the property widget. */
2995
2901
  checkboxEl: HTMLInputElement;
2996
- /** @todo Documentation incomplete. */
2902
+ /** The type of the property widget. */
2997
2903
  type: "checkbox";
2998
- /** @todo Documentation incomplete. */
2999
- setValue(value: boolean | null): void;
3000
2904
  }
3001
2905
  /**
3002
2906
  * @todo Documentation incomplete.
@@ -3878,34 +3782,65 @@ export interface DateOnOrAfterFunction extends BasesFunction, HasGetDisplayName,
3878
3782
  export interface DateOnOrBeforeFunction extends BasesFunction, HasGetDisplayName, HasCompare, HasGetRHSWidgetType {
3879
3783
  }
3880
3784
  /**
3881
- * @todo Documentation incomplete.
3785
+ * Property widget component for dates.
3786
+ *
3882
3787
  * @public
3883
3788
  * @unofficial
3884
3789
  */
3885
- export interface DatePropertyWidgetComponent extends PropertyWidgetComponentBase {
3886
- /** @todo Documentation incomplete. */
3887
- inputEl: HTMLInputElement;
3888
- /** @todo Documentation incomplete. */
3790
+ export interface DatePropertyWidgetComponent extends DatePropertyWidgetComponentBase {
3791
+ /** The button element for the property widget. */
3792
+ buttonEl: HTMLDivElement | null;
3793
+ /** The type of the property widget. */
3889
3794
  type: "date";
3890
- /** @todo Documentation incomplete. */
3891
- parseDate(input: moment$1.MomentInput): string;
3892
- /** @todo Documentation incomplete. */
3893
- setValue(value: string | null): void;
3894
3795
  }
3895
3796
  /**
3896
- * @todo Documentation incomplete.
3797
+ * Base interface for date property widget components.
3798
+ *
3897
3799
  * @public
3898
3800
  * @unofficial
3899
3801
  */
3900
- export interface DatetimePropertyWidgetComponent extends PropertyWidgetComponentBase {
3901
- /** @todo Documentation incomplete. */
3802
+ export interface DatePropertyWidgetComponentBase extends PropertyWidgetComponentBase<moment$1.MomentInput> {
3803
+ /** The date of the property widget. */
3804
+ date?: moment$1.Moment;
3805
+ /** Whether the property widget is dirty. */
3806
+ dirty: boolean;
3807
+ /** The hover popup for the property widget. */
3808
+ hoverPopup: HoverPopover | null;
3809
+ /** The input element for the property widget. */
3902
3810
  inputEl: HTMLInputElement;
3903
- /** @todo Documentation incomplete. */
3811
+ /** The value of the property widget. */
3812
+ value: string;
3813
+ /**
3814
+ * Build the input element for the property widget.
3815
+ *
3816
+ * @param parentEl - The parent element.
3817
+ * @returns The input element.
3818
+ */
3819
+ buildInput(parentEl: HTMLElement): HTMLInputElement;
3820
+ /**
3821
+ * Format the date input.
3822
+ *
3823
+ * @param input - The input to format.
3824
+ * @returns The formatted date.
3825
+ */
3826
+ format(input: moment$1.Moment): string;
3827
+ /**
3828
+ * Parse the date input.
3829
+ *
3830
+ * @param input - The input to parse.
3831
+ * @returns The parsed date.
3832
+ */
3833
+ parse(input: moment$1.MomentInput): void;
3834
+ }
3835
+ /**
3836
+ * Property widget component for datetimes.
3837
+ *
3838
+ * @public
3839
+ * @unofficial
3840
+ */
3841
+ export interface DatetimePropertyWidgetComponent extends DatePropertyWidgetComponentBase {
3842
+ /** The type of the property widget. */
3904
3843
  type: "datetime";
3905
- /** @todo Documentation incomplete. */
3906
- parseDateTime(input: moment$1.MomentInput): string;
3907
- /** @todo Documentation incomplete. */
3908
- setValue(value: string | null): void;
3909
3844
  }
3910
3845
  /**
3911
3846
  * @todo Documentation incomplete.
@@ -5185,17 +5120,16 @@ export interface FilePropertiesViewConstructor extends TypedViewConstructor<File
5185
5120
  ]> {
5186
5121
  }
5187
5122
  /**
5188
- * @todo Documentation incomplete.
5123
+ * Property widget component for files.
5124
+ *
5189
5125
  * @public
5190
5126
  * @unofficial
5191
5127
  */
5192
- export interface FilePropertyWidgetComponent extends PropertyWidgetComponentBase {
5193
- /** @todo Documentation incomplete. */
5128
+ export interface FilePropertyWidgetComponent extends PropertyWidgetComponentBase<string | null> {
5129
+ /** The input element for the property widget. */
5194
5130
  inputEl: HTMLInputElement;
5195
- /** @todo Documentation incomplete. */
5131
+ /** The type of the property widget. */
5196
5132
  type: "file";
5197
- /** @todo Documentation incomplete. */
5198
- setValue(value: string | null): void;
5199
5133
  }
5200
5134
  /**
5201
5135
  * @todo Documentation incomplete.
@@ -5412,17 +5346,16 @@ export interface FolderBookmarkItem extends BookmarkItem {
5412
5346
  type: "folder";
5413
5347
  }
5414
5348
  /**
5415
- * @todo Documentation incomplete.
5349
+ * Property widget component for folders.
5350
+ *
5416
5351
  * @public
5417
5352
  * @unofficial
5418
5353
  */
5419
- export interface FolderPropertyWidgetComponent extends PropertyWidgetComponentBase {
5420
- /** @todo Documentation incomplete. */
5354
+ export interface FolderPropertyWidgetComponent extends PropertyWidgetComponentBase<string> {
5355
+ /** The input element for the property widget. */
5421
5356
  inputEl: HTMLInputElement;
5422
- /** @todo Documentation incomplete. */
5357
+ /** The type of the property widget. */
5423
5358
  type: "folder";
5424
- /** @todo Documentation incomplete. */
5425
- setValue(value: string | null): void;
5426
5359
  }
5427
5360
  /**
5428
5361
  * @todo Documentation incomplete.
@@ -6534,9 +6467,11 @@ export interface InfinityScroll {
6534
6467
  /** @todo Documentation incomplete. */
6535
6468
  updateVirtualDisplay(x: unknown): unknown;
6536
6469
  }
6537
- /** @todo This is probably not the right term */
6538
6470
  /**
6539
- * @todo Documentation incomplete.
6471
+ * Info file view.
6472
+ *
6473
+ * @remark This is probably not the right term.
6474
+ *
6540
6475
  * @public
6541
6476
  * @unofficial
6542
6477
  */
@@ -7837,6 +7772,10 @@ export interface MetadataTypeManager extends Events {
7837
7772
  * Get expected widget type for property and the one inferred from the property value.
7838
7773
  */
7839
7774
  getTypeInfo(options: GetTypeInfoOptions): TypeInfo;
7775
+ /**
7776
+ * Get property widget.
7777
+ */
7778
+ getWidget(type: string): PropertyWidget<unknown>;
7840
7779
  /**
7841
7780
  * Load property types from config.
7842
7781
  */
@@ -7870,33 +7809,34 @@ export interface MetadataTypeManager extends Events {
7870
7809
  export interface MetadataTypeManagerPropertiesRecord extends Record<string, PropertyInfo> {
7871
7810
  }
7872
7811
  /**
7873
- * @todo Documentation incomplete.
7812
+ * Registered type widgets.
7813
+ *
7874
7814
  * @public
7875
7815
  * @unofficial
7876
7816
  */
7877
7817
  export interface MetadataTypeManagerRegisteredTypeWidgetsRecord extends Record<PropertyWidgetType, PropertyWidget<unknown>> {
7878
- /** @todo Documentation incomplete. */
7818
+ /** Property widget for aliases. */
7879
7819
  aliases: PropertyWidget<string | string[], AliasesPropertyWidgetComponent>;
7880
- /** @todo Documentation incomplete. */
7881
- checkbox: PropertyWidget<boolean | null, CheckboxPropertyWidgetComponent>;
7882
- /** @todo Documentation incomplete. */
7820
+ /** Property widget for checkboxes. */
7821
+ checkbox: PropertyWidget<boolean, CheckboxPropertyWidgetComponent>;
7822
+ /** Property widget for dates. */
7883
7823
  date: PropertyWidget<moment$1.MomentInput, DatePropertyWidgetComponent>;
7884
- /** @todo Documentation incomplete. */
7824
+ /** Property widget for datetimes. */
7885
7825
  datetime: PropertyWidget<moment$1.MomentInput, DatetimePropertyWidgetComponent>;
7886
- /** @todo Documentation incomplete. */
7826
+ /** Property widget for files. */
7887
7827
  file: PropertyWidget<string, FilePropertyWidgetComponent>;
7888
- /** @todo Documentation incomplete. */
7828
+ /** Property widget for folders. */
7889
7829
  folder: PropertyWidget<string, FolderPropertyWidgetComponent>;
7890
- /** @todo Documentation incomplete. */
7891
- multitext: PropertyWidget<string[], MultitextPropertyWidgetComponent>;
7892
- /** @todo Documentation incomplete. */
7830
+ /** Property widget for multitexts. */
7831
+ multitext: PropertyWidget<string[] | string, MultitextPropertyWidgetComponent>;
7832
+ /** Property widget for numbers. */
7893
7833
  number: PropertyWidget<number, NumberPropertyWidgetComponent>;
7894
- /** @todo Documentation incomplete. */
7834
+ /** Property widget for properties. */
7895
7835
  property: PropertyWidget<string, PropertyPropertyWidgetComponent>;
7896
- /** @todo Documentation incomplete. */
7897
- tags: PropertyWidget<string[], TagsPropertyWidgetComponent>;
7898
- /** @todo Documentation incomplete. */
7899
- text: PropertyWidget<null | string, TextPropertyWidgetComponent>;
7836
+ /** Property widget for tags. */
7837
+ tags: PropertyWidget<string[] | string, TagsPropertyWidgetComponent>;
7838
+ /** Property widget for text. */
7839
+ text: PropertyWidget<string, TextPropertyWidgetComponent>;
7900
7840
  }
7901
7841
  /**
7902
7842
  * @todo Documentation incomplete.
@@ -7995,82 +7935,178 @@ export interface MobileToolbar {
7995
7935
  export interface MonthFunction extends BasesFunction, HasExtract {
7996
7936
  }
7997
7937
  /**
7998
- * @todo Documentation incomplete.
7938
+ * Multiselect component.
7939
+ *
7999
7940
  * @public
8000
7941
  * @unofficial
8001
7942
  */
8002
7943
  export interface Multiselect {
8003
- /** @todo Documentation incomplete. */
8004
- changeCallback?: (values: string[]) => void;
8005
- /** @todo Documentation incomplete. */
7944
+ /** The elements of the multiselect. */
8006
7945
  elements: HTMLDivElement[];
8007
- /** @todo Documentation incomplete. */
7946
+ /** The input element of the multiselect. */
8008
7947
  inputEl: HTMLDivElement;
8009
- /** @todo Documentation incomplete. */
7948
+ /** The text of the input element of the multiselect. */
8010
7949
  readonly inputText: string;
8011
- /** @todo Documentation incomplete. */
8012
- optionRenderer?: (value: string, ctx: OptionContext) => void;
8013
- /** @todo Documentation incomplete. */
7950
+ /** The root element of the multiselect. */
8014
7951
  rootEl: HTMLDivElement;
8015
- /** @todo Documentation incomplete. */
8016
- setupInput: (this: Multiselect, inputEl: HTMLDivElement, initializer: (value: string, shouldFocus?: boolean) => unknown) => void;
8017
- /** @todo Documentation incomplete. */
7952
+ /** The values of the multiselect. */
8018
7953
  values: string[];
8019
- /** @todo Documentation incomplete. */
7954
+ /**
7955
+ * Create a new element for the multiselect.
7956
+ *
7957
+ * @param value - the value of the element.
7958
+ * @returns the created element or `null` if the value is not valid.
7959
+ */
8020
7960
  _createElement(value: string): string | null;
8021
- /** @todo Documentation incomplete. */
7961
+ /** Create a new input element for the multiselect. */
8022
7962
  _createInputEl(): HTMLDivElement;
8023
- /** @todo Documentation incomplete. */
7963
+ /**
7964
+ * Add a new element to the multiselect.
7965
+ *
7966
+ * @param value - the value of the element.
7967
+ * @returns `true` if the element was added, `false` otherwise.
7968
+ */
8024
7969
  addElement(value: string): boolean;
8025
- /** @todo Documentation incomplete. */
7970
+ /**
7971
+ * Allow creating options for the multiselect.
7972
+ *
7973
+ * @param createOption - the function to create an option.
7974
+ * @returns the multiselect.
7975
+ */
8026
7976
  allowCreatingOptions(createOption: (this: Multiselect, value: string) => string | undefined): this;
8027
- /** @todo Documentation incomplete. */
7977
+ /**
7978
+ * The callback for the change event.
7979
+ *
7980
+ * @param values - the values of the multiselect.
7981
+ */
7982
+ changeCallback?(values: string[]): void;
7983
+ /**
7984
+ * Create a new option for the multiselect.
7985
+ *
7986
+ * @param value - the value of the option.
7987
+ * @returns the created option or `undefined` if the value is not valid.
7988
+ */
8028
7989
  createOption?(this: Multiselect, value: string): string | undefined;
8029
- /** @todo Documentation incomplete. */
7990
+ /**
7991
+ * Edit an element of the multiselect.
7992
+ *
7993
+ * @param index - the index of the element.
7994
+ */
8030
7995
  editElement(index: number): void;
8031
- /** @todo Documentation incomplete. */
7996
+ /**
7997
+ * Find a duplicate in the multiselect.
7998
+ *
7999
+ * @param values - the values to find a duplicate in.
8000
+ * @returns `true` if a duplicate was found, `false` otherwise.
8001
+ */
8032
8002
  findDuplicate?(this: Multiselect, values: string[]): boolean;
8033
- /** @todo Documentation incomplete. */
8003
+ /**
8004
+ * Focus an element of the multiselect.
8005
+ *
8006
+ * @param index - the index of the element.
8007
+ */
8034
8008
  focusElement(index: number): void;
8035
- /** @todo Documentation incomplete. */
8009
+ /**
8010
+ * Handle the change event of the multiselect.
8011
+ *
8012
+ * @param changeCallback - the callback to handle the change event.
8013
+ */
8036
8014
  onChange(changeCallback: (values: string[]) => void): void;
8037
- /** @todo Documentation incomplete. */
8038
- onOptionContextmenu?(this: Multiselect, menu: Menu, value: string, ctx: OptionContext): void;
8039
- /** @todo Documentation incomplete. */
8015
+ /**
8016
+ * Handle the context menu event of the multiselect.
8017
+ *
8018
+ * @param menu - the menu to handle the context menu event.
8019
+ * @param value - the value of the element.
8020
+ */
8021
+ onOptionContextmenu?(this: Multiselect, menu: Menu, value: string, ctx: MultiselectOptionContextMenuContext): void;
8022
+ /** The renderer for the options of the multiselect. */
8023
+ optionRenderer?(value: string, ctx: MultiselectOptionContextMenuContext): void;
8024
+ /**
8025
+ * Prevent duplicates in the multiselect.
8026
+ *
8027
+ * @param findDuplicate - the function to find a duplicate.
8028
+ * @returns the multiselect.
8029
+ */
8040
8030
  preventDuplicates(findDuplicate: (this: Multiselect, values: string[]) => number): this;
8041
- /** @todo Documentation incomplete. */
8031
+ /**
8032
+ * Remove an element of the multiselect.
8033
+ *
8034
+ * @param index - the index of the element.
8035
+ */
8042
8036
  removeElement(index: number, shouldFocus?: boolean): void;
8043
- /** @todo Documentation incomplete. */
8037
+ /** Render the values of the multiselect. */
8044
8038
  renderValues(): void;
8045
- /** @todo Documentation incomplete. */
8039
+ /**
8040
+ * Set the text of the input element of the multiselect.
8041
+ *
8042
+ * @param text - the text to set.
8043
+ */
8046
8044
  setInputText(text: string): void;
8047
- /** @todo Documentation incomplete. */
8048
- setOptionContextmenuHandler(onOptionContextmenu: (this: Multiselect, menu: Menu, value: string, ctx: OptionContext) => void): this;
8049
- /** @todo Documentation incomplete. */
8050
- setOptionRenderer(optionRenderer: (value: string, ctx: OptionContext) => void): this;
8051
- /** @todo Documentation incomplete. */
8045
+ /**
8046
+ * Set the context menu handler of the multiselect.
8047
+ *
8048
+ * @param onOptionContextmenu - the function to handle the context menu event.
8049
+ * @returns the multiselect.
8050
+ */
8051
+ setOptionContextmenuHandler(onOptionContextmenu: (this: Multiselect, menu: Menu, value: string, ctx: MultiselectOptionContextMenuContext) => void): this;
8052
+ /**
8053
+ * Set the option renderer of the multiselect.
8054
+ *
8055
+ * @param optionRenderer - the function to render the options.
8056
+ * @returns the multiselect.
8057
+ */
8058
+ setOptionRenderer(optionRenderer: (value: string, ctx: MultiselectOptionContextMenuContext) => void): this;
8059
+ /**
8060
+ * The setup function for the input element of the multiselect.
8061
+ *
8062
+ * @param inputEl - the input element.
8063
+ * @param initializer - the initializer function.
8064
+ */
8065
+ setupInput?(this: Multiselect, inputEl: HTMLDivElement, initializer: (value: string, shouldFocus?: boolean) => unknown): void;
8066
+ /**
8067
+ * Set the setup function for the input element of the multiselect.
8068
+ *
8069
+ * @param setupInput - the function to setup the input element.
8070
+ * @returns the multiselect.
8071
+ */
8052
8072
  setupInputEl(setupInput: (this: Multiselect, inputEl: HTMLDivElement, initializer: (value: string, shouldFocus?: boolean) => unknown) => void): this;
8053
- /** @todo Documentation incomplete. */
8073
+ /**
8074
+ * Set the values of the multiselect.
8075
+ *
8076
+ * @param values - the values to set.
8077
+ * @returns the multiselect.
8078
+ */
8054
8079
  setValues(values: string[] | null): this;
8055
- /** @todo Documentation incomplete. */
8080
+ /** Trigger the change event of the multiselect. */
8056
8081
  triggerChange(): void;
8057
8082
  }
8058
8083
  /**
8059
- * @todo Documentation incomplete.
8084
+ * Multiselect option context menu context.
8085
+ *
8060
8086
  * @public
8061
8087
  * @unofficial
8062
8088
  */
8063
- export interface MultitextPropertyWidgetComponent extends PropertyWidgetComponentBase {
8064
- /** @todo Documentation incomplete. */
8089
+ export interface MultiselectOptionContextMenuContext {
8090
+ /** The element of the option context. */
8091
+ el: HTMLDivElement;
8092
+ /** The pill element of the option context. */
8093
+ pillEl: HTMLDivElement;
8094
+ }
8095
+ /**
8096
+ * Property widget component for multiple texts.
8097
+ *
8098
+ * @public
8099
+ * @unofficial
8100
+ */
8101
+ export interface MultitextPropertyWidgetComponent extends PropertyWidgetComponentBase<string[] | string> {
8102
+ /** The hover popover for the property widget. */
8065
8103
  hoverPopover: HoverPopover | null;
8066
- /** @todo Documentation incomplete. */
8104
+ /** The multiselect component for the property widget. */
8067
8105
  multiselect: Multiselect;
8068
- /** @todo Documentation incomplete. */
8106
+ /** The type of the property widget. */
8069
8107
  type: "multitext";
8070
- /** @todo Documentation incomplete. */
8108
+ /** The values of the property widget. */
8071
8109
  valueSet: Set<string>;
8072
- /** @todo Documentation incomplete. */
8073
- setValue(value: string[] | string): void;
8074
8110
  }
8075
8111
  /**
8076
8112
  * @todo Documentation incomplete.
@@ -8174,17 +8210,18 @@ export interface NoteComposerPluginOptions {
8174
8210
  export interface NowFunction extends BasesFunction {
8175
8211
  }
8176
8212
  /**
8177
- * @todo Documentation incomplete.
8213
+ * Property widget component for numbers.
8214
+ *
8178
8215
  * @public
8179
8216
  * @unofficial
8180
8217
  */
8181
- export interface NumberPropertyWidgetComponent extends PropertyWidgetComponentBase {
8182
- /** @todo Documentation incomplete. */
8218
+ export interface NumberPropertyWidgetComponent extends PropertyWidgetComponentBase<number> {
8219
+ /** The input element for the property widget. */
8183
8220
  inputEl: HTMLInputElement;
8184
- /** @todo Documentation incomplete. */
8221
+ /** The type of the property widget. */
8185
8222
  type: "number";
8186
- /** @todo Documentation incomplete. */
8187
- setValue(value: number | null): void;
8223
+ /** Show the error message. */
8224
+ showError(): void;
8188
8225
  }
8189
8226
  /**
8190
8227
  * @todo Documentation incomplete.
@@ -8285,17 +8322,6 @@ export interface OpenNotificationOptions {
8285
8322
  /** @todo Documentation incomplete. */
8286
8323
  duration?: number;
8287
8324
  }
8288
- /**
8289
- * @todo Documentation incomplete.
8290
- * @public
8291
- * @unofficial
8292
- */
8293
- export interface OptionContext {
8294
- /** @todo Documentation incomplete. */
8295
- el: HTMLDivElement;
8296
- /** @todo Documentation incomplete. */
8297
- pillEl: HTMLDivElement;
8298
- }
8299
8325
  /**
8300
8326
  * @todo Documentation incomplete.
8301
8327
  * @public
@@ -8505,7 +8531,6 @@ export interface PdfViewConstructor extends TypedViewConstructor<PdfView> {
8505
8531
  * @unofficial
8506
8532
  *
8507
8533
  * Due to limitations of TypeScript, we cannot extend the `Platform` constant directly.
8508
- *
8509
8534
  * @example
8510
8535
  *
8511
8536
  * ```ts
@@ -8860,31 +8885,164 @@ export interface PropertyEntryData<T> {
8860
8885
  * @unofficial
8861
8886
  */
8862
8887
  export interface PropertyInfo {
8863
- /**
8864
- * Usage count of property.
8865
- */
8866
- occurrences: number;
8867
8888
  /**
8868
8889
  * Name of property.
8869
8890
  */
8870
8891
  name: string;
8892
+ /**
8893
+ * Usage count of property.
8894
+ */
8895
+ occurrences: number;
8871
8896
  /**
8872
8897
  * Type of property.
8873
8898
  */
8874
8899
  widget: string;
8875
8900
  }
8876
8901
  /**
8877
- * @todo Documentation incomplete.
8902
+ * Property widget component for properties.
8903
+ *
8878
8904
  * @public
8879
8905
  * @unofficial
8880
8906
  */
8881
- export interface PropertyPropertyWidgetComponent extends PropertyWidgetComponentBase {
8882
- /** @todo Documentation incomplete. */
8907
+ export interface PropertyPropertyWidgetComponent extends PropertyWidgetComponentBase<string> {
8908
+ /** The combobox component for the property widget. */
8909
+ combobox: PropertyPropertyWidgetComponentComboBox;
8910
+ /** The input element for the property widget. */
8883
8911
  inputEl: HTMLInputElement;
8884
- /** @todo Documentation incomplete. */
8912
+ /** The type of the property widget. */
8885
8913
  type: "property";
8886
- /** @todo Documentation incomplete. */
8887
- setValue(value: string | null): void;
8914
+ }
8915
+ /**
8916
+ * Combobox component for {@link PropertyPropertyWidgetComponent}.
8917
+ *
8918
+ * @public
8919
+ * @unofficial
8920
+ */
8921
+ export interface PropertyPropertyWidgetComponentComboBox extends PopoverSuggest<PropertyPropertyWidgetComponentComboBoxItem> {
8922
+ /** The items of the combobox. */
8923
+ _items: PropertyPropertyWidgetComponentComboBoxItem[];
8924
+ /** The background element of the combobox. */
8925
+ bgEl: HTMLDivElement;
8926
+ /** The button element of the combobox. */
8927
+ buttonEl: HTMLDivElement;
8928
+ /** Whether the combobox is clearable. */
8929
+ clearable: boolean;
8930
+ /** The icon element of the combobox. */
8931
+ iconEl: HTMLDivElement;
8932
+ /** The label element of the combobox. */
8933
+ labelEl: HTMLDivElement;
8934
+ /** The search component of the combobox. */
8935
+ searchComponent: SearchComponent;
8936
+ /** The current value of the combobox. */
8937
+ value: PropertyPropertyWidgetComponentComboBoxItem | null;
8938
+ /**
8939
+ * Callback for `onClose`.
8940
+ */
8941
+ _onClose?(): void;
8942
+ /**
8943
+ * Callback for `onOpen`.
8944
+ */
8945
+ _onOpen?(): void;
8946
+ /** Attach the DOM of the combobox. */
8947
+ attachDom(): void;
8948
+ /** Detach the DOM of the combobox. */
8949
+ detachDom(): Promise<void>;
8950
+ /** Focus the combobox. */
8951
+ focus(): void;
8952
+ /** Get the items of the combobox. */
8953
+ getItems(): PropertyPropertyWidgetComponentComboBoxItem[];
8954
+ /**
8955
+ * Callback for `getSuggestions`.
8956
+ */
8957
+ getSuggestions(query: string): SearchResult[];
8958
+ /**
8959
+ * Register a callback for `close` event.
8960
+ *
8961
+ * @param callback - the callback to register.
8962
+ */
8963
+ onClose(callback: () => void): this;
8964
+ /**
8965
+ * Handle the input change event of the combobox.
8966
+ *
8967
+ * @param query - the query to handle.
8968
+ */
8969
+ onInputChange(query: string): void;
8970
+ /**
8971
+ * Register a callback for `open` event.
8972
+ *
8973
+ * @param callback - the callback to register.
8974
+ */
8975
+ onOpen(callback: () => void): this;
8976
+ /**
8977
+ * Register a callback for `select` event.
8978
+ *
8979
+ * @param callback - the callback to register.
8980
+ */
8981
+ onSelect(callback: (item: PropertyPropertyWidgetComponentComboBoxItem) => void): this;
8982
+ /** Render the label of the combobox. */
8983
+ renderLabel(): void;
8984
+ /**
8985
+ * Callback for `onSelect`.
8986
+ *
8987
+ * @param item - the item that was selected.
8988
+ */
8989
+ selectCb?(item: PropertyPropertyWidgetComponentComboBoxItem): void;
8990
+ /**
8991
+ * Set the clearable state of the combobox.
8992
+ *
8993
+ * @param clearable - whether the combobox should be clearable.
8994
+ * @returns the combobox.
8995
+ */
8996
+ setClearable(clearable: boolean): this;
8997
+ /**
8998
+ * Set the items of the combobox.
8999
+ *
9000
+ * @param items - the items to set.
9001
+ * @returns the combobox.
9002
+ */
9003
+ setItems(items: PropertyPropertyWidgetComponentComboBoxItem[]): this;
9004
+ /**
9005
+ * Set the placeholder of the combobox.
9006
+ *
9007
+ * @param placeholder - the placeholder to set.
9008
+ * @returns the combobox.
9009
+ */
9010
+ setPlaceholder(placeholder: string): this;
9011
+ /**
9012
+ * Set the value of the combobox.
9013
+ *
9014
+ * @param value - the value to set.
9015
+ * @returns the combobox.
9016
+ */
9017
+ setValue(value: PropertyPropertyWidgetComponentComboBoxItem): this;
9018
+ /**
9019
+ * Set the value of the combobox by its id.
9020
+ *
9021
+ * @param id - the id of the value to set.
9022
+ * @returns the combobox.
9023
+ */
9024
+ setValueById(id: string): this;
9025
+ /** Toggle the combobox. */
9026
+ toggle(): unknown;
9027
+ /**
9028
+ * Update the value of the combobox.
9029
+ *
9030
+ * @param value - the value to update.
9031
+ * @returns the combobox.
9032
+ */
9033
+ updateValue(value: PropertyPropertyWidgetComponentComboBoxItem): this;
9034
+ }
9035
+ /**
9036
+ * Combo box item for {@link PropertyPropertyWidgetComponentComboBox}.
9037
+ *
9038
+ * @public
9039
+ * @unofficial
9040
+ */
9041
+ export interface PropertyPropertyWidgetComponentComboBoxItem {
9042
+ /** The icon of the item. */
9043
+ icon: string;
9044
+ /** The value of the item. */
9045
+ value: string;
8888
9046
  }
8889
9047
  /**
8890
9048
  * @todo Documentation incomplete.
@@ -8914,11 +9072,12 @@ export interface PropertyRenderContext {
8914
9072
  onChange(value: unknown): void;
8915
9073
  }
8916
9074
  /**
8917
- * @todo Documentation incomplete.
9075
+ * Property widget.
9076
+ *
8918
9077
  * @public
8919
9078
  * @unofficial
8920
9079
  */
8921
- export interface PropertyWidget<Value = unknown, ComponentType extends PropertyWidgetComponentBase = PropertyWidgetComponentBase> {
9080
+ export interface PropertyWidget<Value = unknown, ComponentType extends PropertyWidgetComponentBase<Value> = PropertyWidgetComponentBase<Value>> {
8922
9081
  /**
8923
9082
  * Lucide-dev icon associated with the widget.
8924
9083
  */
@@ -8945,19 +9104,34 @@ export interface PropertyWidget<Value = unknown, ComponentType extends PropertyW
8945
9104
  validate(value: unknown): boolean;
8946
9105
  }
8947
9106
  /**
8948
- * @todo Documentation incomplete.
9107
+ * Base class for property widget components.
9108
+ *
8949
9109
  * @public
8950
9110
  * @unofficial
8951
9111
  */
8952
- export interface PropertyWidgetComponentBase {
8953
- /** @todo Documentation incomplete. */
9112
+ export interface PropertyWidgetComponentBase<Value = unknown> {
9113
+ /** The container element for the property widget. */
8954
9114
  containerEl: HTMLElement;
8955
- /** @todo Documentation incomplete. */
9115
+ /** The type of the property widget. */
8956
9116
  type: string;
8957
- /** @todo Documentation incomplete. */
9117
+ /**
9118
+ * Focus the property widget.
9119
+ *
9120
+ * @param mode - The focus mode.
9121
+ */
8958
9122
  focus(mode?: FocusMode): void;
8959
- /** @todo Documentation incomplete. */
9123
+ /**
9124
+ * Handle focus event.
9125
+ *
9126
+ * @param mode - The focus mode.
9127
+ */
8960
9128
  onFocus(mode: FocusMode): void;
9129
+ /**
9130
+ * Set the value of the property widget.
9131
+ *
9132
+ * @param value - The value to set.
9133
+ */
9134
+ setValue(value: Value | null): void;
8961
9135
  }
8962
9136
  /**
8963
9137
  * @todo Documentation incomplete.
@@ -8988,6 +9162,27 @@ export interface PublishPluginInstance extends InternalPluginInstance<PublishPlu
8988
9162
  /** @todo Documentation incomplete. */
8989
9163
  plugin: PublishPlugin;
8990
9164
  }
9165
+ /**
9166
+ * Query for fuzzy search.
9167
+ *
9168
+ * @public
9169
+ * @unofficial
9170
+ */
9171
+ export interface QueryForFuzzySearch {
9172
+ /** */
9173
+ /**
9174
+ * The fuzzy tokens of the query.
9175
+ */
9176
+ fuzzy: string[];
9177
+ /**
9178
+ * The query string.
9179
+ */
9180
+ query: string;
9181
+ /**
9182
+ * The tokens of the query.
9183
+ */
9184
+ tokens: string[];
9185
+ }
8991
9186
  /**
8992
9187
  * @todo Documentation incomplete.
8993
9188
  * @public
@@ -10197,17 +10392,16 @@ export interface TagViewConstructor extends TypedViewConstructor<TagView> {
10197
10392
  export interface TaggedWithFunction extends BasesFunction, HasGetDisplayName, HasGetRHSWidgetType {
10198
10393
  }
10199
10394
  /**
10200
- * @todo Documentation incomplete.
10395
+ * Property widget component for tags.
10396
+ *
10201
10397
  * @public
10202
10398
  * @unofficial
10203
10399
  */
10204
- export interface TagsPropertyWidgetComponent extends PropertyWidgetComponentBase {
10205
- /** @todo Documentation incomplete. */
10400
+ export interface TagsPropertyWidgetComponent extends PropertyWidgetComponentBase<string[] | string> {
10401
+ /** The multiselect component for the property widget. */
10206
10402
  multiselect: Multiselect;
10207
- /** @todo Documentation incomplete. */
10403
+ /** The type of the property widget. */
10208
10404
  type: "tags";
10209
- /** @todo Documentation incomplete. */
10210
- setValue(value: string[] | string): void;
10211
10405
  }
10212
10406
  /**
10213
10407
  * @todo Documentation incomplete.
@@ -10230,37 +10424,52 @@ export interface TemplatesPluginInstance extends InternalPluginInstance<Template
10230
10424
  plugin: TemplatesPlugin;
10231
10425
  }
10232
10426
  /**
10233
- * @todo Documentation incomplete.
10427
+ * Property widget component for text.
10428
+ *
10234
10429
  * @public
10235
10430
  * @unofficial
10236
10431
  */
10237
- export interface TextPropertyWidgetComponent extends PropertyWidgetComponentBase {
10238
- /** @todo Documentation incomplete. */
10432
+ export interface TextPropertyWidgetComponent extends PropertyWidgetComponentBase<string> {
10433
+ /** The render context for the property widget. */
10239
10434
  ctx: PropertyRenderContext;
10240
- /** @todo Documentation incomplete. */
10435
+ /** The input element for the property widget. */
10241
10436
  inputEl: HTMLInputElement;
10242
- /** @todo Documentation incomplete. */
10437
+ /** The link element for the property widget. */
10243
10438
  linkEl: HTMLDivElement;
10244
- /** @todo Documentation incomplete. */
10439
+ /** The link text element for the property widget. */
10245
10440
  linkTextEl: HTMLDivElement;
10246
- /** @todo Documentation incomplete. */
10441
+ /** The type of the property widget. */
10247
10442
  type: "text";
10248
- /** @todo Documentation incomplete. */
10443
+ /** The value of the property widget. */
10249
10444
  value: string;
10250
- /** @todo Documentation incomplete. */
10445
+ /**
10446
+ * Get the display text of the link from the property widget.
10447
+ *
10448
+ * @returns The display text.
10449
+ */
10251
10450
  getDisplayText(): string;
10252
- /** @todo Documentation incomplete. */
10451
+ /**
10452
+ * Get the link text of the property widget.
10453
+ *
10454
+ * @returns The link text.
10455
+ */
10253
10456
  getLinkText(): string;
10254
- /** @todo Documentation incomplete. */
10457
+ /**
10458
+ * Check if the property widget link has an alias.
10459
+ *
10460
+ * @returns Whether the property widget link has an alias.
10461
+ */
10255
10462
  isAlias(): boolean;
10256
- /** @todo Documentation incomplete. */
10463
+ /**
10464
+ * Check if the property widget link is a wikilink.
10465
+ *
10466
+ * @returns Whether the property widget link is a wikilink.
10467
+ */
10257
10468
  isWikilink(): boolean;
10258
- /** @todo Documentation incomplete. */
10469
+ /**
10470
+ * Render the property widget.
10471
+ */
10259
10472
  render(): void;
10260
- /** @todo Documentation incomplete. */
10261
- setValue(value: string | null): void;
10262
- /** @todo Documentation incomplete. */
10263
- setValue(value: string | null): void;
10264
10473
  }
10265
10474
  /**
10266
10475
  * @todo Documentation incomplete.
@@ -10535,14 +10744,16 @@ export interface TreeItem extends TreeNode {
10535
10744
  */
10536
10745
  setClickable(value: boolean): void;
10537
10746
  }
10538
- /** @todo Documentation incomplete. */
10539
10747
  /**
10540
- * @todo Documentation incomplete.
10748
+ * Tree node.
10749
+ *
10541
10750
  * @public
10542
10751
  * @unofficial
10543
10752
  */
10544
10753
  export interface TreeNode {
10545
- /** @todo Documentation incomplete. */
10754
+ /**
10755
+ * The element of the tree node.
10756
+ */
10546
10757
  el: HTMLElement;
10547
10758
  }
10548
10759
  /**
@@ -10663,11 +10874,22 @@ export interface TypedWorkspaceLeaf<TView extends View> extends WorkspaceLeaf {
10663
10874
  export interface UniqueFunction extends BasesFunction {
10664
10875
  }
10665
10876
  /**
10666
- * Views of plugins that have been deactivated become an UnknownView.
10667
- * @todo This is probably not the right term.
10877
+ * Property widget component for unknown types.
10878
+ *
10879
+ * @public
10880
+ * @unofficial
10668
10881
  */
10882
+ export interface UnknownPropertyWidgetComponent extends PropertyWidgetComponentBase<unknown> {
10883
+ /** The element of the property widget. */
10884
+ el: HTMLSpanElement;
10885
+ /** The type of the property widget. */
10886
+ type: "unknown";
10887
+ }
10669
10888
  /**
10670
- * @todo Documentation incomplete.
10889
+ * Views of plugins that have been deactivated become an UnknownView.
10890
+ *
10891
+ * @remark This is probably not the right term.
10892
+ *
10671
10893
  * @public
10672
10894
  * @unofficial
10673
10895
  */
@@ -11714,10 +11936,7 @@ export type Mapping = {
11714
11936
  */
11715
11937
  export type MaybeDeferredView<TView extends View> = TView | DeferredView;
11716
11938
  /**
11717
- * @todo Documentation incomplete.
11718
- */
11719
- /**
11720
- * @todo Documentation incomplete.
11939
+ * Property widget type.
11721
11940
  *
11722
11941
  * @public
11723
11942
  * @unofficial