/**
 * @stryde/superapp-sdk — the governed surface every app builds against (req §7).
 *
 * Apps receive an `SdkContext` at mount (app-standards §6.1) and must route ALL
 * platform concerns through it (strict SDK usage, app-standards §1.2): auth, api,
 * telemetry, theme, i18n, lookups, bus, nav, errors. The SDK is a shared
 * singleton provided by the shell — never bundled per app (req §6.4).
 *
 * NOTE: types + thin runtime contract. The concrete browser/RN runtime wiring
 * (OTel exporter, Clerk token, fetch base) is implemented in the shell and is a
 * backlog item ("SDK runtime implementation"). See backlog.md.
 */
import type { ReactNode } from 'react';
export interface Principal {
    userId: string;
    email: string;
    orgId: string | null;
    teamIds: string[];
    scopes: string[];
}
export interface AuthApi {
    principal(): Principal;
    /** Permission guard, e.g. can('app.hello.greet') (req §9.3). */
    can(permission: string): boolean;
    /** Internal access token for API calls (req §9.2). */
    token(): Promise<string | null>;
}
/** Targets /api/apps/{app_key}/...; attaches internal token + trace context;
 *  throws ApiError carrying the backend error CODE (req §13). */
export interface ApiClient {
    get<T>(path: string, query?: Record<string, unknown>): Promise<T>;
    post<T>(path: string, body?: unknown): Promise<T>;
    put<T>(path: string, body?: unknown): Promise<T>;
    del<T>(path: string): Promise<T>;
}
export declare class ApiError extends Error {
    code: string;
    params?: Record<string, unknown> | undefined;
    httpStatus?: number | undefined;
    constructor(code: string, params?: Record<string, unknown> | undefined, httpStatus?: number | undefined);
}
export interface Span {
    end(): void;
    setAttribute(key: string, value: unknown): void;
    recordError(code: string): void;
}
/** Mandatory attributes (user_id, session_id, app_id, org_id, team_id) are
 *  attached automatically (req §12.3) — apps must not strip them. */
export interface TelemetryApi {
    startSpan(name: string): Span;
    log(level: 'info' | 'warn' | 'error', message: string, attrs?: Record<string, unknown>): void;
    metric(name: string, value: number, attrs?: Record<string, unknown>): void;
}
export interface I18nApi {
    locale: string;
    direction: 'ltr' | 'rtl';
    /** Resolve a namespaced key with params; never hardcode strings (app-standards §8). */
    t(key: string, params?: Record<string, unknown>): string;
    formatNumber(n: number): string;
    formatDate(d: Date | number): string;
}
export interface ThemeTokens {
    color: Record<string, string>;
    space: Record<string, number>;
    radius: Record<string, number>;
    font: Record<string, string>;
    direction: 'ltr' | 'rtl';
    mode: 'light' | 'dark';
}
export interface ThemeApi {
    tokens(): ThemeTokens;
}
export interface LookupValue {
    lookup_key: string;
    name: string;
    is_default: boolean;
}
export interface LookupsApi {
    /** Resolve a group's values (use platform lookups, never hardcode enums). */
    group(groupKey: string): Promise<LookupValue[]>;
}
export interface BusApi {
    emit(eventKey: string, payload: unknown): void;
    on(eventKey: string, handler: (payload: unknown) => void): () => void;
}
export interface NavApi {
    push(route: string, params?: Record<string, string>): void;
    /** Cross-app deep link (req §11.2). */
    navigateToApp(appKey: string, route: string, params?: Record<string, string>): void;
}
export interface ErrorsApi {
    /** Resolve a thrown ApiError/code to a localized message + surface it. */
    show(err: unknown): void;
    message(code: string, params?: Record<string, unknown>): string;
}
export interface SdkContext {
    appKey: string;
    auth: AuthApi;
    api: ApiClient;
    telemetry: TelemetryApi;
    i18n: I18nApi;
    theme: ThemeApi;
    lookups: LookupsApi;
    bus: BusApi;
    nav: NavApi;
    errors: ErrorsApi;
}
export interface MountArgs {
    sdk: SdkContext;
    route: string;
    params: Record<string, string>;
}
/** The standard frontend entry the shell mounts (app-standards §6.1). */
export type AppMount = (args: MountArgs) => ReactNode;
export { applyStrydeSkin, bindIframeSkin, SKIN_ID, SKIN_VERSION, SKIN_HREF } from './skin';
export type { SkinOptions } from './skin';
