forked from r.muellner/velum-raycast
22 lines
854 B
TypeScript
22 lines
854 B
TypeScript
import type { NormalizedPreferences } from "../preferences";
|
|
|
|
// Only these Raycast services are used by the shared Node project code.
|
|
export const environment = { assetsPath: "", supportPath: "" };
|
|
let preferences: NormalizedPreferences;
|
|
export function getPreferenceValues<T>(): T {
|
|
return preferences as T;
|
|
}
|
|
|
|
const tokenStore = new Map<string, string>();
|
|
export const LocalStorage = {
|
|
async getItem<T>(key: string) { return tokenStore.get(key) as T | undefined; },
|
|
async setItem(key: string, value: string) { tokenStore.set(key, value); },
|
|
async removeItem(key: string) { tokenStore.delete(key); },
|
|
};
|
|
|
|
export function configureWorker(config: { assets: string; support: string; preferences: NormalizedPreferences }) {
|
|
environment.assetsPath = config.assets;
|
|
environment.supportPath = config.support;
|
|
preferences = config.preferences;
|
|
}
|