silverbullet/plug-api/lib/settings_page.ts

16 lines
374 B
TypeScript
Raw Normal View History

import { system } from "$sb/syscalls.ts";
2022-07-18 16:51:28 +08:00
/**
* Retrieves a setting from the space configuration.
* @deprecated Use use `editor.getSpaceConfig` syscall instead
* @param key string
* @param defaultValue
* @returns
2022-07-18 16:51:28 +08:00
*/
export async function readSetting(
key: string,
defaultValue?: any,
): Promise<any> {
return await system.getSpaceConfig(key) ?? defaultValue;
2022-09-13 14:41:01 +08:00
}