UNPKG

@furystack/rest-service

Version:

Repository implementation for FuryStack

34 lines 1.64 kB
import type { User } from '@furystack/core'; import type { Injector } from '@furystack/inject'; import { HttpAuthenticationSettings } from './http-authentication-settings.js'; import type { RestApi } from '@furystack/rest'; import type { ImplementApiOptions } from './api-manager.js'; import type { DefaultSession } from './models/default-session.js'; import type { StaticServerOptions } from './static-server-manager.js'; /** * Sets up the @furystack/rest-service with the provided settings * @param api The API implementation details * @returns a promise that resolves when the API is added to the server */ export declare const useRestService: <T extends RestApi>(api: ImplementApiOptions<T>) => Promise<{ shouldExec: (msg: import("./server-manager.js").OnRequest) => boolean; onRequest: (msg: import("./server-manager.js").OnRequest) => Promise<void>; }>; /** * Sets up the HTTP Authentication * @param injector The Injector instance * @param settings Settings for HTTP Authentication * @returns void */ export declare const useHttpAuthentication: <TUser extends User, TSession extends DefaultSession>(injector: Injector, settings?: Partial<HttpAuthenticationSettings<TUser, TSession>>) => void; /** * Sets up a static file server * @param options The settings for the static file server * @param options.injector The Injector instance * @param options.settings Settings for the static file server * @returns a promise that resolves when the server is ready */ export declare const useStaticFiles: (options: { injector: Injector; } & StaticServerOptions) => Promise<void>; //# sourceMappingURL=helpers.d.ts.map