@coko/client
Version:
Client side common code for coko apps
44 lines (43 loc) • 1.1 kB
TypeScript
import { DocumentNode } from '@apollo/client';
type CurrentUserQueryContextType = {
currentUserQuery: DocumentNode | undefined;
onLogout: () => void;
};
export declare const CurrentUserQueryContext: import("react").Context<CurrentUserQueryContextType>;
type User = {
id: string;
displayName: string;
username: string;
teams: Array<{
id: string;
role: string;
objectId: string;
global: boolean;
members: Array<{
id: string;
user: {
id: string;
};
status: string;
}>;
}>;
isActive: boolean;
defaultIdentity: {
id: string;
isVerified: boolean;
};
identities: Array<{
id: string;
provider: string;
hasValidRefreshToken: boolean;
}>;
};
type UseCurrentUserReturn = {
currentUser: User | null | undefined;
error: Error | undefined;
loading: boolean;
refetch: () => Promise<unknown>;
logout: () => void;
};
export declare const useCurrentUser: () => UseCurrentUserReturn;
export {};