carbon-components-svelte/types/PaginationNav/PaginationNav.svelte.d.ts
Eric Liu 7fdc2ef7f0
fix(types): allow data-* attributes for props forwarded to HTML elements (#1741)
* chore(deps-dev): upgrade `sveld` to v0.18.1

* Run "yarn build:docs"

* test: assert that `data-*` attributes are valid
2023-07-08 16:41:44 -07:00

60 lines
1.3 KiB
TypeScript

/// <reference types="svelte" />
import type { SvelteComponentTyped } from "svelte";
export interface PaginationNavProps
extends svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["nav"]> {
/**
* Specify the current page index
* @default 1
*/
page?: number;
/**
* Specify the total number of pages
* @default 10
*/
total?: number;
/**
* Specify the total number of pages to show
* @default 10
*/
shown?: number;
/**
* Set to `true` to loop the navigation
* @default false
*/
loop?: boolean;
/**
* Specify the forward button text
* @default "Next page"
*/
forwardText?: string;
/**
* Specify the backward button text
* @default "Previous page"
*/
backwardText?: string;
/**
* Set the position of the tooltip relative to the pagination buttons.
* @default "bottom"
*/
tooltipPosition?: "top" | "right" | "bottom" | "left" | "outside" | "inside";
[key: `data-${string}`]: any;
}
export default class PaginationNav extends SvelteComponentTyped<
PaginationNavProps,
{
/** fires after every user interaction */
change: CustomEvent<{ page: number }>;
["click:button--previous"]: CustomEvent<{ page: number }>;
["click:button--next"]: CustomEvent<{ page: number }>;
},
{}
> {}