import { IImageData } from '../types.ts'; import { Icon } from '../icon.ts'; /** * Icon entry. */ export interface IIconIcnsEntry { /** * Icon type. */ readonly type: string; /** * Icon data. */ readonly data: Readonly; } /** * IconIcns object. */ export declare class IconIcns extends Icon { /** * Option to include TOC tag (table of contents) in encode. */ toc: boolean; /** * List of icon entries. */ entries: IIconIcnsEntry[]; /** * Types that are ARGB. */ protected _typeArgb: Set; /** * Types that are PNG. */ protected _typePng: Set; /** * Types that are icon 24-bit. */ protected _typeIcon24Bit: Set; /** * Types that are mask 8-bit. */ protected _typeMask8Bit: Set; /** * IconIcns constructor. */ constructor(); /** * Add an icon from PNG data. * * @param data PNG data. * @param types Types to encode as. * @param raw Use raw PNG data without re-encoding for the PNG types. */ addFromPng(data: Readonly, types: readonly string[], raw?: boolean): Promise; /** * Add an icon from RGBA image data. * * @param imageData RGBA image data. * @param types Types to encode as. */ addFromRgba(imageData: Readonly, types: readonly string[]): Promise; /** * Add raw data chunk. * * @param data Chunk data. * @param type Chunk tag. */ addRaw(data: Readonly, type: string): void; /** * Add dark mode icns. * * @param data Full encoded icns data. */ addDarkIcns(data: Readonly): void; /** * Encode icon. * * @returns Encoded icon. */ encode(): Uint8Array; /** * Add an icon from RGBA image data, individual type. * * @param imageData RGBA image data. * @param type Type to encode as. */ protected _addFromRgbaType(imageData: Readonly, type: string): Promise; /** * Encode RGBA image data to PNG. * * @param imageData RGBA image data. * @param _type Icon type. * @returns Encoded data. */ protected _encodeRgbaToTypePng(imageData: Readonly, _type: string): Promise; /** * Encode RGBA image data to ARGB. * * @param imageData RGBA image data. * @param _type Icon type. * @returns Encoded data. */ protected _encodeRgbaToTypeArgb(imageData: Readonly, _type: string): Uint8Array; /** * Encode RGBA image data to icon 24-bit. * * @param imageData RGBA image data. * @param type Icon type. * @returns Encoded data. */ protected _encodeRgbaToTypeIcon24Bit(imageData: Readonly, type: string): Uint8Array; /** * Encode RGBA image data to mask 8-bit. * * @param imageData RGBA image data. * @param _type Icon type. * @returns Encoded data. */ protected _encodeRgbaToTypeMask8Bit(imageData: Readonly, _type: string): Uint8Array; /** * Encode RGBA image data to packbits. * * @param imageData RGBA image data. * @param alpha Incldue the alpha channel. * @param header Header to prepend to the output. * @returns Encoded data. */ protected _encodeRgbaToPackBits(imageData: Readonly, alpha: boolean, header?: Readonly | null): Uint8Array; /** * Encode channel from RGBA image data. * * @param imageData RGBA image data. * @param index Channel index (R=0, B=1, G=2, A=3). * @returns Encoded data. */ protected _encodeRgbaChannel(imageData: Readonly, index: 0 | 1 | 2 | 3): Uint8Array; /** * Encode data using PackBits ICNS compression. * * @param data Data to be compressed. * @returns Compressed data. */ protected _encodePackBitsIcns(data: Readonly): Uint8Array; }