@cocalc/project
Version:
CoCalc: project daemon
43 lines (42 loc) • 1.37 kB
TypeScript
import { SyncTable } from "@cocalc/sync/table";
import { TypedMap } from "@cocalc/frontend/app-framework";
import { DirectoryListingEntry } from "@cocalc/util/types";
interface Listing {
path: string;
project_id?: string;
listing?: DirectoryListingEntry[];
time?: Date;
interest?: Date;
missing?: number;
error?: string;
deleted?: string[];
}
export declare type ImmutableListing = TypedMap<Listing>;
declare class ListingsTable {
private readonly table?;
private logger;
private project_id;
private watchers;
constructor(table: SyncTable, logger: any, project_id: string);
close(): void;
private setup_watchers;
private remove_stale_watchers;
private log;
private is_ready;
private get_table;
set(obj: Listing): Promise<void>;
get(path: string): ImmutableListing | undefined;
private handle_change_event;
private handle_change;
private ensure_watching;
private compute_listing;
private start_watching;
private stop_watching;
private trim_old_paths;
private remove_path;
set_deleted(filename: string): Promise<void>;
is_deleted(filename: string): boolean;
}
export declare function register_listings_table(table: SyncTable, logger: any, project_id: string): void;
export declare function get_listings_table(): ListingsTable | undefined;
export {};