forked from r.muellner/velum-raycast
feat: run Velum project jobs in the background and process DOCX locally
This commit is contained in:
21
src/lib/worker-runtime.ts
Normal file
21
src/lib/worker-runtime.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
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;
|
||||
}
|
||||
Reference in New Issue
Block a user