import { AtlasViewer } from './viewer.js'; import type { components } from './type-gen/openapi.js'; import * as Atlas from './global.js'; export declare const isNode: string | false; export type LoadedObject, U extends Record> = T & { attr: U; }; export declare abstract class BaseAtlasClass> { viewer: AtlasViewer; protected attributePromise: Promise | undefined; protected _attr: AttributesType | undefined; constructor(viewer?: AtlasUser | AtlasViewer); protected abstract endpoint(): string; /** * returns the object's information; this may be undefined */ get attr(): AttributesType | undefined; /** * Fetches basic information about the object. * By default, this caches the call; if you want to * bust the cache, pass `true` as the first argument. * This immediately. * * @param bustCache Whether to refetch the relevant information * @returns A promise that resolves to the organization info. */ fetchAttributes(bustCache?: boolean): Promise; /** * Loads the information associated with the class, removing any * existing caches. * * * * @returns a LoadedObject instance of the class that is guaranteed to * have its `attr` slot populated with appropriate information. * * @example * const loadedProject = await (new AtlasProject(projectId)).withLoadedAttributes() * * // OR, in cases where we want to do stuff immediately with the project and ensure * // that later calls there don't double-fetch information. * * const project = new AtlasProject(projectId) * * // do stuff right away. * const projection = new AtlasProjection(projectionId, {project: project}) * const loadedProjection = await projection.withLoadedAttributes() * // do stuff with loadedProjection * * */ withLoadedAttributes(): Promise>; apiCall(endpoint: string, method: 'GET' | 'POST', payload?: Atlas.Payload, headers?: null | Record): Promise | Uint8Array | import("apache-arrow").Table | null>; } export declare function getEnvViewer(): AtlasViewer; type ViewMakerArgs = ConstructorParameters; export declare class AtlasUser extends BaseAtlasClass { constructor(...args: ViewMakerArgs | [AtlasViewer]); protected endpoint(): string; get anonymous(): boolean; get apiLocation(): string; /** * * @returns All projects that the user has access to. */ projects(): Promise<{ id: string; owner: string; project_name: string; creator: string; description: string; is_public: boolean; is_public_to_org: boolean; project_fields: string[]; unique_id_field: string; modality?: string | undefined; total_datums_in_project: number; created_timestamp: string; nickname: string; thumbnail: string; slug: string; organization_slug: string; organization_name: string; creator_nickname: string; creator_picture: string; }[]>; /** * * @param role return only organizations where the user has this role (default: null, return all organizations) * @returns A list of organizations where the user has the specified role */ organizations(role?: 'OWNER' | 'MEMBER' | null): Promise; } export {};