import { EventSource } from 'apprt-core/Events'; import Credential from '@arcgis/core/identity/Credential'; /** * Events emitted from PortalLoginService. */ interface PortalLoginServiceEvents { /** * Emitted when signed out. */ "portal-sign-out": void; /** * Emitted when signed in. */ "portal-sign-in": void; } /** * Service to access security information of ArcGIS services like ArcGIS Enterprise portal. */ interface PortalLoginService extends EventSource { /** * Checks if the user is signed in to ArcGIS Online */ isSignedIn(): boolean; /** * Forces a sign-in to ArcGIS Online. The user is prompted to enter credentials. * * @return The user's credentials, wrapped in a promise. */ signIn(): Promise; /** * Clears all ArcGIS Online Tokens. */ signOut(): void; /** * Gets the token for the portal or undefined if user is not signed in. * * @returns The user's credentials. */ getPortalCredential(): Credential | undefined; /** * Gets the response of the community/self endpoint of ArcGIS Online or undefined if user is not signed in. */ getPortalUserSelfInfo(): Promise>; } export type { PortalLoginService, PortalLoginServiceEvents };