import * as s from 'solid-js'; import * as debug from '@solid-devtools/debugger/types'; import * as structure from './structure.tsx'; export type InputMessage = debug.OutputMessage; export type InputListener = debug.OutputListener; export type OutputMessage = debug.InputMessage; export type OutputListener = debug.InputListener; export type InputEventBus = { emit: (e: InputMessage) => void; listen: (fn: InputListener) => void; }; export type OutputEventBus = { emit: (e: OutputMessage) => void; listen: (fn: OutputListener) => void; }; /** * devtools options provided to {@link Devtools} component * with their default values */ export type DevtoolsOptionsWithDefaults = { errorOverlayFooter: () => s.JSX.Element; headerSubtitle: () => s.JSX.Element; useShortcuts: boolean; catchWindowErrors: boolean; }; export type DevtoolsOptions = Partial; export declare function createDevtools(props: DevtoolsOptions): { output: OutputEventBus; input: InputEventBus; Devtools(): s.JSX.Element; }; declare function createAppCtx(props: DevtoolsOptions): { locator: { locatorEnabled: () => boolean; setLocatorState: s.Setter; }; hovered: { isNodeHovered: (key: `#${string}`) => boolean; hoveredId: s.Accessor<`#${string}` | null>; toggleHoveredNode: (id: debug.NodeID, type?: "element" | "node", isHovered?: boolean) => { type: "element" | "node"; id: debug.NodeID; } | null; toggleHoveredElement: (id: debug.NodeID, isHovered?: boolean) => { type: "element" | "node"; id: debug.NodeID; } | null; }; view: { get: s.Accessor; set: (view: debug.DevtoolsMainView) => void; }; inspector: { inspected: debug.InspectedState; inspectedNode: s.Accessor<{ ownerId: debug.NodeID | null; signalId: debug.NodeID | null; treeWalkerOwnerId: debug.NodeID | null; }>; isSomeNodeInspected: s.Accessor; isInspected: (key: `#${string}`) => boolean; isInspectedTreeWalkerOwner: (key: `#${string}`) => boolean; state: import("./inspector.tsx").Inspector.State; setInspectedNode: (ownerId: debug.NodeID | null, signalId: debug.NodeID | null) => void; setInspectedOwner: (id: debug.NodeID | null) => void; toggleInspectedOwner: (id: debug.NodeID) => void; setInspectedSignal: (id: debug.NodeID | null) => void; inspectValueItem: (item: import("./inspector.tsx").Inspector.ValueItem, selected?: boolean) => void; openComponentLocation: () => void; }; options: DevtoolsOptionsWithDefaults; output: OutputEventBus; input: InputEventBus; viewCache: { set: (view: T, getter: () => { structure: structure.Cache; }[T]) => void; get: (view: T) => { [K in "short" | "long"]: { structure: structure.Cache; }[T][K] | null; }; }; listenToNodeUpdate(id: debug.NodeID, fn: VoidFunction): VoidFunction; }; export type AppCtx = ReturnType; export declare const useAppCtx: () => { locator: { locatorEnabled: () => boolean; setLocatorState: s.Setter; }; hovered: { isNodeHovered: (key: `#${string}`) => boolean; hoveredId: s.Accessor<`#${string}` | null>; toggleHoveredNode: (id: debug.NodeID, type?: "element" | "node", isHovered?: boolean) => { type: "element" | "node"; id: debug.NodeID; } | null; toggleHoveredElement: (id: debug.NodeID, isHovered?: boolean) => { type: "element" | "node"; id: debug.NodeID; } | null; }; view: { get: s.Accessor; set: (view: debug.DevtoolsMainView) => void; }; inspector: { inspected: debug.InspectedState; inspectedNode: s.Accessor<{ ownerId: debug.NodeID | null; signalId: debug.NodeID | null; treeWalkerOwnerId: debug.NodeID | null; }>; isSomeNodeInspected: s.Accessor; isInspected: (key: `#${string}`) => boolean; isInspectedTreeWalkerOwner: (key: `#${string}`) => boolean; state: import("./inspector.tsx").Inspector.State; setInspectedNode: (ownerId: debug.NodeID | null, signalId: debug.NodeID | null) => void; setInspectedOwner: (id: debug.NodeID | null) => void; toggleInspectedOwner: (id: debug.NodeID) => void; setInspectedSignal: (id: debug.NodeID | null) => void; inspectValueItem: (item: import("./inspector.tsx").Inspector.ValueItem, selected?: boolean) => void; openComponentLocation: () => void; }; options: DevtoolsOptionsWithDefaults; output: OutputEventBus; input: InputEventBus; viewCache: { set: (view: T, getter: () => { structure: structure.Cache; }[T]) => void; get: (view: T) => { [K in "short" | "long"]: { structure: structure.Cache; }[T][K] | null; }; }; listenToNodeUpdate(id: debug.NodeID, fn: VoidFunction): VoidFunction; }; export {}; //# sourceMappingURL=controller.d.ts.map