PHP 8.2.30
Preview: useCreatable.d.ts Size: 2.33 KB
/proc/thread-self/root/home/byroehnu/.trash/node_modules11/react-select/dist/declarations/src/useCreatable.d.ts

import { ReactNode } from 'react';
import { PublicBaseSelectProps } from './Select';
import { GetOptionLabel, GetOptionValue, GroupBase, Options, OptionsOrGroups } from './types';
export interface Accessors<Option> {
    getOptionValue: GetOptionValue<Option>;
    getOptionLabel: GetOptionLabel<Option>;
}
export interface CreatableAdditionalProps<Option, Group extends GroupBase<Option>> {
    /**
     * Allow options to be created while the `isLoading` prop is true. Useful to
     * prevent the "create new ..." option being displayed while async results are
     * still being loaded.
     */
    allowCreateWhileLoading?: boolean;
    /** Sets the position of the createOption element in your options list. Defaults to 'last' */
    createOptionPosition?: 'first' | 'last';
    /**
     * Gets the label for the "create new ..." option in the menu. Is given the
     * current input value.
     */
    formatCreateLabel?: (inputValue: string) => ReactNode;
    /**
     * Determines whether the "create new ..." option should be displayed based on
     * the current input value, select value and options array.
     */
    isValidNewOption?: (inputValue: string, value: Options<Option>, options: OptionsOrGroups<Option, Group>, accessors: Accessors<Option>) => boolean;
    /**
     * Returns the data for the new option when it is created. Used to display the
     * value, and is passed to `onChange`.
     */
    getNewOptionData?: (inputValue: string, optionLabel: ReactNode) => Option;
    /**
     * If provided, this will be called with the input value when a new option is
     * created, and `onChange` will **not** be called. Use this when you need more
     * control over what happens when new options are created.
     */
    onCreateOption?: (inputValue: string) => void;
}
declare type BaseCreatableProps<Option, IsMulti extends boolean, Group extends GroupBase<Option>> = PublicBaseSelectProps<Option, IsMulti, Group> & CreatableAdditionalProps<Option, Group>;
export default function useCreatable<Option, IsMulti extends boolean, Group extends GroupBase<Option>>({ allowCreateWhileLoading, createOptionPosition, formatCreateLabel, isValidNewOption, getNewOptionData, onCreateOption, options: propsOptions, onChange: propsOnChange, ...restSelectProps }: BaseCreatableProps<Option, IsMulti, Group>): PublicBaseSelectProps<Option, IsMulti, Group>;
export {};

Directory Contents

Dirs: 8 × Files: 17

Name Size Perms Modified Actions
- drwxr-xr-x 2026-02-28 00:29:58
Edit Download
animated DIR
- drwxr-xr-x 2026-02-28 00:30:28
Edit Download
async DIR
- drwxr-xr-x 2026-02-28 00:30:00
Edit Download
- drwxr-xr-x 2026-02-28 00:29:58
Edit Download
base DIR
- drwxr-xr-x 2026-02-28 00:30:00
Edit Download
- drwxr-xr-x 2026-02-28 00:30:16
Edit Download
creatable DIR
- drwxr-xr-x 2026-02-28 00:30:04
Edit Download
internal DIR
- drwxr-xr-x 2026-02-28 00:30:26
Edit Download
559 B lrw-r--r-- 2026-02-28 00:29:52
Edit Download
870 B lrw-r--r-- 2026-02-28 00:29:52
Edit Download
365 B lrw-r--r-- 2026-02-28 00:29:54
Edit Download
790 B lrw-r--r-- 2026-02-28 00:29:58
Edit Download
63 B lrw-r--r-- 2026-02-28 00:29:58
Edit Download
539 B lrw-r--r-- 2026-02-28 00:29:58
Edit Download
1.98 KB lrw-r--r-- 2026-02-28 00:30:04
Edit Download
289 B lrw-r--r-- 2026-02-28 00:30:08
Edit Download
26.09 KB lrw-r--r-- 2026-02-28 00:30:16
Edit Download
559 B lrw-r--r-- 2026-02-28 00:30:18
Edit Download
5.84 KB lrw-r--r-- 2026-02-28 00:30:20
Edit Download
672 B lrw-r--r-- 2026-02-28 00:30:20
Edit Download
5.15 KB lrw-r--r-- 2026-02-28 00:30:22
Edit Download
1.83 KB lrw-r--r-- 2026-02-28 00:30:22
Edit Download
2.33 KB lrw-r--r-- 2026-02-28 00:30:24
Edit Download
1.47 KB lrw-r--r-- 2026-02-28 00:30:26
Edit Download
3.32 KB lrw-r--r-- 2026-02-28 00:30:28
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).