diff --git a/types/index.d.ts b/types/index.d.ts index 4b85729..abccc3f 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -1,5 +1,4 @@ -import { NavigationView } from "tabris"; -import type { Page, Action, SearchAction, Widget, Constructor } from "tabris"; +import { NavigationView, Page, Action, SearchAction/*, Widget, Constructor, WidgetCollection, Properties*/ } from "tabris"; export * from "./modal"; export * from "./navigation"; export * from "./preference"; @@ -9,14 +8,21 @@ export declare function addView(...widgets: (Page | Action | SearchAction)[]): N */ declare abstract class VoirRender implements Render { abstract renderAction(): (Action | SearchAction)[]; - abstract render(): Widget; + abstract render(): Widget; constructor(); } export interface Render { - renderAction(): (Action | SearchAction)[]; - render(): Widget; + renderAction?: () => (Action | SearchAction)[]; + render(): any; } export declare const Voir: Readonly<{ Render: typeof VoirRender; factory(Class: Constructor): (new () => Render) & (() => Render); }>; +export * from "./support"; + +declare global { + var $: tabris.$ | { + (selector?: string | Widget | any): WidgetCollection>; + } +} \ No newline at end of file diff --git a/types/preference/AbstractCheked.d.ts b/types/preference/AbstractChecked.d.ts similarity index 95% rename from types/preference/AbstractCheked.d.ts rename to types/preference/AbstractChecked.d.ts index f6b7fd5..48268f7 100644 --- a/types/preference/AbstractCheked.d.ts +++ b/types/preference/AbstractChecked.d.ts @@ -1,6 +1,7 @@ import type { CheckBox, Properties, RadioButton, Switch } from "tabris"; import ItemPreference from "./AbstractItemPreference"; export declare abstract class Checked extends ItemPreference { + onSelect: any; constructor(props: Pick); addListener(checkButton: RadioButton | Switch | CheckBox, originalOnSelect: Function): void; abstract _getButton(props: Properties): CheckBox | Switch | RadioButton; diff --git a/types/preference/CheckBoxPreference.d.ts b/types/preference/CheckBoxPreference.d.ts index 0ac12fc..ff5d515 100644 --- a/types/preference/CheckBoxPreference.d.ts +++ b/types/preference/CheckBoxPreference.d.ts @@ -1,5 +1,5 @@ import { Properties } from "tabris"; -import { Checked } from "./AbstractCheked"; +import { Checked } from "./AbstractChecked"; export declare class CheckBoxPreferenceComponent extends Checked { constructor(props: Properties); _getButton(props: Properties): import("tabris").widgets.CheckBox; diff --git a/types/preference/ListPreference.d.ts b/types/preference/ListPreference.d.ts index 0dbfe23..14788cc 100644 --- a/types/preference/ListPreference.d.ts +++ b/types/preference/ListPreference.d.ts @@ -1,5 +1,5 @@ import { RadioButton, Properties } from "tabris"; -import { Checked } from "./AbstractCheked"; +import { Checked } from "./AbstractChecked"; export interface IEntry { id?: string; text: string; diff --git a/types/preference/SwitchPreference.d.ts b/types/preference/SwitchPreference.d.ts index 43fb0d1..dad1342 100644 --- a/types/preference/SwitchPreference.d.ts +++ b/types/preference/SwitchPreference.d.ts @@ -1,8 +1,7 @@ -import { Properties } from "tabris"; -import { Checked } from "./AbstractCheked"; +import { Constructor, Properties, Switch, WidgetTapEvent } from "tabris"; +import { Checked } from "./AbstractChecked"; export declare class SwitchPreferenceComponent extends Checked { - onChange: any; constructor(props: Properties); - _getButton(props: Properties): import("tabris").widgets.Switch; + _getButton(props: Properties): Switch; } -export declare const SwitchPreference: import("tabris").Constructor; +export declare const SwitchPreference: Constructor; diff --git a/types/preference/index.d.ts b/types/preference/index.d.ts index 5eeadbf..dc64750 100644 --- a/types/preference/index.d.ts +++ b/types/preference/index.d.ts @@ -1,4 +1,4 @@ -export * from './AbstractCheked'; +export * from './AbstractChecked'; export { default as AbstractItemPreference } from './AbstractItemPreference'; export * from './CheckBoxPreference'; export * from './SwitchPreference'; diff --git a/types/support/index.d.ts b/types/support/index.d.ts new file mode 100644 index 0000000..ebe838b --- /dev/null +++ b/types/support/index.d.ts @@ -0,0 +1,49 @@ +import * as tabris from "tabris"; + +export declare const isVersion2: boolean; +export declare const contentView: tabris.ContentView; +export declare const stretch: { + left: number; + right: number; + top: number; + bottom: number; +}; +export declare const stretchY: { + top: number; + bottom: number; +}; +export declare const stretchX: { + right: number; + left: number; +}; +export declare const layoutData: { + stretch: typeof stretch, + stretchX: typeof stretchX; + stretchY: typeof stretchY; + centerX: number | boolean; + centerY: number | boolean; +}; + +export declare const Action: typeof tabris.Action | ((props?: any) => typeof tabris.Action); + +declare class RowMake extends tabris.Composite { + get alignment(): string + set alignment(value: string); + //@ts-ignore + layoutData: 'center' | keyof typeof layoutData; +} + +export declare const Row: typeof RowMake | typeof tabris.Row; + +export declare const Listeners: { + new (target: tabris.Widget, event: string): { + addListener(handler: (event: any)=> typeof Listeners): void; + trigger(eventObject: any): typeof Listeners; + }; +} | typeof tabris.Listeners; + +export declare const LayoutData: typeof tabris.LayoutData | { + new (): {}; +}; + +export const statusBar = tabris.statusBar //| typeof tabris.ui.statusBar;