Skip to content

Commit 67579ca

Browse files
committed
Regenerate API docs
1 parent e8eeb9d commit 67579ca

24 files changed

+4162
-13
lines changed

docs/api/classes/App.md

+12
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,18 @@ constructor();
88

99
## Properties
1010

11+
### keymap
12+
13+
```ts
14+
keymap: Keymap
15+
```
16+
17+
### scope
18+
19+
```ts
20+
scope: Scope
21+
```
22+
1123
### workspace
1224

1325
```ts

docs/api/classes/Component.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ Registers an key event to be detached when unloading
107107
### registerInterval
108108
109109
```ts
110-
registerInterval(id: number): void;
110+
registerInterval(id: number): number;
111111
```
112112
113113
Registers an interval (from setInterval) to be cancelled when unloading

docs/api/classes/Editor.md

+6
Original file line numberDiff line numberDiff line change
@@ -202,3 +202,9 @@ abstract posToOffset(pos: EditorPosition): number;
202202
```ts
203203
abstract offsetToPos(offset: number): EditorPosition;
204204
```
205+
206+
### processLines
207+
208+
```ts
209+
processLines<T>(read: (line: number, lineText: string) => T | null, write: (line: number, lineText: string, value: T | null) => EditorChange | void, ignoreEmpty?: boolean): void;
210+
```

docs/api/classes/Keymap.md

+12
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,18 @@ constructor();
88

99
## Methods
1010

11+
### pushScope
12+
13+
```ts
14+
pushScope(scope: Scope): void;
15+
```
16+
17+
### popScope
18+
19+
```ts
20+
popScope(scope: Scope): void;
21+
```
22+
1123
### isModifier
1224

1325
```ts

docs/api/classes/MarkdownSourceView.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ constructor(view: MarkdownView);
1313
### cmEditor
1414

1515
```ts
16-
cmEditor: Editor
16+
cmEditor: any
1717
```
1818

1919
### hoverPopover

docs/api/classes/MetadataCache.md

+20-1
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,25 @@ If not unique, use full path.
6868
### on
6969

7070
```ts
71-
on(name: 'changed', callback: (file: TFile) => any, ctx?: any): EventRef;
71+
on(name: 'changed', callback: (file: TFile, data: string, cache: CachedMetadata) => any, ctx?: any): EventRef;
7272
```
7373

7474
Called when a file has been indexed, and its (updated) cache is now available.
75+
Called when a file has been deleted. A best-effort previous version of the cached metadata is presented,
76+
but it could be null in case the file was not successfully cached previously.
77+
Called when a file has been resolved for `resolvedLinks` and `unresolvedLinks`.
78+
This happens sometimes after a file has been indexed.
79+
Called when all files has been resolved. This will be fired each time files get modified after the initial load.
80+
81+
### on
82+
83+
```ts
84+
on(name: 'deleted', callback: (file: TFile, prevCache: CachedMetadata | null) => any, ctx?: any): EventRef;
85+
```
86+
87+
Called when a file has been indexed, and its (updated) cache is now available.
88+
Called when a file has been deleted. A best-effort previous version of the cached metadata is presented,
89+
but it could be null in case the file was not successfully cached previously.
7590
Called when a file has been resolved for `resolvedLinks` and `unresolvedLinks`.
7691
This happens sometimes after a file has been indexed.
7792
Called when all files has been resolved. This will be fired each time files get modified after the initial load.
@@ -83,6 +98,8 @@ on(name: 'resolve', callback: (file: TFile) => any, ctx?: any): EventRef;
8398
```
8499

85100
Called when a file has been indexed, and its (updated) cache is now available.
101+
Called when a file has been deleted. A best-effort previous version of the cached metadata is presented,
102+
but it could be null in case the file was not successfully cached previously.
86103
Called when a file has been resolved for `resolvedLinks` and `unresolvedLinks`.
87104
This happens sometimes after a file has been indexed.
88105
Called when all files has been resolved. This will be fired each time files get modified after the initial load.
@@ -94,6 +111,8 @@ on(name: 'resolved', callback: () => any, ctx?: any): EventRef;
94111
```
95112

96113
Called when a file has been indexed, and its (updated) cache is now available.
114+
Called when a file has been deleted. A best-effort previous version of the cached metadata is presented,
115+
but it could be null in case the file was not successfully cached previously.
97116
Called when a file has been resolved for `resolvedLinks` and `unresolvedLinks`.
98117
This happens sometimes after a file has been indexed.
99118
Called when all files has been resolved. This will be fired each time files get modified after the initial load.

docs/api/classes/Plugin_2.md

+12-2
Original file line numberDiff line numberDiff line change
@@ -67,13 +67,13 @@ registerExtensions(extensions: string[], viewType: string): void;
6767
### registerMarkdownPostProcessor
6868

6969
```ts
70-
registerMarkdownPostProcessor(postProcessor: MarkdownPostProcessor): MarkdownPostProcessor;
70+
registerMarkdownPostProcessor(postProcessor: MarkdownPostProcessor, sortOrder?: number): MarkdownPostProcessor;
7171
```
7272

7373
### registerMarkdownCodeBlockProcessor
7474

7575
```ts
76-
registerMarkdownCodeBlockProcessor(language: string, handler: (source: string, el: HTMLElement, ctx: MarkdownPostProcessorContext) => Promise<any> | void): MarkdownPostProcessor;
76+
registerMarkdownCodeBlockProcessor(language: string, handler: (source: string, el: HTMLElement, ctx: MarkdownPostProcessorContext) => Promise<any> | void, sortOrder?: number): MarkdownPostProcessor;
7777
```
7878

7979
Register a special post processor that handles fenced code given a language and a handler.
@@ -89,6 +89,16 @@ registerCodeMirror(callback: (cm: CodeMirror.Editor) => any): void;
8989
Runs callback on all currently loaded instances of CodeMirror,
9090
then registers the callback for all future CodeMirror instances.
9191

92+
### registerEditorExtension
93+
94+
```ts
95+
registerEditorExtension(extension: Extension): void;
96+
```
97+
98+
Registers a CodeMirror 6 extension.
99+
To reconfigure cm6 extensions for your plugin on the fly, you can pass an array here and dynamically
100+
modify it. Once this array is modified, call `Workspace.updateOptions()` to have the changes applied.
101+
92102
### registerObsidianProtocolHandler
93103

94104
```ts

docs/api/classes/Scope.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
## Constructor
44

55
```ts
6-
constructor();
6+
constructor(parent: Scope);
77
```
88

99
## Methods

docs/api/classes/Setting.md

+6
Original file line numberDiff line numberDiff line change
@@ -143,3 +143,9 @@ then(cb: (setting: this) => any): this;
143143
```
144144

145145
Facilitates chaining
146+
147+
### clear
148+
149+
```ts
150+
clear(): this;
151+
```

docs/api/classes/SuggestModal.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ Called when the user makes a selection.
6767
### getSuggestions
6868

6969
```ts
70-
abstract getSuggestions(query: string): T[];
70+
abstract getSuggestions(query: string): T[] | Promise<T[]>;
7171
```
7272

7373
### renderSuggestion

docs/api/classes/TAbstractFile.md

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# TAbstractFile
22

3+
This can be either a `TFile` or a `TFolder`.
4+
35
## Constructor
46

57
```ts

docs/api/classes/Workspace.md

+11-2
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ splitLeafOrActive(leaf?: WorkspaceLeaf, direction?: SplitDirection): WorkspaceLe
126126
### duplicateLeaf
127127

128128
```ts
129-
duplicateLeaf(leaf: WorkspaceLeaf, direction?: SplitDirection): Promise<void>;
129+
duplicateLeaf(leaf: WorkspaceLeaf, direction?: SplitDirection): Promise<WorkspaceLeaf>;
130130
```
131131

132132
### getUnpinnedLeaf
@@ -233,6 +233,15 @@ revealLeaf(leaf: WorkspaceLeaf): void;
233233
getLastOpenFiles(): string[];
234234
```
235235
236+
### updateOptions
237+
238+
```ts
239+
updateOptions(): void;
240+
```
241+
242+
Calling this function will update/reconfigure the options of all markdown panes.
243+
It is fairly expensive, so it should not be called frequently.
244+
236245
### iterateCodeMirrors
237246
238247
```ts
@@ -280,7 +289,7 @@ Perform some best effort cleanup here.
280289
### on
281290
282291
```ts
283-
on(name: 'click', callback: () => any, ctx?: any): EventRef;
292+
on(name: 'click', callback: (evt: MouseEvent) => any, ctx?: any): EventRef;
284293
```
285294
286295
Triggered when the CSS of the app has changed.

docs/api/functions/request.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
# request
22

33
```ts
4-
export function request(request: RequestParam): Promise<string>;
4+
export function request(request: RequestUrlParam): Promise<string>;
55
```
66

7+
Similar to `fetch()`, request a URL using HTTP/HTTPS, without any CORS restrictions.
8+
Returns the text value of the response.
9+
710
## Parameters
811

912
| Parameter | Description |

docs/api/functions/requestUrl.md

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# requestUrl
2+
3+
```ts
4+
export function requestUrl(request: RequestUrlParam): Promise<RequestUrlResponse>;
5+
```
6+
7+
Similar to `fetch()`, request a URL using HTTP/HTTPS, without any CORS restrictions.
8+
9+
## Parameters
10+
11+
| Parameter | Description |
12+
|-----------|-------------|
13+
| `request` | |
+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# requireApiVersion
2+
3+
```ts
4+
export function requireApiVersion(version: string): boolean;
5+
```
6+
7+
Returns true if the API version is equal or higher than the requested version.
8+
Use this to limit functionality that require specific API versions to avoid
9+
crashing on older Obsidian builds.
10+
11+
## Parameters
12+
13+
| Parameter | Description |
14+
|-----------|-------------|
15+
| `version` | |

docs/api/interfaces/AjaxOptions.md

+6
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,9 @@ headers: Record<string, string>
4343
```ts
4444
withCredentials: boolean
4545
```
46+
47+
### req
48+
49+
```ts
50+
req: XMLHttpRequest
51+
```

docs/api/interfaces/BlockSubpathResult.md

+6
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,9 @@ type: "block"
1313
```ts
1414
block: BlockCache
1515
```
16+
17+
### list
18+
19+
```ts
20+
list: ListItemCache
21+
```

docs/api/interfaces/Command.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -76,4 +76,5 @@ Overrides `editorCallback`, `callback` and `checkCallback`
7676
hotkeys: Hotkey[]
7777
```
7878

79-
Sets the default hotkey
79+
Sets the default hotkey. It is recommended for plugins to avoid setting default hotkeys if possible,
80+
to avoid conflicting hotkeys with one that's set by the user, even though customized hotkeys have higher priority.
+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# RequestUrlParam
2+
3+
## Properties
4+
5+
### url
6+
7+
```ts
8+
url: string
9+
```
10+
11+
### method
12+
13+
```ts
14+
method: string
15+
```
16+
17+
### contentType
18+
19+
```ts
20+
contentType: string
21+
```
22+
23+
### body
24+
25+
```ts
26+
body: string | ArrayBuffer
27+
```
28+
29+
### headers
30+
31+
```ts
32+
headers: Record<string, string>
33+
```
+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# RequestUrlResponse
2+
3+
## Properties
4+
5+
### status
6+
7+
```ts
8+
status: number
9+
```
10+
11+
### headers
12+
13+
```ts
14+
headers: Record<string, string>
15+
```
16+
17+
### arrayBuffer
18+
19+
```ts
20+
arrayBuffer: ArrayBuffer
21+
```
22+
23+
### json
24+
25+
```ts
26+
json: any
27+
```
28+
29+
### text
30+
31+
```ts
32+
text: string
33+
```

docs/api/overview.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,8 @@ The [script](https://github.com/marcusolsson/dts-docs) used to generate the docu
106106
- [renderMath](functions/renderMath.md)
107107
- [renderResults](functions/renderResults.md)
108108
- [request](functions/request.md)
109+
- [requestUrl](functions/requestUrl.md)
110+
- [requireApiVersion](functions/requireApiVersion.md)
109111
- [resolveSubpath](functions/resolveSubpath.md)
110112
- [sanitizeHTMLToDom](functions/sanitizeHTMLToDom.md)
111113
- [setIcon](functions/setIcon.md)
@@ -167,7 +169,8 @@ The [script](https://github.com/marcusolsson/dts-docs) used to generate the docu
167169
- [PreparedQuery](interfaces/PreparedQuery.md)
168170
- [Rect_2](interfaces/Rect_2.md)
169171
- [ReferenceCache](interfaces/ReferenceCache.md)
170-
- [RequestParam](interfaces/RequestParam.md)
172+
- [RequestUrlParam](interfaces/RequestUrlParam.md)
173+
- [RequestUrlResponse](interfaces/RequestUrlResponse.md)
171174
- [SearchResult](interfaces/SearchResult.md)
172175
- [SearchResultContainer](interfaces/SearchResultContainer.md)
173176
- [SectionCache](interfaces/SectionCache.md)
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# MarkdownViewModeType
22

33
```ts
4-
export type MarkdownViewModeType = 'source' | 'preview' | 'live';
4+
export type MarkdownViewModeType = 'source' | 'preview';
55
```
66

77

0 commit comments

Comments
 (0)