Skip to content

Commit

Permalink
añadido nuevos tipos
Browse files Browse the repository at this point in the history
  • Loading branch information
everskyblue committed Aug 18, 2024
1 parent 76dc928 commit 1782bdf
Show file tree
Hide file tree
Showing 7 changed files with 68 additions and 13 deletions.
16 changes: 11 additions & 5 deletions types/index.d.ts
Original file line number Diff line number Diff line change
@@ -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";
Expand All @@ -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<any>;
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<Render>): (new () => Render) & (() => Render);
}>;
export * from "./support";

declare global {
var $: tabris.$ | {
(selector?: string | Widget | any): WidgetCollection<Widget<any>>;
}
}
Original file line number Diff line number Diff line change
@@ -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<any, any>);
addListener(checkButton: RadioButton | Switch | CheckBox, originalOnSelect: Function): void;
abstract _getButton(props: Properties<CheckBox | Switch | RadioButton>): CheckBox | Switch | RadioButton;
Expand Down
2 changes: 1 addition & 1 deletion types/preference/CheckBoxPreference.d.ts
Original file line number Diff line number Diff line change
@@ -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<CheckBoxPreferenceComponent>);
_getButton(props: Properties<CheckBoxPreferenceComponent>): import("tabris").widgets.CheckBox;
Expand Down
2 changes: 1 addition & 1 deletion types/preference/ListPreference.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { RadioButton, Properties } from "tabris";
import { Checked } from "./AbstractCheked";
import { Checked } from "./AbstractChecked";
export interface IEntry {
id?: string;
text: string;
Expand Down
9 changes: 4 additions & 5 deletions types/preference/SwitchPreference.d.ts
Original file line number Diff line number Diff line change
@@ -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<SwitchPreferenceComponent>);
_getButton(props: Properties<SwitchPreferenceComponent>): import("tabris").widgets.Switch;
_getButton(props: Properties<SwitchPreferenceComponent>): Switch;
}
export declare const SwitchPreference: import("tabris").Constructor<SwitchPreferenceComponent>;
export declare const SwitchPreference: Constructor<SwitchPreferenceComponent>;
2 changes: 1 addition & 1 deletion types/preference/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export * from './AbstractCheked';
export * from './AbstractChecked';
export { default as AbstractItemPreference } from './AbstractItemPreference';
export * from './CheckBoxPreference';
export * from './SwitchPreference';
Expand Down
49 changes: 49 additions & 0 deletions types/support/index.d.ts
Original file line number Diff line number Diff line change
@@ -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;

0 comments on commit 1782bdf

Please sign in to comment.