import { SWRResponse } from 'swr';
import { ObjectId, RoleType, User as UserTyped } from '@/lib/types/models';
import Parse from './parse';
interface Params {
    redirectTo?: string;
    redirectIfFound?: boolean;
}
export declare type UserValue = UserTyped & {
    value?: ObjectId;
};
export declare type UserValueOption = {
    label: string;
    value: ObjectId;
    username: string;
    nickname: string;
    deleted: boolean;
    enabled: boolean;
};
export declare const userDataFormat: (user: UserValue) => UserValueOption;
export declare const isEqualUsers: <T = UserValue>(prevUsers: T | T[], currentUsers: T | T[]) => boolean;
/**
 * user hook
 */
declare const useUser: (props?: Params) => SWRResponse<any, any>;
/**
 * @deprecated
 */
export declare const useCurrentUser: () => SWRResponse<Parse.User<Parse.Attributes>, any>;
export declare const useRole: (workspaceKey?: string) => RoleType;
export declare const useUsers: <T = UserTyped>() => [list: T[], loading: boolean];
export declare const getRoleOptionsByName: (name: string | RegExp) => Promise<Record<'label' | 'value', string>[]>;
export declare const getRolesOptionsByValues: (values: string[]) => Promise<Record<'label' | 'value', string>[]>;
export declare const useGroups: () => [list: {
    objectId: string;
    name: string;
}[], loading: boolean];
export declare const getUserCustomFieldOptionsByName: (name: string | RegExp, type?: string | string[]) => Promise<Record<'label' | 'value', string>[]>;
export declare const getUserCustomFieldOptionsByValues: (values: string[], type?: string | string[]) => Promise<Record<'label' | 'value', string>[]>;
export default useUser;
export declare type TreeItem = {
    id: string;
    children: TreeItem[];
    title: string;
};
export declare const getRolesTree: (keys?: string[]) => Promise<TreeItem[]>;
export declare const getRolesData: (keyword?: string) => Promise<TreeItem[]>;
export declare const getGroupsTree: (keys?: string[]) => Promise<TreeItem[]>;
export declare const getGroupTreeSelect: (keyword?: string) => Promise<[TreeItem[], string[]]>;
export declare const getWorkspaceUsers: (workspaceId: string, pageData: {
    pageIndex: number;
    pageSize: number;
    keyWord: string;
}) => Promise<[Parse.Role, Parse.User[], number]>;
export declare const getRoles: (keyword?: string) => Promise<{
    objectId: string;
    name: string;
}[]>;
/** 用户被删除 */
export declare const isUserDeleted: (user: UserTyped) => boolean;
/** 用户被禁用 */
export declare const isUserDisabled: (user: UserTyped) => boolean;
export declare const generateUserDisplayName: (user: UserTyped, onlyNickname?: boolean) => string;
