UNPKG

@wfcd/arsenal-parser

Version:

Parser for Digital Extreme's Twitch Arsenal Extension data

76 lines (75 loc) 1.59 kB
/** * Generic palette descriptor * @typedef {Object} Palette * @property {string} name Palette name (as seen in-game) * @property {string} description Description of the palette */ /** * Palette Entry * @typedef {Object} PaletteEntry * @property {Palette} palette * @property {PaletteCoordinate} */ export default class Pixel { /** * Generate a pixel descriptive object * @param {string} hex string-represented hex code * @constructor */ constructor(hex: string); /** * Palette within the * @returns {Array<string>} */ get palettes(): Array<string>; /** * Pixel Coordinate matches * @returns {Array<PaletteEntry>} */ get matches(): Array<PaletteEntry>; /** * Whether this pixel is transparent * @returns {boolean} */ get isTransparent(): boolean; get hex(): string; toJSON(): { matches: PaletteEntry[]; isTransparent: boolean; hex: string; }; #private; } /** * Palette Coordinate representation */ export type PaletteCoordinate = { /** * row in palette to which this coordinate corresponds */ row: number; /** * column in palette to which this coordinate corresponds */ col: number; }; /** * Generic palette descriptor */ export type Palette = { /** * Palette name (as seen in-game) */ name: string; /** * Description of the palette */ description: string; }; /** * Palette Entry */ export type PaletteEntry = { palette: Palette; "": PaletteCoordinate; };