fix(types): strongly type translateWithId parameters (#1284)

This commit is contained in:
metonym 2022-05-04 07:31:51 -07:00 committed by GitHub
commit 0c39506dcb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 112 additions and 92 deletions

View file

@ -113,22 +113,27 @@ export interface ComboBoxProps
shouldFilterItem?: (item: ComboBoxItem, value: string) => boolean;
/**
* Override the default translation ids
* Override the chevron icon label based on the open state.
* Defaults to "Open menu" when closed and "Close menu" when open
* @default undefined
*/
translateWithId?: (id: any) => string;
translateWithId?: (
id: import("../ListBox/ListBoxMenuIcon.svelte").ListBoxMenuIconTranslationId
) => string;
/**
* Override the default translation ids for the menu
* Override the menu label based on the open state.
* Defaults to "Open menu" and "Close menu"
* @default undefined
*/
translateWithIdMenu?: (id: any) => string;
/**
* Override the default translation ids for the input
* Override the label of the clear button when the input has a selection.
* Defaults to "Clear selected item"
* @default undefined
*/
translateWithIdInput?: (id: any) => string;
translateWithIdInput?: (id: "clearSelection") => string;
/**
* Set an id for the list box component

View file

@ -123,10 +123,13 @@ export interface MultiSelectProps
| (() => void);
/**
* Override the default translation ids
* Override the chevron icon label based on the open state.
* Defaults to "Open menu" when closed and "Close menu" when open
* @default undefined
*/
translateWithId?: (id: any) => string;
translateWithId?: (
id: import("../ListBox/ListBoxMenuIcon.svelte").ListBoxMenuIconTranslationId
) => string;
/**
* Override the default translation ids for the menu
@ -135,10 +138,13 @@ export interface MultiSelectProps
translateWithIdMenu?: (id: any) => string;
/**
* Override the default translation ids for the input
* Override the label of the clear button when the input has a selection.
* Defaults to "Clear selected item" and "Clear all items"
* @default undefined
*/
translateWithIdInput?: (id: any) => string;
translateWithIdInput?: (
id: import("../ListBox/ListBoxSelection.svelte").ListBoxSelectionTranslationId
) => string;
/**
* Specify the title text