@ne1410s/griddler
Version:
Complete package for creating, sharing and solving griddler grids!
83 lines (82 loc) • 2.51 kB
TypeScript
import { CustomElementBase } from '@ne1410s/cust-elems';
import { ContextMenu } from '@ne1410s/menu';
import { PlainGrid, DenseGrid } from '../../models/grid';
import { Point } from '../../models/meta';
export declare class Griddler extends CustomElementBase {
static observedAttributes: string[];
private static readonly Css;
private static readonly Html;
private static readonly PIXEL_OFFSET;
private readonly $root;
private readonly $grid;
private readonly $lite;
private readonly $menu;
private readonly _ctxGrid;
private readonly _ctxLite;
private readonly _settingsPopup;
private readonly _historyPopup;
private readonly _editLabelPopup;
private readonly _pixelsPopup;
private _size;
private _grid;
private _menuCoords;
private _downCoords;
private _history;
private _historyIndex;
private _fontSize;
get totalColumns(): number;
get totalRows(): number;
get totalWidth(): number;
set totalWidth(value: number);
get totalHeight(): number;
set totalHeight(value: number);
get isBlank(): boolean;
get isFull(): boolean;
get anyLabels(): boolean;
toString(): string;
get textDataUrl(): string;
get imageDataUrl(): string;
constructor();
/**
* Draws a grid according to the grid data supplied.
* @param grid The grid data.
*/
load(grid: PlainGrid | DenseGrid | Point): void;
/** Removes all cell data, leaving the labels intact. */
clear(): void;
/** Provides a hint for the next solving action. */
hint(): void;
/** Attempts to solve the grid. */
solve(): void;
/**
* Redraws the entire grid in accordance with the current state.
*/
refresh(): void;
connectedCallback(): void;
attributeChangedCallback(name: string, oldValue: string, newValue: string): void;
private static Download;
private static Round;
private read;
private addToHistory;
private gotoHistory;
private undoOne;
private getState;
private setState;
private markCell;
private setCell;
private populate;
private populateLabels;
private populateStates;
private setRowLabels;
private setColumnLabels;
private clearContext;
private getCoords;
private getShade;
private highlight;
private showHistoryModal;
private showLabelModal;
private receiveLabelUpdate;
private handleMenuEvents;
private updateMenuContext;
}
export { ContextMenu };