import { AccessibleDisplayObject } from './RoleObjects/AccessibilityObject'; type ElementBounds = { height?: number; width?: number; x: number; y: number; }; type EventHandler = (evt: Event) => void; export type DisplayObjectProps = { disabled?: string; role?: string; style?: { [key: string]: string | number; display?: string; height?: string; left?: string; margin?: number; padding?: number | string; position?: string; top?: string; width?: string; }; [k: string]: string | number | boolean | object | EventHandler; }; export type DomDataObjectType = { tagName: string; props: DisplayObjectProps; childElements: (DomDataObjectType | string)[]; }; /** * Update process for translating accessibility information for a stage to a DOM approach * that is available to assistive technologies. Applications should create an instance * of this for each stage and provide instances with different parent nodes. Since the * drawing order may not always be convient for accessibility, this manages a separate * tree of DisplayObjects. After the instance is created, the setter for 'root' should * be used to specify which DisplayObject will serve as the root of the accessibility tree * and other DisplayObjects can be added to that to be included in the accessibility output. * This also helps minimize the processing done by this class along with reduce * its output to the DOM. */ export default class AccessibilityTranslator { private _root; private rootElem; constructor(); /** * Sets the DisplayObject to use as the root of the accessibility tree. * @param {!createjs.DisplayObject} displayObject - DisplayObject to use as the root of the accessibility tree */ set root(displayObject: AccessibleDisplayObject); /** * Retrieves the root of the accessibility tree * @return {createjs.DisplayObject} DisplayObject that is the root of the accessibility tree */ get root(): AccessibleDisplayObject; /** * Starts the update of the accessibility DOM. This should be called each time * the accessibility information for all DisplayObjects has been completed(e.g. just after * drawing a frame) to make sure that the canvas and accessibility DOM are in sync. */ update(callback?: (...args: any[]) => void): void; _processDisplayObject: (displayObject: AccessibleDisplayObject, parentBoundsInGlobalSpace: ElementBounds) => DomDataObjectType; createDomTree(): void; } export {};