1
0
silverbullet/plugs/index/plug_api.ts
Zef Hemel 0313565610
Complete redo of content indexing and querying (#517)
Complete redo of data store
Introduces live queries and live templates
2023-10-03 14:16:33 +02:00

25 lines
631 B
TypeScript

import { ObjectQuery, ObjectValue } from "$sb/types.ts";
import { invokeFunction } from "$sb/silverbullet-syscall/system.ts";
export function indexObjects<T>(
page: string,
objects: ObjectValue<T>[],
): Promise<void> {
return invokeFunction("index.indexObjects", page, objects);
}
export function queryObjects<T>(
tag: string,
query: ObjectQuery,
): Promise<ObjectValue<T>[]> {
return invokeFunction("index.queryObjects", tag, query);
}
export function getObjectByRef<T>(
page: string,
tag: string,
ref: string,
): Promise<ObjectValue<T>[]> {
return invokeFunction("index.getObjectByRef", page, tag, ref);
}