UNPKG

@itwin/core-frontend

Version:
189 lines • 8.17 kB
/** @packageDocumentation * @module Tools */ /** Tool Assistance known images * @public * @extensions */ export declare enum ToolAssistanceImage { /** When Keyboard is specified, ToolAssistanceInstruction.keyboardInfo should be set. */ Keyboard = 0, /** Plus sign */ AcceptPoint = 1, /** Cursor image with click symbol */ CursorClick = 2, /** Mouse image with darkened left button */ LeftClick = 3, /** Mouse image with darkened right button */ RightClick = 4, /** Mouse image with darkened scroll wheel */ MouseWheel = 5, /** Mouse image with darkened left button and left/right arrows */ LeftClickDrag = 6, /** Mouse image with darkened right button and left/right arrows */ RightClickDrag = 7, /** Mouse image with darkened scroll wheel and left/right arrows */ MouseWheelClickDrag = 8, /** Touch image with single finger tapping once */ OneTouchTap = 9, /** Touch image with single finger tapping twice */ OneTouchDoubleTap = 10, /** Touch image with single finger dragging */ OneTouchDrag = 11, /** Touch image with two fingers tapping once */ TwoTouchTap = 12, /** Touch image with two fingers dragging */ TwoTouchDrag = 13, /** Touch image with two fingers pinching */ TwoTouchPinch = 14, /** Touch cursor image with single finger tapping once */ TouchCursorTap = 15, /** Touch cursor image with single finger dragging */ TouchCursorDrag = 16 } /** Input Method for Tool Assistance instruction * @public * @extensions */ export declare enum ToolAssistanceInputMethod { /** Instruction applies to both touch & mouse input methods */ Both = 0, /** Instruction applies to only mouse input method */ Mouse = 1, /** Instruction applies to only touch input method */ Touch = 2 } /** Identifies one of a set of commonly-used [[ToolAssistance]] messages prompting the user to specify * an element or location for a tool operation. * @see [[ToolAssistance.translatePrompt]] to obtain a corresponding localized message appropriate for displaying to the user. * @public * @extensions */ export type ToolAssistancePromptKey = "IdentifyElement" | "IdentifyPoint" | "StartPoint" | "EndPoint"; /** Identifies one of a set of commonly-used [[ToolAssistance]] messages notifying the user of the result of * the next input. * @see [[ToolAssistance.translateInput]] to obtain a corresponding localized message appropriate for displaying to the user. * @public * @extensions */ export type ToolAssistanceInputKey = "AcceptSelection" | "AcceptElement" | "AcceptPoint" | "AdditionalElement" | "AdditionalPoint" | "Accept" | "Complete" | "Cancel" | "Restart" | "Exit"; /** Tool Assistance image keyboard keys * @public * @extensions */ export interface ToolAssistanceKeyboardInfo { /** Text for keys to display */ keys: string[]; /** If two rows of keys should be displayed, text for the bottom row of keys */ bottomKeys?: string[]; } /** Interface used to describe a Tool Assistance instruction. * @public * @extensions */ export interface ToolAssistanceInstruction { /** Name of icon WebFont entry, or if specifying an SVG symbol, use "svg:" prefix to imported symbol Id. * ToolAssistanceImage enum also supported. If ToolAssistanceImage.Keyboard specified, also provide keyboardInfo. */ image: string | ToolAssistanceImage; /** Text for the instruction. */ text: string; /** When ToolAssistanceImage.Keyboard is specified for image, information about the Keyboard keys in the image. */ keyboardInfo?: ToolAssistanceKeyboardInfo; /** Indicates whether this instruction is new. Defaults to false. */ isNew?: boolean; /** Input Method to which the instruction applies */ inputMethod?: ToolAssistanceInputMethod; } /** Interface used to describe a Tool Assistance section with a label and a set of instructions. * @public * @extensions */ export interface ToolAssistanceSection { /** Instructions in the section. */ instructions: ToolAssistanceInstruction[]; /** Label for the section. */ label?: string; } /** Interface used to describe Tool Assistance for a tool's state. * @public * @extensions */ export interface ToolAssistanceInstructions { /** The main instruction. */ mainInstruction: ToolAssistanceInstruction; /** Sections of instructions. */ sections?: ToolAssistanceSection[]; } /** Tool Assistance helper methods. * @public * @extensions */ export declare class ToolAssistance { /** Up key symbol. */ static readonly upSymbol: string; /** Down key symbol. */ static readonly downSymbol: string; /** Left key symbol. */ static readonly leftSymbol: string; /** Right key symbol. */ static readonly rightSymbol: string; /** Keyboard info for Arrow keys. */ static readonly arrowKeyboardInfo: ToolAssistanceKeyboardInfo; private static translateKey; private static translateTouch; /** Return the translated string for the specified main instruction key */ static translatePrompt(key: ToolAssistancePromptKey): string; /** Return the translated string for the specified input instruction key */ static translateInput(key: ToolAssistanceInputKey): string; /** Alt key text. */ static get altKey(): string; /** Ctrl key text. */ static get ctrlKey(): string; /** Shift key text. */ static get shiftKey(): string; /** Inputs text. */ static get inputsLabel(): string; /** Keyboard info for Alt key. */ static get altKeyboardInfo(): ToolAssistanceKeyboardInfo; /** Keyboard info for Ctrl key. */ static get ctrlKeyboardInfo(): ToolAssistanceKeyboardInfo; /** Shift key symbol. */ static readonly shiftSymbol: string; /** Keyboard info for Shift key with symbol. */ static get shiftKeyboardInfo(): ToolAssistanceKeyboardInfo; /** Keyboard info for Shift key without symbol. */ static get shiftKeyboardInfoNoSymbol(): ToolAssistanceKeyboardInfo; /** Keyboard info for Shift key symbol. */ static get shiftSymbolKeyboardInfo(): ToolAssistanceKeyboardInfo; /** Ctrl key symbol. */ static readonly ctrlSymbol: string; /** Keyboard info for Ctrl key symbol. */ static get ctrlSymbolKeyboardInfo(): ToolAssistanceKeyboardInfo; /** Alt key symbol. */ static readonly altSymbol: string; /** Keyboard info for Alt key symbol. */ static get altSymbolKeyboardInfo(): ToolAssistanceKeyboardInfo; /** Creates a [[ToolAssistanceInstruction]]. */ static createInstruction(image: string | ToolAssistanceImage, text: string, isNew?: boolean, inputMethod?: ToolAssistanceInputMethod, keyboardInfo?: ToolAssistanceKeyboardInfo): ToolAssistanceInstruction; /** Creates a [[ToolAssistanceInstruction]] with a [[ToolAssistanceKeyboardInfo]]. */ static createKeyboardInstruction(keyboardInfo: ToolAssistanceKeyboardInfo, text: string, isNew?: boolean, inputMethod?: ToolAssistanceInputMethod): ToolAssistanceInstruction; /** Creates a [[ToolAssistanceInstruction]] with a modifier key and an image. */ static createModifierKeyInstruction(modifierKey: string, image: string | ToolAssistanceImage, text: string, isNew?: boolean, inputMethod?: ToolAssistanceInputMethod): ToolAssistanceInstruction; /** Creates a [[ToolAssistanceKeyboardInfo]]. */ static createKeyboardInfo(keys: string[], bottomKeys?: string[]): ToolAssistanceKeyboardInfo; /** Creates instructions for interaction with the touch cursor that are appended to the supplied [[ToolAssistanceInstruction]] array. */ static createTouchCursorInstructions(instructions: ToolAssistanceInstruction[]): boolean; /** Creates a [[ToolAssistanceSection]]. */ static createSection(instructions: ToolAssistanceInstruction[], label?: string): ToolAssistanceSection; /** Creates a [[ToolAssistanceInstructions]]. */ static createInstructions(mainInstruction: ToolAssistanceInstruction, sections?: ToolAssistanceSection[]): ToolAssistanceInstructions; } //# sourceMappingURL=ToolAssistance.d.ts.map