import { ImmutableTree } from '@youwol/rx-tree-views'; import { BehaviorSubject, Observable, Subject } from 'rxjs'; import { ExplorerBackend } from '@youwol/http-clients'; import { RequestEvent } from '@youwol/http-primitives'; type NodeEventType = 'item-added'; export interface Origin { local: boolean; remote: boolean; } type Children = BrowserNode[] | Observable; export declare class BrowserNode extends ImmutableTree.Node { readonly name: string; readonly events$: Subject<{ type: NodeEventType; }>; readonly status$: BehaviorSubject<{ type: string; id: string; }[]>; readonly icon: string; readonly origin?: Origin; constructor(params: { id: string; name: string; icon?: string; children?: Children; origin?: Origin; }); addStatus({ type, id }: { type: string; id?: string; }): { type: string; id: string; }; removeStatus({ type, id }: { type: string; id?: string; }): void; resolveChildren(): Observable>; } export declare function serialize(node: BrowserNode): any; type GroupKind = 'user' | 'users'; export declare class GroupNode extends BrowserNode { static iconsFactory: Record; readonly groupId: string; readonly kind: GroupKind; constructor(params: { id: string; name: string; kind: GroupKind; children?: Array | Observable>; }); } export declare class DriveNode extends BrowserNode implements ExplorerBackend.GetDriveResponse { readonly groupId: string; readonly driveId: string; readonly metadata: string; readonly icon = "fas fa-hdd"; constructor(params: { groupId: string; driveId: string; name: string; children?: Children; }); } type FolderKind = 'regular' | 'home' | 'download' | 'trash' | 'system'; export declare class FolderNode extends BrowserNode implements ExplorerBackend.GetFolderResponse { static iconsFactory: Record; readonly folderId: string; readonly groupId: string; readonly driveId: string; readonly parentFolderId: string; readonly metadata: string; readonly kind: T; constructor(params: ExplorerBackend.GetFolderResponse & { origin?: Origin; children: Children; }); } export declare function getFolderChildren(groupId: string, driveId: string, folderId: string): any; export declare function getDeletedChildren(driveId: string): Observable; export type RegularFolderNode = FolderNode<'regular'>; export type HomeNode = FolderNode<'home'>; export type DownloadNode = FolderNode<'download'>; export type TrashNode = FolderNode<'trash'>; export type SystemNode = FolderNode<'system'>; export type AnyFolderNode = FolderNode; export declare function instanceOfTrashFolder(folder: BrowserNode): boolean; export declare function instanceOfStandardFolder(folder: BrowserNode): boolean; export declare class ItemNode extends BrowserNode implements ExplorerBackend.GetItemResponse { static iconsFactory: { [key: string]: string; }; readonly id: string; readonly name: string; readonly groupId: string; readonly driveId: string; readonly rawId: string; readonly assetId: string; readonly itemId: string; readonly folderId: string; readonly borrowed: boolean; readonly kind: string; readonly icon: string; readonly metadata: string; constructor(params: ExplorerBackend.GetItemResponse & { origin?: Origin; }); } export declare class FutureNode extends BrowserNode { readonly onResponse: (unknown: any, BrowserNode: any) => void; readonly response$: Observable; constructor(params: { icon: string; name: string; onResponse: (unknown: any, BrowserNode: any) => void; response$: Observable; }); } export declare class FutureItemNode extends FutureNode { } export declare class FutureFolderNode extends FutureNode { } export declare class DeletedNode extends BrowserNode { readonly name: string; readonly driveId: string; constructor({ id, name, driveId }: { id: any; name: any; driveId: any; }); } export declare class DeletedFolderNode extends DeletedNode { readonly name: string; readonly driveId: string; constructor({ id, driveId, name, }: { id: string; driveId: string; name: string; }); } export declare class DeletedItemNode extends DeletedNode { readonly name: string; readonly driveId: string; readonly kind: string; constructor({ id, driveId, name, kind, }: { id: string; driveId: string; name: string; kind: string; }); } export declare class ProgressNode extends BrowserNode { readonly progress$: Observable; readonly response$: Observable; readonly onResponse: (unknown: any, BrowserNode: any) => void; readonly direction: 'upload' | 'download'; constructor(params: { id: string; name: string; progress$: Observable; response$: Observable; onResponse: (unknown: any, BrowserNode: any) => void; direction: 'upload' | 'download'; }); } export type AnyItemNode = ItemNode | FutureItemNode | DeletedItemNode | ProgressNode; export {};