/** * Lightdash client. * * Usage: * const lightdash = createClient() // auto-detects from environment */ import { QueryBuilder } from './query'; import type { ExternalFetchOptions, ExternalFetchResult, LightdashClientConfig, LightdashUser, Transport } from './types'; export declare class LightdashClient { readonly config: LightdashClientConfig; readonly transport: Transport; readonly auth: { getUser: () => Promise; }; constructor(config: LightdashClientConfig, transport: Transport); /** Start building a query against a model */ model(exploreName: string): QueryBuilder; /** * Call an external API through a Lightdash-managed connection. * * Supply only the connection `alias` and a relative request — Lightdash * resolves the alias to a stored connection, attaches its credentials, * and proxies the call. The app never sees the URL, headers, or secrets. * * const res = await lightdash.externalFetch('stripe', { * path: '/v1/charges', * query: { limit: '10' }, * }); * // res.body is the parsed JSON */ externalFetch(alias: string, opts: ExternalFetchOptions): Promise; } /** * Create a Lightdash client. Auto-detects the transport from the environment: * * 1. Hash fragment #transport=postMessage → postMessage bridge (Lightdash iframe) * 2. Env vars (VITE_LIGHTDASH_* or LIGHTDASH_*) → direct API calls (local dev) */ export declare function createClient(): LightdashClient;