import { AuthError, PostgrestError, Provider } from "@supabase/supabase-js";
import { PageSuggestion, Project } from "../data/types";
import { SupabaseProject, SupabaseSession, SupabaseTeam, SupabaseUser, SupabaseUserProfile } from "./supabase-types";
/**
 * Error handling
 */
export interface CustomError {
    type: "custom-error";
    message: string;
}
export interface SupabaseError {
    type: "supabase-error";
    code?: string;
    message: string;
}
export declare function createSupabaseError(error: PostgrestError | AuthError | CustomError): SupabaseError;
export declare function isJWTError(error: any): error is AuthError;
export declare function isSupabaseError(error: any): error is SupabaseError;
/**
 * Authentication
 */
export declare function signInWithGoogleOAuth(): Promise<Provider | SupabaseError>;
/**
 * Users
 */
export declare function getSession(): Promise<SupabaseSession | null>;
export declare function getUser(jwt?: string): Promise<SupabaseUser | null>;
/**
 * Teams
 */
export declare function getTeam(): Promise<SupabaseTeam | SupabaseError>;
/**
 * User Profile
 */
export declare function getUserProfile(): Promise<SupabaseUserProfile | SupabaseError>;
export declare function setUserProfile(profile: SupabaseUserProfile): Promise<SupabaseUserProfile | SupabaseError>;
export declare function setUserProfileHasDismissedGettingStartedBanner({ id, hasDismissedGettingStartedBanner, }: {
    id: string;
    hasDismissedGettingStartedBanner: boolean;
}): Promise<SupabaseUserProfile | SupabaseError>;
export declare function setUserProfileHasOnboarded({ id, hasOnboarded, }: {
    id: string;
    hasOnboarded: boolean;
}): Promise<SupabaseUserProfile | SupabaseError>;
/**
 * Projects
 */
export declare function getRawSupabaseProject(): Promise<SupabaseProject | SupabaseError | null>;
export declare function createProject(teamId: number, project: Project): Promise<SupabaseProject | SupabaseError>;
export declare function getLatestCommitVersion(): Promise<number | SupabaseError>;
export declare function updateSupabaseProjectMetadataRaw(id: string, update: {
    pageSuggestions: PageSuggestion[];
    companyName: string;
    companyContext: string;
}): Promise<SupabaseProject | SupabaseError>;
export declare function updateSupabaseProjectRaw(id: string, update: {
    project: Project;
    commitVersion: number;
    opsTransactionId: string | null;
    schemaVersion: number;
}): Promise<SupabaseProject | SupabaseError>;
export declare function updateSubframeImportAlias(id: string, alias: string): Promise<SupabaseError | undefined>;
//# sourceMappingURL=supabase-api.d.ts.map