import { BoxCryptoManager } from "./Crypto"; export { ready, getPrettyFingerprint, _setRnSodium, deriveKey, KeyDerivationDifficulty } from "./Crypto"; export * from "./Exceptions"; import { base64 } from "./Helpers"; export { base64, fromBase64, toBase64, randomBytes } from "./Helpers"; import { CollectionAccessLevel, CollectionCryptoManager, MinimalCollectionCryptoManager, CollectionItemCryptoManager, ItemMetadata, EncryptedCollection, EncryptedCollectionItem } from "./EncryptedModels"; export * from "./EncryptedModels"; import { CollectionItemListResponse, FetchOptions, ItemFetchOptions, LoginResponseUser, User, MemberFetchOptions, InvitationFetchOptions, RevisionsFetchOptions, WebSocketHandle } from "./OnlineManagers"; export { User, CollectionMember, FetchOptions, ItemFetchOptions } from "./OnlineManagers"; export { CURRENT_VERSION } from "./Constants"; export interface AccountData { version: number; key: Uint8Array; user: LoginResponseUser; serverUrl: string; authToken?: string; } export interface AccountDataStored { version: number; encryptedData: Uint8Array; } export declare class Account { private mainKey; private version; user: LoginResponseUser; serverUrl: string; authToken: string | null; private constructor(); static isEtebaseServer(serverUrl: string): Promise; static signup(user: User, password: string, serverUrl?: string): Promise; static login(username: string, password: string, serverUrl?: string): Promise; fetchToken(): Promise; logout(): Promise; changePassword(password: string): Promise; getDashboardUrl(): Promise; save(encryptionKey_?: Uint8Array): Promise; static restore(accountDataStored_: base64, encryptionKey_?: Uint8Array): Promise; getCollectionManager(): CollectionManager; getInvitationManager(): CollectionInvitationManager; _getCryptoManager(): import("./EncryptedModels").AccountCryptoManager; _getIdentityCryptoManager(): BoxCryptoManager; } export declare class CollectionManager { private readonly etebase; private readonly onlineManager; constructor(etebase: Account); create(colType: string, meta: ItemMetadata, content: Uint8Array | string): Promise; fetch(colUid: base64, options?: FetchOptions): Promise; list(colType: string | string[], options?: FetchOptions): Promise<{ data: Collection[]; removedMemberships?: import("./OnlineManagers").RemovedCollection[] | undefined; stoken: string; done: boolean; }>; upload(collection: Collection, options?: FetchOptions): Promise; transaction(collection: Collection, options?: FetchOptions): Promise; cacheSave(collection: Collection, options?: { saveContent: boolean; }): Uint8Array; cacheLoad(cache: Uint8Array): Collection; getItemManager(col_: Collection): ItemManager; getMemberManager(col: Collection): CollectionMemberManager; } export declare class ItemManager { private readonly collectionCryptoManager; private readonly onlineManager; private readonly collectionUid; constructor(etebase: Account, collectionCryptoManager: MinimalCollectionCryptoManager, colUid: string); create(meta: ItemMetadata, content: Uint8Array | string): Promise; fetch(itemUid: base64, options?: ItemFetchOptions): Promise; list(options?: ItemFetchOptions): Promise<{ data: Item[]; stoken: string; done: boolean; }>; itemRevisions(item: Item, options?: RevisionsFetchOptions): Promise<{ data: Item[]; iterator: string; done: boolean; }>; private itemsPrepareForUpload; fetchUpdates(items: Item[], options?: ItemFetchOptions): Promise<{ data: Item[]; stoken: string; done: boolean; }>; fetchMulti(items: base64[], options?: ItemFetchOptions): Promise<{ data: Item[]; stoken: string; done: boolean; }>; batch(items: Item[], deps?: Item[] | null, options?: ItemFetchOptions): Promise; transaction(items: Item[], deps?: Item[] | null, options?: ItemFetchOptions): Promise; uploadContent(item: Item): Promise; downloadContent(item: Item): Promise; subscribeChanges(cb: (data: CollectionItemListResponse) => void, options?: ItemFetchOptions): Promise; cacheSave(item: Item, options?: { saveContent: boolean; }): Uint8Array; cacheLoad(cache: Uint8Array): Item; } export interface SignedInvitationContent { encryptionKey: Uint8Array; collectionType: string; } export interface SignedInvitation { uid: base64; version: number; username: string; collection: base64; accessLevel: CollectionAccessLevel; signedEncryptionKey: Uint8Array; fromUsername?: string; fromPubkey: Uint8Array; } export declare class CollectionInvitationManager { private readonly etebase; private readonly onlineManager; constructor(etebase: Account); listIncoming(options?: InvitationFetchOptions): Promise>; listOutgoing(options?: InvitationFetchOptions): Promise>; accept(invitation: SignedInvitation): Promise<{}>; reject(invitation: SignedInvitation): Promise<{}>; fetchUserProfile(username: string): Promise; invite(col: Collection, username: string, pubkey: Uint8Array, accessLevel: CollectionAccessLevel): Promise; disinvite(invitation: SignedInvitation): Promise<{}>; get pubkey(): Uint8Array; } export declare class CollectionMemberManager { private readonly etebase; private readonly onlineManager; constructor(etebase: Account, _collectionManager: CollectionManager, encryptedCollection: EncryptedCollection); list(options?: MemberFetchOptions): Promise>; remove(username: string): Promise<{}>; leave(): Promise<{}>; modifyAccessLevel(username: string, accessLevel: CollectionAccessLevel): Promise<{}>; } export declare enum OutputFormat { Uint8Array = 0, String = 1 } export declare class Collection { private readonly cryptoManager; readonly encryptedCollection: EncryptedCollection; constructor(cryptoManager: CollectionCryptoManager, encryptedCollection: EncryptedCollection); verify(): boolean; setMeta(meta: ItemMetadata): void; getMeta(): ItemMetadata; setContent(content: Uint8Array | string): Promise; getContent(outputFormat?: OutputFormat.Uint8Array): Promise; getContent(outputFormat?: OutputFormat.String): Promise; delete(preserveContent?: boolean): void; get uid(): string; get etag(): string; get isDeleted(): boolean; get stoken(): string | null; get accessLevel(): CollectionAccessLevel; getCollectionType(): string; get item(): Item; } export declare class Item { private readonly cryptoManager; readonly encryptedItem: EncryptedCollectionItem; readonly collectionUid: string; constructor(collectionUid: string, cryptoManager: CollectionItemCryptoManager, encryptedItem: EncryptedCollectionItem); verify(): boolean; setMeta(meta: ItemMetadata): void; getMeta(): ItemMetadata; setContent(content: Uint8Array | string): Promise; getContent(outputFormat?: OutputFormat.Uint8Array): Promise; getContent(outputFormat?: OutputFormat.String): Promise; delete(preserveContent?: boolean): void; get uid(): string; get etag(): string; get isDeleted(): boolean; get isMissingContent(): boolean; _clone(): Item; }