JavaScript UI Libraries & Blazor Components Suite – Smart UI › Forums › General Discussions › Typescript bindings › Reply To: Typescript bindings
May 3, 2019 at 6:19 am
#99772
admin
Keymaster
I decided to roll on my own type definitions to keep typescript compiler happy.
With a smart guy this kind of type definitions could be generated programmatically in no time!
It is a bit tedious and I feel a bit stupid doing this, but I feel it is easier for my eyes to do this way:
export interface MenuEvent extends CustomEvent {
detail: SmartMenuItem;
}
export interface SmartMenu extends HTMLElement {
locale: string;
}
export interface SmartMenuItem extends HTMLElement {
item: any;
label: any;
value: any;
}
export interface SmartTextBox extends HTMLElement {
locale: string;
readonly: boolean;
required: boolean;
theme: string;
value: string;
}
export interface SmartPasswordTextBox extends HTMLElement {
locale: string;
maxLength: number;
minLength: number;
passwordStrength: (password, allowedSymbols) => string;
required: boolean;
showPasswordIcon: boolean;
showPasswordStrength: boolean;
theme: string;
tooltipArrow: boolean;
value: string;
}
export interface SmartDropDownList extends HTMLElement {
displayMember: string;
locale: string;
selectedIndexes: any[]; // array type?
selectedValues: any[]; // array type?
selectionMode: string;
valueMember: string;
clearItems();
insert(position: number, value: any);
}