5.3.0
2024-08-06
BREAKING
squared.base
class Node {
toFloat(attr: CssStyleAttr, fallback?: number, options?: CssInitialOptions): number; // Without options uses Node.valueOf and not Node.cssInitial
toInt(attr: CssStyleAttr, fallback?: number, options?: CssInitialOptions): number;
get plainText(): boolean; // Set in the constructor
}
class NodeUI {
get plainText(): boolean; // Modifiable using NodeUI.setCacheState
}
squared.lib
/* client */
interface UserAgentData {
name: "Chrome";
name: "Chrome" | "Chromium"; // getUserAgentData
}
/* regex */
const STRING: {
CSS_COLOR_PROFILE: string; // capture group removed
};
ADDED
squared
interface FileActionConfig {
inherit?: boolean | "append" | "preserve" | { append?: boolean; preserve?: boolean; depth?: number };
dataSource?: DataSource | DataSource[];
}
squared.base
interface ControllerSettingsStyleUI {
inputFontSize?: string;
buttonFontSize?: string;
textareaFontSize?: string;
selectFontSize?: string;
h1FontSize?: string;
h2FontSize?: string;
h3FontSize?: string;
h4FontSize?: string;
h5FontSize?: string;
h6FontSize?: string;
rtFontSize?: string;
}
interface ExcludeOptions {
optimization?: number;
}
interface AutoMargin {
leftRightAnchor?: boolean;
topBottomAnchor?: boolean;
}
interface HasOptions {
inherit?: boolean;
}
interface HasUnitOptions {
not?: string | string[];
}
class Node {
resetCache(): void;
resetState(): void;
get leftPos(): number;
get rightPos(): number;
get nowrapWhiteSpace(): boolean;
}
class NodeUI {
static baselineElement(node: NodeUI): boolean;
actualRect(position: PositionAttr, dimension?: BoxType): number; // abstract
getPositionOffset(name: "sticky"): Point;
hasFixedDimension(dimension: DimensionAttr): boolean;
hasOptimization(value: number): boolean;
get afterLineBreak(): boolean;
get wordSpacing(): number;
get locales(): string[] | null;
}
squared.base.lib
/* constant */
enum STAGE_OPTIMIZATION {
EXCLUDE = 1,
MERGE = 2,
CONTAINER = 4,
ALIGNMENT = 8,
POSITION = 16,
DIMENSION = 32,
MARGIN = 64,
PADDING = 128,
BASELINE = 256,
WHITESPACE = 512,
TRANSLATE = 1024,
TRANSFORM = 2048,
SCALING = 4096
}
/* dom */
function causesLineBreak(element: Element): boolean;
squared.lib
/* client */
interface UserAgentFeatures {
RULES: {
ADOPTED_STYLE_SHEET: boolean;
STARTING_STYLES: boolean;
};
}
/* color */
type ColorLAB = "lab" | "lch" | "oklab" | "oklch";
type ColorMethod = "rgb" | "hsl" | "hwb" | ColorLAB;
type ColorSpaceRGB = "srgb" | "srgb-linear" | "display-p3" | "rec2020" | "a98-rgb" | "prophoto-rgb";
type ColorSpaceXYZ = "xyz" | "xyz-d65" | "xyz-d50";
type ColorCoords = ColorLAB | ColorSpaceRGB | ColorSpaceXYZ;
type ColorCoordinates = [number, number, number];
interface ColorRGB {
toString(alpha: number, precision?: number): string;
toString(precision: 2 | 3 | 4 | 5 | 6 | 7 | 8): string;
toString(name: ColorCoords | ColorMethod, precision: 2 | 3 | 4 | 5 | 6 | 7 | 8): string;
toString(name?: ColorCoords | ColorMethod, alpha?: number, precision?: number): string;
get lab(): ColorCoordinates;
get lch(): ColorCoordinates;
get oklab(): ColorCoordinates;
get oklch(): ColorCoordinates;
get srgb: ColorCoordinates;
get "srgb-linear"(): ColorCoordinates;
get xyz: ColorCoordinates;
get "xyz-d50"(): ColorCoordinates;
get "xyz-d65"(): ColorCoordinates;
get "display-p3"(): ColorCoordinates;
get rec2020(): ColorCoordinates;
get "a98-rgb"(): ColorCoordinates;
get "prophoto-rgb"(): ColorCoordinates;
}
function formatCoords(name: string, values: ColorCoordinates, alpha?: number, precision?: number): string;
function fromRGB(value: RGB | HSL | HWB, opacity?: number): ColorRGB;
function fromCoords(name: string, values: ColorCoordinates, alpha?: number, precision?: number): ColorRGB | null;
function setPrecision(value: number): void;
/* css */
function roundPx(value: number, min?: number, precision?: number): string;
/* dom */
interface BoxRectDimension {
columns?: Dimension[] | null; // getRangeClientRect
}
/* regex */
const STRING: {
CSS_COLOR_INTERPOLATION: string;
};
android.base
interface ExtensionComposeViewElement {
selector?: string;
android?: StringMap;
app?: StringMap;
tools?: StringMap;
}
android.lib.constant
const LAYOUT_RELATIVE: string[];
const LAYOUT_CONSTRAINT: string[];
chrome.base
interface RequestData {
log?: { showDiff?: string[] };
}
interface DocumentOutput {
sanitizeFramework?: string[];
}
interface FileRequestAttribute {
removeBinaries?: boolean;
}
interface FileActionAttribute {
saveAs?: {
video?: SaveAsOptions;
audio?: SaveAsOptions;
raw?: SaveAsOptions;
};
}
CHANGED
squared
function toString(projectId?: string): string; // projectId
squared.base
interface HasOptions {
type?: number; // CSS_UNIT.DECIMAL | CSS_UNIT.INTEGER
}
interface CacheStateUI {
plainText?: boolean; // Relocated from CacheState
firstLineStyle?: CssStyleMap | null;
firstLetterStyle?: CssStyleMap | null;
flowChildren?: NodeUI[];
extensions?: string[];
causesLineBreak?: boolean; // Relocated from CacheValueUI
}
class Node {
cssSpecificity(attr: CssStyleAttr, context?: string): Specificity | undefined; // context
get dir(): TextDirection; // "ltr" | "rtl" | ""
}
class NodeUI {
getPseudoElement(name: PseudoElt | PseudoStyleElt, attr?: CssStyleAttr, context?: string): CssStyleMap | string | null; // context
renderEach(predicate: IteratorPredicate<NodeUI, void | true>): this; // true
}
squared.lib.color
interface ColorRGB {
get scheme(): "light" | "dark" | ""; // readonly
set scheme(value);
}
interface ColorSpace {
out?: string | ColorCoordinates | null; // ColorCoordinates
}
function convertHSLA(value: RGB, opacity?: number): HSLA; // opacity
function convertHWBA(value: RGB, opacity?: number): HWBA;
function convertRGBA(value: HSL | HWB, opacity?: number): RGBA;
function intoRGB(value: ColorSpace): RGB | [ColorCoords, ColorCoordinates] | null; // [ColorCoords, ColorCoordinates]
function intoRelativeRGB(method: string, relative: ColorRGB, r: string, g: string, b: string, profile?: string): RGB | [ColorCoords, ColorCoordinates] | null;
android.base
interface UserResourceSettingsUI {
showAttributes: boolean | Record<string, string | null | (string | null)[] | Record<string, string | null>>; // Record<string, string | null>
}
interface ExtensionComposeViewElement {
selector?: string;
android?: StringMap;
app?: StringMap;
tools?: StringMap;
}
class Resource {
addFontProvider(authority: string, package: string, certs: string[], webFonts: string | FontProviderFonts, verified?: boolean): Promise<boolean>; // Promise<boolean>
}
class View {
setLayoutPercent(value: number | string, horizontal?: boolean, includeMargin?: boolean): void; // includeMargin
}
DEPRECATED
squared.base
interface ControllerSettingsStyleUI {
formFontSize: string;
}
class ApplicationUI {
get layouts(): FileAsset[]; // ApplicationUI.getProject().layouts
}
squared.base.lib.regex
const CSS: {
ANGLE_G: RegExp; // Delete
BACKGROUNDIMAGE_G: RegExp; // Delete
};
const DOM: {
ENTITY_G: RegExp; // Renaming to ENTITY
AMPERSAND_G: RegExp; // Delete
};
squared.lib
/* color */
interface ColorRGB {
get rgbaAsString(): string; // toString("rgb", 1)
get hslaAsString(): string; // toString("hsl", 1)
get rgbAsString(): string; // toString()
get hslAsString(): string; // toString("hsl")
get hwbAsString(): string; // toString("hwb")
}
function formatRGBA(value: RGB, precision?: number): string; // formatRGB
function formatHSLA(value: HSL, precision?: number): string; // formatHSL
/* css */
function formatPX(value: number): string; // roundPx
/* error */
const FRAMEWORK_NOT_INSTALLED: string; // squared.lib.internal.MESSAGE
const SERVER_REQUIRED: string;
const DIRECTORY_NOT_PROVIDED: string;
const UNABLE_TO_FINALIZE_DOCUMENT: string;
const INVALID_ASSET_REQUEST: string;
const OPERATION_NOT_SUPPORTED: string;
const ELEMENT_NOT_FOUND: string;
const CSS_CANNOT_BE_PARSED: string;
/* regex */
const CSS: {
HWBA: RegExp; // Renaming to HWB
SELECTOR_G: RegExp; // Renaming to SELECTOR
};
android.lib.constant
const LAYOUT_ALIGNMENT: string[]; // LAYOUT_RELATIVE
const LAYOUT_ALIGNMENT_APP: string[]; // LAYOUT_CONSTRAINT