Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
microsoft
GitHub Repository: microsoft/vscode
Path: blob/main/src/vs/platform/defaultAccount/common/defaultAccount.ts
5221 views
1
/*---------------------------------------------------------------------------------------------
2
* Copyright (c) Microsoft Corporation. All rights reserved.
3
* Licensed under the MIT License. See License.txt in the project root for license information.
4
*--------------------------------------------------------------------------------------------*/
5
6
import { createDecorator } from '../../instantiation/common/instantiation.js';
7
import { Event } from '../../../base/common/event.js';
8
import { IDefaultAccount, IDefaultAccountAuthenticationProvider, IPolicyData } from '../../../base/common/defaultAccount.js';
9
10
export interface IDefaultAccountProvider {
11
readonly defaultAccount: IDefaultAccount | null;
12
readonly onDidChangeDefaultAccount: Event<IDefaultAccount | null>;
13
readonly policyData: IPolicyData | null;
14
readonly onDidChangePolicyData: Event<IPolicyData | null>;
15
getDefaultAccountAuthenticationProvider(): IDefaultAccountAuthenticationProvider;
16
refresh(): Promise<IDefaultAccount | null>;
17
signIn(options?: { additionalScopes?: readonly string[];[key: string]: unknown }): Promise<IDefaultAccount | null>;
18
}
19
20
export const IDefaultAccountService = createDecorator<IDefaultAccountService>('defaultAccountService');
21
22
export interface IDefaultAccountService {
23
readonly _serviceBrand: undefined;
24
readonly onDidChangeDefaultAccount: Event<IDefaultAccount | null>;
25
readonly onDidChangePolicyData: Event<IPolicyData | null>;
26
readonly policyData: IPolicyData | null;
27
getDefaultAccount(): Promise<IDefaultAccount | null>;
28
getDefaultAccountAuthenticationProvider(): IDefaultAccountAuthenticationProvider;
29
setDefaultAccountProvider(provider: IDefaultAccountProvider): void;
30
refresh(): Promise<IDefaultAccount | null>;
31
signIn(options?: { additionalScopes?: readonly string[];[key: string]: unknown }): Promise<IDefaultAccount | null>;
32
}
33
34