/*---------------------------------------------------------------------------------------------
 *  Copyright (c) Microsoft Corporation. All rights reserved.
 *  Licensed under the MIT License. See License.txt in the project root for license information.
 *--------------------------------------------------------------------------------------------*/
import { CancellationTokenSource } from '../../../base/common/cancellation.js';
import { Emitter } from '../../../base/common/event.js';
import { KeyChord, SimpleKeybinding, ChordKeybinding, ResolvedKeybinding, ResolvedKeybindingPart, KeyCodeUtils } from '../../../base/common/keyCodes.js';
import { URI } from '../../../base/common/uri.js';
import { Position } from '../core/position.js';
import { Range } from '../core/range.js';
import { Selection } from '../core/selection.js';
import { Token } from '../core/token.js';
import * as standaloneEnums from './standaloneEnums.js';
import { IContextKeyService, SET_CONTEXT_COMMAND_ID, ContextKeyExpr, ContextKeyFalseExpr, ContextKeyTrueExpr, ContextKeyDefinedExpr, ContextKeyEqualsExpr, ContextKeyInExpr, ContextKeyNotInExpr, ContextKeyNotEqualsExpr, ContextKeyNotExpr, ContextKeyGreaterExpr, ContextKeyGreaterEqualsExpr, ContextKeySmallerExpr, ContextKeySmallerEqualsExpr, ContextKeyRegexExpr, ContextKeyNotRegexExpr, ContextKeyAndExpr, ContextKeyOrExpr, RawContextKey, implies } from '../../../platform/contextkey/common/contextkey.js';
import { KeybindingIO, OutputBuilder } from '../../../workbench/services/keybinding/common/keybindingIO.js';
import { KeybindingParser } from '../../../base/common/keybindingParser.js';
import { ScanCodeBinding } from '../../../base/common/scanCode.js';
import { ResolvedKeybindingItem } from '../../../platform/keybinding/common/resolvedKeybindingItem.js';
import { MarkdownString } from '../../../base/common/htmlContent.js';
import { Registry } from '../../../platform/registry/common/platform.js';
import { DefaultConfigurationModel, ConfigurationModel } from '../../../platform/configuration/common/configurationModels.js';
import { Disposable, DisposableStore } from '../../../base/common/lifecycle.js';
import { IProgressService, IEditorProgressService } from '../../../platform/progress/common/progress.js';
import { IConfigurationService } from '../../../platform/configuration/common/configuration.js';
import { ILoggerService, ILogService, DEFAULT_LOG_LEVEL, AbstractLogger } from '../../../platform/log/common/log.js';
import { MacLinuxFallbackKeyboardMapper } from '../../../workbench/services/keybinding/common/macLinuxFallbackKeyboardMapper.js';
import { Extensions as KeybindingExtensions, KeybindingsRegistry } from '../../../platform/keybinding/common/keybindingsRegistry.js';
import { KeybindingResolver } from '../../../platform/keybinding/common/keybindingResolver.js';
import { ICommandService, CommandsRegistry } from '../../../platform/commands/common/commands.js';
import { Extensions as ConfigurationExtensions } from '../../../platform/configuration/common/configurationRegistry.js';
import { ErrorHandler, errorHandler } from '../../../base/common/errors.js';
import { resolveUserKeybindingItems } from '../../../workbench/services/keybinding/browser/keybindingService.js';
import { OS } from '../../../base/common/platform.js';
import { IKeybindingService } from '../../../platform/keybinding/common/keybinding.js';
import { AbstractKeybindingService } from '../../../platform/keybinding/common/abstractKeybindingService.js';
import { StandaloneKeybindingService } from '../../standalone/browser/simpleServices.js';
export class KeyMod {
    static chord(firstPart, secondPart) {
        return KeyChord(firstPart, secondPart);
    }
}
KeyMod.CtrlCmd = 2048 /* CtrlCmd */;
KeyMod.Shift = 1024 /* Shift */;
KeyMod.Alt = 512 /* Alt */;
KeyMod.WinCtrl = 256 /* WinCtrl */;
export function createMonacoBaseAPI() {
    return {
        editor: undefined,
        languages: undefined,
        CancellationTokenSource: CancellationTokenSource,
        Emitter: Emitter,
        KeyCode: standaloneEnums.KeyCode,
        KeyMod: KeyMod,
        Position: Position,
        Range: Range,
        Selection: Selection,
        Uri: URI,
        Token: Token,
        // methods
        implies: implies,
        resolveUserKeybindingItems: resolveUserKeybindingItems,
        // classes
        KeybindingIO: KeybindingIO,
        OutputBuilder: OutputBuilder,
        KeybindingParser: KeybindingParser,
        ResolvedKeybindingItem: ResolvedKeybindingItem,
        SimpleKeybinding: SimpleKeybinding,
        ChordKeybinding: ChordKeybinding,
        ResolvedKeybinding: ResolvedKeybinding,
        ResolvedKeybindingPart: ResolvedKeybindingPart,
        ScanCodeBinding: ScanCodeBinding,
        MarkdownString: MarkdownString,
        DefaultConfigurationModel: DefaultConfigurationModel,
        ConfigurationModel: ConfigurationModel,
        Disposable: Disposable,
        AbstractLogger: AbstractLogger,
        ContextKeyExpr: ContextKeyExpr,
        ContextKeyFalseExpr: ContextKeyFalseExpr,
        ContextKeyTrueExpr: ContextKeyTrueExpr,
        ContextKeyDefinedExpr: ContextKeyDefinedExpr,
        ContextKeyEqualsExpr: ContextKeyEqualsExpr,
        ContextKeyInExpr: ContextKeyInExpr,
        ContextKeyNotInExpr: ContextKeyNotInExpr,
        ContextKeyNotEqualsExpr: ContextKeyNotEqualsExpr,
        ContextKeyNotExpr: ContextKeyNotExpr,
        ContextKeyGreaterExpr: ContextKeyGreaterExpr,
        ContextKeyGreaterEqualsExpr: ContextKeyGreaterEqualsExpr,
        ContextKeySmallerExpr: ContextKeySmallerExpr,
        ContextKeySmallerEqualsExpr: ContextKeySmallerEqualsExpr,
        ContextKeyRegexExpr: ContextKeyRegexExpr,
        ContextKeyNotRegexExpr: ContextKeyNotRegexExpr,
        ContextKeyAndExpr: ContextKeyAndExpr,
        ContextKeyOrExpr: ContextKeyOrExpr,
        RawContextKey: RawContextKey,
        MacLinuxFallbackKeyboardMapper: MacLinuxFallbackKeyboardMapper,
        KeyCodeUtils: KeyCodeUtils,
        DisposableStore: DisposableStore,
        KeybindingResolver: KeybindingResolver,
        ErrorHandler: ErrorHandler,
        IProgressService: IProgressService,
        IConfigurationService: IConfigurationService,
        IEditorProgressService: IEditorProgressService,
        ILoggerService: ILoggerService,
        ILogService: ILogService,
        // enums
        SelectionDirection: standaloneEnums.SelectionDirection,
        MarkerSeverity: standaloneEnums.MarkerSeverity,
        MarkerTag: standaloneEnums.MarkerTag,
        ContextKeyExprType: standaloneEnums.ContextKeyExprType,
        OperatingSystem: standaloneEnums.OperatingSystem,
        ScanCode: standaloneEnums.ScanCode,
        EditPresentationTypes: standaloneEnums.EditPresentationTypes,
        ConfigurationScope: standaloneEnums.ConfigurationScope,
        MarkdownStringTextNewlineStyle: standaloneEnums.MarkdownStringTextNewlineStyle,
        ProgressLocation: standaloneEnums.ProgressLocation,
        ConfigurationTarget: standaloneEnums.ConfigurationTarget,
        LogLevel: standaloneEnums.LogLevel,
        KeybindingWeight: standaloneEnums.KeybindingWeight,
        KeybindingSource: standaloneEnums.KeybindingSource,
        // Constants
        SET_CONTEXT_COMMAND_ID,
        DEFAULT_LOG_LEVEL,
        IContextKeyService: IContextKeyService,
        Registry: Registry,
        KeybindingExtensions: KeybindingExtensions,
        KeybindingsRegistry: KeybindingsRegistry,
        ConfigurationExtensions: ConfigurationExtensions,
        ICommandService: ICommandService,
        errorHandler,
        CommandsRegistry,
        OS: OS,
        IKeybindingService,
        AbstractKeybindingService: AbstractKeybindingService,
        StandaloneKeybindingService: StandaloneKeybindingService
    };
}
