Skip to content

Commit

Permalink
Fixed #1695 - Update all .d.ts files for events and slots
Browse files Browse the repository at this point in the history
  • Loading branch information
tugcekucukoglu committed Oct 25, 2021
1 parent e8b012f commit 56285f0
Show file tree
Hide file tree
Showing 33 changed files with 478 additions and 101 deletions.
52 changes: 43 additions & 9 deletions src/components/autocomplete/AutoComplete.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { VNode } from 'vue';
import { VirtualScrollerProps } from '../virtualscroller';
import VirtualScrollerProps from '../virtualscroller';

interface AutoCompleteProps {
modelValue?: any;
Expand All @@ -25,6 +24,41 @@ interface AutoCompleteProps {
virtualScrollerOptions?: VirtualScrollerProps;
}

interface AutoCompleteItemSlotInterface {
item: any;
index: number;
}

interface AutoCompleteOptionGroupInterface {
item: any;
index: number;
}

interface AutoCompleteHeaderInterface {
value: any;
suggestions: any;
}

interface AutoCompleteFooterInterface {
value: any;
suggestions: any;
}

interface AutoCompleteChipInterface {
value: any;
}

interface AutoCompleteContentInterface {
items: any;
styleClass: string;
contentRef: string;
getItemOptions: any;
}

interface AutoCompleteLoaderInterface {
options: any[];
}

declare class AutoComplete {
$props: AutoCompleteProps;
$emit(eventName: 'update:modelValue', value: any): this;
Expand All @@ -34,13 +68,13 @@ declare class AutoComplete {
$emit(eventName: 'complete', e: {originalEvent: Event, query: string}): this;
$emit(eventName: 'clear'): this;
$slots: {
item: VNode[];
optiongroup: VNode[];
header: VNode[];
footer: VNode[];
chip: VNode[];
content: VNode[];
loader: VNode[];
item: AutoCompleteItemSlotInterface;
optiongroup: AutoCompleteOptionGroupInterface;
header: AutoCompleteHeaderInterface;
footer: AutoCompleteFooterInterface;
chip: AutoCompleteChipInterface;
content: AutoCompleteContentInterface;
loader: AutoCompleteLoaderInterface;
};
}

Expand Down
7 changes: 7 additions & 0 deletions src/components/breadcrumb/Breadcrumb.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,15 @@ interface BreadcrumbProps {
exact?: boolean;
}

interface BreadcrumbItemSlotInterface {
item: any;
}

declare class Breadcrumb {
$props: BreadcrumbProps;
$slots: {
item: BreadcrumbItemSlotInterface
}
}

export default Breadcrumb;
6 changes: 5 additions & 1 deletion src/components/calendar/Calendar.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ interface CalendarProps {
keepInvalid?: boolean;
}

interface CalendarDateSlotInterface {
date: any;
}

declare class Calendar {
$props: CalendarProps;
$emit(eventName: 'update:modelValue', value: Date | Date[]): this;
Expand All @@ -57,7 +61,7 @@ declare class Calendar {
$emit(eventName: 'clear-click', event: Event): this;
$slots: {
header: VNode[];
date: VNode[];
date: CalendarDateSlotInterface;
footer: VNode[];
};
}
Expand Down
7 changes: 6 additions & 1 deletion src/components/carousel/Carousel.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,16 @@ interface CarouselProps {
autoplayInterval?: number;
}

interface CarouselItemSlotInterface {
data: any;
index: number;
}

declare class Carousel {
$props: CarouselProps;
$emit(eventName: 'update:page', value: number): this;
$slots: {
item: VNode[];
item: CarouselItemSlotInterface;
header: VNode[];
footer: VNode[];
}
Expand Down
13 changes: 11 additions & 2 deletions src/components/cascadeselect/CascadeSelect.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,15 @@ interface CascadeSelectProps {
loadingIcon?: string;
}

interface CascadeSelectOptionSlotInterface {
option: any;
}

interface CascadeSelectValueSlotInterface {
value: any;
placeholder: string;
}

declare class CascadeSelect {
$props: CascadeSelectProps;
$emit(eventName: 'update:modelValue', value: string): this;
Expand All @@ -29,8 +38,8 @@ declare class CascadeSelect {
$emit(eventName: 'show'): this;
$emit(eventName: 'hide'): this;
$slot: {
option: VNode[];
value: VNode[];
option: CascadeSelectOptionSlotInterface;
value: CascadeSelectValueSlotInterface;
indicator: VNode[];
}
}
Expand Down
6 changes: 5 additions & 1 deletion src/components/chips/Chips.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,17 @@ interface ChipsProps {
style?: any;
}

interface ChipsChipSlotInterface {
value: any;
}

declare class Chips {
$props: ChipsProps;
$emit(eventName: 'update:modelValue', value: any[]): this;
$emit(eventName: 'add', e: { originalEvent: Event, value: any }): this;
$emit(eventName: 'remove', e: { originalEvent: Event, value: any }): this;
$slots: {
chip: VNode[];
chip: ChipsChipSlotInterface;
}
}

Expand Down
53 changes: 42 additions & 11 deletions src/components/column/Column.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { VNode } from 'vue';

interface ColumnProps {
columnKey?: any;
field?: string | ((item: any) => any);
Expand Down Expand Up @@ -45,18 +43,51 @@ interface ColumnProps {
hidden?: boolean;
}

interface ColumnBodySlotInterface {
data: any;
column: any;
field: string;
index: number;
frozenRow: boolean;
}

interface ColumnHeaderSlotInterface {
column: any;
}

interface ColumnFooterSlotInterface {
column: any;
}

interface ColumnEditorSlotInterface {
data: any;
column: any;
field: string;
index: number;
frozenRow: boolean;
}

interface ColumnFilterSlotInterface {
field: string;
filterModel: {
value: any;
matchMode: string;
};
filterCallback: any;
}

declare class Column {
$props: ColumnProps;
$slots: {
body: VNode[];
header: VNode[];
footer: VNode[];
editor: VNode[];
filter: VNode[];
filterheader: VNode[];
filterfooter: VNode[];
filterclear: VNode[];
filterapply: VNode[];
body: ColumnBodySlotInterface;
header: ColumnHeaderSlotInterface;
footer: ColumnFooterSlotInterface;
editor: ColumnEditorSlotInterface;
filter: ColumnFilterSlotInterface;
filterheader: ColumnFilterSlotInterface;
filterfooter: ColumnFilterSlotInterface;
filterclear: ColumnFilterSlotInterface;
filterapply: ColumnFilterSlotInterface;
}
}

Expand Down
6 changes: 5 additions & 1 deletion src/components/contextmenu/ContextMenu.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,14 @@ interface ContextMenuProps {
exact?: boolean;
}

interface ContextMenuItemSlotInterface {
item: object;
}

declare class ContextMenu {
$props: ContextMenuProps;
$slots: {
item: VNode[];
item: ContextMenuItemSlotInterface;
}
toggle(event: Event): void;
show(event: Event, target?: any): void;
Expand Down
35 changes: 30 additions & 5 deletions src/components/datatable/DataTable.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,29 @@ interface DataTableProps {
stripedRows?: boolean;
}

interface DataTableHeaderSlotInterface {
column: any;
}

interface DataTableFooterSlotInterface {
column: any;
}

interface DataTableGroupHeaderSlotInterface {
data: any;
index: number;
}

interface DataTableGroupFooterSlotInterface {
data: any;
index: number;
}

interface DataTableExpansionSlotInterface {
data: any;
index: number;
}

declare class DataTable {
$props: DataTableProps;

Expand Down Expand Up @@ -104,16 +127,18 @@ declare class DataTable {
$emit(eventName: 'state-restore', value: any[]): this;
$emit(eventName: 'state-save', value: any[]): this;

exportCSV(options?: any): void;

$slots: {
header: VNode[];
header: DataTableHeaderSlotInterface;
footer: DataTableFooterSlotInterface;
paginatorLeft: VNode[];
paginatorRight: VNode[];
empty: VNode[];
footer: VNode[];
groupheader: VNode[];
groupfooter: VNode[];
groupheader: DataTableGroupHeaderSlotInterface;
groupfooter: DataTableGroupFooterSlotInterface;
loading: VNode[];
expansion: VNode[];
expansion: DataTableExpansionSlotInterface;
};
}

Expand Down
9 changes: 7 additions & 2 deletions src/components/dataview/DataView.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ interface DataViewProps {
lazy?: boolean;
}

interface DataViewSlotInterface {
data: any;
index: number;
}

declare class DataView {
$props: DataViewProps;
$emit(eventName: 'update:first', value: number): this;
Expand All @@ -27,8 +32,8 @@ declare class DataView {
header: VNode[];
paginatorLeft: VNode[];
paginatorRight: VNode[];
list: VNode[];
grid: VNode[];
list: DataViewSlotInterface;
grid: DataViewSlotInterface;
empty: VNode[];
footer: VNode[];
}
Expand Down
12 changes: 10 additions & 2 deletions src/components/dock/Dock.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,19 @@ interface DockProps {
tooltipOptions?: any;
}

interface DockItemSlotInterface {
item: any;
}

interface DockIconSlotInterface {
item: any;
}

declare class Dock {
$props: DockProps;
$slots: {
'item': VNode[];
'icon': VNode[];
item: DockItemSlotInterface;
icon: DockIconSlotInterface;
}
}

Expand Down
Loading

0 comments on commit 56285f0

Please sign in to comment.