import { Context } from '../contexts'; import { Rect } from './helpers'; import { ViewDesc } from './ViewDescriptions'; export interface HeightCache { [width: number]: number; } export declare class View { private parent; private _cacheContentHeights; private _contentHeightCache; protected frame: Rect; protected absoluteFrame: Rect; subviews: View[]; fixedWidth?: number; /** * useAutoWidths is a flag to determine if a container should use the automatically calculated * width of it's subviews during layoutSubviews, or if it should give it a width according to it's * own internal logic. For instance if `useAutoWidths = false` then a FrameView might expand a subview's * frame to fit it's own width - the sum of it's side thicknesses. A column view might expand the width * of it's subviews to be the same as it's own width. * * "useAutoWidths" is perhaps a bit ambiguous since it's not clear what auto refers to the "auto" refers to. * maybe we should negate it and call it useSubvewFrameWidths */ useAutoWidths: boolean; name: string; _debugOutlineColor: string | null; constructor(); static fromDesc(desc: ViewDesc): View; toJSON(): any; stringifyRenderTree(depth?: number): string; setDescFields(desc: ViewDesc): void; readonly leftMargin: number; readonly topMargin: number; readonly rightMargin: number; readonly bottomMargin: number; setParent(newParent: View): void; getFrame(): Rect; addSubview(newSubview: View): void; setFrameWithRect(newFrame: Rect): void; calculateAbsoluteFrameFromParent(): void; setFrame(left: number, top: number, width: number, height: number): void; setHeight(newHeight: number): void; drawSelf(context: Context): void; /** * There are basically two situations for View widths. One is we set the frame ahead of time and don't touch the width * whille rendering. The other is we want some view to auto-calculate the width based on the View's settings. This is * how we auto-calculate the width in second case. The rules for when it uses which method are complex and outside the * scope of this comment. */ getAutoWidth(context: Context): number; getContentWidth(context: Context): number; getContentHeightForWidth(context: Context, width: number): number; _getContentHeightForWidth(context: Context, width: number): number; layoutSubviews(context: Context): void; layoutAll(context: Context): void; drawAll(context: Context): void; draw(context: Context): void; }