interface InitialData<T> extends PlainObject {
    styleMap?: CssStyleMap;
    children?: T[];
    bounds?: BoxRectDimension | null;
}

interface CacheValue extends Partial<BoxModel>, Partial<Dimension>, Partial<BoxRect> {
    pageFlow?: boolean;
    positionStatic?: boolean;
    positionRelative?: boolean;
    contentBox?: boolean;
    contentBoxWidth?: number;
    contentBoxHeight?: number;
    borderBoxElement?: boolean;
    containerDimension?: Readonly<ContainerDimension>[] | null;
    outlineWidth?: number;
    inline?: boolean;
    inlineStatic?: boolean;
    block?: boolean;
    blockStatic?: boolean;
    baseline?: boolean;
    verticalAlign?: number;
    multiline?: boolean;
    centerAligned?: boolean;
    rightAligned?: boolean;
    bottomAligned?: boolean;
    preserveWhiteSpace?: boolean;
    nowrapWhiteSpace?: boolean;
    hasWidth?: boolean;
    hasHeight?: boolean;
    lineHeight?: number;
    tagName?: string;
    actualWidth?: number;
    actualHeight?: number;
    containerHeight?: boolean;
    percentWidth?: number;
    percentHeight?: number;
    aspectRatio?: [number, number] | null;
    /** @deprecated */
    flexdata?: FlexboxLayout;
    flexbox?: Flexbox;
    autoMargin?: AutoMargin;
    backgroundColor?: string;
    backgroundImage?: string;
    visibleStyle?: VisibleStyle;
    textStyle?: CssStyleMap;
    fontSize?: number;
    writingMode?: string;
}

interface CacheValueUI extends CacheValue {
    float?: FloatDirectionAttr;
    floatClear?: ClearDirectionAttr;
    floating?: boolean;
    imageElement?: boolean;
    flexElement?: boolean;
    gridElement?: boolean;
    inputElement?: boolean;
    buttonElement?: boolean;
    tableElement?: boolean;
    layoutElement?: boolean;
    scrollElement?: boolean;
    modalElement?: boolean;
    voidElement?: boolean;
    baselineElement?: boolean;
    tagDisplay?: string;
    autoPosition?: boolean;
    leftTopAxis?: boolean;
    positiveAxis?: boolean;
    renderExclude?: boolean;
    inlineFlow?: boolean;
    inlineBlock?: boolean;
    inlineVertical?: boolean;
    inlineDimension?: boolean;
    blockDimension?: boolean;
    blockVertical?: boolean;
    variableWidth?: boolean;
    variableHeight?: boolean;
    fullWidth?: boolean;
    fullHeight?: boolean;
    verticalAligned?: boolean;
    overflow?: number;
    textIndent?: number;
    textWidth?: number;
    wordSpacing?: number;
    baselineHeight?: number;
    flowElement?: boolean;
    fontSynthesis?: FontSynthesis;
    onlyChild?: boolean;
    onlyStaticChild?: boolean;
}

interface CacheState<T> {
    htmlElement?: boolean;
    svgElement?: boolean;
    styleElement?: boolean;
    customElement?: boolean;
    naturalElement?: boolean;
    naturalChild?: boolean;
    absoluteParent?: T | null;
    wrapperOf?: T | null;
    textContent?: string;
    textBounds?: BoxRectDimension | null;
    textEmpty?: boolean;
    dir?: TextDirection;
}

interface CacheStateUI<T> extends CacheState<T> {
    controlName?: string;
    containerName?: string;
    pseudoElement?: boolean;
    innerMostWrapped?: T;
    attributes?: StringMap;
    horizontalRowStart?: boolean;
    horizontalRowEnd?: boolean;
    plainText?: boolean;
    causesLineBreak?: boolean;
    firstLineStyle?: CssStyleMap | null;
    firstLetterStyle?: CssStyleMap | null;
    fontVariantAlternates?: string[];
    flowChildren?: T[];
    locales?: ResourceIntlLocales;
    extensions?: string[];
}

interface LocalSettingsUI extends Partial<Pick<UserSettings, "adaptStyleMap">> {
    projectId: string;
    resourceId: number;
    systemName: string;
    screenDimension?: Dimension;
}

interface SupportUI {
    positionRelative: boolean;
    positionTranslation: boolean;
}

interface VisibleStyle {
    borderWidth: boolean;
    background: boolean;
    backgroundImage: boolean;
    backgroundColor: boolean;
    backgroundRepeat: boolean;
    backgroundRepeatX: boolean;
    backgroundRepeatY: boolean;
    borderRadius: boolean;
    outline: boolean;
}

interface FontSynthesis {
    weight: boolean;
    style: boolean;
    smallCaps: boolean;
    position: boolean;
}

interface AutoMargin extends Partial<BoxRect<boolean>> {
    horizontal?: boolean;
    leftRight?: boolean;
    vertical?: boolean;
    topBottom?: boolean;
    leftRightAnchor?: boolean;
    topBottomAnchor?: boolean;
}

interface LinearData {
    linearX: boolean;
    linearY: boolean;
    x?: number;
    y?: number;
    floated?: Set<string>;
}