import { Group } from "three"; import { ApiEdge } from "./apiEdge"; import { CategoryConfig, CategoryId } from "./category"; import { EdgeId, LegacyEdge } from "./edge"; import { LegacyNode, NodeId } from "./node"; import { GraphxrEvent, GraphxrEventCallback } from "./on"; import { ReduxActions } from "./redux/getReduxActions"; import { ReduxStore } from "./redux/getReduxStore"; import { RelationshipId } from "./relationship"; import { Position } from "./styles"; export interface RxjsSubscription { unsubscribe(): void; } export interface RequestData { setLabelConfig(category: CategoryId, config: CategoryConfig): Promise; } export interface LabelsConfig { configs: Record; getConfig: (category: CategoryId) => CategoryConfig; updateLabel: (config: CategoryConfig) => void; } export interface RelationshipConfig { getInvisibleRelationships(): RelationshipId[]; } export interface Runtime { isMockRuntime?: boolean; _AppActions: ReduxActions; _app: { controller: { API: { on: (event: GraphxrEvent, callback: GraphxrEventCallback, id: string) => void; }; drawing: { cloudScene: THREE.Group; convertCloudPoint: (position: Position) => Position; GPUPicker: { lineCloud: { _widthScale: number; }; }; forceStartLayout: () => void; graph2DControl: { rotating: boolean; object: Group; showAxes: (visible: boolean) => void; }; nodeCloud: { _showImage: boolean; }; }; graph: LegacyGraph; }; store: ReduxStore; }; _GXR: { Node: any; Edge: any; GraphObservable: { subscribe: (callback: () => void) => RxjsSubscription; subscribeDebounced: (callback: () => void, delay: number) => RxjsSubscription; next: () => void; }; LabelsConfig: { instance: () => LabelsConfig; }; RelationshipConfig: { instance: () => RelationshipConfig; }; TypeColor: { getColorByType: (type: CategoryId) => string; }; }; globalVariable?: { version?: string; name?: string; }; _plot: any; _hd: { axisTitle: any; axisText: { x: any; y: any; z: any; }; setScale: (scale: THREE.Vector3) => void; }; _requestData: RequestData; _testEnvironmentMocks?: { makeNodeId?: () => NodeId; projectId?: string; }; } export type ObjectType = { [key: string]: boolean | string | number | null | undefined; }; export interface LegacyGraph { addEdges: (edges: ApiEdge[]) => LegacyEdge[]; addNodes: (nodes: LegacyNode[]) => void; clear: () => void; nodes: LegacyNode[]; nodeSet: Record; edges: LegacyEdge[]; edgeSet: Record; layoutNodes: LegacyNode[]; layoutEdges: LegacyEdge[]; getEdgeWithId: (sourceId: NodeId, targetId: NodeId, relationship?: RelationshipId) => LegacyEdge | undefined; getNodeById: (id: string) => LegacyNode | undefined; getNodeWithProps: (props: ObjectType) => LegacyNode | undefined; removeEdgesByIds: (ids: EdgeId[]) => void; removeNodesByIds: (ids: NodeId[], onlyVisible?: boolean) => void; update_degree: () => void; } declare global { interface Window extends Runtime { } } export declare function findGraphXRWindow(): Window | undefined; export declare let runtime: Runtime; export declare function getRuntime(): Runtime; /** * An optional function which enables test runners to inject a mock Window object into the API. Most of the time, you won't call this function because the API runtime object defaults to `window`. * @param value - typically a mock of the Window * @category Runtime * @since 0.0.1 */ export declare function setRuntime(value: Runtime): void;