mirror of
https://github.com/Choices-js/Choices.git
synced 2024-06-19 22:25:09 +02:00
Add types to constants
This commit is contained in:
parent
46a4987997
commit
9d14f568d5
|
@ -1,5 +1,11 @@
|
||||||
import { sanitise, sortByAlpha } from './lib/utils';
|
import { sanitise, sortByAlpha } from './lib/utils';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @typedef {import('../../types/index').Choices.ClassNames} ClassNames
|
||||||
|
* @typedef {import('../../types/index').Choices.Options} Options
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @type {ClassNames} */
|
||||||
export const DEFAULT_CLASSNAMES = {
|
export const DEFAULT_CLASSNAMES = {
|
||||||
containerOuter: 'choices',
|
containerOuter: 'choices',
|
||||||
containerInner: 'choices__inner',
|
containerInner: 'choices__inner',
|
||||||
|
@ -28,6 +34,7 @@ export const DEFAULT_CLASSNAMES = {
|
||||||
noChoices: 'has-no-choices',
|
noChoices: 'has-no-choices',
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/** @type {Options} */
|
||||||
export const DEFAULT_CONFIG = {
|
export const DEFAULT_CONFIG = {
|
||||||
items: [],
|
items: [],
|
||||||
choices: [],
|
choices: [],
|
||||||
|
@ -51,7 +58,7 @@ export const DEFAULT_CONFIG = {
|
||||||
resetScrollPosition: true,
|
resetScrollPosition: true,
|
||||||
shouldSort: true,
|
shouldSort: true,
|
||||||
shouldSortItems: false,
|
shouldSortItems: false,
|
||||||
sortFn: sortByAlpha,
|
sorter: sortByAlpha,
|
||||||
placeholder: true,
|
placeholder: true,
|
||||||
placeholderValue: null,
|
placeholderValue: null,
|
||||||
searchPlaceholderValue: null,
|
searchPlaceholderValue: null,
|
||||||
|
|
Loading…
Reference in a new issue