import type { AstroConfig } from '../@types/astro.js'; import { type Preferences } from './defaults.js'; type DotKeys = T extends object ? { [K in keyof T]: `${Exclude}${DotKeys extends never ? '' : `.${DotKeys}`}`; }[keyof T] : never; export type GetDotKey, K extends string> = K extends `${infer U}.${infer Rest}` ? GetDotKey : T[K]; export type PreferenceLocation = 'global' | 'project'; export interface PreferenceOptions { location?: PreferenceLocation; } type DeepPartial = T extends object ? { [P in keyof T]?: DeepPartial; } : T; export type PreferenceKey = DotKeys; export interface PreferenceList extends Record> { fromAstroConfig: DeepPartial; defaults: Preferences; } export interface AstroPreferences { get(key: Key, opts?: PreferenceOptions): Promise>; set(key: Key, value: GetDotKey, opts?: PreferenceOptions): Promise; getAll(): Promise; list(opts?: PreferenceOptions): Promise; } export declare function isValidKey(key: string): key is PreferenceKey; export declare function coerce(key: string, value: unknown): any; export default function createPreferences(config: AstroConfig): AstroPreferences; export declare function getGlobalPreferenceDir(): string; export {};