mirror of
https://github.com/wavetermdev/waveterm.git
synced 2025-01-02 18:39:05 +01:00
update type defs
This commit is contained in:
parent
15cd0b2477
commit
3c9b3423a9
@ -18,10 +18,16 @@ import React, {
|
||||
import { DropTargetMonitor, XYCoord, useDrag, useDragLayer, useDrop } from "react-dnd";
|
||||
import { debounce, throttle } from "throttle-debounce";
|
||||
import { useDevicePixelRatio } from "use-device-pixel-ratio";
|
||||
import { LayoutModel, ResizeHandleProps } from "./layoutModel";
|
||||
import { LayoutModel } from "./layoutModel";
|
||||
import { useLayoutNode, useTileLayout } from "./layoutModelHooks";
|
||||
import "./tilelayout.less";
|
||||
import { LayoutNode, LayoutTreeActionType, LayoutTreeComputeMoveNodeAction, TileLayoutContents } from "./types";
|
||||
import {
|
||||
LayoutNode,
|
||||
LayoutTreeActionType,
|
||||
LayoutTreeComputeMoveNodeAction,
|
||||
ResizeHandleProps,
|
||||
TileLayoutContents,
|
||||
} from "./types";
|
||||
import { determineDropDirection } from "./utils";
|
||||
|
||||
export interface TileLayoutProps {
|
||||
|
@ -17,6 +17,7 @@ import {
|
||||
import {
|
||||
ContentRenderer,
|
||||
LayoutNode,
|
||||
LayoutNodeAdditionalProps,
|
||||
LayoutTreeAction,
|
||||
LayoutTreeActionType,
|
||||
LayoutTreeComputeMoveNodeAction,
|
||||
@ -30,27 +31,12 @@ import {
|
||||
LayoutTreeState,
|
||||
LayoutTreeSwapNodeAction,
|
||||
PreviewRenderer,
|
||||
ResizeHandleProps,
|
||||
TileLayoutContents,
|
||||
WritableLayoutTreeStateAtom,
|
||||
} from "./types";
|
||||
import { Dimensions, FlexDirection, setTransform } from "./utils";
|
||||
|
||||
export interface ResizeHandleProps {
|
||||
id: string;
|
||||
parentNodeId: string;
|
||||
parentIndex: number;
|
||||
centerPx: number;
|
||||
transform: CSSProperties;
|
||||
flexDirection: FlexDirection;
|
||||
}
|
||||
|
||||
export interface LayoutNodeAdditionalProps {
|
||||
transform?: CSSProperties;
|
||||
rect?: Dimensions;
|
||||
pixelToSizeRatio?: number;
|
||||
resizeHandles?: ResizeHandleProps[];
|
||||
}
|
||||
|
||||
interface ResizeContext {
|
||||
handleId: string;
|
||||
pixelToSizeRatio: number;
|
||||
|
@ -3,8 +3,8 @@ import useResizeObserver from "@react-hook/resize-observer";
|
||||
import { atom, Atom, useAtomValue } from "jotai";
|
||||
import { useEffect, useState } from "react";
|
||||
import { withLayoutTreeStateAtomFromTab } from "./layoutAtom";
|
||||
import { LayoutModel, LayoutNodeAdditionalProps } from "./layoutModel";
|
||||
import { LayoutNode, TileLayoutContents } from "./types";
|
||||
import { LayoutModel } from "./layoutModel";
|
||||
import { LayoutNode, LayoutNodeAdditionalProps, TileLayoutContents } from "./types";
|
||||
|
||||
const layoutModelMap: Map<string, LayoutModel> = new Map();
|
||||
|
||||
|
@ -2,7 +2,8 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import { WritableAtom } from "jotai";
|
||||
import { DropDirection, FlexDirection } from "./utils.js";
|
||||
import { CSSProperties } from "react";
|
||||
import { Dimensions, DropDirection, FlexDirection } from "./utils.js";
|
||||
|
||||
/**
|
||||
* Represents an operation to insert a node into a tree.
|
||||
@ -258,3 +259,19 @@ export interface TileLayoutContents {
|
||||
*/
|
||||
tabId?: string;
|
||||
}
|
||||
|
||||
export interface ResizeHandleProps {
|
||||
id: string;
|
||||
parentNodeId: string;
|
||||
parentIndex: number;
|
||||
centerPx: number;
|
||||
transform: CSSProperties;
|
||||
flexDirection: FlexDirection;
|
||||
}
|
||||
|
||||
export interface LayoutNodeAdditionalProps {
|
||||
transform?: CSSProperties;
|
||||
rect?: Dimensions;
|
||||
pixelToSizeRatio?: number;
|
||||
resizeHandles?: ResizeHandleProps[];
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user