@public-ui/components
Version:
Contains all web components that belong to KoliBri - The accessible HTML-Standard.
42 lines (41 loc) • 1.67 kB
TypeScript
import type { Generic } from 'adopted-style-sheets';
import type { Callback } from '../enums';
import type { PropCustomClass, PropLabel, PropMax, PropTooltipAlign } from '../props';
import type { EventValueOrEventCallback, Option, Stringified } from '../types';
export type KoliBriPaginationButtonCallbacks = {
[Callback.onClick]?: EventValueOrEventCallback<Event, number>;
onChangePage?: EventValueOrEventCallback<Event, number>;
onChangePageSize?: EventValueOrEventCallback<Event, number>;
};
export type PaginationHasButton = {
first: boolean;
last: boolean;
next: boolean;
previous: boolean;
};
type RequiredProps = {
on: KoliBriPaginationButtonCallbacks;
page: number;
} & PropMax;
type OptionalProps = {
boundaryCount: number;
hasButtons: boolean | Stringified<PaginationHasButton>;
pageSize: number;
pageSizeOptions: Stringified<number[]>;
siblingCount: number;
} & PropCustomClass & PropLabel & PropTooltipAlign;
export type KoliBriPaginationProps = RequiredProps & OptionalProps;
type RequiredStates = {
boundaryCount: number;
hasButtons: PaginationHasButton;
page: number;
pageSize: number;
pageSizeOptions: Option<number>[];
on: KoliBriPaginationButtonCallbacks;
siblingCount: number;
} & PropLabel & PropMax;
type OptionalStates = PropCustomClass & PropTooltipAlign;
export type PaginationProps = Generic.Element.Members<RequiredProps, OptionalProps>;
export type PaginationStates = Generic.Element.Members<RequiredStates, OptionalStates>;
export type PaginationAPI = Generic.Element.ComponentApi<RequiredProps, OptionalProps, RequiredStates, OptionalStates>;
export {};