import { ontology, panel, project } from '@synnaxlabs/client'; import { optional, record } from '@synnaxlabs/x'; import { z } from 'zod'; import { Flux } from '../flux'; export type RetrieveQuery = { key: panel.Key; }; export declare const use: Flux.Use, useEnsure: Flux.UseEnsure, useInvalidate: Flux.UseInvalidate, useResult: Flux.UseResult, createSelector: Flux.CreateSelector; export type RetrieveKeysByProjectQuery = { project: project.Key; }; export declare const useKeysByProject: Flux.Use; export interface KeyParams { key: panel.Key; } /** * Reports whether the subject may restructure the panel. Every mosaic gesture, from * closing a tab to resizing a split, reduces to one dispatch against the panel * document, so a single update grant answers all of them. */ export declare const useCanEdit: (arg?: optional.Optional | undefined) => boolean; export interface TabContentParams { key: panel.Key; tabKey: panel.TabKey; } export interface NodeParams extends KeyParams { nodeKey: number; } export declare const useNodeVariant: (arg: optional.Optional) => "split" | "leaf"; export declare const useLeafNode: (arg: optional.Optional) => Omit & { tabs: panel.TabKey[]; }; export declare const useSplitNode: (arg: optional.Optional) => panel.SplitNode; export declare const useTabKeys: (arg?: optional.Optional | undefined) => string[]; export declare const useRoot: (arg?: optional.Optional | undefined) => { variant: "leaf"; tabs: ({ key: string; variant: "resource"; resource: { type: "arc" | "builtin" | "channel" | "device" | "framer" | "group" | "label" | "lineplot" | "log" | "node" | "panel" | "policy" | "project" | "rack" | "range" | "range-alias" | "role" | "schematic" | "schematic_symbol" | "status" | "table" | "task" | "user" | "view"; key: string; } | { type: "label" | "table" | "schematic" | "view" | "range" | "group" | "log" | "status" | "role" | "panel" | "node" | "channel" | "project" | "user" | "policy" | "task" | "device" | "rack" | "arc" | "builtin" | "framer" | "lineplot" | "range-alias" | "schematic_symbol"; key: string; }; } | { key: string; type: string; args: Record; variant: "view"; })[]; } | { variant: "split"; direction: "x" | "y"; size: number; first: panel.Node; last: panel.Node; }; export declare const useName: (arg?: optional.Optional | undefined) => string; export declare const useTab: (arg?: optional.Optional | undefined) => panel.Tab; export declare const useTabLeaf: (arg?: optional.Optional | undefined) => panel.LeafNode; export declare const useTabVariant: (arg?: optional.Optional | undefined) => "view" | "resource"; export declare const useTabType: (arg?: optional.Optional | undefined) => string; export declare const useTabResource: (arg?: optional.Optional | undefined) => { type: "arc" | "builtin" | "channel" | "device" | "framer" | "group" | "label" | "lineplot" | "log" | "node" | "panel" | "policy" | "project" | "rack" | "range" | "range-alias" | "role" | "schematic" | "schematic_symbol" | "status" | "table" | "task" | "user" | "view"; key: string; } | { type: "label" | "table" | "schematic" | "view" | "range" | "group" | "log" | "status" | "role" | "panel" | "node" | "channel" | "project" | "user" | "policy" | "task" | "device" | "rack" | "arc" | "builtin" | "framer" | "lineplot" | "range-alias" | "schematic_symbol"; key: string; }; export declare const useTabArgs: (arg?: optional.Optional | undefined) => record.Unknown; export declare const createSelectTabArgs: (schema: Z) => (() => z.output); export interface ListParams extends Pick { } export declare const useList: Flux.UseList; export interface CreateParams extends panel.New { } export declare const useCreate: Flux.UseUpdate; export interface RenameParams extends Pick { } export declare const useRename: Flux.UseUpdate; export type DeleteParams = panel.Key | panel.Key[]; export declare const useDelete: Flux.UseUpdate; export declare const useDispatch: () => Flux.UseDispatchReturn; variant: "view"; })[]; } | { variant: "split"; direction: "x" | "y"; size: number; first: panel.Node; last: panel.Node; }; parent?: { type: "arc" | "builtin" | "channel" | "device" | "framer" | "group" | "label" | "lineplot" | "log" | "node" | "panel" | "policy" | "project" | "rack" | "range" | "range-alias" | "role" | "schematic" | "schematic_symbol" | "status" | "table" | "task" | "user" | "view"; key: string; } | { type: "label" | "table" | "schematic" | "view" | "range" | "group" | "log" | "status" | "role" | "panel" | "node" | "channel" | "project" | "user" | "policy" | "task" | "device" | "rack" | "arc" | "builtin" | "framer" | "lineplot" | "range-alias" | "schematic_symbol"; key: string; } | undefined; }; }; } | { type: "rename"; rename: { name: string; }; } | { type: "insert_tabs"; insertTabs: { tabs: ({ key: string; variant: "resource"; resource: { type: "arc" | "builtin" | "channel" | "device" | "framer" | "group" | "label" | "lineplot" | "log" | "node" | "panel" | "policy" | "project" | "rack" | "range" | "range-alias" | "role" | "schematic" | "schematic_symbol" | "status" | "table" | "task" | "user" | "view"; key: string; } | { type: "label" | "table" | "schematic" | "view" | "range" | "group" | "log" | "status" | "role" | "panel" | "node" | "channel" | "project" | "user" | "policy" | "task" | "device" | "rack" | "arc" | "builtin" | "framer" | "lineplot" | "range-alias" | "schematic_symbol"; key: string; }; } | { key: string; type: string; args: Record; variant: "view"; })[]; targetLeaf?: number | undefined; targetTab?: string | undefined; index?: number | undefined; location?: "left" | "right" | "top" | "bottom" | "center" | undefined; singleton?: boolean | undefined; }; } | { type: "remove_tab"; removeTab: { key: string; }; } | { type: "move_tab"; moveTab: { key: string; targetLeaf: number; index?: number | undefined; location?: "left" | "right" | "top" | "bottom" | "center" | undefined; }; } | { type: "split_tab"; splitTab: { key: string; direction: "x" | "y"; }; } | { type: "resize_split"; resizeSplit: { split: number; size: number; }; } | { type: "set_tab_resource"; setTabResource: { key: string; resource: { type: "arc" | "builtin" | "channel" | "device" | "framer" | "group" | "label" | "lineplot" | "log" | "node" | "panel" | "policy" | "project" | "rack" | "range" | "range-alias" | "role" | "schematic" | "schematic_symbol" | "status" | "table" | "task" | "user" | "view"; key: string; } | { type: "label" | "table" | "schematic" | "view" | "range" | "group" | "log" | "status" | "role" | "panel" | "node" | "channel" | "project" | "user" | "policy" | "task" | "device" | "rack" | "arc" | "builtin" | "framer" | "lineplot" | "range-alias" | "schematic_symbol"; key: string; }; }; } | { type: "set_tab_view"; setTabView: { key: string; view: { type: string; args: Record; }; }; }>, useSingleDispatchBase: (params: record.Keyed) => (action: { type: "create"; create: { panel: { key: string; name: string; root: { variant: "leaf"; tabs: ({ key: string; variant: "resource"; resource: { type: "arc" | "builtin" | "channel" | "device" | "framer" | "group" | "label" | "lineplot" | "log" | "node" | "panel" | "policy" | "project" | "rack" | "range" | "range-alias" | "role" | "schematic" | "schematic_symbol" | "status" | "table" | "task" | "user" | "view"; key: string; } | { type: "label" | "table" | "schematic" | "view" | "range" | "group" | "log" | "status" | "role" | "panel" | "node" | "channel" | "project" | "user" | "policy" | "task" | "device" | "rack" | "arc" | "builtin" | "framer" | "lineplot" | "range-alias" | "schematic_symbol"; key: string; }; } | { key: string; type: string; args: Record; variant: "view"; })[]; } | { variant: "split"; direction: "x" | "y"; size: number; first: panel.Node; last: panel.Node; }; parent?: { type: "arc" | "builtin" | "channel" | "device" | "framer" | "group" | "label" | "lineplot" | "log" | "node" | "panel" | "policy" | "project" | "rack" | "range" | "range-alias" | "role" | "schematic" | "schematic_symbol" | "status" | "table" | "task" | "user" | "view"; key: string; } | { type: "label" | "table" | "schematic" | "view" | "range" | "group" | "log" | "status" | "role" | "panel" | "node" | "channel" | "project" | "user" | "policy" | "task" | "device" | "rack" | "arc" | "builtin" | "framer" | "lineplot" | "range-alias" | "schematic_symbol"; key: string; } | undefined; }; }; } | { type: "rename"; rename: { name: string; }; } | { type: "insert_tabs"; insertTabs: { tabs: ({ key: string; variant: "resource"; resource: { type: "arc" | "builtin" | "channel" | "device" | "framer" | "group" | "label" | "lineplot" | "log" | "node" | "panel" | "policy" | "project" | "rack" | "range" | "range-alias" | "role" | "schematic" | "schematic_symbol" | "status" | "table" | "task" | "user" | "view"; key: string; } | { type: "label" | "table" | "schematic" | "view" | "range" | "group" | "log" | "status" | "role" | "panel" | "node" | "channel" | "project" | "user" | "policy" | "task" | "device" | "rack" | "arc" | "builtin" | "framer" | "lineplot" | "range-alias" | "schematic_symbol"; key: string; }; } | { key: string; type: string; args: Record; variant: "view"; })[]; targetLeaf?: number | undefined; targetTab?: string | undefined; index?: number | undefined; location?: "left" | "right" | "top" | "bottom" | "center" | undefined; singleton?: boolean | undefined; }; } | { type: "remove_tab"; removeTab: { key: string; }; } | { type: "move_tab"; moveTab: { key: string; targetLeaf: number; index?: number | undefined; location?: "left" | "right" | "top" | "bottom" | "center" | undefined; }; } | { type: "split_tab"; splitTab: { key: string; direction: "x" | "y"; }; } | { type: "resize_split"; resizeSplit: { split: number; size: number; }; } | { type: "set_tab_resource"; setTabResource: { key: string; resource: { type: "arc" | "builtin" | "channel" | "device" | "framer" | "group" | "label" | "lineplot" | "log" | "node" | "panel" | "policy" | "project" | "rack" | "range" | "range-alias" | "role" | "schematic" | "schematic_symbol" | "status" | "table" | "task" | "user" | "view"; key: string; } | { type: "label" | "table" | "schematic" | "view" | "range" | "group" | "log" | "status" | "role" | "panel" | "node" | "channel" | "project" | "user" | "policy" | "task" | "device" | "rack" | "arc" | "builtin" | "framer" | "lineplot" | "range-alias" | "schematic_symbol"; key: string; }; }; } | { type: "set_tab_view"; setTabView: { key: string; view: { type: string; args: Record; }; }; } | ({ type: "create"; create: { panel: { key: string; name: string; root: { variant: "leaf"; tabs: ({ key: string; variant: "resource"; resource: { type: "arc" | "builtin" | "channel" | "device" | "framer" | "group" | "label" | "lineplot" | "log" | "node" | "panel" | "policy" | "project" | "rack" | "range" | "range-alias" | "role" | "schematic" | "schematic_symbol" | "status" | "table" | "task" | "user" | "view"; key: string; } | { type: "label" | "table" | "schematic" | "view" | "range" | "group" | "log" | "status" | "role" | "panel" | "node" | "channel" | "project" | "user" | "policy" | "task" | "device" | "rack" | "arc" | "builtin" | "framer" | "lineplot" | "range-alias" | "schematic_symbol"; key: string; }; } | { key: string; type: string; args: Record; variant: "view"; })[]; } | { variant: "split"; direction: "x" | "y"; size: number; first: panel.Node; last: panel.Node; }; parent?: { type: "arc" | "builtin" | "channel" | "device" | "framer" | "group" | "label" | "lineplot" | "log" | "node" | "panel" | "policy" | "project" | "rack" | "range" | "range-alias" | "role" | "schematic" | "schematic_symbol" | "status" | "table" | "task" | "user" | "view"; key: string; } | { type: "label" | "table" | "schematic" | "view" | "range" | "group" | "log" | "status" | "role" | "panel" | "node" | "channel" | "project" | "user" | "policy" | "task" | "device" | "rack" | "arc" | "builtin" | "framer" | "lineplot" | "range-alias" | "schematic_symbol"; key: string; } | undefined; }; }; } | { type: "rename"; rename: { name: string; }; } | { type: "insert_tabs"; insertTabs: { tabs: ({ key: string; variant: "resource"; resource: { type: "arc" | "builtin" | "channel" | "device" | "framer" | "group" | "label" | "lineplot" | "log" | "node" | "panel" | "policy" | "project" | "rack" | "range" | "range-alias" | "role" | "schematic" | "schematic_symbol" | "status" | "table" | "task" | "user" | "view"; key: string; } | { type: "label" | "table" | "schematic" | "view" | "range" | "group" | "log" | "status" | "role" | "panel" | "node" | "channel" | "project" | "user" | "policy" | "task" | "device" | "rack" | "arc" | "builtin" | "framer" | "lineplot" | "range-alias" | "schematic_symbol"; key: string; }; } | { key: string; type: string; args: Record; variant: "view"; })[]; targetLeaf?: number | undefined; targetTab?: string | undefined; index?: number | undefined; location?: "left" | "right" | "top" | "bottom" | "center" | undefined; singleton?: boolean | undefined; }; } | { type: "remove_tab"; removeTab: { key: string; }; } | { type: "move_tab"; moveTab: { key: string; targetLeaf: number; index?: number | undefined; location?: "left" | "right" | "top" | "bottom" | "center" | undefined; }; } | { type: "split_tab"; splitTab: { key: string; direction: "x" | "y"; }; } | { type: "resize_split"; resizeSplit: { split: number; size: number; }; } | { type: "set_tab_resource"; setTabResource: { key: string; resource: { type: "arc" | "builtin" | "channel" | "device" | "framer" | "group" | "label" | "lineplot" | "log" | "node" | "panel" | "policy" | "project" | "rack" | "range" | "range-alias" | "role" | "schematic" | "schematic_symbol" | "status" | "table" | "task" | "user" | "view"; key: string; } | { type: "label" | "table" | "schematic" | "view" | "range" | "group" | "log" | "status" | "role" | "panel" | "node" | "channel" | "project" | "user" | "policy" | "task" | "device" | "rack" | "arc" | "builtin" | "framer" | "lineplot" | "range-alias" | "schematic_symbol"; key: string; }; }; } | { type: "set_tab_view"; setTabView: { key: string; view: { type: string; args: Record; }; }; })[]) => void, useUndoBase: (params: { key: string; }) => Flux.UseUndoReturn, useRedoBase: (params: record.Keyed) => Flux.UseRedoReturn; export declare const useSingleDispatch: (arg?: optional.Optional, "key"> | undefined) => (action: { type: "create"; create: { panel: { key: string; name: string; root: { variant: "leaf"; tabs: ({ key: string; variant: "resource"; resource: { type: "arc" | "builtin" | "channel" | "device" | "framer" | "group" | "label" | "lineplot" | "log" | "node" | "panel" | "policy" | "project" | "rack" | "range" | "range-alias" | "role" | "schematic" | "schematic_symbol" | "status" | "table" | "task" | "user" | "view"; key: string; } | { type: "label" | "table" | "schematic" | "view" | "range" | "group" | "log" | "status" | "role" | "panel" | "node" | "channel" | "project" | "user" | "policy" | "task" | "device" | "rack" | "arc" | "builtin" | "framer" | "lineplot" | "range-alias" | "schematic_symbol"; key: string; }; } | { key: string; type: string; args: Record; variant: "view"; })[]; } | { variant: "split"; direction: "x" | "y"; size: number; first: panel.Node; last: panel.Node; }; parent?: { type: "arc" | "builtin" | "channel" | "device" | "framer" | "group" | "label" | "lineplot" | "log" | "node" | "panel" | "policy" | "project" | "rack" | "range" | "range-alias" | "role" | "schematic" | "schematic_symbol" | "status" | "table" | "task" | "user" | "view"; key: string; } | { type: "label" | "table" | "schematic" | "view" | "range" | "group" | "log" | "status" | "role" | "panel" | "node" | "channel" | "project" | "user" | "policy" | "task" | "device" | "rack" | "arc" | "builtin" | "framer" | "lineplot" | "range-alias" | "schematic_symbol"; key: string; } | undefined; }; }; } | { type: "rename"; rename: { name: string; }; } | { type: "insert_tabs"; insertTabs: { tabs: ({ key: string; variant: "resource"; resource: { type: "arc" | "builtin" | "channel" | "device" | "framer" | "group" | "label" | "lineplot" | "log" | "node" | "panel" | "policy" | "project" | "rack" | "range" | "range-alias" | "role" | "schematic" | "schematic_symbol" | "status" | "table" | "task" | "user" | "view"; key: string; } | { type: "label" | "table" | "schematic" | "view" | "range" | "group" | "log" | "status" | "role" | "panel" | "node" | "channel" | "project" | "user" | "policy" | "task" | "device" | "rack" | "arc" | "builtin" | "framer" | "lineplot" | "range-alias" | "schematic_symbol"; key: string; }; } | { key: string; type: string; args: Record; variant: "view"; })[]; targetLeaf?: number | undefined; targetTab?: string | undefined; index?: number | undefined; location?: "left" | "right" | "top" | "bottom" | "center" | undefined; singleton?: boolean | undefined; }; } | { type: "remove_tab"; removeTab: { key: string; }; } | { type: "move_tab"; moveTab: { key: string; targetLeaf: number; index?: number | undefined; location?: "left" | "right" | "top" | "bottom" | "center" | undefined; }; } | { type: "split_tab"; splitTab: { key: string; direction: "x" | "y"; }; } | { type: "resize_split"; resizeSplit: { split: number; size: number; }; } | { type: "set_tab_resource"; setTabResource: { key: string; resource: { type: "arc" | "builtin" | "channel" | "device" | "framer" | "group" | "label" | "lineplot" | "log" | "node" | "panel" | "policy" | "project" | "rack" | "range" | "range-alias" | "role" | "schematic" | "schematic_symbol" | "status" | "table" | "task" | "user" | "view"; key: string; } | { type: "label" | "table" | "schematic" | "view" | "range" | "group" | "log" | "status" | "role" | "panel" | "node" | "channel" | "project" | "user" | "policy" | "task" | "device" | "rack" | "arc" | "builtin" | "framer" | "lineplot" | "range-alias" | "schematic_symbol"; key: string; }; }; } | { type: "set_tab_view"; setTabView: { key: string; view: { type: string; args: Record; }; }; } | ({ type: "create"; create: { panel: { key: string; name: string; root: { variant: "leaf"; tabs: ({ key: string; variant: "resource"; resource: { type: "arc" | "builtin" | "channel" | "device" | "framer" | "group" | "label" | "lineplot" | "log" | "node" | "panel" | "policy" | "project" | "rack" | "range" | "range-alias" | "role" | "schematic" | "schematic_symbol" | "status" | "table" | "task" | "user" | "view"; key: string; } | { type: "label" | "table" | "schematic" | "view" | "range" | "group" | "log" | "status" | "role" | "panel" | "node" | "channel" | "project" | "user" | "policy" | "task" | "device" | "rack" | "arc" | "builtin" | "framer" | "lineplot" | "range-alias" | "schematic_symbol"; key: string; }; } | { key: string; type: string; args: Record; variant: "view"; })[]; } | { variant: "split"; direction: "x" | "y"; size: number; first: panel.Node; last: panel.Node; }; parent?: { type: "arc" | "builtin" | "channel" | "device" | "framer" | "group" | "label" | "lineplot" | "log" | "node" | "panel" | "policy" | "project" | "rack" | "range" | "range-alias" | "role" | "schematic" | "schematic_symbol" | "status" | "table" | "task" | "user" | "view"; key: string; } | { type: "label" | "table" | "schematic" | "view" | "range" | "group" | "log" | "status" | "role" | "panel" | "node" | "channel" | "project" | "user" | "policy" | "task" | "device" | "rack" | "arc" | "builtin" | "framer" | "lineplot" | "range-alias" | "schematic_symbol"; key: string; } | undefined; }; }; } | { type: "rename"; rename: { name: string; }; } | { type: "insert_tabs"; insertTabs: { tabs: ({ key: string; variant: "resource"; resource: { type: "arc" | "builtin" | "channel" | "device" | "framer" | "group" | "label" | "lineplot" | "log" | "node" | "panel" | "policy" | "project" | "rack" | "range" | "range-alias" | "role" | "schematic" | "schematic_symbol" | "status" | "table" | "task" | "user" | "view"; key: string; } | { type: "label" | "table" | "schematic" | "view" | "range" | "group" | "log" | "status" | "role" | "panel" | "node" | "channel" | "project" | "user" | "policy" | "task" | "device" | "rack" | "arc" | "builtin" | "framer" | "lineplot" | "range-alias" | "schematic_symbol"; key: string; }; } | { key: string; type: string; args: Record; variant: "view"; })[]; targetLeaf?: number | undefined; targetTab?: string | undefined; index?: number | undefined; location?: "left" | "right" | "top" | "bottom" | "center" | undefined; singleton?: boolean | undefined; }; } | { type: "remove_tab"; removeTab: { key: string; }; } | { type: "move_tab"; moveTab: { key: string; targetLeaf: number; index?: number | undefined; location?: "left" | "right" | "top" | "bottom" | "center" | undefined; }; } | { type: "split_tab"; splitTab: { key: string; direction: "x" | "y"; }; } | { type: "resize_split"; resizeSplit: { split: number; size: number; }; } | { type: "set_tab_resource"; setTabResource: { key: string; resource: { type: "arc" | "builtin" | "channel" | "device" | "framer" | "group" | "label" | "lineplot" | "log" | "node" | "panel" | "policy" | "project" | "rack" | "range" | "range-alias" | "role" | "schematic" | "schematic_symbol" | "status" | "table" | "task" | "user" | "view"; key: string; } | { type: "label" | "table" | "schematic" | "view" | "range" | "group" | "log" | "status" | "role" | "panel" | "node" | "channel" | "project" | "user" | "policy" | "task" | "device" | "rack" | "arc" | "builtin" | "framer" | "lineplot" | "range-alias" | "schematic_symbol"; key: string; }; }; } | { type: "set_tab_view"; setTabView: { key: string; view: { type: string; args: Record; }; }; })[]) => void; export declare const useUndo: (arg?: optional.Optional<{ key: string; }, "key"> | undefined) => Flux.UseUndoReturn; export declare const useRedo: (arg?: optional.Optional, "key"> | undefined) => Flux.UseRedoReturn; export declare const useCloseResourceTabs: () => ((ids: ontology.ID | ontology.ID[]) => void); export interface MoveTabToPanelParams extends Pick { /** Panel currently holding the tab. */ source: panel.Key; /** Panel the tab moves into. Must differ from source. */ destination: panel.Key; tab: panel.Tab; } /** * useMoveTabToPanel moves a tab between two panels. The panels are separate documents, * so the move is two dispatches: the insert lands first and the source only gives the * tab up once it has, leaving the tab where it was if the destination rejects it. * @returns a callback resolving with the tab's key in the destination, or undefined * when the tab is not there. */ export declare const useMoveTabToPanel: () => ((params: MoveTabToPanelParams) => Promise); export declare const useSetCurrentTabResource: () => ((resource: ontology.ID) => void); export declare const useSetCurrentTabView: () => ((view: panel.View) => void); //# sourceMappingURL=queries.d.ts.map