UNPKG

dotting

Version:

Dotting is a pixel art editor component library for react

44 lines (43 loc) 2.7 kB
import { Index } from "./types"; import { DottingData, GridIndices, PixelModifyItem, Coord, LayerProps } from "../components/Canvas/types"; export declare const getGridIndicesFromData: (data: DottingData) => GridIndices; export declare const getAllGridIndicesSorted: (data: DottingData) => { rowIndices: Array<number>; columnIndices: Array<number>; }; /** * @description get all the row keys (sorted) from the data * @param data */ export declare const getRowKeysFromData: (data: DottingData) => Array<number>; /** * @description get all the column keys (sorted) from the data * @param data */ export declare const getColumnKeysFromData: (data: DottingData) => Array<number>; export declare const getColumnCountFromData: (data: DottingData) => number; export declare const getRowCountFromData: (data: DottingData) => number; export declare const extractColoredPixelsFromRow: (data: DottingData, rowIndex: number) => PixelModifyItem[]; export declare const extractColoredPixelsFromColumn: (data: DottingData, columnIndex: number) => PixelModifyItem[]; export declare const deleteRowOfData: (data: DottingData, rowIndex: number) => void; export declare const deleteColumnOfData: (data: DottingData, columnIndex: number) => void; export declare const addRowToData: (data: DottingData, rowIndex: number, defaultColor: string) => void; export declare const addColumnToData: (data: DottingData, columnIndex: number, defaultColor: string) => void; export declare const validateSquareArray: (data: Array<Array<unknown>>) => { isDataValid: boolean; columnCount: number; rowCount: number; }; export declare const createPixelDataSquareArray: (rowCount: number, columnCount: number, topRowIndex: number, leftColumnIndex: number) => Array<Array<PixelModifyItem>>; export declare const createRowKeyOrderMapfromData: (data: DottingData) => { rowKeyOrderMap: Map<number, number>; minRowKey: number; }; export declare const createColumnKeyOrderMapfromData: (data: DottingData) => { columnKeyOrderMap: Map<number, number>; minColumnKey: number; }; export declare const getInBetweenPixelIndicesfromCoords: (previousCoord: Coord, currentCoord: Coord, gridSquareLength: number, data: DottingData) => Index[]; export declare const getRectanglePixelIndicesfromCoords: (previousCoord: Coord, currentCoord: Coord, gridSquareLength: number, data: DottingData, filled: boolean) => Index[]; export declare const getEllipsePixelIndicesfromCoords: (previousCoord: Coord, currentCoord: Coord, gridSquareLength: number, data: DottingData, filled: boolean) => Index[]; export declare const validateLayers: (layers: Array<LayerProps>) => boolean;