@furystack/core
Version:
Core FuryStack package
38 lines • 1.62 kB
TypeScript
import type { Injector } from '@furystack/inject';
import type { PhysicalStore } from './models/physical-store.js';
import { StoreManager } from './store-manager.js';
/**
* The disposable will be disposed on process exit
* @param disposable The Disposable object to dispose on process exit
* @returns A set of global disposables
*/
export declare const disposeOnProcessExit: (disposable: Disposable | AsyncDisposable) => Set<Disposable | AsyncDisposable>;
/**
* @param injector The Injector instance
* @returns the current authentication status from the identity context
*/
export declare const isAuthenticated: (injector: Injector) => Promise<boolean>;
/**
* @param injector The Injector instance
* @param {...any} roles A list of roles
* @returns if the current authorization status from the identity context
*/
export declare const isAuthorized: (injector: Injector, ...roles: string[]) => Promise<boolean>;
/**
* @param injector The Injector instance
* @returns The current user from the identity context
*/
export declare const getCurrentUser: (injector: Injector) => Promise<import("./index.js").User>;
/**
* @param injector The Injector instance
* @returns A Store Manager instance to setup stores
*/
export declare const getStoreManager: (injector: Injector) => StoreManager;
/**
*
* @param injector The Injector instance
* @param store The store to add
* @returns The Store Manager instance for chaining
*/
export declare const addStore: <T, TPrimaryKey extends keyof T>(injector: Injector, store: PhysicalStore<T, TPrimaryKey>) => StoreManager;
//# sourceMappingURL=helpers.d.ts.map