UNPKG

@gamesberry/karmyc-core

Version:

A flexible and powerful layout management system for React applications

39 lines (38 loc) 1.29 kB
import React from 'react'; import { Rect } from '../types/math'; export type ComponentIdentifier = { name: string; type: string; }; export type ToolsBarAlignment = 'left' | 'center' | 'right'; export type ToolsBarPosition = 'top-outer' | 'top-inner' | 'bottom-outer' | 'bottom-inner' | string; export interface ToolsBarComponent { component: React.ComponentType<any>; order: number; alignment: ToolsBarAlignment; width?: string | number; identifier: ComponentIdentifier; allowedLayerTypes?: string[]; callback?: (() => void)[]; } export declare function useToolsSlot(key: string, position: ToolsBarPosition, nbOfLines?: number): { registerComponent: (component: React.ComponentType<any>, identifier: ComponentIdentifier, options?: { order?: number; alignment?: ToolsBarAlignment; width?: string | number; allowedLayerTypes?: string[]; callback?: (() => void)[]; }) => string; getComponents: () => ToolsBarComponent[]; getLines: () => number; }; export interface ToolsProps { areaId?: string; areaType?: string; areaState?: any; children: React.ReactNode; style?: React.CSSProperties; viewport?: Rect; nbOfLines?: number; } export declare const Tools: React.FC<ToolsProps>;