QueryAPI
Defined in: jsEngine/api/QueryAPI.ts:7
Constructors
new QueryAPI()
new QueryAPI(
apiInstance
):QueryAPI
Defined in: jsEngine/api/QueryAPI.ts:10
Parameters
Parameter | Type |
---|---|
|
Returns
Properties
apiInstance
readonly
apiInstance:API
Defined in: jsEngine/api/QueryAPI.ts:8
Methods
files()
files<
T
>(query
):T
[]
Defined in: jsEngine/api/QueryAPI.ts:29
This function will run the query
callback on every markdown file in the vault and then return a list of the results, with undefined
filtered out.
Type Parameters
Type Parameter |
---|
|
Parameters
Parameter | Type |
---|---|
|
( |
Returns
T
[]
Examples
// Find all markdown `TFiles` that start with the word "Foo"const files = engine.query.files(file => file.name.startsWith("Foo") ? file : undefined);
// Find all the names of all markdown files that are in the "Foo" folderconst fileNames = engine.query.files(file => file.path.startsWith("Foo/") ? file.name : undefined);
filesWithMetadata()
filesWithMetadata<
T
>(query
):T
[]
Defined in: jsEngine/api/QueryAPI.ts:47
This function functions similarly tp QueryAPI.files, but also provides the cache and tags of each file to the query
callback.
Type Parameters
Type Parameter |
---|
|
Parameters
Parameter | Type |
---|---|
|
( |
Returns
T
[]
Example
// Find the paths of all markdown files that have the tag "Foo"const paths = engine.query.filesWithMetadata((file, cache, tags) => tags.includes("Foo") ? file.path : undefined);
incomingLinks()
incomingLinks(
file
):object
[]
Defined in: jsEngine/api/QueryAPI.ts:92
Parameters
Parameter | Type |
---|---|
|
|
Returns
object
[]
outgoingLinks()
outgoingLinks(
file
):object
[]
Defined in: jsEngine/api/QueryAPI.ts:69
Parameters
Parameter | Type |
---|---|
|
|
Returns
object
[]