UNPKG

@gamesberry/karmyc-core

Version:

A flexible and powerful layout management system for React applications

24 lines (23 loc) 773 B
import { AreaTypeValue } from '../core/types/actions'; import { IArea } from '../types/areaTypes'; /** * Représente une position d'area. */ export interface Position { x: number; y: number; } /** * Hook for managing areas * Provides functions to manipulate areas and access their state */ export declare function useArea(): { createArea: (type: AreaTypeValue, state: any, position?: Position, id?: string) => string; removeArea: (id: string) => void; setActive: (id: string | null) => void; update: (id: string, changes: Partial<IArea<AreaTypeValue>>) => void; getActive: () => IArea<string> | null; getById: (id: string) => IArea<string> | undefined; getAll: () => Record<string, IArea<string>>; getErrors: () => string[]; };