@react-libraries/virtual-window
Version:
VirtualWindow for React
114 lines (113 loc) • 2.41 kB
TypeScript
export declare type WindowState = "normal" | "max" | "min" | "close";
export declare type PartsType = "top" | "right" | "bottom" | "left" | "left-top" | "right-top" | "right-bottom" | "left-bottom" | "title" | "client";
/**
*位置設定用
*
* @export
* @interface Point
*/
export interface Point {
x: number;
y: number;
}
/**
* サイズ設定用
*/
export interface Size {
width: number;
height: number;
}
/**
* ドラッグドロップ機能用
*
* @export
* @interface MoveParams
* @param {Point} basePoint クリック基準位置
* @param {Point} relativePoint 移動相対位置
* @param {Point} nodePoint ノード初期位置
* @param {Size} nodeSize ノード初期サイズ
* @param {Size} distance ピッチ距離
* @param {Size} radian ピッチ方向
*/
export declare type MoveParams = {
select: true;
basePoint: Point;
relativePoint: Point;
nodeType: PartsType;
nodePoint: Point;
nodeSize: Size;
distance?: number;
radian?: number;
state: WindowState;
} | {
select: false;
nodePoint: Point;
nodeSize: Size;
state: WindowState;
};
export interface CustomEvent extends Event {
params?: unknown;
}
export declare type WindowParams = {
/**
* Window active
*
* @type {boolean}
*/
active: boolean;
/**
* Current x
*
* @type {number}
*/
x: number;
/**
* Current y
*
* @type {number}
*/
y: number;
/**
* Current width
*
* @type {number}
*/
width: number;
/**
* Current height
*
* @type {number}
*/
height: number;
/**
* Current state
*
* @type {WindowState}
*/
state: WindowState;
/**
* Initial display
*
* @type {boolean}
*/
init: boolean;
};
export declare type ActionType = {
type: "state";
payload: WindowState;
} | {
type: "position";
payload: {
x?: number;
y?: number;
};
} | {
type: "size";
payload: {
width?: number;
height?: number;
};
};
export declare type BaseType = "start" | "end" | "center";
export declare const WindowSymbol = "__symbol";
export declare const WindowSymbolParam = "Window";