import { Timer } from "js-vextensions"; import { ObservableMap } from "mobx"; import { FetchResult, Observable, ObservableSubscription } from "@apollo/client"; import { Graphlink } from "../Graphlink.js"; import { QueryParams, QueryParams_Linked } from "./QueryParams.js"; import { TreeNodeData } from "./TreeNodeData.js"; import { n } from "../Utils/@Internal/Types.js"; export declare enum TreeNodeType { Root = "Root", Collection = "Collection", CollectionQuery = "CollectionQuery", Document = "Document" } export declare enum SubscriptionStatus { Initial = "Initial", PrepForSubscribe = "PrepForSubscribe", WaitingForSubscribeComplete = "WaitingForSubscribeComplete", ReadyAndLive = "ReadyAndLive" } export declare class PathSubscription { constructor(unsubscribe: () => void); unsubscribe: () => void; } export declare class String_NotWrappedInGraphQL { str: string; toJSON(): string; } export declare const nodesByPath: Map[]>; export declare function PathSegmentsAreValid(pathSegments: string[]): boolean; export type Doc_Base = { id: string; extras: object; }; export declare class TreeNode { constructor(graph: Graphlink, pathOrSegments: string | string[]); observedDataFields: Set; countSecondsWithoutObserver_timer: Timer; get Data_ForDirectSubscriber(): DataShape | null; get DocDatas_ForDirectSubscriber(): any[]; graph: Graphlink; pathSegments: string[]; pathSegments_noQuery: string[]; path: string; path_noQuery: string; type: TreeNodeType; get ParentNode(): TreeNode | null; MarkRequested(): void; Request(subscribeIfNotAlready?: boolean): void; private currentSubscribe_id?; /** Must be called from within a mobx action. (and not be run within a mobx computation) */ SubscribeIfNotAlready(): void; Unsubscribe(allowKeepDataCached?: boolean): { observable: Observable, Record>> | null; subscription: ObservableSubscription | null; } | null; UnsubscribeAll(allowKeepDataCached?: boolean, nodesThatHadActiveOrInitializingSub?: Set>): Set>; self_subscriptionStatus: SubscriptionStatus; self_apolloObservable: Observable, Record>> | null; self_subscription: ObservableSubscription | null; data_fromParent: TreeNodeData; data_fromSelf: TreeNodeData; get PreferredDataContainer(): TreeNodeData; get PreferredData(): DataShape | null; get DocDatas(): any[]; collectionNodes: ObservableMap>; queryNodes: ObservableMap>; query_raw: QueryParams; query: QueryParams_Linked | n; docNodes: ObservableMap>; get AllChildNodes(): TreeNode[]; get AllDescendantNodes(): TreeNode[]; Get(subpathOrGetterFunc: string | string[] | ((data: DataShape) => any), createTreeNodesIfMissing: boolean): TreeNode | null; get raw(): DataShape; AsRawData(addTreeLink?: boolean): DataShape; UploadRawData(rawData: DataShape): void; } export declare function GetTreeNodeTypeForPath(pathOrSegments: string | string[]): TreeNodeType; export declare function TreeNodeToRawData(treeNode: TreeNode, addTreeLink?: boolean): DataShape;