Path: blob/main/src/vs/platform/defaultAccount/common/defaultAccount.ts
5221 views
/*---------------------------------------------------------------------------------------------1* Copyright (c) Microsoft Corporation. All rights reserved.2* Licensed under the MIT License. See License.txt in the project root for license information.3*--------------------------------------------------------------------------------------------*/45import { createDecorator } from '../../instantiation/common/instantiation.js';6import { Event } from '../../../base/common/event.js';7import { IDefaultAccount, IDefaultAccountAuthenticationProvider, IPolicyData } from '../../../base/common/defaultAccount.js';89export interface IDefaultAccountProvider {10readonly defaultAccount: IDefaultAccount | null;11readonly onDidChangeDefaultAccount: Event<IDefaultAccount | null>;12readonly policyData: IPolicyData | null;13readonly onDidChangePolicyData: Event<IPolicyData | null>;14getDefaultAccountAuthenticationProvider(): IDefaultAccountAuthenticationProvider;15refresh(): Promise<IDefaultAccount | null>;16signIn(options?: { additionalScopes?: readonly string[];[key: string]: unknown }): Promise<IDefaultAccount | null>;17}1819export const IDefaultAccountService = createDecorator<IDefaultAccountService>('defaultAccountService');2021export interface IDefaultAccountService {22readonly _serviceBrand: undefined;23readonly onDidChangeDefaultAccount: Event<IDefaultAccount | null>;24readonly onDidChangePolicyData: Event<IPolicyData | null>;25readonly policyData: IPolicyData | null;26getDefaultAccount(): Promise<IDefaultAccount | null>;27getDefaultAccountAuthenticationProvider(): IDefaultAccountAuthenticationProvider;28setDefaultAccountProvider(provider: IDefaultAccountProvider): void;29refresh(): Promise<IDefaultAccount | null>;30signIn(options?: { additionalScopes?: readonly string[];[key: string]: unknown }): Promise<IDefaultAccount | null>;31}323334