UNPKG

astro-integration-pocketbase

Version:

An Astro integration to support developers working with astro-loader-pocketbase.

65 lines (64 loc) 2.06 kB
import { AstroIntegration } from "astro"; //#region src/types/pocketbase-integration-options.type.d.ts /** * Options for the PocketBase integration. */ interface PocketBaseIntegrationOptions { /** * URL of the PocketBase instance. */ url: string; /** * Credentials of a superuser to get full access to the PocketBase instance. * This is required to access all resources even if they are not public. */ superuserCredentials?: { /** * Email of the superuser. */ email: string; /** * Password of the superuser. */ password: string; } | { /** * Impersonate auth token of the superuser. * This token will take precedence over the email and password. */ impersonateToken: string; }; /** * List of PocketBase collections to watch for changes. * When an entry in one of these collections changes, the content will be reloaded. * * Example: * ```ts * collectionsToWatch: ["users", "posts"] * ``` * * For advanced usage, you can specify a map where the key is the collection that is used to load the content. * The value can be: * - `true` to watch the collection itself for changes (base collection) * - an array of strings to watch multiple collections for changes (view collection) * * These advanced options are especially useful when you're working with view collections. * [View collections](https://pocketbase.io/docs/collections/#view-collection) don't emit events when their * entries change, since they are based on other collections. * * Example: * ```ts * collectionsToWatch: { * "users": true, * "postings": ["posts", "comments"] * } * ``` */ collectionsToWatch?: Array<string> | Record<string, true | Array<string>>; } //#endregion //#region src/pocketbase-integration.d.ts declare function pocketbaseIntegration(options: PocketBaseIntegrationOptions): AstroIntegration; //#endregion export { type PocketBaseIntegrationOptions, pocketbaseIntegration }; //# sourceMappingURL=index.d.mts.map