import { DirectoryBaseDTO, DirectoryPathDTO, ParentDirectoryDTO } from './DirectoryDTO'; import { SearchResultDTO } from './SearchResultDTO'; import { FileDTO } from './FileDTO'; export interface ContentWrapper { directory?: ParentDirectoryDTO | null; searchResult?: SearchResultDTO | null; notModified?: boolean; } export interface PackedContentWrapper { directory?: ParentDirectoryDTO | null; searchResult?: SearchResultDTO | null; notModified?: boolean; map: { faces: string[]; keywords: string[]; lens: string[]; camera: string[]; directories: DirectoryPathDTO[]; }; reverseMap?: { faces: Map; keywords: Map; lens: Map; camera: Map; directories: Map; }; } export interface ContentWrapperWithError extends ContentWrapper { error?: string; } export interface PackedContentWrapperWithError extends PackedContentWrapper { error?: string; } export declare class ContentWrapperUtils { static readonly MAX_BITMASK_LENGTH = 52; static equals(cw1: ContentWrapper, cw2: ContentWrapper): boolean; static equalsMedia(d1: FileDTO | null | undefined, d2: FileDTO | null | undefined): boolean; static equalsPartialDirectory(d1: DirectoryBaseDTO | null | undefined, d2: DirectoryBaseDTO | null | undefined): boolean; static equalsDirectories(d1: DirectoryBaseDTO[], d2: DirectoryBaseDTO[]): boolean; static equalsFiles(m1: FileDTO[], m2: FileDTO[]): boolean; /** * Encodes a boolean list to a number: bit i is the i-th element, with an extra 1 bit above the last element * to keep the length of the list (e.g.: [true, false] -> 0b101). * Returns null if the list is too long to be stored in a safe integer. */ static booleansToBitmask(list: boolean[]): number | null; static bitmaskToBooleans(mask: number): boolean[]; /** * availableParents travels as a bitmask over the network */ private static packAvailableParents; private static unPackAvailableParents; static pack(cwIn: ContentWrapper): PackedContentWrapper; static unpack(cwIn: PackedContentWrapper | null): ContentWrapper; static build(directory?: ParentDirectoryDTO | null, searchResult?: SearchResultDTO | null, notModified?: boolean): ContentWrapper; private static mapify; private static packMedia; private static packDirectory; private static deMapify; private static unPackMedia; private static unPackDirectory; }