zy-react-library/hooks/useDictionary/index.d.ts

25 lines
728 B
TypeScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

export interface getDictionaryOptions {
/** appKey默认 DICTIONARY_APP_KEY_ENUM.DEFAULT0bb989ecada5470c87635018ece9f327 */
appKey?: string;
/** 要获取的字典 */
dictValue: string;
}
export interface DictionaryItem {
/** label */
dictLabel: string;
/** value */
dictValue: string;
/** 子级 */
children: DictionaryItem[];
[key: string]: any;
}
export type getDictionaryFunction = (options: getDictionaryOptions) => Promise<DictionaryItem[]>;
/**
* 获取数据字典
*/
export default function useDictionary(returnType: "array"): [boolean, getDictionaryFunction];
export default function useDictionary(returnType?: "object"): { loading: boolean; getDictionary: getDictionaryFunction };