From 715b679d6fa97f219781468ec819b797414f05cd Mon Sep 17 00:00:00 2001 From: Andre Loker <140714+aloker@users.noreply.github.com> Date: Sun, 29 Jul 2018 15:03:03 +0200 Subject: [PATCH] Fix a lot of basic errors in typescript definitions --- src/components/accordion/Accordion.d.ts | 4 ++- src/components/autocomplete/AutoComplete.d.ts | 4 +-- src/components/breadcrumb/BreadCrumb.d.ts | 4 +-- src/components/button/Button.d.ts | 5 ++-- src/components/calendar/Calendar.d.ts | 5 ++-- src/components/checkbox/Checkbox.d.ts | 4 +-- src/components/chips/Chips.d.ts | 4 +-- src/components/column/Column.d.ts | 10 +++---- src/components/columngroup/ColumnGroup.d.ts | 3 +- src/components/contextmenu/ContextMenu.d.ts | 7 +++-- src/components/datagrid/DataGrid.d.ts | 10 +++---- src/components/datalist/DataList.d.ts | 10 +++---- src/components/datascroller/DataScroller.d.ts | 8 +++--- src/components/datatable/BodyCell.d.ts | 3 +- src/components/datatable/BodyRow.d.ts | 3 +- src/components/datatable/DataTable.d.ts | 28 +++++++++++-------- src/components/datatable/FooterCell.d.ts | 3 +- src/components/datatable/HeaderCell.d.ts | 3 +- src/components/datatable/RowRadioButton.d.ts | 4 +-- src/components/datatable/TableBody.d.ts | 3 +- src/components/datatable/TableFooter.d.ts | 3 +- src/components/datatable/TableHeader.d.ts | 3 +- src/components/dataview/DataView.d.ts | 11 ++++---- src/components/dialog/Dialog.d.ts | 6 ++-- src/components/dropdown/Dropdown.d.ts | 5 ++-- src/components/dropdown/DropdownItem.d.ts | 4 +-- src/components/editor/Editor.d.ts | 11 ++++---- src/components/gmap/GMap.d.ts | 4 +-- src/components/growl/Growl.d.ts | 17 ++++++----- src/components/inplace/Inplace.d.ts | 12 ++++++-- src/components/inputtext/InputText.d.ts | 6 ++-- src/components/lightbox/Lightbox.d.ts | 4 +-- src/components/listbox/ListBox.d.ts | 4 +-- src/components/megamenu/MegaMenu.d.ts | 4 +-- src/components/menu/Menu.d.ts | 7 +++-- src/components/menubar/Menubar.d.ts | 4 +-- src/components/menuitem/MenuItem.d.ts | 4 +-- src/components/messages/Messages.d.ts | 19 +++++++++++-- src/components/multiselect/MultiSelect.d.ts | 4 +-- src/components/orderlist/OrderList.d.ts | 4 +-- .../organizationchart/OrganizationChart.d.ts | 19 +++++++++---- src/components/overlaypanel/OverlayPanel.d.ts | 5 +++- src/components/paginator/Paginator.d.ts | 17 +++++++---- src/components/panelmenu/PanelMenu.d.ts | 4 +-- src/components/picklist/PickList.d.ts | 4 +-- src/components/picklist/PickListControls.d.ts | 6 ++-- src/components/picklist/PickListItem.d.ts | 4 +-- src/components/picklist/PickListSubList.d.ts | 8 +++--- .../picklist/PickListTransferControls.d.ts | 12 ++++---- src/components/radiobutton/RadioButton.d.ts | 6 ++-- src/components/rating/Rating.d.ts | 6 ++-- src/components/schedule/Schedule.d.ts | 8 +++--- src/components/selectbutton/SelectButton.d.ts | 4 +-- src/components/slidemenu/SlideMenu.d.ts | 9 ++++-- src/components/slider/Slider.d.ts | 6 ++-- src/components/splitbutton/SplitButton.d.ts | 4 +-- src/components/steps/Steps.d.ts | 6 ++-- src/components/tabmenu/TabMenu.d.ts | 4 +-- src/components/tabview/TabView.d.ts | 9 ++++-- src/components/tieredmenu/TieredMenu.d.ts | 7 +++-- src/components/tooltip/Tooltip.d.ts | 5 ++-- src/components/tree/Tree.d.ts | 12 ++++---- src/components/treetable/TreeTable.d.ts | 22 +++++++++------ .../tristatecheckbox/TriStateCheckbox.d.ts | 2 +- src/components/util.d.ts | 1 + 65 files changed, 268 insertions(+), 183 deletions(-) create mode 100644 src/components/util.d.ts diff --git a/src/components/accordion/Accordion.d.ts b/src/components/accordion/Accordion.d.ts index 2e63a3616e..399c177964 100644 --- a/src/components/accordion/Accordion.d.ts +++ b/src/components/accordion/Accordion.d.ts @@ -22,4 +22,6 @@ interface AccordionProps { onTabChange?(e: {originalEvent: Event, index: number}): void; } -export class Accordion extends React.Component {} \ No newline at end of file +// tslint:disable-next-line:max-classes-per-file +export class Accordion extends React.Component {} + diff --git a/src/components/autocomplete/AutoComplete.d.ts b/src/components/autocomplete/AutoComplete.d.ts index c310771a0e..8a510b3e28 100755 --- a/src/components/autocomplete/AutoComplete.d.ts +++ b/src/components/autocomplete/AutoComplete.d.ts @@ -4,7 +4,7 @@ interface AutoCompleteProps { id?: string; value?: any; name?: string; - suggestions?: Array; + suggestions?: any[]; field?: string; scrollHeight?: string; dropdown?: boolean; @@ -42,4 +42,4 @@ interface AutoCompleteProps { onClear?(event:Event): void; } -export class AutoComplete extends React.Component {} \ No newline at end of file +export class AutoComplete extends React.Component {} diff --git a/src/components/breadcrumb/BreadCrumb.d.ts b/src/components/breadcrumb/BreadCrumb.d.ts index b754244870..7f6d23bf5f 100644 --- a/src/components/breadcrumb/BreadCrumb.d.ts +++ b/src/components/breadcrumb/BreadCrumb.d.ts @@ -3,10 +3,10 @@ import {MenuItem} from '../menuitem/MenuItem'; interface BreadCrumbProps { id?: string; - model?: Array; + model?: MenuItem[]; home?: any; style?: object; className?: string; } -export class BreadCrumb extends React.Component {} \ No newline at end of file +export class BreadCrumb extends React.Component {} diff --git a/src/components/button/Button.d.ts b/src/components/button/Button.d.ts index 7de6bfc791..23f0b15dd4 100644 --- a/src/components/button/Button.d.ts +++ b/src/components/button/Button.d.ts @@ -1,6 +1,7 @@ import React = require("react"); +import {Omit} from "../util"; -interface ButtonProps extends React.HTMLProps { +interface ButtonProps extends Omit, 'ref'> { label?: string; icon?: string; iconPos?: string; @@ -8,4 +9,4 @@ interface ButtonProps extends React.HTMLProps { [key: string]: any; } -export class Button extends React.Component {} \ No newline at end of file +export class Button extends React.Component {} diff --git a/src/components/calendar/Calendar.d.ts b/src/components/calendar/Calendar.d.ts index 5affcbfc92..8bf3118395 100644 --- a/src/components/calendar/Calendar.d.ts +++ b/src/components/calendar/Calendar.d.ts @@ -71,7 +71,8 @@ interface CalendarProps { autoZIndex?: boolean; baseZIndex?: number; appendTo?: any; - dateTemplate?(dateMeta:DateMetaData): JSX.Element | undefined; + yearRange?: string; + dateTemplate?(dateMeta:DateMetaData): React.ReactNode; onFocus?(event: Event): void; onBlur?(event: Event): void; onInput?(event: Event): void; @@ -82,4 +83,4 @@ interface CalendarProps { onViewDateChange?(e: {originalEvent: Event, value: Date}): void; } -export class Calendar extends React.Component {} \ No newline at end of file +export class Calendar extends React.Component {} diff --git a/src/components/checkbox/Checkbox.d.ts b/src/components/checkbox/Checkbox.d.ts index 2f45690c53..deb635c6f1 100644 --- a/src/components/checkbox/Checkbox.d.ts +++ b/src/components/checkbox/Checkbox.d.ts @@ -5,7 +5,7 @@ interface CheckboxProps { inputId?: string; value?: any; name?: string; - checked: boolean; + checked?: boolean; style?: object; className?: string; disabled?: boolean; @@ -15,4 +15,4 @@ interface CheckboxProps { onChange(e: { originalEvent: Event, value: any, checked: boolean}): void; } -export class Checkbox extends React.Component {} \ No newline at end of file +export class Checkbox extends React.Component {} diff --git a/src/components/chips/Chips.d.ts b/src/components/chips/Chips.d.ts index fd0825d196..8ac79e75ff 100755 --- a/src/components/chips/Chips.d.ts +++ b/src/components/chips/Chips.d.ts @@ -4,7 +4,7 @@ interface ChipsProps { id?: string; name?: string; placeholder?: string; - value?: Array; + value?: any[]; max?: number; disabled?: boolean; style?: object; @@ -15,4 +15,4 @@ interface ChipsProps { onChange?(e: {originalEvent: Event, value: any}): void; } -export class Chips extends React.Component {} \ No newline at end of file +export class Chips extends React.Component {} diff --git a/src/components/column/Column.d.ts b/src/components/column/Column.d.ts index 242ecd76aa..96372cad8c 100644 --- a/src/components/column/Column.d.ts +++ b/src/components/column/Column.d.ts @@ -8,14 +8,12 @@ interface ColumnProps { body?: any; footer?: any; sortable?: boolean; - sortFunction?(): void; filter?: boolean; filterMatchMode?: string; filterPlaceholder?: string; filterType?: string; filterMaxLength?: number; filterElement?: object; - filterFunction?(value: any, filter: any): void; style?: object; className?: string; headerStyle?: object; @@ -29,10 +27,12 @@ interface ColumnProps { selectionMode?: string; colSpan?: number; rowSpan?: number; - editor?(props: any): JSX.Element | undefined; - editorValidator?(props: any): boolean; rowReorder?: boolean; rowReorderIcon?: string; + sortFunction?(): void; + filterFunction?(value: any, filter: any): void; + editor?(props: any): JSX.Element | undefined; + editorValidator?(props: any): boolean; } -export class Column extends React.Component {} \ No newline at end of file +export class Column extends React.Component {} diff --git a/src/components/columngroup/ColumnGroup.d.ts b/src/components/columngroup/ColumnGroup.d.ts index 5f8fd339ba..4e70d41235 100644 --- a/src/components/columngroup/ColumnGroup.d.ts +++ b/src/components/columngroup/ColumnGroup.d.ts @@ -1,6 +1,7 @@ import React = require("react"); +// tslint:disable-next-line:no-empty-interface interface ColumnGroupProps { } -export class ColumnGroup extends React.Component {} \ No newline at end of file +export class ColumnGroup extends React.Component {} diff --git a/src/components/contextmenu/ContextMenu.d.ts b/src/components/contextmenu/ContextMenu.d.ts index 6b27ca901a..6c947cbc11 100644 --- a/src/components/contextmenu/ContextMenu.d.ts +++ b/src/components/contextmenu/ContextMenu.d.ts @@ -1,9 +1,10 @@ import React = require("react"); import {MenuItem} from '../menuitem/MenuItem'; +import {SyntheticEvent} from "react"; interface ContextMenuProps { id?: string; - model?: Array; + model?: MenuItem[]; style?: object; className?: string; global?: boolean; @@ -14,4 +15,6 @@ interface ContextMenuProps { onHide?(e: Event): void; } -export class ContextMenu extends React.Component {} \ No newline at end of file +export class ContextMenu extends React.Component { + public show(event:SyntheticEvent):void; +} diff --git a/src/components/datagrid/DataGrid.d.ts b/src/components/datagrid/DataGrid.d.ts index 5139edbafe..bac1373168 100755 --- a/src/components/datagrid/DataGrid.d.ts +++ b/src/components/datagrid/DataGrid.d.ts @@ -2,22 +2,22 @@ import React = require("react"); interface DataGridProps { id?: string, - value?: Array, + value?: any[], rows?: number, first?:number, paginator?: boolean, totalRecords?: number, pageLinks?: number, - rowsPerPageOptions?: Array, + rowsPerPageOptions?: any[], lazy?: boolean, style?: string, className?: string, paginatorPosition?: string, paginatorTemplate?: string, - onLazyLoad?(e: {first: number, rows:number}): void, - itemTemplate?(item: any): JSX.Element | undefined, header?:string, footer?:string; + onLazyLoad?(e: {first: number, rows:number}): void, + itemTemplate?(item: any): JSX.Element | undefined, } -export class DataGrid extends React.Component {} \ No newline at end of file +export class DataGrid extends React.Component {} diff --git a/src/components/datalist/DataList.d.ts b/src/components/datalist/DataList.d.ts index 641f838d23..c9681110b6 100755 --- a/src/components/datalist/DataList.d.ts +++ b/src/components/datalist/DataList.d.ts @@ -2,22 +2,22 @@ import React = require("react"); interface DataListProps { id?: string; - value?: Array; + value?: any[]; rows?: number; first?:number; paginator?: boolean; totalRecords?: number; pageLinks?: number; - rowsPerPageOptions?: Array; + rowsPerPageOptions?: any[]; lazy?: boolean; style?: object; className?: string; paginatorPosition?: string; paginatorTemplate?: string; - onLazyLoad?({first: number, rows:number}): void; - itemTemplate?(item: any): JSX.Element | undefined; header?:string; footer?:string; + onLazyLoad?(e: {first: number, rows:number}): void; + itemTemplate?(item: any): JSX.Element | undefined; } -export class DataList extends React.Component {} \ No newline at end of file +export class DataList extends React.Component {} diff --git a/src/components/datascroller/DataScroller.d.ts b/src/components/datascroller/DataScroller.d.ts index 9f72ecf730..34e924f360 100644 --- a/src/components/datascroller/DataScroller.d.ts +++ b/src/components/datascroller/DataScroller.d.ts @@ -2,7 +2,7 @@ import React = require("react"); interface DataScrollerProps { id?: string; - value?: Array; + value?: any[]; rows?: number; inline?: boolean; scrollHeight?: any; @@ -10,11 +10,11 @@ interface DataScrollerProps { buffer?: number; style?: object; className?: string; - onLazyLoad?(e: {first: number, rows: number}): void; - itemTemplate?(item: any): JSX.Element | undefined; header?: any; footer?: any; lazy?: boolean; + onLazyLoad?(e: {first: number, rows: number}): void; + itemTemplate?(item: any): JSX.Element | undefined; } -export class DataScroller extends React.Component {} \ No newline at end of file +export class DataScroller extends React.Component {} diff --git a/src/components/datatable/BodyCell.d.ts b/src/components/datatable/BodyCell.d.ts index 325bdfeb65..45ad4d6a47 100644 --- a/src/components/datatable/BodyCell.d.ts +++ b/src/components/datatable/BodyCell.d.ts @@ -1,6 +1,7 @@ import React = require("react"); +// tslint:disable-next-line:no-empty-interface interface BodyCellProps { } -export class BodyCell extends React.Component {} \ No newline at end of file +export class BodyCell extends React.Component {} diff --git a/src/components/datatable/BodyRow.d.ts b/src/components/datatable/BodyRow.d.ts index b83dbb3dde..dc9a52d7a4 100644 --- a/src/components/datatable/BodyRow.d.ts +++ b/src/components/datatable/BodyRow.d.ts @@ -1,6 +1,7 @@ import React = require("react"); +// tslint:disable-next-line:no-empty-interface interface BodyRowProps { } -export class BodyRow extends React.Component {} \ No newline at end of file +export class BodyRow extends React.Component {} diff --git a/src/components/datatable/DataTable.d.ts b/src/components/datatable/DataTable.d.ts index 15c4d5d3f2..b997f260f0 100644 --- a/src/components/datatable/DataTable.d.ts +++ b/src/components/datatable/DataTable.d.ts @@ -2,7 +2,7 @@ import React = require("react"); interface DataTableProps { id?: string; - value?: Array; + value?: any[]; header?: any; footer?: any; style?: object; @@ -23,12 +23,11 @@ interface DataTableProps { lazy?: boolean; sortField?: string; sortOrder?: number; - multiSortMeta?: Array; + multiSortMeta?: any[]; sortMode?: string; emptyMessage?: string; selectionMode?: string; selection?: any; - onSelectionChange?(e: {originalEvent: Event, data: any}): void; compareSelectionBy?: string; dataKey?: string; metaKeySelection?: boolean; @@ -36,9 +35,7 @@ interface DataTableProps { footerColumnGroup?: JSX.Element; frozenHeaderColumnGroup?: JSX.Element; frozenFooterColumnGroup?: JSX.Element; - rowExpansionTemplate?(data: any): JSX.Element | undefined; - expandedRows?: Array; - onRowToggle?(data: Array): void; + expandedRows?: any[]; responsive?: boolean; resizableColumns?: boolean; columnResizeMode?: string; @@ -51,21 +48,25 @@ interface DataTableProps { virtualScrollDelay?: number; frozenWidth?: string; unfrozenWidth?: string; - frozenValue?: Array; + frozenValue?: any[]; csvSeparator?: string; exportFilename?: string; contextMenu?: any; rowGroupMode?: string; autoLayout?:boolean; - rowClassName?(rowData: any): object; - rowGroupHeaderTemplate?(data: any, index: number): JSX.Element | undefined; - rowGroupFooterTemplate?(data: any, index: number): JSX.Element | undefined; loading?:boolean; loadingIcon?:string; + groupField?:string; + onSelectionChange?(e: {originalEvent: Event, data: any}): void; + rowExpansionTemplate?(data: any): JSX.Element | undefined; + onRowToggle?(e: {data: any[]}): void; + rowClassName?(rowData: any): object; + rowGroupHeaderTemplate?(data: any, index: number): React.ReactNode | undefined; + rowGroupFooterTemplate?(data: any, index: number): React.ReactNode | undefined; onColumnResizeEnd?(e: {element: HTMLElement, delta: number}): void; onSort?(e: {sortField: string, sortOrder: number, multiSortMeta: any}): void; onPage?(e: {first: number, rows: number}): void; - onFilter?(filters: Array): void; + onFilter?(filters: any[]): void; onVirtualScroll?(e: {first: number, rows: number}): void; onRowClick?(e: Event): void; onRowDoubleClick?(e: {originalEvent: Event, data: any, index: number}): void; @@ -78,4 +79,7 @@ interface DataTableProps { onRowReorder?(e: {originalEvent: Event, value: any, dragIndex: number, dropIndex: number}): void; } -export class DataTable extends React.Component {} +export class DataTable extends React.Component { + public exportCSV():void; + public filter(value:T, field:string, mode:string):void; +} diff --git a/src/components/datatable/FooterCell.d.ts b/src/components/datatable/FooterCell.d.ts index 362e8ca10d..b1afd41752 100644 --- a/src/components/datatable/FooterCell.d.ts +++ b/src/components/datatable/FooterCell.d.ts @@ -1,6 +1,7 @@ import React = require("react"); +// tslint:disable-next-line:no-empty-interface interface FooterCellProps { } -export class FooterCell extends React.Component {} \ No newline at end of file +export class FooterCell extends React.Component {} diff --git a/src/components/datatable/HeaderCell.d.ts b/src/components/datatable/HeaderCell.d.ts index 0d4a33cb08..f89a7d3c2c 100644 --- a/src/components/datatable/HeaderCell.d.ts +++ b/src/components/datatable/HeaderCell.d.ts @@ -1,6 +1,7 @@ import React = require("react"); +// tslint:disable-next-line:no-empty-interface interface HeaderCellProps { } -export class HeaderCell extends React.Component {} \ No newline at end of file +export class HeaderCell extends React.Component {} diff --git a/src/components/datatable/RowRadioButton.d.ts b/src/components/datatable/RowRadioButton.d.ts index 908caa072d..2a20552915 100644 --- a/src/components/datatable/RowRadioButton.d.ts +++ b/src/components/datatable/RowRadioButton.d.ts @@ -2,8 +2,8 @@ import React = require("react"); interface RowRadioButtonProps { rowData?: object; - onClick?(e: {originalEvent: Event, data: object}): void; selected?: boolean; + onClick?(e: {originalEvent: Event, data: object}): void; } -export class RowRadioButton extends React.Component {} \ No newline at end of file +export class RowRadioButton extends React.Component {} diff --git a/src/components/datatable/TableBody.d.ts b/src/components/datatable/TableBody.d.ts index f97668503c..7e1e6423e8 100644 --- a/src/components/datatable/TableBody.d.ts +++ b/src/components/datatable/TableBody.d.ts @@ -1,6 +1,7 @@ import React = require("react"); +// tslint:disable-next-line:no-empty-interface interface TableBodyProps { } -export class TableBody extends React.Component {} \ No newline at end of file +export class TableBody extends React.Component {} diff --git a/src/components/datatable/TableFooter.d.ts b/src/components/datatable/TableFooter.d.ts index ec9e334f26..e6c108ecdf 100644 --- a/src/components/datatable/TableFooter.d.ts +++ b/src/components/datatable/TableFooter.d.ts @@ -1,6 +1,7 @@ import React = require("react"); +// tslint:disable-next-line:no-empty-interface interface TableFooterProps { } -export class TableFooter extends React.Component {} \ No newline at end of file +export class TableFooter extends React.Component {} diff --git a/src/components/datatable/TableHeader.d.ts b/src/components/datatable/TableHeader.d.ts index 9d22f7c7af..6bfdb2bad5 100644 --- a/src/components/datatable/TableHeader.d.ts +++ b/src/components/datatable/TableHeader.d.ts @@ -1,6 +1,7 @@ import React = require("react"); +// tslint:disable-next-line:no-empty-interface interface TableHeaderProps { } -export class TableHeader extends React.Component {} \ No newline at end of file +export class TableHeader extends React.Component {} diff --git a/src/components/dataview/DataView.d.ts b/src/components/dataview/DataView.d.ts index 3944d4f65f..f121ab6438 100755 --- a/src/components/dataview/DataView.d.ts +++ b/src/components/dataview/DataView.d.ts @@ -5,7 +5,7 @@ interface DataViewLayoutOptionsProps { layout?: string, style?: string, className?: string, - onChange(e: {originalEvent: event, value: string}): void + onChange(e: {originalEvent: Event, value: string}): void } export class DataViewLayoutOptions extends React.Component {} @@ -14,22 +14,23 @@ interface DataViewProps { id?: string, header?: JSX.Element | string, footer?: JSX.Element | string, - value?: Array, + value?: any[], layout?: string, paginator?: boolean, rows?: number, first?: number, totalRecords?: number, pageLinks?: number, - rowsPerPageOptions?: Array, + rowsPerPageOptions?: any[], paginatorPosition?: string, emptyMessage?: string, sortField?: string, sortOrder?: number, style?: string, className?: string, - onPage?(e: {originalEvent: event, first: number, rows: number}): void, + onPage?(e: {originalEvent: Event, first: number, rows: number}): void, itemTemplate?(item: any, layout: "grid" | "list"): JSX.Element | undefined } -export class DataView extends React.Component {} \ No newline at end of file +// tslint:disable-next-line:max-classes-per-file +export class DataView extends React.Component {} diff --git a/src/components/dialog/Dialog.d.ts b/src/components/dialog/Dialog.d.ts index e3151b85ef..e4ab21ff78 100644 --- a/src/components/dialog/Dialog.d.ts +++ b/src/components/dialog/Dialog.d.ts @@ -8,8 +8,6 @@ interface DialogProps { width?: string; height?: string; modal?: boolean; - onHide(): void; - onShow?(): void; draggable?: boolean; resizable?: boolean; minWidth?: number; @@ -31,6 +29,8 @@ interface DialogProps { minX?: number; minY?: number; maximizable?: boolean; + onHide(): void; + onShow?(): void; } -export class Dialog extends React.Component {} \ No newline at end of file +export class Dialog extends React.Component {} diff --git a/src/components/dropdown/Dropdown.d.ts b/src/components/dropdown/Dropdown.d.ts index a3001f4acd..c5f8ca734d 100755 --- a/src/components/dropdown/Dropdown.d.ts +++ b/src/components/dropdown/Dropdown.d.ts @@ -3,14 +3,14 @@ import React = require("react"); interface DropdownProps { id?: string; value?: any; - options?: Array; + options?: any[]; optionLabel?: string; - itemTemplate?(option:any): JSX.Element | undefined; style?: object; className?: string; autoWidth?: boolean; scrollHeight?: string; filter?: boolean; + filterBy?: string; filterPlaceholder?: string; editable?:boolean; placeholder?: string; @@ -25,6 +25,7 @@ interface DropdownProps { dataKey?: string; inputId?: string; showClear?: boolean; + itemTemplate?(option:any): React.ReactNode; onChange?(e: {originalEvent: Event, value: any}): void; onMouseDown?(event: Event): void; onContextMenu?(event: Event): void; diff --git a/src/components/dropdown/DropdownItem.d.ts b/src/components/dropdown/DropdownItem.d.ts index e78848045f..8abb352e07 100755 --- a/src/components/dropdown/DropdownItem.d.ts +++ b/src/components/dropdown/DropdownItem.d.ts @@ -2,9 +2,9 @@ import React = require("react"); interface DropdownItemProps { option?: object; - template?(option:any): JSX.Element | undefined; selected?: boolean; + template?(option:any): JSX.Element | undefined; onClick?(e: {originalEvent: Event, option: object}): void; } -export class DropdownItem extends React.Component {} \ No newline at end of file +export class DropdownItem extends React.Component {} diff --git a/src/components/editor/Editor.d.ts b/src/components/editor/Editor.d.ts index ce46cd3077..5d79aa6606 100644 --- a/src/components/editor/Editor.d.ts +++ b/src/components/editor/Editor.d.ts @@ -3,14 +3,15 @@ import React = require("react"); interface EditorProps { id?: string, value?: string, - style?: string, + style?: object, className?: string, placeholder?: string, readonly?: boolean, - formats?: Array, + formats?: any[], headerTemplate?: JSX.Element | undefined, - onTextChange?({htmlValue: HTMLElement, textValue: string, delta: any, source: string}): void, - onSelectionChange?({range: any, oldRange: any, source: string}): void; + onTextChange?(e: { htmlValue: string|null, textValue: string, delta: any, source: string }): void, + onSelectionChange?(e: { range: any, oldRange: any, source: string }): void; } -export class Editor extends React.Component {} \ No newline at end of file +export class Editor extends React.Component { +} diff --git a/src/components/gmap/GMap.d.ts b/src/components/gmap/GMap.d.ts index beb6ec0c1c..91ca190578 100644 --- a/src/components/gmap/GMap.d.ts +++ b/src/components/gmap/GMap.d.ts @@ -2,7 +2,7 @@ import React = require("react"); interface GMapProps { options?: object; - overlays?: Array; + overlays?: any[]; style?: object; className?: string; onMapReady?(map: any): void; @@ -15,4 +15,4 @@ interface GMapProps { onOverlayClick?(e: {originalEvent: Event, overlay: any, map: any}): void; } -export class GMap extends React.Component {} \ No newline at end of file +export class GMap extends React.Component {} diff --git a/src/components/growl/Growl.d.ts b/src/components/growl/Growl.d.ts index 2d52599010..b8294ca732 100644 --- a/src/components/growl/Growl.d.ts +++ b/src/components/growl/Growl.d.ts @@ -1,12 +1,12 @@ import React = require("react"); export interface GrowlMessage { - severity: 'success' | 'info' | 'warn' | 'error', - summary: Element | string; - detail: Element | string; - closable: boolean; - sticky: boolean; - life: number; + severity?: 'success' | 'info' | 'warn' | 'error', + summary?: React.ReactNode; + detail?: React.ReactNode; + closable?: boolean; + sticky?: boolean; + life?: number; } interface GrowlProps { @@ -19,4 +19,7 @@ interface GrowlProps { onClose?(message: GrowlMessage): void; } -export class Growl extends React.Component {} \ No newline at end of file +export class Growl extends React.Component { + public show(message: GrowlMessage | GrowlMessage[]): void; + public clear():void; +} diff --git a/src/components/inplace/Inplace.d.ts b/src/components/inplace/Inplace.d.ts index 30e58ecfb9..cff8007b91 100644 --- a/src/components/inplace/Inplace.d.ts +++ b/src/components/inplace/Inplace.d.ts @@ -4,11 +4,17 @@ interface InplaceProps { style?: object; className?: string; active?: boolean; - closble?: boolean; + closable?: boolean; disabled?: boolean; onOpen?(event: Event): void; onClose?(event: Event): void; - onToggle?(e:{event: originalEvent, value: boolean}): void; + onToggle?(e:{originalEvent: Event, value: boolean}): void; } -export class Inplace extends React.Component {} \ No newline at end of file +export class Inplace extends React.Component {} + +// tslint:disable-next-line:max-classes-per-file +export class InplaceDisplay extends React.Component{} + +// tslint:disable-next-line:max-classes-per-file +export class InplaceContent extends React.Component {} diff --git a/src/components/inputtext/InputText.d.ts b/src/components/inputtext/InputText.d.ts index df2478e8a5..417c3e8277 100644 --- a/src/components/inputtext/InputText.d.ts +++ b/src/components/inputtext/InputText.d.ts @@ -2,10 +2,10 @@ import React = require("react"); interface InputTextProps extends React.HTMLProps { [key: string]: any; - onInput?(event: Event): void; - onKeyPress?(event: Event): void; keyfilter?: any; validateOnly?: boolean; + onInput?(event: React.FormEvent): void; + onKeyPress?(event: React.KeyboardEvent): void; } -export class InputText extends React.Component {} \ No newline at end of file +export class InputText extends React.Component {} diff --git a/src/components/lightbox/Lightbox.d.ts b/src/components/lightbox/Lightbox.d.ts index a50aeb7ec1..a22aadb3bd 100644 --- a/src/components/lightbox/Lightbox.d.ts +++ b/src/components/lightbox/Lightbox.d.ts @@ -2,7 +2,7 @@ import React = require("react"); interface LightboxProps { id?: string; - images?: Array; + images?: any[]; type?: string; style?: object; className?: string; @@ -10,4 +10,4 @@ interface LightboxProps { effectDuration?: string; } -export class Lightbox extends React.Component {} \ No newline at end of file +export class Lightbox extends React.Component {} diff --git a/src/components/listbox/ListBox.d.ts b/src/components/listbox/ListBox.d.ts index 901d4c5e64..316374bcc8 100755 --- a/src/components/listbox/ListBox.d.ts +++ b/src/components/listbox/ListBox.d.ts @@ -3,9 +3,8 @@ import React = require("react"); interface ListBoxProps { id?: string, value?: any, - options?: Array, + options?: any[], optionLabel?: string, - itemTemplate?(item: any): JSX.Element | undefined, style?: object, listStyle?: object, className?: string, @@ -14,6 +13,7 @@ interface ListBoxProps { multiple?: boolean, metaKeySelection?: boolean, filter?: boolean, + itemTemplate?(item: any): JSX.Element | undefined, onChange?(e: {originalEvent: Event, value: any}): void; } diff --git a/src/components/megamenu/MegaMenu.d.ts b/src/components/megamenu/MegaMenu.d.ts index 52c47c1116..34b0665315 100644 --- a/src/components/megamenu/MegaMenu.d.ts +++ b/src/components/megamenu/MegaMenu.d.ts @@ -3,7 +3,7 @@ import {MenuItem} from '../menuitem/MenuItem'; interface MegaMenuProps { id?: string; - model?: Array; + model?: MenuItem[]; style?: object; className?: string; orientation?: string; @@ -11,4 +11,4 @@ interface MegaMenuProps { bazeZIndex?: number; } -export class MegaMenu extends React.Component {} \ No newline at end of file +export class MegaMenu extends React.Component {} diff --git a/src/components/menu/Menu.d.ts b/src/components/menu/Menu.d.ts index f5ee6449ac..a8f058311c 100644 --- a/src/components/menu/Menu.d.ts +++ b/src/components/menu/Menu.d.ts @@ -1,9 +1,10 @@ import React = require("react"); import {MenuItem} from '../menuitem/MenuItem'; +import {SyntheticEvent} from "react"; interface MenuProps { id?: string; - model?: Array; + model?: MenuItem[]; popup?: boolean; style?: object; className?: string; @@ -13,4 +14,6 @@ interface MenuProps { onHide?(e: Event): void; } -export class Menu extends React.Component {} \ No newline at end of file +export class Menu extends React.Component { + public toggle(event:SyntheticEvent):void; +} diff --git a/src/components/menubar/Menubar.d.ts b/src/components/menubar/Menubar.d.ts index 6dbd227dab..7de9ab1c7f 100644 --- a/src/components/menubar/Menubar.d.ts +++ b/src/components/menubar/Menubar.d.ts @@ -3,11 +3,11 @@ import {MenuItem} from '../menuitem/MenuItem'; interface MenubarProps { id?: string; - model?: Array; + model?: MenuItem[]; style?: object; className?: string; autoZIndex?: boolean; bazeZIndex?: number; } -export class Menubar extends React.Component {} \ No newline at end of file +export class Menubar extends React.Component {} diff --git a/src/components/menuitem/MenuItem.d.ts b/src/components/menuitem/MenuItem.d.ts index 4863a43380..849af4d9be 100644 --- a/src/components/menuitem/MenuItem.d.ts +++ b/src/components/menuitem/MenuItem.d.ts @@ -1,7 +1,6 @@ export interface MenuItem { label?: string; icon?: string; - command?(e: {originalEvent: Event, item: MenuItem}): void; url?: string; items?: MenuItem[]|MenuItem[][]; disabled?: boolean; @@ -9,4 +8,5 @@ export interface MenuItem { separator?: boolean; style?: any; className?: string; -} \ No newline at end of file + command?(e: {originalEvent: Event, item: MenuItem}): void; +} diff --git a/src/components/messages/Messages.d.ts b/src/components/messages/Messages.d.ts index 66394f0f6e..6af9439ae0 100644 --- a/src/components/messages/Messages.d.ts +++ b/src/components/messages/Messages.d.ts @@ -1,11 +1,24 @@ import React = require("react"); +interface Message { + id?: string; + severity?: 'success' | 'info' | 'warn' | 'error', + summary?: React.ReactNode; + detail?: React.ReactNode; + closable?: boolean; + sticky?: boolean; + life?: number; +} + interface MessagesProps { id?: string; className?: string; style?: object; - onRemove?(message:any): void; - onClick?(message:any): void; + onRemove?(message: Message): void; + onClick?(message: Message): void; } -export class Messages extends React.Component {} \ No newline at end of file +export class Messages extends React.Component { + public show(message: Message | Message[]): void; + public clear(): void; +} diff --git a/src/components/multiselect/MultiSelect.d.ts b/src/components/multiselect/MultiSelect.d.ts index c89f76720b..2e92cde47c 100755 --- a/src/components/multiselect/MultiSelect.d.ts +++ b/src/components/multiselect/MultiSelect.d.ts @@ -3,7 +3,7 @@ import React = require("react"); interface MultiSelectProps { id?: string; value?: any; - options?: Array; + options?: any[]; optionLabel?: string; style?: object; className?: string; @@ -17,4 +17,4 @@ interface MultiSelectProps { onChange?(e: {originalEvent: Event, value: any}): void; } -export class MultiSelect extends React.Component {} \ No newline at end of file +export class MultiSelect extends React.Component {} diff --git a/src/components/orderlist/OrderList.d.ts b/src/components/orderlist/OrderList.d.ts index 2c876561bf..2d46e26d63 100755 --- a/src/components/orderlist/OrderList.d.ts +++ b/src/components/orderlist/OrderList.d.ts @@ -2,7 +2,7 @@ import React = require("react"); interface OrderListProps { id?: string; - value?: Array; + value?: any[]; header?: any; style?: object; className?: string; @@ -13,4 +13,4 @@ interface OrderListProps { itemTemplate?(item: any): JSX.Element | undefined; } -export class OrderList extends React.Component {} \ No newline at end of file +export class OrderList extends React.Component {} diff --git a/src/components/organizationchart/OrganizationChart.d.ts b/src/components/organizationchart/OrganizationChart.d.ts index b60e14f352..90bd58e751 100644 --- a/src/components/organizationchart/OrganizationChart.d.ts +++ b/src/components/organizationchart/OrganizationChart.d.ts @@ -1,16 +1,25 @@ import React = require("react"); +export interface OrganizationChartNodeData { + className?: string, + expanded?: boolean, + children?: OrganizationChartNodeData[] + selectable?: boolean + label?: string, +} + interface OrganizationChartProps { id?: string; - value?: any; + value?: OrganizationChartNodeData[]; style?: object; className?: string; selectionMode?: string; selection?: any; - nodeTemplate?: any; + nodeTemplate?(node: OrganizationChartNodeData): React.ReactNode; selectionChange?(data: any): void; - onNodeSelect?(e: {originalEvent: Event, node: any}): void; - onNodeUnselect?(e: {originalEvent: Event, node: any}): void; + onNodeSelect?(e: { originalEvent: Event, node: any }): void; + onNodeUnselect?(e: { originalEvent: Event, node: any }): void; } -export class OrganizationChart extends React.Component {} \ No newline at end of file +export class OrganizationChart extends React.Component { +} diff --git a/src/components/overlaypanel/OverlayPanel.d.ts b/src/components/overlaypanel/OverlayPanel.d.ts index c316b08bd3..db05641b1b 100644 --- a/src/components/overlaypanel/OverlayPanel.d.ts +++ b/src/components/overlaypanel/OverlayPanel.d.ts @@ -1,4 +1,5 @@ import React = require("react"); +import {SyntheticEvent} from "react"; interface OverlayPanelProps { id?: string; @@ -9,4 +10,6 @@ interface OverlayPanelProps { appendTo?: any; } -export class OverlayPanel extends React.Component {} \ No newline at end of file +export class OverlayPanel extends React.Component { + public toggle(event:SyntheticEvent):void; +} diff --git a/src/components/paginator/Paginator.d.ts b/src/components/paginator/Paginator.d.ts index 2129b75cf5..096bdb1475 100644 --- a/src/components/paginator/Paginator.d.ts +++ b/src/components/paginator/Paginator.d.ts @@ -1,17 +1,24 @@ import React = require("react"); +export interface PageState{ + first: number, + rows: number, + page: number, + pageCount: number +} + interface PaginatorProps { totalRecords?: number; rows?: number; first?: number; pageLinkSize?: number; - rowsPerPageOptions?: Array; + rowsPerPageOptions?: any[]; style?: object; className?: string; template?: string; - onPageChange?(event: Event): void; - leftContent: JSX.Element | undefined; - rightContent: JSX.Element | undefined; + leftContent?: JSX.Element | undefined; + rightContent?: JSX.Element | undefined; + onPageChange?(event: PageState): void; } -export class Paginator extends React.Component {} \ No newline at end of file +export class Paginator extends React.Component {} diff --git a/src/components/panelmenu/PanelMenu.d.ts b/src/components/panelmenu/PanelMenu.d.ts index bc68cb310f..1dd3d86f9b 100644 --- a/src/components/panelmenu/PanelMenu.d.ts +++ b/src/components/panelmenu/PanelMenu.d.ts @@ -3,9 +3,9 @@ import {MenuItem} from '../menuitem/MenuItem'; interface PanelMenuProps { id?: string; - model?: Array; + model?: MenuItem[]; style?: object; className?: string; } -export class PanelMenu extends React.Component {} \ No newline at end of file +export class PanelMenu extends React.Component {} diff --git a/src/components/picklist/PickList.d.ts b/src/components/picklist/PickList.d.ts index 1782de1505..10fbfffea5 100755 --- a/src/components/picklist/PickList.d.ts +++ b/src/components/picklist/PickList.d.ts @@ -2,8 +2,8 @@ import React = require("react"); interface PickListProps { id?: string; - source?: Array; - target?: Array; + source?: any[]; + target?: any[]; sourceHeader?: any; targetHeader?: any; style?: object; diff --git a/src/components/picklist/PickListControls.d.ts b/src/components/picklist/PickListControls.d.ts index 91b040e70e..f2176745e7 100644 --- a/src/components/picklist/PickListControls.d.ts +++ b/src/components/picklist/PickListControls.d.ts @@ -2,9 +2,9 @@ import React = require("react"); interface PickListControlsProps { className?: string; - list?: Array; - selection?: Array; + list?: any[]; + selection?: any[]; onReorder?(e: {originalEvent: Event, value: any, direction: string}): void; } -export class PickListControls extends React.Component {} \ No newline at end of file +export class PickListControls extends React.Component {} diff --git a/src/components/picklist/PickListItem.d.ts b/src/components/picklist/PickListItem.d.ts index 208ea1deb5..a7c58fcdd3 100755 --- a/src/components/picklist/PickListItem.d.ts +++ b/src/components/picklist/PickListItem.d.ts @@ -3,9 +3,9 @@ import React = require("react"); interface PickListItemProps { value?: any; className?: string; - template?(item: any): JSX.Element | undefined; selected?: boolean; + template?(item: any): JSX.Element | undefined; onClick?(e: {originalEvent: Event, value: any}): void; } -export class PickListItem extends React.Component {} \ No newline at end of file +export class PickListItem extends React.Component {} diff --git a/src/components/picklist/PickListSubList.d.ts b/src/components/picklist/PickListSubList.d.ts index 9f347bae62..b5d0dfd40c 100755 --- a/src/components/picklist/PickListSubList.d.ts +++ b/src/components/picklist/PickListSubList.d.ts @@ -1,8 +1,8 @@ import React = require("react"); interface PickListSubListProps { - list?: Array; - selection?: Array; + list?: any[]; + selection?: any[]; header?: string; className?: string; listClassName?: string; @@ -11,7 +11,7 @@ interface PickListSubListProps { metaKeySelection?: boolean; itemTemplate?(item: any): JSX.Element | undefined; onItemClick?(): void; - onSelectionChange?({event: Event, value: any}): void; + onSelectionChange?(e: {event: Event, value: any}): void; } -export class PickListSubList extends React.Component {} \ No newline at end of file +export class PickListSubList extends React.Component {} diff --git a/src/components/picklist/PickListTransferControls.d.ts b/src/components/picklist/PickListTransferControls.d.ts index c17bf882f8..6a62385a73 100644 --- a/src/components/picklist/PickListTransferControls.d.ts +++ b/src/components/picklist/PickListTransferControls.d.ts @@ -1,11 +1,11 @@ import React = require("react"); interface PickListTransferControlsProps { - source?: Array; - target?: Array; - sourceSelection?: Array; - targetSelection?: Array; - onTransfer?: Array; + source?: any[]; + target?: any[]; + sourceSelection?: any[]; + targetSelection?: any[]; + onTransfer?: any[]; } -export class PickListTransferControls extends React.Component {} \ No newline at end of file +export class PickListTransferControls extends React.Component {} diff --git a/src/components/radiobutton/RadioButton.d.ts b/src/components/radiobutton/RadioButton.d.ts index 21bd8c3056..a14f2cf537 100644 --- a/src/components/radiobutton/RadioButton.d.ts +++ b/src/components/radiobutton/RadioButton.d.ts @@ -5,11 +5,11 @@ interface RadioButtonProps { inputId?: string; name?: string; value?: any; - checked: boolean; + checked?: boolean; style?: object; className?: string; disabled?: boolean; - onChange({originalEvent: Event, value: any, checked: boolean}): void; + onChange(e: {originalEvent: Event, value: any, checked: boolean}): void; } -export class RadioButton extends React.Component {} \ No newline at end of file +export class RadioButton extends React.Component {} diff --git a/src/components/rating/Rating.d.ts b/src/components/rating/Rating.d.ts index 45e834a26f..c6e67f2325 100644 --- a/src/components/rating/Rating.d.ts +++ b/src/components/rating/Rating.d.ts @@ -2,14 +2,14 @@ import React = require("react"); interface RatingProps { id?: string; - value?: string; + value?: number; disabled?: boolean; readonly?: boolean; stars?: number; cancel?: boolean; style?: object; className?: string; - onChange?(e: {originalEvent: Event, value: string}): void; + onChange?(e: {originalEvent: Event, value: number}): void; } -export class Rating extends React.Component {} \ No newline at end of file +export class Rating extends React.Component {} diff --git a/src/components/schedule/Schedule.d.ts b/src/components/schedule/Schedule.d.ts index d63331a6c5..ef45a47156 100644 --- a/src/components/schedule/Schedule.d.ts +++ b/src/components/schedule/Schedule.d.ts @@ -2,13 +2,13 @@ import React = require("react"); interface ScheduleProps { id?: string; - events?: Array; + events?: any[]; header?: any; style?: object; className?: string; isRTL?: boolean; weekends?: boolean; - hiddenDays?: Array; + hiddenDays?: any[]; fixedWeekCount?: boolean; weekNumbers?: boolean; businessHours?: any; @@ -37,11 +37,11 @@ interface ScheduleProps { dragScroll?: boolean; eventOverlap?: any; eventConstraint?: any; - eventRender?(): void; - dayRender?(): void; locale?: object; timezone?: any; options?: object; + eventRender?(): void; + dayRender?(): void; onDayClick?(): void; onEventClick?(): void; onEventMouseover?(): void; diff --git a/src/components/selectbutton/SelectButton.d.ts b/src/components/selectbutton/SelectButton.d.ts index e7133dd387..37b3daaa4d 100644 --- a/src/components/selectbutton/SelectButton.d.ts +++ b/src/components/selectbutton/SelectButton.d.ts @@ -3,7 +3,7 @@ import React = require("react"); interface SelectButtonProps { id?: string; value?: any; - options?: Array; + options?: any[]; optionLabel?: string; tabIndex?: string; multiple?: boolean; @@ -14,4 +14,4 @@ interface SelectButtonProps { onChange?(e: {originalEvent: Event, value: any}): void; } -export class SelectButton extends React.Component {} \ No newline at end of file +export class SelectButton extends React.Component {} diff --git a/src/components/slidemenu/SlideMenu.d.ts b/src/components/slidemenu/SlideMenu.d.ts index d357783e37..6d3c1aca82 100644 --- a/src/components/slidemenu/SlideMenu.d.ts +++ b/src/components/slidemenu/SlideMenu.d.ts @@ -1,9 +1,10 @@ import React = require("react"); import {MenuItem} from '../menuitem/MenuItem'; +import {SyntheticEvent} from "react"; interface SlideMenuProps { id?: string; - model?: Array; + model?: MenuItem[]; popup?: boolean; style?: object; className?: string; @@ -18,4 +19,8 @@ interface SlideMenuProps { onHide?(e: Event): void; } -export class SlideMenu extends React.Component {} \ No newline at end of file +export class SlideMenu extends React.Component { + public show(event:SyntheticEvent):void; + public hide(event:SyntheticEvent):void; + public toggle(event:SyntheticEvent):void; +} diff --git a/src/components/slider/Slider.d.ts b/src/components/slider/Slider.d.ts index abdbc2cb37..8903eb2f87 100644 --- a/src/components/slider/Slider.d.ts +++ b/src/components/slider/Slider.d.ts @@ -2,7 +2,7 @@ import React = require("react"); interface SliderProps { id?: string; - value?: number; + value?: number|[number, number]; animate?: boolean; min?: number; max?: number; @@ -11,7 +11,7 @@ interface SliderProps { range?: boolean; style?: object; className?: string; - onChange?(e: {originalEvent: Event, value: any}): void; + onChange?(e: {originalEvent: Event, value: number|[number, number]}): void; } -export class Slider extends React.Component {} \ No newline at end of file +export class Slider extends React.Component {} diff --git a/src/components/splitbutton/SplitButton.d.ts b/src/components/splitbutton/SplitButton.d.ts index 78db53d570..21316fa734 100644 --- a/src/components/splitbutton/SplitButton.d.ts +++ b/src/components/splitbutton/SplitButton.d.ts @@ -4,7 +4,7 @@ interface SplitButtonProps { id?: string; label?: string; icon?: string; - model?: Array; + model?: any[]; disabled?: boolean; style?: object; className?: string; @@ -15,4 +15,4 @@ interface SplitButtonProps { onClick?(event: Event): void; } -export class SplitButton extends React.Component {} \ No newline at end of file +export class SplitButton extends React.Component {} diff --git a/src/components/steps/Steps.d.ts b/src/components/steps/Steps.d.ts index a49db1f9b9..a501d60b70 100644 --- a/src/components/steps/Steps.d.ts +++ b/src/components/steps/Steps.d.ts @@ -3,12 +3,12 @@ import {MenuItem} from '../menuitem/MenuItem'; interface StepsProps { id?: string; - model: Array; + model: MenuItem[]; activeIndex?: number; readOnly?: boolean; style?: object; className?: string; - onSelect?(e: {originalEvent: Event, item: any, index: any}): void; + onSelect?(e: {originalEvent: Event, item: MenuItem, index: number}): void; } -export class Steps extends React.Component {} \ No newline at end of file +export class Steps extends React.Component {} diff --git a/src/components/tabmenu/TabMenu.d.ts b/src/components/tabmenu/TabMenu.d.ts index b9a964e384..4f4ad9ded9 100644 --- a/src/components/tabmenu/TabMenu.d.ts +++ b/src/components/tabmenu/TabMenu.d.ts @@ -3,11 +3,11 @@ import {MenuItem} from '../menuitem/MenuItem'; interface TabMenuProps { id?: string; - model?: Array; + model?: MenuItem[]; activeItem?: any; style?: any; className?: string; onTabChange?(e: { originalEvent: Event, value: any}): void; } -export class TabMenu extends React.Component {} \ No newline at end of file +export class TabMenu extends React.Component {} diff --git a/src/components/tabview/TabView.d.ts b/src/components/tabview/TabView.d.ts index 877d94004c..45cf99e389 100644 --- a/src/components/tabview/TabView.d.ts +++ b/src/components/tabview/TabView.d.ts @@ -11,13 +11,16 @@ interface TabPanelProps { contentClassName?: string; } +export class TabPanel extends React.Component {} + interface TabViewProps { id?: string; activeIndex?: number; style?: any; className?: string; - onTabChange?(e: {event: originalEvent, index: number}): void; + effect?: string; + onTabChange?(e: {originalEvent: Event, index: number}): void; } -export class TabPanel extends React.Component {} -export class TabView extends React.Component {} \ No newline at end of file +// tslint:disable-next-line:max-classes-per-file +export class TabView extends React.Component {} diff --git a/src/components/tieredmenu/TieredMenu.d.ts b/src/components/tieredmenu/TieredMenu.d.ts index b63bdf5e70..ec2a134b4f 100644 --- a/src/components/tieredmenu/TieredMenu.d.ts +++ b/src/components/tieredmenu/TieredMenu.d.ts @@ -1,9 +1,10 @@ import React = require("react"); import {MenuItem} from '../menuitem/MenuItem'; +import {SyntheticEvent} from "react"; interface TieredMenuProps { id?: string; - model?: Array; + model?: MenuItem[]; popup?: boolean; style?: object; className?: string; @@ -13,4 +14,6 @@ interface TieredMenuProps { onHide?(e: Event): void; } -export class TieredMenu extends React.Component {} \ No newline at end of file +export class TieredMenu extends React.Component { + public toggle(event: SyntheticEvent): void; +} diff --git a/src/components/tooltip/Tooltip.d.ts b/src/components/tooltip/Tooltip.d.ts index b25dd00fbf..a5fb21392c 100644 --- a/src/components/tooltip/Tooltip.d.ts +++ b/src/components/tooltip/Tooltip.d.ts @@ -1,4 +1,5 @@ import React = require("react"); +import {SyntheticEvent} from "react"; interface TooltipProps { for?: any; @@ -12,7 +13,7 @@ interface TooltipProps { escape?: boolean; hideDelay?: number; showDelay?: number; - onBeforeShow?(e: Event): void; + onBeforeShow?(e: SyntheticEvent): void; } -export class Tooltip extends React.Component {} \ No newline at end of file +export class Tooltip extends React.Component {} diff --git a/src/components/tree/Tree.d.ts b/src/components/tree/Tree.d.ts index f77123f0b2..f53202798f 100644 --- a/src/components/tree/Tree.d.ts +++ b/src/components/tree/Tree.d.ts @@ -5,17 +5,17 @@ interface TreeProps { value: any; selectionMode?: string; selection?: any; - selectionChange(e: {originalEvent: Event, selection: any}): void; layout?: string; - onNodeSelect?(e: {originalEvent: Event, node: any}): void; - onNodeUnselect?(e: {originalEvent: Event, node: any}): void; - onNodeExpand?(): void; - onNodeCollapse?(): void; style?: object; className?: string; metaKeySelection?: boolean; propagateSelectionUp?: boolean; propagateSelectionDown?: boolean; + selectionChange?(e: {originalEvent: Event, selection: any}): void; + onNodeSelect?(e: {originalEvent: Event, node: any}): void; + onNodeUnselect?(e: {originalEvent: Event, node: any}): void; + onNodeExpand?(): void; + onNodeCollapse?(): void; } -export class Tree extends React.Component {} \ No newline at end of file +export class Tree extends React.Component {} diff --git a/src/components/treetable/TreeTable.d.ts b/src/components/treetable/TreeTable.d.ts index 3b46e471bb..0d92fa9cb8 100644 --- a/src/components/treetable/TreeTable.d.ts +++ b/src/components/treetable/TreeTable.d.ts @@ -1,13 +1,17 @@ import React = require("react"); +interface Node { + data: any, + children: Node[] +} + interface TreeTableProps { id?: string; - value?: any; + value: Node | Node[]; labelExpand?: string; labelCollapse?: string; selectionMode?: string; selection?: any; - selectionChange(e: {originalEvent: Event, selection: any}): void; style?: object; className?: string; metaKeySelection?: boolean; @@ -17,11 +21,13 @@ interface TreeTableProps { sortOrder?: number; multiSortMeta?: string; sortMode?: string; - onSort?(e: {sortField: string, sortOrder: number, multiSortMeta: any}): void; - onNodeSelect?(e: {originalEvent: Event, node: any}): void; - onNodeUnselect?(e: {originalEvent: Event, node: any}): void; - onNodeExpand?(e: {originalEvent: Event, node: any}): void; - onNodeCollapse?(e: {originalEvent: Event, node: any}): void; + selectionChange?(e: { originalEvent: Event, selection: any }): void; + onSort?(e: { sortField: string, sortOrder: number, multiSortMeta: any }): void; + onNodeSelect?(e: { originalEvent: Event, node: any }): void; + onNodeUnselect?(e: { originalEvent: Event, node: any }): void; + onNodeExpand?(e: { originalEvent: Event, node: any }): void; + onNodeCollapse?(e: { originalEvent: Event, node: any }): void; } -export class TreeTable extends React.Component {} \ No newline at end of file +export class TreeTable extends React.Component { +} diff --git a/src/components/tristatecheckbox/TriStateCheckbox.d.ts b/src/components/tristatecheckbox/TriStateCheckbox.d.ts index e60ec984e7..8e0d1d7cc7 100644 --- a/src/components/tristatecheckbox/TriStateCheckbox.d.ts +++ b/src/components/tristatecheckbox/TriStateCheckbox.d.ts @@ -3,7 +3,7 @@ import React = require("react"); interface TriStateCheckboxProps { id?: string; inputId?: string; - value?: boolean; + value?: boolean | null; name?: string; style?: object; className?: string; diff --git a/src/components/util.d.ts b/src/components/util.d.ts new file mode 100644 index 0000000000..3e4c505231 --- /dev/null +++ b/src/components/util.d.ts @@ -0,0 +1 @@ +export type Omit = Pick>;