import { Handle } from '@sveltejs/kit'; import { f as FlagDeclaration, J as JsonValue, a as ApiData, G as GenerousOption } from './types-swW0-Ony.js'; import 'http'; import '@edge-runtime/cookies'; type Flag = (() => ReturnValue | Promise) & { key: string; description?: string; origin?: string | Record; options?: GenerousOption[]; }; /** * Declares a feature flag */ declare function flag(definition: FlagDeclaration): Flag; declare function getProviderData(flags: Record>): ApiData; /** * Establishes context for flags, so they have access to the * request and cookie. * * Also registers evaluated flags, except for flags used only after `resolve` calls in other handlers. * * @example Usage example in src/hooks.server.ts * * ```ts * import { createHandle } from '@vercel/flags/sveltekit'; * import { FLAGS_SECRET } from '$env/static/private'; * import * as flags from '$lib/flags'; * * export const handle = createHandle({ secret: FLAGS_SECRET, flags }); * ``` * * @example Usage example in src/hooks.server.ts with other handlers * * Note that when composing `createHandle` with `sequence` then `createHandle` should come first. Only handlers after it will be able to access feature flags. */ declare function createHandle({ secret, flags, }: { secret: string; flags?: Record>; }): Handle; export { createHandle, flag, getProviderData };