import { type EditorGridAxes, type EditorGridLayer, type EditorGridPaletteEntry } from "./grid.js"; import type { EditorVec3 } from "./types.js"; /** * Options for importing an ASCII/glyph map into a grid layer. Provide `glyphMap` (char → value id) * or a `palette` whose entries carry `glyph`s (or both — `glyphMap` wins on conflict). Any glyph * not mapped, and any short-row padding, resolves to `empty`. * @capability editor-grid-import Configure an ASCII/glyph → grid-layer import. */ export interface AsciiGridImportOptions { id: string; kind: string; label?: string; /** Explicit char → value id map. Merged over glyphs derived from `palette`. */ glyphMap?: Record; palette?: readonly EditorGridPaletteEntry[]; /** Value id for unmapped glyphs and ragged-row padding. Default `""`. */ empty?: string; cellSize?: number; origin?: EditorVec3; axes?: EditorGridAxes; meta?: Record; } /** * Parses an ASCII/glyph map — one row per text line, one char per cell — into a grid layer. Each * glyph is resolved to a value id via the palette/`glyphMap`; unmapped glyphs and padding become * the empty value, so a mostly-open room stays sparse. The canonical representation is the * returned {@link EditorGridLayer}; ASCII is just this import path into it, never the source of * truth. Bounds are the row count × longest row. * @capability editor-grid-import Import an ASCII/glyph map into a grid layer. */ export declare function importAsciiGrid(text: string, options: AsciiGridImportOptions): EditorGridLayer; /** Options for rendering a grid layer back out as an ASCII/glyph map. */ export interface AsciiGridExportOptions { /** value id → char. Defaults to the layer's palette glyphs. */ glyphMap?: Record; /** Char emitted for empty cells. Default `"."`. */ emptyGlyph?: string; } /** * Renders a grid layer back to an ASCII/glyph map (rows top to bottom). Value ids map to chars via * the layer palette (or an override map); empty cells become `emptyGlyph`. Round-trips with * {@link importAsciiGrid} when the glyph legend matches. * @capability editor-grid-import Export a grid layer as an ASCII/glyph map. */ export declare function exportAsciiGrid(layer: EditorGridLayer, options?: AsciiGridExportOptions): string; /** Options for importing a CSV grid (one value id per cell). */ export interface CsvGridImportOptions { id: string; kind: string; label?: string; /** Field separator. Default `","`. */ delimiter?: string; /** Value id for blank fields and ragged-row padding. Default `""`. */ empty?: string; cellSize?: number; origin?: EditorVec3; axes?: EditorGridAxes; palette?: readonly EditorGridPaletteEntry[]; meta?: Record; } /** * Parses a CSV grid — one row per line, one value id per comma-separated field — into a grid * layer. Blank fields become the empty value. Unlike ASCII this carries multi-character value ids * directly, so it suits grids whose cell values are names rather than single glyphs. * @capability editor-grid-import Import a CSV grid (value id per cell) into a grid layer. */ export declare function importCsvGrid(text: string, options: CsvGridImportOptions): EditorGridLayer; /** Options for exporting a grid layer as CSV. */ export interface CsvGridExportOptions { /** Field separator. Default `","`. */ delimiter?: string; /** Text emitted for empty cells. Default `""`. */ emptyField?: string; } /** * Renders a grid layer as CSV — one row per line, each cell's value id as a field, empty cells as * `emptyField`. Round-trips with {@link importCsvGrid}. * @capability editor-grid-import Export a grid layer as CSV. */ export declare function exportCsvGrid(layer: EditorGridLayer, options?: CsvGridExportOptions): string;