import { Formatter } from '@nodata/redux-utils'; import { Resource } from './Resource.js'; import { Position } from './GridChild.js'; export interface GridChildCoordinates { x: number; y: number; } export interface GridChildCoordinatesSize extends GridChildCoordinates { width: number; height: number; } /** * A grid is a subdivision of the available space, set by a number of * cols and rows. * * @prop cols The number of cols for the grid. * @prop rows The number of rows of the grid. * @prop children The childrens of the element. */ export interface Grid { readonly children?: Array; readonly cols?: GridCols; readonly rows?: GridRows; } export type GridCols = Formatter; export type GridRows = Formatter; export type GridChild = GridChildObject & Position & (Grid | Resource); export interface GridChildObject { readonly type?: GridChildType; } export type GridChildType = Formatter<'grid' | 'resource'>;