import * as _supabase_supabase_js from '@supabase/supabase-js'; import { SupportedStorage, SupabaseClient } from '@supabase/supabase-js'; import { S as Schema } from '../index-xv_pDjEt.js'; import { Connection, DefaultAppConfig, App } from 'lite-supa'; import 'jsonv-ts'; declare class Filesystem { readonly root: string; constructor(_path?: string, _root?: string); static homeDir(): string; static projectDir(): string; deleteAll(silent?: boolean): void; delete(name: string, silent?: boolean): void; write(name: string, content: string, silent?: boolean): void; read(name: string, silent?: boolean): string | undefined; relativePath(name?: string): string; path(name?: string): string; } declare class AuthStorage implements SupportedStorage { private readonly root; constructor(root: string); getItem(key: string): Promise; setItem(key: string, value: string): Promise; removeItem(key: string): Promise; } interface BaseApiConfig { host?: string; token?: string; root?: string; client?: SupabaseClient; authStorage?: AuthStorage; withSupabaseClient?: boolean; } declare abstract class BaseApi { readonly config: Config; protected readonly tempFs: Filesystem; protected readonly projectFs: Filesystem; protected readonly schemaFs: Filesystem; protected readonly _client: SupabaseClient | undefined; protected readonly authStorage: AuthStorage; constructor(config: Config); fetch(input: string | URL, init?: RequestInit): Promise; } type Project = { id: string; name?: string; created_at: string; }; interface ProjectApiConfig extends BaseApiConfig { host: string; } declare class ProjectApi extends BaseApi { readonly config: ProjectApiConfig; constructor(config: ProjectApiConfig); protected get client(): SupabaseClient; protected projectRef(): string | undefined; protected projectUrl(projectRef: string): string; } declare class ProjectLocalApi extends ProjectApi { ref(): string | undefined; setRef(projectRef: string): this; link(project: Project): Project; unlink(): this; url(): string; getConfigPath(file_path?: string): Promise; protected readConfig(file_path?: string): Promise; createConnection(): Promise; getConfig(file_path?: string): Promise; createApp(config_path?: string): Promise; } declare class ProjectRemoteApi extends ProjectApi { url(projectRef: string): string; ping(): Promise; list(): Promise; get(projectRef?: string): Promise; create(project?: Partial>): Promise; getConfig(projectRef: string): Promise; setConfig(projectRef: string, config: any): Promise; createApp(projectRef: string): Promise; } interface ApiConfig extends BaseApiConfig { host: string; root: string; } declare class Api extends BaseApi { project: { local: ProjectLocalApi; remote: ProjectRemoteApi; }; get client(): SupabaseClient; getSession(): Promise<{ data: { session: _supabase_supabase_js.AuthSession; }; error: null; } | { data: { session: null; }; error: _supabase_supabase_js.AuthError; } | { data: { session: null; }; error: null; }>; getAccessToken(): Promise; requireSession(): Promise; init(): Promise; } declare function createApi(options?: Partial): Promise; declare function ensureInitialStructure(opts?: Partial<{ configFormat: "toml" | "json"; driver: NonNullable["driver"]; recreate: boolean; template: boolean; }>): Promise; declare function ensureSchema(app: App, opts?: { force?: boolean; }): Promise; declare function watchSchema(app: App, opts?: { force?: boolean; translate?: boolean; }): void; export { createApi, ensureInitialStructure, ensureSchema, watchSchema };