///
import type { CONTAINER_NODE } from '../lib/constant';
import type { FileActionOptions } from '../../index';
import type * as b from '../../base';
type ResourceStoredOutput = (stored: Required, qualifier?: string | FileActionOptions, options?: FileActionOptions) => T;
type ResourceAssetsOutput = (assets: ResourceAssetsMap, qualifier?: string | FileActionOptions, options?: FileActionOptions) => T;
export type TargetElement = b.TargetElement | SVGSVGElement;
export interface AppFramework extends b.AppFramework, ViewModelAction, DependencyAction, FontProviderAction {
addXmlNs(name: string, uri: string): void;
addDependency(group: string, name: string, version?: number | string, type?: number | boolean, overwrite?: boolean): string;
addDependencyByProject(projectId: string, group: string, name: string, version?: number | string, type?: number | boolean, overwrite?: boolean): string;
customize(build: number, widget: string, options: ObjectMap): ObjectMap | undefined;
loadCustomizations(name: string): void;
saveCustomizations(name: string): void;
resetCustomizations(): void;
setResolutionByDeviceName(value: string): boolean;
getLocalSettings(): ControllerSettingsUI;
}
export interface AppViewModel extends PlainObject {
import?: string[];
variable?: { name: string; type: string }[];
}
export interface AppProjectUI extends b.AppProjectUI {
dependencies?: ObjectMap;
resolvedTagName?: string[];
}
export class Application extends b.ApplicationUI implements ViewModelAction, DependencyAction {
getProject(projectId?: string): AppProjectUI;
resolveTarget(element: TargetElement): T | null;
resolveTarget(sessionId: string, element: TargetElement): T | null;
resolveDependencies(template: NodeXmlTemplate): void;
setViewModel(data: AppViewModel, sessionId?: string): void;
setViewModelByProject(data: AppViewModel, projectId?: string): void;
getViewModel(sessionId: string): AppViewModel | undefined;
getViewModelByProject(projectId?: string): AppViewModel | undefined;
addDependency(group: string, name: string, version?: string, overwrite?: boolean): string;
addDependency(group: string, name: string, type?: number, overwrite?: boolean): string;
addDependency(group: string, name: string, version?: number | string, type?: number, overwrite?: boolean): string;
addDependencyByProject(project: AppProjectUI | string, group: string, name: string, version?: string, overwrite?: boolean): string;
addDependencyByProject(project: AppProjectUI | string, group: string, name: string, type?: number, overwrite?: boolean): string;
addDependencyByProject(project: AppProjectUI | string, group: string, name: string, version?: number | string, type?: number, overwrite?: boolean): string;
getDependencies(projectId?: string): string[];
getEncodingOptions(projectId?: string): ReplaceCharacterDataOptions;
get resourceHandler(): Resource;
get fileHandler(): File;
get viewModel(): Map;
get viewModelProject(): Map;
get xmlEncoding(): XmlEncoding | undefined;
}
export class Controller extends b.ControllerUI {
renderNodeStatic(sessionId: string, attrs: RenderNodeStaticAttribute, options?: ViewAttribute): string;
renderSpace(sessionId: string, attrs: RenderSpaceAttribute): string;
checkFrameHorizontal(data: b.LayoutUI): boolean;
checkConstraintFloat(data: b.LayoutUI): boolean;
checkConstraintHorizontal(data: b.LayoutUI): boolean;
checkLinearHorizontal(data: b.LayoutUI): boolean;
addGuideline(options: GuidelineOptions): void;
addBarrier(nodes: T[], barrierDirection: PositionDirectionValue, barrierMargin?: string): string;
evaluateAnchors(nodes: T[]): void;
getTargetApi(sessionId: string): number;
get application(): Application;
}
export class Resource extends b.ResourceUI implements FontProviderAction {
static STORED: ResourceSessionStored>;
static formatOptions(resourceId: number, data: ViewAttribute, options?: AddColorOptions): ViewAttribute;
static addTheme(resourceId: number, theme: ThemeAttribute, options?: AddThemeOptions): boolean;
static addString(resourceId: number, value: string, name?: string, options?: AddStringOptions): string;
static addArray(resourceId: number, name: string, items: string[], options?: AddArrayOptions): string;
static addImage(resourceId: number, images: StringMap, options?: AddImageOptions): string;
static addColor(resourceId: number, value: ColorRGB | string, options?: AddColorOptions): string;
/** @deprecated options */
static addColor(resourceId: number, value: ColorRGB | string, transparent?: boolean): string;
static addDimen(resourceId: number, name: string, value: string): string;
static addRawAsset(resourceId: number, type: ResourceRawAsset | "images", name: string, value: unknown, options?: InsertStoredAssetOptions): string;
static formatName(value: string, isFile?: boolean): string;
parseImage(resourceId: number, src: string, options?: ParseImageOptions): string;
addImageSrc(resourceId: number, element: HTMLImageElement | HTMLInputElement | string, options?: AddImageSrcOptions): string;
/** @deprecated options */
addImageSet(resourceId: number, images: StringMap, prefix?: string): string;
addImageSet(resourceId: number, images: StringMap, options?: AddImageOptions): string;
getAppTheme(resourceId: number, value?: string): string;
getStoredMap(resourceId: number): Required;
addFontProvider(authority: string, package: string, certs: string[], webFonts: U, init?: boolean | RequestInit): Promise;
removeFontProvider(authority: string): void;
convertUnit(value: number, unit: ResolutionUnit, precision?: number, font?: boolean): string | undefined;
get application(): Application;
set fileHandler(value);
get fileHandler(): File;
get fontProvider(): ObjectMap;
constructor(application: Application, cache: b.NodeList);
}
export class File extends b.File {
resourceStringToXml: ResourceStoredOutput;
resourceIntegerToXml: ResourceStoredOutput;
resourceFractionToXml: ResourceStoredOutput;
resourceStringArrayToXml: ResourceStoredOutput;
resourceFontToXml: ResourceStoredOutput;
resourceColorToXml: ResourceStoredOutput;
resourceStyleToXml: ResourceStoredOutput;
resourceDimenToXml: ResourceStoredOutput;
resourceIdToXml: ResourceStoredOutput;
resourceDrawableToXml: ResourceStoredOutput;
resourceAnimToXml: ResourceStoredOutput;
resourceDrawableImageToFile: ResourceStoredOutput;
resourceRawVideoToFile: ResourceAssetsOutput;
resourceRawAudioToFile: ResourceAssetsOutput;
resourceAllToXml: ResourceStoredOutput>;
layoutAllToXml(layouts: FileAsset[], qualifier?: string | FileActionOptions, options?: FileActionOptions): PlainObject;
finalizeStringToXml(resourceId: number, stored: StoredStrings, directory: string, options?: FileActionOptions): string[];
finalizeIntegerToXml(resourceId: number, stored: StoredIntegers, directory: string, options?: FileActionOptions): string[];
finalizeFractionToXml(resourceId: number, stored: StoredIntegers, directory: string, options?: FileActionOptions): string[];
finalizeStringArrayToXml(resourceId: number, stored: StoredArrays, directory: string, options?: FileActionOptions): string[];
finalizeColorToXml(resourceId: number, stored: StoredColors, directory: string, options?: FileActionOptions): string[];
finalizeDimenToXml(resourceId: number, stored: StoredDimens, directory: string, options?: FileActionOptions): string[];
finalizeStyleToXml(resourceId: number, stored: StoredStyles, directory: string, options?: FileActionOptions): string[];
finalizeThemeToXml(resourceId: number, stored: StoredThemes, directory: string, options?: FileActionOptions): string[];
finalizeIdToXml(resourceId: number, stored: string[], directory: string, options?: FileActionOptions): string[];
finalizeFontToXml(resourceId: number, stored: StoredFonts, directory: string, options?: FileActionOptions): string[];
finalizeDrawableToXml(resourceId: number, stored: StoredDrawables, directory: string, options?: FileActionOptions): string[];
finalizeAnimToXml(resourceId: number, stored: StoredAnimators, directory: string, options?: FileActionOptions): string[];
finalizeDrawableImageToFile(resourceId: number, stored: StoredImages, directory: string, options?: FileActionOptions): string[];
finalizeRawVideoToFile(resourceId: number, stored: AssetsVideo, directory: string, options?: FileActionOptions): string[];
finalizeRawAudioToFile(resourceId: number, stored: AssetsAudio, directory: string, options?: FileActionOptions): string[];
get resource(): Resource;
get userSettings(): UserResourceSettingsUI;
get xmlEncoding(): XmlEncoding | undefined;
get layoutExtension(): string;
get controllerSettings(): ControllerSettingsUI;
get directory(): ControllerSettingsDirectoryUI;
}
export class View extends b.NodeUI {
static availablePercent(nodes: T[], dimension: DimensionAttr, boxSize: number, flexContainer?: boolean): number;
static getControlName(containerType: number, api?: number): string;
api: number;
materialDesign: boolean;
android(attr: string, value?: string, overwrite?: boolean): string;
app(attr: string, value?: string, overwrite?: boolean): string;
clone(id?: number, options?: CloneOptions): View;
applyOptimizations(): boolean;
applyCustomizations(overwrite?: boolean): void;
formatted(value: string, overwrite?: boolean): void;
mergeGravity(attr: LayoutGravityAttr, alignment: LayoutGravityValue, options: MergeGravityOptions): void;
mergeGravity(attr: LayoutGravityAttr, alignment: LayoutGravityValue, overwrite?: boolean): void;
anchor(position: AnchorPositionAttr, options: AnchorOptions): boolean;
anchor(position: AnchorPositionAttr, documentId?: string, overwrite?: boolean): boolean;
anchorChain(...values: PositionAttr[]): View[];
anchorParent(orientation: OrientationAttr, bias: number, overwrite: boolean): boolean;
anchorParent(orientation: OrientationAttr, bias?: number, style?: LayoutChainStyle, overwrite?: boolean): boolean;
anchorStyle(orientation: OrientationAttr, bias: number, overwrite: boolean): void;
anchorStyle(orientation: OrientationAttr, bias: number, style?: LayoutChainStyle, overwrite?: boolean): void;
anchorDelete(...position: AnchorPositionAttr[]): void;
anchorClear(update?: View | boolean, renderParent?: View | null): void;
deprecated(attr: string, value: string, output: PlainObject): boolean | undefined;
supported(attr: string, value: string, output: PlainObject): boolean;
combine(sort: boolean, ...values: string[]): string[];
combine(...values: string[]): string[];
setLayoutWidth(value: string, overwrite?: boolean): void;
setLayoutHeight(value: string, overwrite?: boolean): void;
setLayoutPercent(value: number | string, horizontal?: boolean, includeMargin?: boolean): void;
setTextAlign(inherit: boolean): void;
setTextAlign(value?: string): void;
setSingleLine(maxLines: boolean, ellipsize?: boolean): void;
setConstraintDimension(percentAvailable?: number): number;
setFlexDimension(dimension: DimensionAttr, percentAvailable?: number, weight?: number): number;
getMatchConstraint(parent?: View, container?: boolean, percent?: boolean): string;
getAnchorPosition(parent: View, horizontal: boolean, modifyAnchor?: boolean): Partial;
isUnstyled(checkMargin?: boolean): boolean;
isAnchored(options: AnchoredOptions): boolean;
getLayoutConstraint(attr: "justifyContent" | "alignItems" | "alignContent", type: "flex", direction?: "row" | "column", all?: boolean): string;
getLayoutConstraint(attr: "justifyContent" | "alignItems" | "alignContent", type?: "flex" | "grid", all?: boolean): string;
getHorizontalBias(rect?: BoxRect): number;
getVerticalBias(rect?: BoxRect): number;
getAbsolutePaddingOffset(region: number, value: number): number;
getMarginPercent(horizontal: boolean): number;
getPaddingPercent(horizontal: boolean): number;
hasConstraint(horizontal: boolean, type?: LayoutOrientationDefault): boolean;
hasFlex(direction: LayoutDirection): boolean | 0;
get labelForElement(): boolean;
set anchored(value);
get anchored(): boolean;
set localSettings(value);
get localSettings(): LocalSettingsUI & b.ElementSettingsUI;
set useSystemColors(value);
get useSystemColors(): boolean;
get documentId(): string;
get anchorTarget(): View;
get constraint(): Constraint;
get layoutFrame(): boolean;
get layoutLinear(): boolean;
get layoutGrid(): boolean;
get layoutRelative(): boolean;
get layoutConstraint(): boolean;
get layoutFragment(): boolean;
get layoutAnchoring(): boolean;
get layoutWidth(): string;
get layoutHeight(): string;
get inlineWidth(): boolean;
get inlineHeight(): boolean;
get blockWidth(): boolean;
get blockHeight(): boolean;
get flexibleWidth(): boolean;
get flexibleHeight(): boolean;
get flexibleHorizontal(): boolean;
get companionStyle(): boolean;
get emojiContainer(): CONTAINER_NODE;
set translatable(value);
get translatable(): boolean;
get watch(): WatchInterval | undefined;
get tasks(): TaskCommand[] | undefined;
get target(): HTMLElement | null;
get support(): SupportUI;
}
export class ViewGroup extends View {
retainAs(children: U[], child?: U, parent?: U | null): this;
constructor(id: number, node: T, children: T[], parent?: T | null);
}