carbon-components-svelte
Version:
Svelte implementation of the Carbon Design System
48 lines (38 loc) • 1.14 kB
TypeScript
import type { SvelteComponentTyped } from "svelte";
import type { SvelteHTMLElements } from "svelte/elements";
export type ListBoxSelectionTranslationId = "clearAll" | "clearSelection";
type $RestProps = SvelteHTMLElements["div"];
type $Props = {
/**
* Specify the number of selected items
* @default undefined
*/
selectionCount?: number;
/**
* Set to `true` to disable the list box selection
* @default false
*/
disabled?: boolean;
/**
* Override the default translation ids
* @default (id) => defaultTranslations[id]
*/
translateWithId?: (id: ListBoxSelectionTranslationId) => string;
/**
* Obtain a reference to the top-level HTML element
* @default null
*/
ref?: null | HTMLDivElement;
[key: `data-${string}`]: any;
};
export type ListBoxSelectionProps = Omit<$RestProps, keyof $Props> & $Props;
export default class ListBoxSelection extends SvelteComponentTyped<
ListBoxSelectionProps,
{ clear: CustomEvent<KeyboardEvent | MouseEvent> },
{}
> {
/**
* Default translation ids
*/
translationIds: { clearAll: "clearAll"; clearSelection: "clearSelection" };
}