diff --git a/typescript/base/single/button/button.basic.ts b/typescript/base/single/button/button.basic.ts new file mode 100644 index 000000000..294ed0b0e --- /dev/null +++ b/typescript/base/single/button/button.basic.ts @@ -0,0 +1,33 @@ +import { _Single } from "../single"; + +export interface _BasicButton extends _Single { + _createShadow(): void; + + bindEvent(): void; + + _trigger(e: Event): void; + + _doClick(e: Event): void; + + beforeClick(): void; + + doClick(): void; + + handle(): _BasicButton; + + hover(): void; + + dishover(): void; + + setSelected(b: any): void; + + isSelected(): boolean; + + isOnce(): boolean; + + isForceSelected(): boolean; + + isForceNotSelected(): boolean; + + isDisableSelected(): boolean; +} diff --git a/typescript/base/single/single.ts b/typescript/base/single/single.ts new file mode 100644 index 000000000..06e67f015 --- /dev/null +++ b/typescript/base/single/single.ts @@ -0,0 +1,31 @@ +import { _Widget } from "../../core/widget"; + +export interface _Single extends _Widget { + _showToolTip(e: Event, opt?: SingleOpt): void; + + _hideTooltip(): void; + + _clearTimeOut(): void; + + enableHover(opt?: SingleOpt): void; + + disabledHover(): void; + + setTitle(title: string, opt?: SingleOpt): void; + + setWarningTitle(title: string, opt?: SingleOpt): void; + + getTipType(): string; + + isReadOnly(): boolean; + + getTitle(): string; + + getWarningTitle(): string; + + popluate(..._args: any[]): void; +} + +interface SingleOpt { + container?: any, belowMouse?: boolean +} \ No newline at end of file diff --git a/typescript/core/ob.ts b/typescript/core/ob.ts index 0b2ffc1db..5279babe7 100644 --- a/typescript/core/ob.ts +++ b/typescript/core/ob.ts @@ -1,9 +1,3 @@ -export interface OBConstructor { - new(config: any): _OB; - (config: any): _OB; - readonly prototype: _OB; -} - export interface _OB { props: Props | ((config: T) => Props & T); diff --git a/typescript/core/widget.ts b/typescript/core/widget.ts index ddbbfd5e1..a9912ae6c 100644 --- a/typescript/core/widget.ts +++ b/typescript/core/widget.ts @@ -1,9 +1,6 @@ import { _OB } from "./ob"; -export interface WidgetConstructor { - new(config: any): _Widget; - (config: any): _Widget; - readonly prototype: _Widget; +export interface _WidgetStatic { /** * 注册渲染引擎 * @param engine 引擎 diff --git a/typescript/index.ts b/typescript/index.ts index 4f238c3f6..4f52d9fbb 100644 --- a/typescript/index.ts +++ b/typescript/index.ts @@ -1,9 +1,19 @@ import { _i18n } from "./core/i18n"; -import { OBConstructor } from "./core/ob"; +import { _OB } from "./core/ob"; import { _func } from "./core/func"; -import { WidgetConstructor } from "./core/widget"; +import { _Widget, _WidgetStatic } from "./core/widget"; +import { _Single } from "./base/single/single"; +import { _BasicButton } from "./base/single/button/button.basic"; + +type Constructor = T & { + new(config: any): T; + (config: any): T; + readonly prototype: T; +} export interface _BI extends _func, _i18n { - OB: OBConstructor; - Widget: WidgetConstructor; + OB: Constructor<_OB>; + Widget: Constructor<_Widget> & _WidgetStatic; + Single: Constructor<_Single>; + BasicButton: Constructor<_BasicButton>; }