Created
November 11, 2021 03:27
-
-
Save joelburget/194ce727fd16c1bf2a5c625e36b78b7f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
~/code/ocaml/monaco-editor main | |
❯ ts2ocaml jsoo --create-minimal-lib --preset=minimal --output-dir src-minimal monaco.d.ts | |
warn: type predicate is not supported and treated as boolean at line 98, col 35 of monaco.d.ts | |
> static isUri(thing: any): thing is Uri; | |
warn: type predicate is not supported and treated as boolean at line 567, col 39 of monaco.d.ts | |
> static isIPosition(obj: any): obj is IPosition; | |
warn: type predicate is not supported and treated as boolean at line 716, col 36 of monaco.d.ts | |
> static isIRange(obj: any): obj is IRange; | |
warn: type predicate is not supported and treated as boolean at line 829, col 40 of monaco.d.ts | |
> static isISelection(obj: any): obj is ISelection; | |
warn: unsupported TypeNode kind: MappedType at line 4375, col 61 of monaco.d.ts | |
> type FindEditorOptionsKeyById<T extends EditorOption> = { | |
> [K in keyof EditorOptionsType]: EditorOptionsType[K]['id'] extends T ? K : never; | |
> }[keyof EditorOptionsType]; | |
warn: unsupported TypeNode kind: ConditionalType at line 4379, col 73 of monaco.d.ts | |
> type ComputedEditorOptionValue<T extends IEditorOption<any, any>> = T extends IEditorOption<any, infer R> ? R : never; | |
warn: exception while trying to read comments from a signature declaration at line 4921, col 9 of monaco.d.ts | |
> getValue(options?: { | |
> preserveBOM: boolean; | |
> lineEnding: string; | |
> }): string; | |
TypeError: Cannot read properties of undefined (reading 'kind') | |
at Object.isIdentifier (/Users/joel/.config/yarn/global/node_modules/typescript/lib/typescript.js:27792:21) | |
at /Users/joel/.config/yarn/global/node_modules/@ocsigen/ts2ocaml/dist/ts2ocaml.js:2:156758 | |
at En.f (/Users/joel/.config/yarn/global/node_modules/@ocsigen/ts2ocaml/dist/ts2ocaml.js:2:31822) | |
at En.GetEnumerator (/Users/joel/.config/yarn/global/node_modules/@ocsigen/ts2ocaml/dist/ts2ocaml.js:2:30744) | |
at En.[Symbol.iterator] (/Users/joel/.config/yarn/global/node_modules/@ocsigen/ts2ocaml/dist/ts2ocaml.js:2:30783) | |
at Function.from (<anonymous>) | |
at rt (/Users/joel/.config/yarn/global/node_modules/@ocsigen/ts2ocaml/dist/ts2ocaml.js:2:21219) | |
at kl (/Users/joel/.config/yarn/global/node_modules/@ocsigen/ts2ocaml/dist/ts2ocaml.js:2:157998) | |
at /Users/joel/.config/yarn/global/node_modules/@ocsigen/ts2ocaml/dist/ts2ocaml.js:2:158310 | |
at /Users/joel/.config/yarn/global/node_modules/@ocsigen/ts2ocaml/dist/ts2ocaml.js:2:33961 | |
> export interface ICodeEditor extends IEditor { | |
> /** | |
> * An event emitted when the content of the current model has changed. | |
> * @event | |
> */ | |
> onDidChangeModelContent: IEvent<IModelContentChangedEvent>; | |
> /** | |
> * An event emitted when the language of the current model has changed. | |
> * @event | |
> */ | |
> onDidChangeModelLanguage: IEvent<IModelLanguageChangedEvent>; | |
> /** | |
> * An event emitted when the language configuration of the current model has changed. | |
> * @event | |
> */ | |
> onDidChangeModelLanguageConfiguration: IEvent<IModelLanguageConfigurationChangedEvent>; | |
> /** | |
> * An event emitted when the options of the current model has changed. | |
> * @event | |
> */ | |
> onDidChangeModelOptions: IEvent<IModelOptionsChangedEvent>; | |
> /** | |
> * An event emitted when the configuration of the editor has changed. (e.g. `editor.updateOptions()`) | |
> * @event | |
> */ | |
> onDidChangeConfiguration: IEvent<ConfigurationChangedEvent>; | |
> /** | |
> * An event emitted when the cursor position has changed. | |
> * @event | |
> */ | |
> onDidChangeCursorPosition: IEvent<ICursorPositionChangedEvent>; | |
> /** | |
> * An event emitted when the cursor selection has changed. | |
> * @event | |
> */ | |
> onDidChangeCursorSelection: IEvent<ICursorSelectionChangedEvent>; | |
> /** | |
> * An event emitted when the model of this editor has changed (e.g. `editor.setModel()`). | |
> * @event | |
> */ | |
> onDidChangeModel: IEvent<IModelChangedEvent>; | |
> /** | |
> * An event emitted when the decorations of the current model have changed. | |
> * @event | |
> */ | |
> onDidChangeModelDecorations: IEvent<IModelDecorationsChangedEvent>; | |
> /** | |
> * An event emitted when the text inside this editor gained focus (i.e. cursor starts blinking). | |
> * @event | |
> */ | |
> onDidFocusEditorText(listener: () => void): IDisposable; | |
> /** | |
> * An event emitted when the text inside this editor lost focus (i.e. cursor stops blinking). | |
> * @event | |
> */ | |
> onDidBlurEditorText(listener: () => void): IDisposable; | |
> /** | |
> * An event emitted when the text inside this editor or an editor widget gained focus. | |
> * @event | |
> */ | |
> onDidFocusEditorWidget(listener: () => void): IDisposable; | |
> /** | |
> * An event emitted when the text inside this editor or an editor widget lost focus. | |
> * @event | |
> */ | |
> onDidBlurEditorWidget(listener: () => void): IDisposable; | |
> /** | |
> * An event emitted after composition has started. | |
> */ | |
> onDidCompositionStart(listener: () => void): IDisposable; | |
> /** | |
> * An event emitted after composition has ended. | |
> */ | |
> onDidCompositionEnd(listener: () => void): IDisposable; | |
> /** | |
> * An event emitted when editing failed because the editor is read-only. | |
> * @event | |
> */ | |
> onDidAttemptReadOnlyEdit(listener: () => void): IDisposable; | |
> /** | |
> * An event emitted when users paste text in the editor. | |
> * @event | |
> */ | |
> onDidPaste: IEvent<IPasteEvent>; | |
> /** | |
> * An event emitted on a "mouseup". | |
> * @event | |
> */ | |
> onMouseUp: IEvent<IEditorMouseEvent>; | |
> /** | |
> * An event emitted on a "mousedown". | |
> * @event | |
> */ | |
> onMouseDown: IEvent<IEditorMouseEvent>; | |
> /** | |
> * An event emitted on a "contextmenu". | |
> * @event | |
> */ | |
> onContextMenu: IEvent<IEditorMouseEvent>; | |
> /** | |
> * An event emitted on a "mousemove". | |
> * @event | |
> */ | |
> onMouseMove: IEvent<IEditorMouseEvent>; | |
> /** | |
> * An event emitted on a "mouseleave". | |
> * @event | |
> */ | |
> onMouseLeave: IEvent<IPartialEditorMouseEvent>; | |
> /** | |
> * An event emitted on a "keyup". | |
> * @event | |
> */ | |
> onKeyUp: IEvent<IKeyboardEvent>; | |
> /** | |
> * An event emitted on a "keydown". | |
> * @event | |
> */ | |
> onKeyDown: IEvent<IKeyboardEvent>; | |
> /** | |
> * An event emitted when the layout of the editor has changed. | |
> * @event | |
> */ | |
> onDidLayoutChange: IEvent<EditorLayoutInfo>; | |
> /** | |
> * An event emitted when the content width or content height in the editor has changed. | |
> * @event | |
> */ | |
> onDidContentSizeChange: IEvent<IContentSizeChangedEvent>; | |
> /** | |
> * An event emitted when the scroll in the editor has changed. | |
> * @event | |
> */ | |
> onDidScrollChange: IEvent<IScrollEvent>; | |
> /** | |
> * An event emitted when hidden areas change in the editor (e.g. due to folding). | |
> * @event | |
> */ | |
> onDidChangeHiddenAreas: IEvent<void>; | |
> /** | |
> * Saves current view state of the editor in a serializable object. | |
> */ | |
> saveViewState(): ICodeEditorViewState | null; | |
> /** | |
> * Restores the view state of the editor from a serializable object generated by `saveViewState`. | |
> */ | |
> restoreViewState(state: ICodeEditorViewState): void; | |
> /** | |
> * Returns true if the text inside this editor or an editor widget has focus. | |
> */ | |
> hasWidgetFocus(): boolean; | |
> /** | |
> * Get a contribution of this editor. | |
> * @id Unique identifier of the contribution. | |
> * @return The contribution or null if contribution not found. | |
> */ | |
> getContribution<T extends IEditorContribution>(id: string): T; | |
> /** | |
> * Type the getModel() of IEditor. | |
> */ | |
> getModel(): ITextModel | null; | |
> /** | |
> * Sets the current model attached to this editor. | |
> * If the previous model was created by the editor via the value key in the options | |
> * literal object, it will be destroyed. Otherwise, if the previous model was set | |
> * via setModel, or the model key in the options literal object, the previous model | |
> * will not be destroyed. | |
> * It is safe to call setModel(null) to simply detach the current model from the editor. | |
> */ | |
> setModel(model: ITextModel | null): void; | |
> /** | |
> * Gets all the editor computed options. | |
> */ | |
> getOptions(): IComputedEditorOptions; | |
> /** | |
> * Gets a specific editor option. | |
> */ | |
> getOption<T extends EditorOption>(id: T): FindComputedEditorOptionValueById<T>; | |
> /** | |
> * Returns the editor's configuration (without any validation or defaults). | |
> */ | |
> getRawOptions(): IEditorOptions; | |
> /** | |
> * Get value of the current model attached to this editor. | |
> * @see {@link ITextModel.getValue} | |
> */ | |
> getValue(options?: { | |
> preserveBOM: boolean; | |
> lineEnding: string; | |
> }): string; | |
> /** | |
> * Set the value of the current model attached to this editor. | |
> * @see {@link ITextModel.setValue} | |
> */ | |
> setValue(newValue: string): void; | |
> /** | |
> * Get the width of the editor's content. | |
> * This is information that is "erased" when computing `scrollWidth = Math.max(contentWidth, width)` | |
> */ | |
> getContentWidth(): number; | |
> /** | |
> * Get the scrollWidth of the editor's viewport. | |
> */ | |
> getScrollWidth(): number; | |
> /** | |
> * Get the scrollLeft of the editor's viewport. | |
> */ | |
> getScrollLeft(): number; | |
> /** | |
> * Get the height of the editor's content. | |
> * This is information that is "erased" when computing `scrollHeight = Math.max(contentHeight, height)` | |
> */ | |
> getContentHeight(): number; | |
> /** | |
> * Get the scrollHeight of the editor's viewport. | |
> */ | |
> getScrollHeight(): number; | |
> /** | |
> * Get the scrollTop of the editor's viewport. | |
> */ | |
> getScrollTop(): number; | |
> /** | |
> * Change the scrollLeft of the editor's viewport. | |
> */ | |
> setScrollLeft(newScrollLeft: number, scrollType?: ScrollType): void; | |
> /** | |
> * Change the scrollTop of the editor's viewport. | |
> */ | |
> setScrollTop(newScrollTop: number, scrollType?: ScrollType): void; | |
> /** | |
> * Change the scroll position of the editor's viewport. | |
> */ | |
> setScrollPosition(position: INewScrollPosition, scrollType?: ScrollType): void; | |
> /** | |
> * Get an action that is a contribution to this editor. | |
> * @id Unique identifier of the contribution. | |
> * @return The action or null if action not found. | |
> */ | |
> getAction(id: string): IEditorAction; | |
> /** | |
> * Execute a command on the editor. | |
> * The edits will land on the undo-redo stack, but no "undo stop" will be pushed. | |
> * @param source The source of the call. | |
> * @param command The command to execute | |
> */ | |
> executeCommand(source: string | null | undefined, command: ICommand): void; | |
> /** | |
> * Create an "undo stop" in the undo-redo stack. | |
> */ | |
> pushUndoStop(): boolean; | |
> /** | |
> * Remove the "undo stop" in the undo-redo stack. | |
> */ | |
> popUndoStop(): boolean; | |
> /** | |
> * Execute edits on the editor. | |
> * The edits will land on the undo-redo stack, but no "undo stop" will be pushed. | |
> * @param source The source of the call. | |
> * @param edits The edits to execute. | |
> * @param endCursorState Cursor state after the edits were applied. | |
> */ | |
> executeEdits(source: string | null | undefined, edits: IIdentifiedSingleEditOperation[], endCursorState?: ICursorStateComputer | Selection[]): boolean; | |
> /** | |
> * Execute multiple (concomitant) commands on the editor. | |
> * @param source The source of the call. | |
> * @param command The commands to execute | |
> */ | |
> executeCommands(source: string | null | undefined, commands: (ICommand | null)[]): void; | |
> /** | |
> * Get all the decorations on a line (filtering out decorations from other editors). | |
> */ | |
> getLineDecorations(lineNumber: number): IModelDecoration[] | null; | |
> /** | |
> * All decorations added through this call will get the ownerId of this editor. | |
> * @see {@link ITextModel.deltaDecorations} | |
> */ | |
> deltaDecorations(oldDecorations: string[], newDecorations: IModelDeltaDecoration[]): string[]; | |
> /** | |
> * Get the layout info for the editor. | |
> */ | |
> getLayoutInfo(): EditorLayoutInfo; | |
> /** | |
> * Returns the ranges that are currently visible. | |
> * Does not account for horizontal scrolling. | |
> */ | |
> getVisibleRanges(): Range[]; | |
> /** | |
> * Get the vertical position (top offset) for the line w.r.t. to the first line. | |
> */ | |
> getTopForLineNumber(lineNumber: number): number; | |
> /** | |
> * Get the vertical position (top offset) for the position w.r.t. to the first line. | |
> */ | |
> getTopForPosition(lineNumber: number, column: number): number; | |
> /** | |
> * Returns the editor's container dom node | |
> */ | |
> getContainerDomNode(): HTMLElement; | |
> /** | |
> * Returns the editor's dom node | |
> */ | |
> getDomNode(): HTMLElement | null; | |
> /** | |
> * Add a content widget. Widgets must have unique ids, otherwise they will be overwritten. | |
> */ | |
> addContentWidget(widget: IContentWidget): void; | |
> /** | |
> * Layout/Reposition a content widget. This is a ping to the editor to call widget.getPosition() | |
> * and update appropriately. | |
> */ | |
> layoutContentWidget(widget: IContentWidget): void; | |
> /** | |
> * Remove a content widget. | |
> */ | |
> removeContentWidget(widget: IContentWidget): void; | |
> /** | |
> * Add an overlay widget. Widgets must have unique ids, otherwise they will be overwritten. | |
> */ | |
> addOverlayWidget(widget: IOverlayWidget): void; | |
> /** | |
> * Layout/Reposition an overlay widget. This is a ping to the editor to call widget.getPosition() | |
> * and update appropriately. | |
> */ | |
> layoutOverlayWidget(widget: IOverlayWidget): void; | |
> /** | |
> * Remove an overlay widget. | |
> */ | |
> removeOverlayWidget(widget: IOverlayWidget): void; | |
> /** | |
> * Change the view zones. View zones are lost when a new model is attached to the editor. | |
> */ | |
> changeViewZones(callback: (accessor: IViewZoneChangeAccessor) => void): void; | |
> /** | |
> * Get the horizontal position (left offset) for the column w.r.t to the beginning of the line. | |
> * This method works only if the line `lineNumber` is currently rendered (in the editor's viewport). | |
> * Use this method with caution. | |
> */ | |
> getOffsetForColumn(lineNumber: number, column: number): number; | |
> /** | |
> * Force an editor render now. | |
> */ | |
> render(forceRedraw?: boolean): void; | |
> /** | |
> * Get the hit test target at coordinates `clientX` and `clientY`. | |
> * The coordinates are relative to the top-left of the viewport. | |
> * | |
> * @returns Hit test target or null if the coordinates fall outside the editor or the editor has no model. | |
> */ | |
> getTargetAtClientPoint(clientX: number, clientY: number): IMouseTarget | null; | |
> /** | |
> * Get the visible position for `position`. | |
> * The result position takes scrolling into account and is relative to the top left corner of the editor. | |
> * Explanation 1: the results of this method will change for the same `position` if the user scrolls the editor. | |
> * Explanation 2: the results of this method will not change if the container of the editor gets repositioned. | |
> * Warning: the results of this method are inaccurate for positions that are outside the current editor viewport. | |
> */ | |
> getScrolledVisiblePosition(position: IPosition): { | |
> top: number; | |
> left: number; | |
> height: number; | |
> } | null; | |
> /** | |
> * Apply the same font settings as the editor to `target`. | |
> */ | |
> applyFontInfo(target: HTMLElement): void; | |
> } | |
> declare namespace monaco.editor { | |
> | |
> export interface IDiffNavigator { | |
> canNavigate(): boolean; | |
> next(): void; | |
> previous(): void; | |
> dispose(): void; | |
> } | |
> | |
> /** | |
> * Create a new editor under `domElement`. | |
> * `domElement` should be empty (not contain other dom nodes). | |
> * The editor will read the size of `domElement`. | |
> */ | |
> export function create(domElement: HTMLElement, options?: IStandaloneEditorConstructionOptions, override?: IEditorOverrideServices): IStandaloneCodeEditor; | |
> | |
> /** | |
> * Emitted when an editor is created. | |
> * Creating a diff editor might cause this listener to be invoked with the two editors. | |
> * @event | |
> */ | |
> export function onDidCreateEditor(listener: (codeEditor: ICodeEditor) => void): IDisposable; | |
> | |
> /** | |
> * Create a new diff editor under `domElement`. | |
> * `domElement` should be empty (not contain other dom nodes). | |
> * The editor will read the size of `domElement`. | |
> */ | |
> export function createDiffEditor(domElement: HTMLElement, options?: IStandaloneDiffEditorConstructionOptions, override?: IEditorOverrideServices): IStandaloneDiffEditor; | |
> | |
> export interface IDiffNavigatorOptions { | |
> readonly followsCaret?: boolean; | |
> readonly ignoreCharChanges?: boolean; | |
> readonly alwaysRevealFirst?: boolean; | |
> } | |
> | |
> export function createDiffNavigator(diffEditor: IStandaloneDiffEditor, opts?: IDiffNavigatorOptions): IDiffNavigator; | |
> | |
> /** | |
> * Create a new editor model. | |
> * You can specify the language that should be set for this model or let the language be inferred from the `uri`. | |
> */ | |
> export function createModel(value: string, language?: string, uri?: Uri): ITextModel; | |
> | |
> /** | |
> * Change the language for a model. | |
> */ | |
> export function setModelLanguage(model: ITextModel, languageId: string): void; | |
> | |
> /** | |
> * Set the markers for a model. | |
> */ | |
> export function setModelMarkers(model: ITextModel, owner: string, markers: IMarkerData[]): void; | |
> | |
> /** | |
> * Get markers for owner and/or resource | |
> * | |
> * @returns list of markers | |
> */ | |
> export function getModelMarkers(filter: { | |
> owner?: string; | |
> resource?: Uri; | |
> take?: number; | |
> }): IMarker[]; | |
> | |
> /** | |
> * Emitted when markers change for a model. | |
> * @event | |
> */ | |
> export function onDidChangeMarkers(listener: (e: readonly Uri[]) => void): IDisposable; | |
> | |
> /** | |
> * Get the model that has `uri` if it exists. | |
> */ | |
> export function getModel(uri: Uri): ITextModel | null; | |
> | |
> /** | |
> * Get all the created models. | |
> */ | |
> export function getModels(): ITextModel[]; | |
> | |
> /** | |
> * Emitted when a model is created. | |
> * @event | |
> */ | |
> export function onDidCreateModel(listener: (model: ITextModel) => void): IDisposable; | |
> | |
> /** | |
> * Emitted right before a model is disposed. | |
> * @event | |
> */ | |
> export function onWillDisposeModel(listener: (model: ITextModel) => void): IDisposable; | |
> | |
> /** | |
> * Emitted when a different language is set to a model. | |
> * @event | |
> */ | |
> export function onDidChangeModelLanguage(listener: (e: { | |
> readonly model: ITextModel; | |
> readonly oldLanguage: string; | |
> }) => void): IDisposable; | |
> | |
> /** | |
> * Create a new web worker that has model syncing capabilities built in. | |
> * Specify an AMD module to load that will `create` an object that will be proxied. | |
> */ | |
> export function createWebWorker<T>(opts: IWebWorkerOptions): MonacoWebWorker<T>; | |
> | |
> /** | |
> * Colorize the contents of `domNode` using attribute `data-lang`. | |
> */ | |
> export function colorizeElement(domNode: HTMLElement, options: IColorizerElementOptions): Promise<void>; | |
> | |
> /** | |
> * Colorize `text` using language `languageId`. | |
> */ | |
> export function colorize(text: string, languageId: string, options: IColorizerOptions): Promise<string>; | |
> | |
> /** | |
> * Colorize a line in a model. | |
> */ | |
> export function colorizeModelLine(model: ITextModel, lineNumber: number, tabSize?: number): string; | |
> | |
> /** | |
> * Tokenize `text` using language `languageId` | |
> */ | |
> export function tokenize(text: string, languageId: string): Token[][]; | |
> | |
> /** | |
> * Define a new theme or update an existing theme. | |
> */ | |
> export function defineTheme(themeName: string, themeData: IStandaloneThemeData): void; | |
> | |
> /** | |
> * Switches to a theme. | |
> */ | |
> export function setTheme(themeName: string): void; | |
> | |
> /** | |
> * Clears all cached font measurements and triggers re-measurement. | |
> */ | |
> export function remeasureFonts(): void; | |
> | |
> /** | |
> * Register a command. | |
> */ | |
> export function registerCommand(id: string, handler: (accessor: any, ...args: any[]) => void): IDisposable; | |
> | |
> export type BuiltinTheme = 'vs' | 'vs-dark' | 'hc-black'; | |
> | |
> export interface IStandaloneThemeData { | |
> base: BuiltinTheme; | |
> inherit: boolean; | |
> rules: ITokenThemeRule[]; | |
> encodedTokensColors?: string[]; | |
> colors: IColors; | |
> } | |
> | |
> export type IColors = { | |
> [colorId: string]: string; | |
> }; | |
> | |
> export interface ITokenThemeRule { | |
> token: string; | |
> foreground?: string; | |
> background?: string; | |
> fontStyle?: string; | |
> } | |
> | |
> /** | |
> * A web worker that can provide a proxy to an arbitrary file. | |
> */ | |
> export interface MonacoWebWorker<T> { | |
> /** | |
> * Terminate the web worker, thus invalidating the returned proxy. | |
> */ | |
> dispose(): void; | |
> /** | |
> * Get a proxy to the arbitrary loaded code. | |
> */ | |
> getProxy(): Promise<T>; | |
> /** | |
> * Synchronize (send) the models at `resources` to the web worker, | |
> * making them available in the monaco.worker.getMirrorModels(). | |
> */ | |
> withSyncedResources(resources: Uri[]): Promise<T>; | |
> } | |
> | |
> export interface IWebWorkerOptions { | |
> /** | |
> * The AMD moduleId to load. | |
> * It should export a function `create` that should return the exported proxy. | |
> */ | |
> moduleId: string; | |
> /** | |
> * The data to send over when calling create on the module. | |
> */ | |
> createData?: any; | |
> /** | |
> * A label to be used to identify the web worker for debugging purposes. | |
> */ | |
> label?: string; | |
> /** | |
> * An object that can be used by the web worker to make calls back to the main thread. | |
> */ | |
> host?: any; | |
> /** | |
> * Keep idle models. | |
> * Defaults to false, which means that idle models will stop syncing after a while. | |
> */ | |
> keepIdleModels?: boolean; | |
> } | |
> | |
> /** | |
> * Description of an action contribution | |
> */ | |
> export interface IActionDescriptor { | |
> /** | |
> * An unique identifier of the contributed action. | |
> */ | |
> id: string; | |
> /** | |
> * A label of the action that will be presented to the user. | |
> */ | |
> label: string; | |
> /** | |
> * Precondition rule. | |
> */ | |
> precondition?: string; | |
> /** | |
> * An array of keybindings for the action. | |
> */ | |
> keybindings?: number[]; | |
> /** | |
> * The keybinding rule (condition on top of precondition). | |
> */ | |
> keybindingContext?: string; | |
> /** | |
> * Control if the action should show up in the context menu and where. | |
> * The context menu of the editor has these default: | |
> * navigation - The navigation group comes first in all cases. | |
> * 1_modification - This group comes next and contains commands that modify your code. | |
> * 9_cutcopypaste - The last default group with the basic editing commands. | |
> * You can also create your own group. | |
> * Defaults to null (don't show in context menu). | |
> */ | |
> contextMenuGroupId?: string; | |
> /** | |
> * Control the order in the context menu group. | |
> */ | |
> contextMenuOrder?: number; | |
> /** | |
> * Method that will be executed when the action is triggered. | |
> * @param editor The editor instance is passed in as a convenience | |
> */ | |
> run(editor: ICodeEditor, ...args: any[]): void | Promise<void>; | |
> } | |
> | |
> /** | |
> * Options which apply for all editors. | |
> */ | |
> export interface IGlobalEditorOptions { | |
> /** | |
> * The number of spaces a tab is equal to. | |
> * This setting is overridden based on the file contents when `detectIndentation` is on. | |
> * Defaults to 4. | |
> */ | |
> tabSize?: number; | |
> /** | |
> * Insert spaces when pressing `Tab`. | |
> * This setting is overridden based on the file contents when `detectIndentation` is on. | |
> * Defaults to true. | |
> */ | |
> insertSpaces?: boolean; | |
> /** | |
> * Controls whether `tabSize` and `insertSpaces` will be automatically detected when a file is opened based on the file contents. | |
> * Defaults to true. | |
> */ | |
> detectIndentation?: boolean; | |
> /** | |
> * Remove trailing auto inserted whitespace. | |
> * Defaults to true. | |
> */ | |
> trimAutoWhitespace?: boolean; | |
> /** | |
> * Special handling for large files to disable certain memory intensive features. | |
> * Defaults to true. | |
> */ | |
> largeFileOptimizations?: boolean; | |
> /** | |
> * Controls whether completions should be computed based on words in the document. | |
> * Defaults to true. | |
> */ | |
> wordBasedSuggestions?: boolean; | |
> /** | |
> * Controls whether word based completions should be included from opened documents of the same language or any language. | |
> */ | |
> wordBasedSuggestionsOnlySameLanguage?: boolean; | |
> /** | |
> * Controls whether the semanticHighlighting is shown for the languages that support it. | |
> * true: semanticHighlighting is enabled for all themes | |
> * false: semanticHighlighting is disabled for all themes | |
> * 'configuredByTheme': semanticHighlighting is controlled by the current color theme's semanticHighlighting setting. | |
> * Defaults to 'byTheme'. | |
> */ | |
> 'semanticHighlighting.enabled'?: true | false | 'configuredByTheme'; | |
> /** | |
> * Keep peek editors open even when double clicking their content or when hitting `Escape`. | |
> * Defaults to false. | |
> */ | |
> stablePeek?: boolean; | |
> /** | |
> * Lines above this length will not be tokenized for performance reasons. | |
> * Defaults to 20000. | |
> */ | |
> maxTokenizationLineLength?: number; | |
> /** | |
> * Theme to be used for rendering. | |
> * The current out-of-the-box available themes are: 'vs' (default), 'vs-dark', 'hc-black'. | |
> * You can create custom themes via `monaco.editor.defineTheme`. | |
> * To switch a theme, use `monaco.editor.setTheme`. | |
> * **NOTE**: The theme might be overwritten if the OS is in high contrast mode, unless `autoDetectHighContrast` is set to false. | |
> */ | |
> theme?: string; | |
> /** | |
> * If enabled, will automatically change to high contrast theme if the OS is using a high contrast theme. | |
> * Defaults to true. | |
> */ | |
> autoDetectHighContrast?: boolean; | |
> } | |
> | |
> /** | |
> * The options to create an editor. | |
> */ | |
> export interface IStandaloneEditorConstructionOptions extends IEditorConstructionOptions, IGlobalEditorOptions { | |
> /** | |
> * The initial model associated with this code editor. | |
> */ | |
> model?: ITextModel | null; | |
> /** | |
> * The initial value of the auto created model in the editor. | |
> * To not automatically create a model, use `model: null`. | |
> */ | |
> value?: string; | |
> /** | |
> * The initial language of the auto created model in the editor. | |
> * To not automatically create a model, use `model: null`. | |
> */ | |
> language?: string; | |
> /** | |
> * Initial theme to be used for rendering. | |
> * The current out-of-the-box available themes are: 'vs' (default), 'vs-dark', 'hc-black'. | |
> * You can create custom themes via `monaco.editor.defineTheme`. | |
> * To switch a theme, use `monaco.editor.setTheme`. | |
> * **NOTE**: The theme might be overwritten if the OS is in high contrast mode, unless `autoDetectHighContrast` is set to false. | |
> */ | |
> theme?: string; | |
> /** | |
> * If enabled, will automatically change to high contrast theme if the OS is using a high contrast theme. | |
> * Defaults to true. | |
> */ | |
> autoDetectHighContrast?: boolean; | |
> /** | |
> * An URL to open when Ctrl+H (Windows and Linux) or Cmd+H (OSX) is pressed in | |
> * the accessibility help dialog in the editor. | |
> * | |
> * Defaults to "https://go.microsoft.com/fwlink/?linkid=852450" | |
> */ | |
> accessibilityHelpUrl?: string; | |
> /** | |
> * Container element to use for ARIA messages. | |
> * Defaults to document.body. | |
> */ | |
> ariaContainerElement?: HTMLElement; | |
> } | |
> | |
> /** | |
> * The options to create a diff editor. | |
> */ | |
> export interface IStandaloneDiffEditorConstructionOptions extends IDiffEditorConstructionOptions { | |
> /** | |
> * Initial theme to be used for rendering. | |
> * The current out-of-the-box available themes are: 'vs' (default), 'vs-dark', 'hc-black'. | |
> * You can create custom themes via `monaco.editor.defineTheme`. | |
> * To switch a theme, use `monaco.editor.setTheme`. | |
> * **NOTE**: The theme might be overwritten if the OS is in high contrast mode, unless `autoDetectHighContrast` is set to false. | |
> */ | |
> theme?: string; | |
> /** | |
> * If enabled, will automatically change to high contrast theme if the OS is using a high contrast theme. | |
> * Defaults to true. | |
> */ | |
> autoDetectHighContrast?: boolean; | |
> } | |
> | |
> export interface IStandaloneCodeEditor extends ICodeEditor { | |
> updateOptions(newOptions: IEditorOptions & IGlobalEditorOptions): void; | |
> addCommand(keybinding: number, handler: ICommandHandler, context?: string): string | null; | |
> createContextKey<T>(key: string, defaultValue: T): IContextKey<T>; | |
> addAction(descriptor: IActionDescriptor): IDisposable; | |
> } | |
> | |
> export interface IStandaloneDiffEditor extends IDiffEditor { | |
> addCommand(keybinding: number, handler: ICommandHandler, context?: string): string | null; | |
> createContextKey<T>(key: string, defaultValue: T): IContextKey<T>; | |
> addAction(descriptor: IActionDescriptor): IDisposable; | |
> getOriginalEditor(): IStandaloneCodeEditor; | |
> getModifiedEditor(): IStandaloneCodeEditor; | |
> } | |
> export interface ICommandHandler { | |
> (...args: any[]): void; | |
> } | |
> | |
> export interface IContextKey<T> { | |
> set(value: T): void; | |
> reset(): void; | |
> get(): T | undefined; | |
> } | |
> | |
> export interface IEditorOverrideServices { | |
> [index: string]: any; | |
> } | |
> | |
> export interface IMarker { | |
> owner: string; | |
> resource: Uri; | |
> severity: MarkerSeverity; | |
> code?: string | { | |
> value: string; | |
> target: Uri; | |
> }; | |
> message: string; | |
> source?: string; | |
> startLineNumber: number; | |
> startColumn: number; | |
> endLineNumber: number; | |
> endColumn: number; | |
> relatedInformation?: IRelatedInformation[]; | |
> tags?: MarkerTag[]; | |
> } | |
> | |
> /** | |
> * A structure defining a problem/warning/etc. | |
> */ | |
> export interface IMarkerData { | |
> code?: string | { | |
> value: string; | |
> target: Uri; | |
> }; | |
> severity: MarkerSeverity; | |
> message: string; | |
> source?: string; | |
> startLineNumber: number; | |
> startColumn: number; | |
> endLineNumber: number; | |
> endColumn: number; | |
> relatedInformation?: IRelatedInformation[]; | |
> tags?: MarkerTag[]; | |
> } | |
> | |
> /** | |
> * | |
> */ | |
> export interface IRelatedInformation { | |
> resource: Uri; | |
> message: string; | |
> startLineNumber: number; | |
> startColumn: number; | |
> endLineNumber: number; | |
> endColumn: number; | |
> } | |
> | |
> export interface IColorizerOptions { | |
> tabSize?: number; | |
> } | |
> | |
> export interface IColorizerElementOptions extends IColorizerOptions { | |
> theme?: string; | |
> mimeType?: string; | |
> } | |
> | |
> export enum ScrollbarVisibility { | |
> Auto = 1, | |
> Hidden = 2, | |
> Visible = 3 | |
> } | |
> | |
> export interface ThemeColor { | |
> id: string; | |
> } | |
> | |
> /** | |
> * Vertical Lane in the overview ruler of the editor. | |
> */ | |
> export enum OverviewRulerLane { | |
> Left = 1, | |
> Center = 2, | |
> Right = 4, | |
> Full = 7 | |
> } | |
> | |
> /** | |
> * Position in the minimap to render the decoration. | |
> */ | |
> export enum MinimapPosition { | |
> Inline = 1, | |
> Gutter = 2 | |
> } | |
> | |
> export interface IDecorationOptions { | |
> /** | |
> * CSS color to render. | |
> * e.g.: rgba(100, 100, 100, 0.5) or a color from the color registry | |
> */ | |
> color: string | ThemeColor | undefined; | |
> /** | |
> * CSS color to render. | |
> * e.g.: rgba(100, 100, 100, 0.5) or a color from the color registry | |
> */ | |
> darkColor?: string | ThemeColor; | |
> } | |
> | |
> /** | |
> * Options for rendering a model decoration in the overview ruler. | |
> */ | |
> export interface IModelDecorationOverviewRulerOptions extends IDecorationOptions { | |
> /** | |
> * The position in the overview ruler. | |
> */ | |
> position: OverviewRulerLane; | |
> } | |
> | |
> /** | |
> * Options for rendering a model decoration in the overview ruler. | |
> */ | |
> export interface IModelDecorationMinimapOptions extends IDecorationOptions { | |
> /** | |
> * The position in the overview ruler. | |
> */ | |
> position: MinimapPosition; | |
> } | |
> | |
> /** | |
> * Options for a model decoration. | |
> */ | |
> export interface IModelDecorationOptions { | |
> /** | |
> * Customize the growing behavior of the decoration when typing at the edges of the decoration. | |
> * Defaults to TrackedRangeStickiness.AlwaysGrowsWhenTypingAtEdges | |
> */ | |
> stickiness?: TrackedRangeStickiness; | |
> /** | |
> * CSS class name describing the decoration. | |
> */ | |
> className?: string | null; | |
> /** | |
> * Message to be rendered when hovering over the glyph margin decoration. | |
> */ | |
> glyphMarginHoverMessage?: IMarkdownString | IMarkdownString[] | null; | |
> /** | |
> * Array of MarkdownString to render as the decoration message. | |
> */ | |
> hoverMessage?: IMarkdownString | IMarkdownString[] | null; | |
> /** | |
> * Should the decoration expand to encompass a whole line. | |
> */ | |
> isWholeLine?: boolean; | |
> /** | |
> * Specifies the stack order of a decoration. | |
> * A decoration with greater stack order is always in front of a decoration with | |
> * a lower stack order when the decorations are on the same line. | |
> */ | |
> zIndex?: number; | |
> /** | |
> * If set, render this decoration in the overview ruler. | |
> */ | |
> overviewRuler?: IModelDecorationOverviewRulerOptions | null; | |
> /** | |
> * If set, render this decoration in the minimap. | |
> */ | |
> minimap?: IModelDecorationMinimapOptions | null; | |
> /** | |
> * If set, the decoration will be rendered in the glyph margin with this CSS class name. | |
> */ | |
> glyphMarginClassName?: string | null; | |
> /** | |
> * If set, the decoration will be rendered in the lines decorations with this CSS class name. | |
> */ | |
> linesDecorationsClassName?: string | null; | |
> /** | |
> * If set, the decoration will be rendered in the lines decorations with this CSS class name, but only for the first line in case of line wrapping. | |
> */ | |
> firstLineDecorationClassName?: string | null; | |
> /** | |
> * If set, the decoration will be rendered in the margin (covering its full width) with this CSS class name. | |
> */ | |
> marginClassName?: string | null; | |
> /** | |
> * If set, the decoration will be rendered inline with the text with this CSS class name. | |
> * Please use this only for CSS rules that must impact the text. For example, use `className` | |
> * to have a background color decoration. | |
> */ | |
> inlineClassName?: string | null; | |
> /** | |
> * If there is an `inlineClassName` which affects letter spacing. | |
> */ | |
> inlineClassNameAffectsLetterSpacing?: boolean; | |
> /** | |
> * If set, the decoration will be rendered before the text with this CSS class name. | |
> */ | |
> beforeContentClassName?: string | null; | |
> /** | |
> * If set, the decoration will be rendered after the text with this CSS class name. | |
> */ | |
> afterContentClassName?: string | null; | |
> /** | |
> * If set, text will be injected in the view after the range. | |
> */ | |
> after?: InjectedTextOptions | null; | |
> /** | |
> * If set, text will be injected in the view before the range. | |
> */ | |
> before?: InjectedTextOptions | null; | |
> } | |
> | |
> /** | |
> * Configures text that is injected into the view without changing the underlying document. | |
> */ | |
> export interface InjectedTextOptions { | |
> /** | |
> * Sets the text to inject. Must be a single line. | |
> */ | |
> readonly content: string; | |
> /** | |
> * If set, the decoration will be rendered inline with the text with this CSS class name. | |
> */ | |
> readonly inlineClassName?: string | null; | |
> /** | |
> * If there is an `inlineClassName` which affects letter spacing. | |
> */ | |
> readonly inlineClassNameAffectsLetterSpacing?: boolean; | |
> } | |
> | |
> /** | |
> * New model decorations. | |
> */ | |
> export interface IModelDeltaDecoration { | |
> /** | |
> * Range that this decoration covers. | |
> */ | |
> range: IRange; | |
> /** | |
> * Options associated with this decoration. | |
> */ | |
> options: IModelDecorationOptions; | |
> } | |
> | |
> /** | |
> * A decoration in the model. | |
> */ | |
> export interface IModelDecoration { | |
> /** | |
> * Identifier for a decoration. | |
> */ | |
> readonly id: string; | |
> /** | |
> * Identifier for a decoration's owner. | |
> */ | |
> readonly ownerId: number; | |
> /** | |
> * Range that this decoration covers. | |
> */ | |
> readonly range: Range; | |
> /** | |
> * Options associated with this decoration. | |
> */ | |
> readonly options: IModelDecorationOptions; | |
> } | |
> | |
> /** | |
> * Word inside a model. | |
> */ | |
> export interface IWordAtPosition { | |
> /** | |
> * The word. | |
> */ | |
> readonly word: string; | |
> /** | |
> * The column where the word starts. | |
> */ | |
> readonly startColumn: number; | |
> /** | |
> * The column where the word ends. | |
> */ | |
> readonly endColumn: number; | |
> } | |
> | |
> /** | |
> * End of line character preference. | |
> */ | |
> export enum EndOfLinePreference { | |
> /** | |
> * Use the end of line character identified in the text buffer. | |
> */ | |
> TextDefined = 0, | |
> /** | |
> * Use line feed (\n) as the end of line character. | |
> */ | |
> LF = 1, | |
> /** | |
> * Use carriage return and line feed (\r\n) as the end of line character. | |
> */ | |
> CRLF = 2 | |
> } | |
> | |
> /** | |
> * The default end of line to use when instantiating models. | |
> */ | |
> export enum DefaultEndOfLine { | |
> /** | |
> * Use line feed (\n) as the end of line character. | |
> */ | |
> LF = 1, | |
> /** | |
> * Use carriage return and line feed (\r\n) as the end of line character. | |
> */ | |
> CRLF = 2 | |
> } | |
> | |
> /** | |
> * End of line character preference. | |
> */ | |
> export enum EndOfLineSequence { | |
> /** | |
> * Use line feed (\n) as the end of line character. | |
> */ | |
> LF = 0, | |
> /** | |
> * Use carriage return and line feed (\r\n) as the end of line character. | |
> */ | |
> CRLF = 1 | |
> } | |
> | |
> /** | |
> * A single edit operation, that acts as a simple replace. | |
> * i.e. Replace text at `range` with `text` in model. | |
> */ | |
> export interface ISingleEditOperation { | |
> /** | |
> * The range to replace. This can be empty to emulate a simple insert. | |
> */ | |
> range: IRange; | |
> /** | |
> * The text to replace with. This can be null to emulate a simple delete. | |
> */ | |
> text: string | null; | |
> /** | |
> * This indicates that this operation has "insert" semantics. | |
> * i.e. forceMoveMarkers = true => if `range` is collapsed, all markers at the position will be moved. | |
> */ | |
> forceMoveMarkers?: boolean; | |
> } | |
> | |
> /** | |
> * A single edit operation, that has an identifier. | |
> */ | |
> export interface IIdentifiedSingleEditOperation { | |
> /** | |
> * The range to replace. This can be empty to emulate a simple insert. | |
> */ | |
> range: IRange; | |
> /** | |
> * The text to replace with. This can be null to emulate a simple delete. | |
> */ | |
> text: string | null; | |
> /** | |
> * This indicates that this operation has "insert" semantics. | |
> * i.e. forceMoveMarkers = true => if `range` is collapsed, all markers at the position will be moved. | |
> */ | |
> forceMoveMarkers?: boolean; | |
> } | |
> | |
> export interface IValidEditOperation { | |
> /** | |
> * The range to replace. This can be empty to emulate a simple insert. | |
> */ | |
> range: Range; | |
> /** | |
> * The text to replace with. This can be empty to emulate a simple delete. | |
> */ | |
> text: string; | |
> } | |
> | |
> /** | |
> * A callback that can compute the cursor state after applying a series of edit operations. | |
> */ | |
> export interface ICursorStateComputer { | |
> /** | |
> * A callback that can compute the resulting cursors state after some edit operations have been executed. | |
> */ | |
> (inverseEditOperations: IValidEditOperation[]): Selection[] | null; | |
> } | |
> | |
> export class TextModelResolvedOptions { | |
> _textModelResolvedOptionsBrand: void; | |
> readonly tabSize: number; | |
> readonly indentSize: number; | |
> readonly insertSpaces: boolean; | |
> readonly defaultEOL: DefaultEndOfLine; | |
> readonly trimAutoWhitespace: boolean; | |
> readonly bracketPairColorizationOptions: BracketPairColorizationOptions; | |
> } | |
> | |
> export interface BracketPairColorizationOptions { | |
> enabled: boolean; | |
> } | |
> | |
> export interface ITextModelUpdateOptions { | |
> tabSize?: number; | |
> indentSize?: number; | |
> insertSpaces?: boolean; | |
> trimAutoWhitespace?: boolean; | |
> bracketColorizationOptions?: BracketPairColorizationOptions; | |
> } | |
> | |
> export class FindMatch { | |
> _findMatchBrand: void; | |
> readonly range: Range; | |
> readonly matches: string[] | null; | |
> } | |
> | |
> /** | |
> * Describes the behavior of decorations when typing/editing near their edges. | |
> * Note: Please do not edit the values, as they very carefully match `DecorationRangeBehavior` | |
> */ | |
> export enum TrackedRangeStickiness { | |
> AlwaysGrowsWhenTypingAtEdges = 0, | |
> NeverGrowsWhenTypingAtEdges = 1, | |
> GrowsOnlyWhenTypingBefore = 2, | |
> GrowsOnlyWhenTypingAfter = 3 | |
> } | |
> | |
> /** | |
> * A model. | |
> */ | |
> export interface ITextModel { | |
> /** | |
> * Gets the resource associated with this editor model. | |
> */ | |
> readonly uri: Uri; | |
> /** | |
> * A unique identifier associated with this model. | |
> */ | |
> readonly id: string; | |
> /** | |
> * Get the resolved options for this model. | |
> */ | |
> getOptions(): TextModelResolvedOptions; | |
> /** | |
> * Get the current version id of the model. | |
> * Anytime a change happens to the model (even undo/redo), | |
> * the version id is incremented. | |
> */ | |
> getVersionId(): number; | |
> /** | |
> * Get the alternative version id of the model. | |
> * This alternative version id is not always incremented, | |
> * it will return the same values in the case of undo-redo. | |
> */ | |
> getAlternativeVersionId(): number; | |
> /** | |
> * Replace the entire text buffer value contained in this model. | |
> */ | |
> setValue(newValue: string): void; | |
> /** | |
> * Get the text stored in this model. | |
> * @param eol The end of line character preference. Defaults to `EndOfLinePreference.TextDefined`. | |
> * @param preserverBOM Preserve a BOM character if it was detected when the model was constructed. | |
> * @return The text. | |
> */ | |
> getValue(eol?: EndOfLinePreference, preserveBOM?: boolean): string; | |
> /** | |
> * Get the length of the text stored in this model. | |
> */ | |
> getValueLength(eol?: EndOfLinePreference, preserveBOM?: boolean): number; | |
> /** | |
> * Get the text in a certain range. | |
> * @param range The range describing what text to get. | |
> * @param eol The end of line character preference. This will only be used for multiline ranges. Defaults to `EndOfLinePreference.TextDefined`. | |
> * @return The text. | |
> */ | |
> getValueInRange(range: IRange, eol?: EndOfLinePreference): string; | |
> /** | |
> * Get the length of text in a certain range. | |
> * @param range The range describing what text length to get. | |
> * @return The text length. | |
> */ | |
> getValueLengthInRange(range: IRange): number; | |
> /** | |
> * Get the character count of text in a certain range. | |
> * @param range The range describing what text length to get. | |
> */ | |
> getCharacterCountInRange(range: IRange): number; | |
> /** | |
> * Get the number of lines in the model. | |
> */ | |
> getLineCount(): number; | |
> /** | |
> * Get the text for a certain line. | |
> */ | |
> getLineContent(lineNumber: number): string; | |
> /** | |
> * Get the text length for a certain line. | |
> */ | |
> getLineLength(lineNumber: number): number; | |
> /** | |
> * Get the text for all lines. | |
> */ | |
> getLinesContent(): string[]; | |
> /** | |
> * Get the end of line sequence predominantly used in the text buffer. | |
> * @return EOL char sequence (e.g.: '\n' or '\r\n'). | |
> */ | |
> getEOL(): string; | |
> /** | |
> * Get the end of line sequence predominantly used in the text buffer. | |
> */ | |
> getEndOfLineSequence(): EndOfLineSequence; | |
> /** | |
> * Get the minimum legal column for line at `lineNumber` | |
> */ | |
> getLineMinColumn(lineNumber: number): number; | |
> /** | |
> * Get the maximum legal column for line at `lineNumber` | |
> */ | |
> getLineMaxColumn(lineNumber: number): number; | |
> /** | |
> * Returns the column before the first non whitespace character for line at `lineNumber`. | |
> * Returns 0 if line is empty or contains only whitespace. | |
> */ | |
> getLineFirstNonWhitespaceColumn(lineNumber: number): number; | |
> /** | |
> * Returns the column after the last non whitespace character for line at `lineNumber`. | |
> * Returns 0 if line is empty or contains only whitespace. | |
> */ | |
> getLineLastNonWhitespaceColumn(lineNumber: number): number; | |
> /** | |
> * Create a valid position, | |
> */ | |
> validatePosition(position: IPosition): Position; | |
> /** | |
> * Advances the given position by the given offset (negative offsets are also accepted) | |
> * and returns it as a new valid position. | |
> * | |
> * If the offset and position are such that their combination goes beyond the beginning or | |
> * end of the model, throws an exception. | |
> * | |
> * If the offset is such that the new position would be in the middle of a multi-byte | |
> * line terminator, throws an exception. | |
> */ | |
> modifyPosition(position: IPosition, offset: number): Position; | |
> /** | |
> * Create a valid range. | |
> */ | |
> validateRange(range: IRange): Range; | |
> /** | |
> * Converts the position to a zero-based offset. | |
> * | |
> * The position will be [adjusted](#TextDocument.validatePosition). | |
> * | |
> * @param position A position. | |
> * @return A valid zero-based offset. | |
> */ | |
> getOffsetAt(position: IPosition): number; | |
> /** | |
> * Converts a zero-based offset to a position. | |
> * | |
> * @param offset A zero-based offset. | |
> * @return A valid [position](#Position). | |
> */ | |
> getPositionAt(offset: number): Position; | |
> /** | |
> * Get a range covering the entire model | |
> */ | |
> getFullModelRange(): Range; | |
> /** | |
> * Returns if the model was disposed or not. | |
> */ | |
> isDisposed(): boolean; | |
> /** | |
> * Search the model. | |
> * @param searchString The string used to search. If it is a regular expression, set `isRegex` to true. | |
> * @param searchOnlyEditableRange Limit the searching to only search inside the editable range of the model. | |
> * @param isRegex Used to indicate that `searchString` is a regular expression. | |
> * @param matchCase Force the matching to match lower/upper case exactly. | |
> * @param wordSeparators Force the matching to match entire words only. Pass null otherwise. | |
> * @param captureMatches The result will contain the captured groups. | |
> * @param limitResultCount Limit the number of results | |
> * @return The ranges where the matches are. It is empty if not matches have been found. | |
> */ | |
> findMatches(searchString: string, searchOnlyEditableRange: boolean, isRegex: boolean, matchCase: boolean, wordSeparators: string | null, captureMatches: boolean, limitResultCount?: number): FindMatch[]; | |
> /** | |
> * Search the model. | |
> * @param searchString The string used to search. If it is a regular expression, set `isRegex` to true. | |
> * @param searchScope Limit the searching to only search inside these ranges. | |
> * @param isRegex Used to indicate that `searchString` is a regular expression. | |
> * @param matchCase Force the matching to match lower/upper case exactly. | |
> * @param wordSeparators Force the matching to match entire words only. Pass null otherwise. | |
> * @param captureMatches The result will contain the captured groups. | |
> * @param limitResultCount Limit the number of results | |
> * @return The ranges where the matches are. It is empty if no matches have been found. | |
> */ | |
> findMatches(searchString: string, searchScope: IRange | IRange[], isRegex: boolean, matchCase: boolean, wordSeparators: string | null, captureMatches: boolean, limitResultCount?: number): FindMatch[]; | |
> /** | |
> * Search the model for the next match. Loops to the beginning of the model if needed. | |
> * @param searchString The string used to search. If it is a regular expression, set `isRegex` to true. | |
> * @param searchStart Start the searching at the specified position. | |
> * @param isRegex Used to indicate that `searchString` is a regular expression. | |
> * @param matchCase Force the matching to match lower/upper case exactly. | |
> * @param wordSeparators Force the matching to match entire words only. Pass null otherwise. | |
> * @param captureMatches The result will contain the captured groups. | |
> * @return The range where the next match is. It is null if no next match has been found. | |
> */ | |
> findNextMatch(searchString: string, searchStart: IPosition, isRegex: boolean, matchCase: boolean, wordSeparators: string | null, captureMatches: boolean): FindMatch | null; | |
> /** | |
> * Search the model for the previous match. Loops to the end of the model if needed. | |
> * @param searchString The string used to search. If it is a regular expression, set `isRegex` to true. | |
> * @param searchStart Start the searching at the specified position. | |
> * @param isRegex Used to indicate that `searchString` is a regular expression. | |
> * @param matchCase Force the matching to match lower/upper case exactly. | |
> * @param wordSeparators Force the matching to match entire words only. Pass null otherwise. | |
> * @param captureMatches The result will contain the captured groups. | |
> * @return The range where the previous match is. It is null if no previous match has been found. | |
> */ | |
> findPreviousMatch(searchString: string, searchStart: IPosition, isRegex: boolean, matchCase: boolean, wordSeparators: string | null, captureMatches: boolean): FindMatch | null; | |
> /** | |
> * Get the language associated with this model. | |
> */ | |
> getLanguageId(): string; | |
> /** | |
> * Get the word under or besides `position`. | |
> * @param position The position to look for a word. | |
> * @return The word under or besides `position`. Might be null. | |
> */ | |
> getWordAtPosition(position: IPosition): IWordAtPosition | null; | |
> /** | |
> * Get the word under or besides `position` trimmed to `position`.column | |
> * @param position The position to look for a word. | |
> * @return The word under or besides `position`. Will never be null. | |
> */ | |
> getWordUntilPosition(position: IPosition): IWordAtPosition; | |
> /** | |
> * Perform a minimum amount of operations, in order to transform the decorations | |
> * identified by `oldDecorations` to the decorations described by `newDecorations` | |
> * and returns the new identifiers associated with the resulting decorations. | |
> * | |
> * @param oldDecorations Array containing previous decorations identifiers. | |
> * @param newDecorations Array describing what decorations should result after the call. | |
> * @param ownerId Identifies the editor id in which these decorations should appear. If no `ownerId` is provided, the decorations will appear in all editors that attach this model. | |
> * @return An array containing the new decorations identifiers. | |
> */ | |
> deltaDecorations(oldDecorations: string[], newDecorations: IModelDeltaDecoration[], ownerId?: number): string[]; | |
> /** | |
> * Get the options associated with a decoration. | |
> * @param id The decoration id. | |
> * @return The decoration options or null if the decoration was not found. | |
> */ | |
> getDecorationOptions(id: string): IModelDecorationOptions | null; | |
> /** | |
> * Get the range associated with a decoration. | |
> * @param id The decoration id. | |
> * @return The decoration range or null if the decoration was not found. | |
> */ | |
> getDecorationRange(id: string): Range | null; | |
> /** | |
> * Gets all the decorations for the line `lineNumber` as an array. | |
> * @param lineNumber The line number | |
> * @param ownerId If set, it will ignore decorations belonging to other owners. | |
> * @param filterOutValidation If set, it will ignore decorations specific to validation (i.e. warnings, errors). | |
> * @return An array with the decorations | |
> */ | |
> getLineDecorations(lineNumber: number, ownerId?: number, filterOutValidation?: boolean): IModelDecoration[]; | |
> /** | |
> * Gets all the decorations for the lines between `startLineNumber` and `endLineNumber` as an array. | |
> * @param startLineNumber The start line number | |
> * @param endLineNumber The end line number | |
> * @param ownerId If set, it will ignore decorations belonging to other owners. | |
> * @param filterOutValidation If set, it will ignore decorations specific to validation (i.e. warnings, errors). | |
> * @return An array with the decorations | |
> */ | |
> getLinesDecorations(startLineNumber: number, endLineNumber: number, ownerId?: number, filterOutValidation?: boolean): IModelDecoration[]; | |
> /** | |
> * Gets all the decorations in a range as an array. Only `startLineNumber` and `endLineNumber` from `range` are used for filtering. | |
> * So for now it returns all the decorations on the same line as `range`. | |
> * @param range The range to search in | |
> * @param ownerId If set, it will ignore decorations belonging to other owners. | |
> * @param filterOutValidation If set, it will ignore decorations specific to validation (i.e. warnings, errors). | |
> * @return An array with the decorations | |
> */ | |
> getDecorationsInRange(range: IRange, ownerId?: number, filterOutValidation?: boolean): IModelDecoration[]; | |
> /** | |
> * Gets all the decorations as an array. | |
> * @param ownerId If set, it will ignore decorations belonging to other owners. | |
> * @param filterOutValidation If set, it will ignore decorations specific to validation (i.e. warnings, errors). | |
> */ | |
> getAllDecorations(ownerId?: number, filterOutValidation?: boolean): IModelDecoration[]; | |
> /** | |
> * Gets all the decorations that should be rendered in the overview ruler as an array. | |
> * @param ownerId If set, it will ignore decorations belonging to other owners. | |
> * @param filterOutValidation If set, it will ignore decorations specific to validation (i.e. warnings, errors). | |
> */ | |
> getOverviewRulerDecorations(ownerId?: number, filterOutValidation?: boolean): IModelDecoration[]; | |
> /** | |
> * Gets all the decorations that contain injected text. | |
> * @param ownerId If set, it will ignore decorations belonging to other owners. | |
> */ | |
> getInjectedTextDecorations(ownerId?: number): IModelDecoration[]; | |
> /** | |
> * Normalize a string containing whitespace according to indentation rules (converts to spaces or to tabs). | |
> */ | |
> normalizeIndentation(str: string): string; | |
> /** | |
> * Change the options of this model. | |
> */ | |
> updateOptions(newOpts: ITextModelUpdateOptions): void; | |
> /** | |
> * Detect the indentation options for this model from its content. | |
> */ | |
> detectIndentation(defaultInsertSpaces: boolean, defaultTabSize: number): void; | |
> /** | |
> * Close the current undo-redo element. | |
> * This offers a way to create an undo/redo stop point. | |
> */ | |
> pushStackElement(): void; | |
> /** | |
> * Open the current undo-redo element. | |
> * This offers a way to remove the current undo/redo stop point. | |
> */ | |
> popStackElement(): void; | |
> /** | |
> * Push edit operations, basically editing the model. This is the preferred way | |
> * of editing the model. The edit operations will land on the undo stack. | |
> * @param beforeCursorState The cursor state before the edit operations. This cursor state will be returned when `undo` or `redo` are invoked. | |
> * @param editOperations The edit operations. | |
> * @param cursorStateComputer A callback that can compute the resulting cursors state after the edit operations have been executed. | |
> * @return The cursor state returned by the `cursorStateComputer`. | |
> */ | |
> pushEditOperations(beforeCursorState: Selection[] | null, editOperations: IIdentifiedSingleEditOperation[], cursorStateComputer: ICursorStateComputer): Selection[] | null; | |
> /** | |
> * Change the end of line sequence. This is the preferred way of | |
> * changing the eol sequence. This will land on the undo stack. | |
> */ | |
> pushEOL(eol: EndOfLineSequence): void; | |
> /** | |
> * Edit the model without adding the edits to the undo stack. | |
> * This can have dire consequences on the undo stack! See @pushEditOperations for the preferred way. | |
> * @param operations The edit operations. | |
> * @return If desired, the inverse edit operations, that, when applied, will bring the model back to the previous state. | |
> */ | |
> applyEdits(operations: IIdentifiedSingleEditOperation[]): void; | |
> applyEdits(operations: IIdentifiedSingleEditOperation[], computeUndoEdits: false): void; | |
> applyEdits(operations: IIdentifiedSingleEditOperation[], computeUndoEdits: true): IValidEditOperation[]; | |
> /** | |
> * Change the end of line sequence without recording in the undo stack. | |
> * This can have dire consequences on the undo stack! See @pushEOL for the preferred way. | |
> */ | |
> setEOL(eol: EndOfLineSequence): void; | |
> /** | |
> * An event emitted when the contents of the model have changed. | |
> * @event | |
> */ | |
> onDidChangeContent(listener: (e: IModelContentChangedEvent) => void): IDisposable; | |
> /** | |
> * An event emitted when decorations of the model have changed. | |
> * @event | |
> */ | |
> onDidChangeDecorations(listener: (e: IModelDecorationsChangedEvent) => void): IDisposable; | |
> /** | |
> * An event emitted when the model options have changed. | |
> * @event | |
> */ | |
> onDidChangeOptions(listener: (e: IModelOptionsChangedEvent) => void): IDisposable; | |
> /** | |
> * An event emitted when the language associated with the model has changed. | |
> * @event | |
> */ | |
> onDidChangeLanguage(listener: (e: IModelLanguageChangedEvent) => void): IDisposable; | |
> /** | |
> * An event emitted when the language configuration associated with the model has changed. | |
> * @event | |
> */ | |
> onDidChangeLanguageConfiguration(listener: (e: IModelLanguageConfigurationChangedEvent) => void): IDisposable; | |
> /** | |
> * An event emitted when the model has been attached to the first editor or detached from the last editor. | |
> * @event | |
> */ | |
> onDidChangeAttached(listener: () => void): IDisposable; | |
> /** | |
> * An event emitted right before disposing the model. | |
> * @event | |
> */ | |
> onWillDispose(listener: () => void): IDisposable; | |
> /** | |
> * Destroy this model. | |
> */ | |
> dispose(): void; | |
> /** | |
> * Returns if this model is attached to an editor or not. | |
> */ | |
> isAttachedToEditor(): boolean; | |
> } | |
> | |
> /** | |
> * A builder and helper for edit operations for a command. | |
> */ | |
> export interface IEditOperationBuilder { | |
> /** | |
> * Add a new edit operation (a replace operation). | |
> * @param range The range to replace (delete). May be empty to represent a simple insert. | |
> * @param text The text to replace with. May be null to represent a simple delete. | |
> */ | |
> addEditOperation(range: IRange, text: string | null, forceMoveMarkers?: boolean): void; | |
> /** | |
> * Add a new edit operation (a replace operation). | |
> * The inverse edits will be accessible in `ICursorStateComputerData.getInverseEditOperations()` | |
> * @param range The range to replace (delete). May be empty to represent a simple insert. | |
> * @param text The text to replace with. May be null to represent a simple delete. | |
> */ | |
> addTrackedEditOperation(range: IRange, text: string | null, forceMoveMarkers?: boolean): void; | |
> /** | |
> * Track `selection` when applying edit operations. | |
> * A best effort will be made to not grow/expand the selection. | |
> * An empty selection will clamp to a nearby character. | |
> * @param selection The selection to track. | |
> * @param trackPreviousOnEmpty If set, and the selection is empty, indicates whether the selection | |
> * should clamp to the previous or the next character. | |
> * @return A unique identifier. | |
> */ | |
> trackSelection(selection: Selection, trackPreviousOnEmpty?: boolean): string; | |
> } | |
> | |
> /** | |
> * A helper for computing cursor state after a command. | |
> */ | |
> export interface ICursorStateComputerData { | |
> /** | |
> * Get the inverse edit operations of the added edit operations. | |
> */ | |
> getInverseEditOperations(): IValidEditOperation[]; | |
> /** | |
> * Get a previously tracked selection. | |
> * @param id The unique identifier returned by `trackSelection`. | |
> * @return The selection. | |
> */ | |
> getTrackedSelection(id: string): Selection; | |
> } | |
> | |
> /** | |
> * A command that modifies text / cursor state on a model. | |
> */ | |
> export interface ICommand { | |
> /** | |
> * Get the edit operations needed to execute this command. | |
> * @param model The model the command will execute on. | |
> * @param builder A helper to collect the needed edit operations and to track selections. | |
> */ | |
> getEditOperations(model: ITextModel, builder: IEditOperationBuilder): void; | |
> /** | |
> * Compute the cursor state after the edit operations were applied. | |
> * @param model The model the command has executed on. | |
> * @param helper A helper to get inverse edit operations and to get previously tracked selections. | |
> * @return The cursor state after the command executed. | |
> */ | |
> computeCursorState(model: ITextModel, helper: ICursorStateComputerData): Selection; | |
> } | |
> | |
> /** | |
> * A model for the diff editor. | |
> */ | |
> export interface IDiffEditorModel { | |
> /** | |
> * Original model. | |
> */ | |
> original: ITextModel; | |
> /** | |
> * Modified model. | |
> */ | |
> modified: ITextModel; | |
> } | |
> | |
> /** | |
> * An event describing that an editor has had its model reset (i.e. `editor.setModel()`). | |
> */ | |
> export interface IModelChangedEvent { | |
> /** | |
> * The `uri` of the previous model or null. | |
> */ | |
> readonly oldModelUrl: Uri | null; | |
> /** | |
> * The `uri` of the new model or null. | |
> */ | |
> readonly newModelUrl: Uri | null; | |
> } | |
> | |
> export interface IDimension { | |
> width: number; | |
> height: number; | |
> } | |
> | |
> /** | |
> * A change | |
> */ | |
> export interface IChange { | |
> readonly originalStartLineNumber: number; | |
> readonly originalEndLineNumber: number; | |
> readonly modifiedStartLineNumber: number; | |
> readonly modifiedEndLineNumber: number; | |
> } | |
> | |
> /** | |
> * A character level change. | |
> */ | |
> export interface ICharChange extends IChange { | |
> readonly originalStartColumn: number; | |
> readonly originalEndColumn: number; | |
> readonly modifiedStartColumn: number; | |
> readonly modifiedEndColumn: number; | |
> } | |
> | |
> /** | |
> * A line change | |
> */ | |
> export interface ILineChange extends IChange { | |
> readonly charChanges: ICharChange[] | undefined; | |
> } | |
> | |
> export interface IContentSizeChangedEvent { | |
> readonly contentWidth: number; | |
> readonly contentHeight: number; | |
> readonly contentWidthChanged: boolean; | |
> readonly contentHeightChanged: boolean; | |
> } | |
> | |
> export interface INewScrollPosition { | |
> scrollLeft?: number; | |
> scrollTop?: number; | |
> } | |
> | |
> export interface IEditorAction { | |
> readonly id: string; | |
> readonly label: string; | |
> readonly alias: string; | |
> isSupported(): boolean; | |
> run(): Promise<void>; | |
> } | |
> | |
> export type IEditorModel = ITextModel | IDiffEditorModel; | |
> | |
> /** | |
> * A (serializable) state of the cursors. | |
> */ | |
> export interface ICursorState { | |
> inSelectionMode: boolean; | |
> selectionStart: IPosition; | |
> position: IPosition; | |
> } | |
> | |
> /** | |
> * A (serializable) state of the view. | |
> */ | |
> export interface IViewState { | |
> /** written by previous versions */ | |
> scrollTop?: number; | |
> /** written by previous versions */ | |
> scrollTopWithoutViewZones?: number; | |
> scrollLeft: number; | |
> firstPosition: IPosition; | |
> firstPositionDeltaTop: number; | |
> } | |
> | |
> /** | |
> * A (serializable) state of the code editor. | |
> */ | |
> export interface ICodeEditorViewState { | |
> cursorState: ICursorState[]; | |
> viewState: IViewState; | |
> contributionsState: { | |
> [id: string]: any; | |
> }; | |
> } | |
> | |
> /** | |
> * (Serializable) View state for the diff editor. | |
> */ | |
> export interface IDiffEditorViewState { | |
> original: ICodeEditorViewState | null; | |
> modified: ICodeEditorViewState | null; | |
> } | |
> | |
> /** | |
> * An editor view state. | |
> */ | |
> export type IEditorViewState = ICodeEditorViewState | IDiffEditorViewState; | |
> | |
> export enum ScrollType { | |
> Smooth = 0, | |
> Immediate = 1 | |
> } | |
> | |
> /** | |
> * An editor. | |
> */ | |
> export interface IEditor { | |
> /** | |
> * An event emitted when the editor has been disposed. | |
> * @event | |
> */ | |
> onDidDispose(listener: () => void): IDisposable; | |
> /** | |
> * Dispose the editor. | |
> */ | |
> dispose(): void; | |
> /** | |
> * Get a unique id for this editor instance. | |
> */ | |
> getId(): string; | |
> /** | |
> * Get the editor type. Please see `EditorType`. | |
> * This is to avoid an instanceof check | |
> */ | |
> getEditorType(): string; | |
> /** | |
> * Update the editor's options after the editor has been created. | |
> */ | |
> updateOptions(newOptions: IEditorOptions): void; | |
> /** | |
> * Instructs the editor to remeasure its container. This method should | |
> * be called when the container of the editor gets resized. | |
> * | |
> * If a dimension is passed in, the passed in value will be used. | |
> */ | |
> layout(dimension?: IDimension): void; | |
> /** | |
> * Brings browser focus to the editor text | |
> */ | |
> focus(): void; | |
> /** | |
> * Returns true if the text inside this editor is focused (i.e. cursor is blinking). | |
> */ | |
> hasTextFocus(): boolean; | |
> /** | |
> * Returns all actions associated with this editor. | |
> */ | |
> getSupportedActions(): IEditorAction[]; | |
> /** | |
> * Saves current view state of the editor in a serializable object. | |
> */ | |
> saveViewState(): IEditorViewState | null; | |
> /** | |
> * Restores the view state of the editor from a serializable object generated by `saveViewState`. | |
> */ | |
> restoreViewState(state: IEditorViewState): void; | |
> /** | |
> * Given a position, returns a column number that takes tab-widths into account. | |
> */ | |
> getVisibleColumnFromPosition(position: IPosition): number; | |
> /** | |
> * Returns the primary position of the cursor. | |
> */ | |
> getPosition(): Position | null; | |
> /** | |
> * Set the primary position of the cursor. This will remove any secondary cursors. | |
> * @param position New primary cursor's position | |
> */ | |
> setPosition(position: IPosition): void; | |
> /** | |
> * Scroll vertically as necessary and reveal a line. | |
> */ | |
> revealLine(lineNumber: number, scrollType?: ScrollType): void; | |
> /** | |
> * Scroll vertically as necessary and reveal a line centered vertically. | |
> */ | |
> revealLineInCenter(lineNumber: number, scrollType?: ScrollType): void; | |
> /** | |
> * Scroll vertically as necessary and reveal a line centered vertically only if it lies outside the viewport. | |
> */ | |
> revealLineInCenterIfOutsideViewport(lineNumber: number, scrollType?: ScrollType): void; | |
> /** | |
> * Scroll vertically as necessary and reveal a line close to the top of the viewport, | |
> * optimized for viewing a code definition. | |
> */ | |
> revealLineNearTop(lineNumber: number, scrollType?: ScrollType): void; | |
> /** | |
> * Scroll vertically or horizontally as necessary and reveal a position. | |
> */ | |
> revealPosition(position: IPosition, scrollType?: ScrollType): void; | |
> /** | |
> * Scroll vertically or horizontally as necessary and reveal a position centered vertically. | |
> */ | |
> revealPositionInCenter(position: IPosition, scrollType?: ScrollType): void; | |
> /** | |
> * Scroll vertically or horizontally as necessary and reveal a position centered vertically only if it lies outside the viewport. | |
> */ | |
> revealPositionInCenterIfOutsideViewport(position: IPosition, scrollType?: ScrollType): void; | |
> /** | |
> * Scroll vertically or horizontally as necessary and reveal a position close to the top of the viewport, | |
> * optimized for viewing a code definition. | |
> */ | |
> revealPositionNearTop(position: IPosition, scrollType?: ScrollType): void; | |
> /** | |
> * Returns the primary selection of the editor. | |
> */ | |
> getSelection(): Selection | null; | |
> /** | |
> * Returns all the selections of the editor. | |
> */ | |
> getSelections(): Selection[] | null; | |
> /** | |
> * Set the primary selection of the editor. This will remove any secondary cursors. | |
> * @param selection The new selection | |
> */ | |
> setSelection(selection: IRange): void; | |
> /** | |
> * Set the primary selection of the editor. This will remove any secondary cursors. | |
> * @param selection The new selection | |
> */ | |
> setSelection(selection: Range): void; | |
> /** | |
> * Set the primary selection of the editor. This will remove any secondary cursors. | |
> * @param selection The new selection | |
> */ | |
> setSelection(selection: ISelection): void; | |
> /** | |
> * Set the primary selection of the editor. This will remove any secondary cursors. | |
> * @param selection The new selection | |
> */ | |
> setSelection(selection: Selection): void; | |
> /** | |
> * Set the selections for all the cursors of the editor. | |
> * Cursors will be removed or added, as necessary. | |
> */ | |
> setSelections(selections: readonly ISelection[]): void; | |
> /** | |
> * Scroll vertically as necessary and reveal lines. | |
> */ | |
> revealLines(startLineNumber: number, endLineNumber: number, scrollType?: ScrollType): void; | |
> /** | |
> * Scroll vertically as necessary and reveal lines centered vertically. | |
> */ | |
> revealLinesInCenter(lineNumber: number, endLineNumber: number, scrollType?: ScrollType): void; | |
> /** | |
> * Scroll vertically as necessary and reveal lines centered vertically only if it lies outside the viewport. | |
> */ | |
> revealLinesInCenterIfOutsideViewport(lineNumber: number, endLineNumber: number, scrollType?: ScrollType): void; | |
> /** | |
> * Scroll vertically as necessary and reveal lines close to the top of the viewport, | |
> * optimized for viewing a code definition. | |
> */ | |
> revealLinesNearTop(lineNumber: number, endLineNumber: number, scrollType?: ScrollType): void; | |
> /** | |
> * Scroll vertically or horizontally as necessary and reveal a range. | |
> */ | |
> revealRange(range: IRange, scrollType?: ScrollType): void; | |
> /** | |
> * Scroll vertically or horizontally as necessary and reveal a range centered vertically. | |
> */ | |
> revealRangeInCenter(range: IRange, scrollType?: ScrollType): void; | |
> /** | |
> * Scroll vertically or horizontally as necessary and reveal a range at the top of the viewport. | |
> */ | |
> revealRangeAtTop(range: IRange, scrollType?: ScrollType): void; | |
> /** | |
> * Scroll vertically or horizontally as necessary and reveal a range centered vertically only if it lies outside the viewport. | |
> */ | |
> revealRangeInCenterIfOutsideViewport(range: IRange, scrollType?: ScrollType): void; | |
> /** | |
> * Scroll vertically or horizontally as necessary and reveal a range close to the top of the viewport, | |
> * optimized for viewing a code definition. | |
> */ | |
> revealRangeNearTop(range: IRange, scrollType?: ScrollType): void; | |
> /** | |
> * Scroll vertically or horizontally as necessary and reveal a range close to the top of the viewport, | |
> * optimized for viewing a code definition. Only if it lies outside the viewport. | |
> */ | |
> revealRangeNearTopIfOutsideViewport(range: IRange, scrollType?: ScrollType): void; | |
> /** | |
> * Directly trigger a handler or an editor action. | |
> * @param source The source of the call. | |
> * @param handlerId The id of the handler or the id of a contribution. | |
> * @param payload Extra data to be sent to the handler. | |
> */ | |
> trigger(source: string | null | undefined, handlerId: string, payload: any): void; | |
> /** | |
> * Gets the current model attached to this editor. | |
> */ | |
> getModel(): IEditorModel | null; | |
> /** | |
> * Sets the current model attached to this editor. | |
> * If the previous model was created by the editor via the value key in the options | |
> * literal object, it will be destroyed. Otherwise, if the previous model was set | |
> * via setModel, or the model key in the options literal object, the previous model | |
> * will not be destroyed. | |
> * It is safe to call setModel(null) to simply detach the current model from the editor. | |
> */ | |
> setModel(model: IEditorModel | null): void; | |
> } | |
> | |
> /** | |
> * An editor contribution that gets created every time a new editor gets created and gets disposed when the editor gets disposed. | |
> */ | |
> export interface IEditorContribution { | |
> /** | |
> * Dispose this contribution. | |
> */ | |
> dispose(): void; | |
> /** | |
> * Store view state. | |
> */ | |
> saveViewState?(): any; | |
> /** | |
> * Restore view state. | |
> */ | |
> restoreViewState?(state: any): void; | |
> } | |
> | |
> /** | |
> * The type of the `IEditor`. | |
> */ | |
> export const EditorType: { | |
> ICodeEditor: string; | |
> IDiffEditor: string; | |
> }; | |
> | |
> /** | |
> * An event describing that the current language associated with a model has changed. | |
> */ | |
> export interface IModelLanguageChangedEvent { | |
> /** | |
> * Previous language | |
> */ | |
> readonly oldLanguage: string; | |
> /** | |
> * New language | |
> */ | |
> readonly newLanguage: string; | |
> } | |
> | |
> /** | |
> * An event describing that the language configuration associated with a model has changed. | |
> */ | |
> export interface IModelLanguageConfigurationChangedEvent { | |
> } | |
> | |
> export interface IModelContentChange { | |
> /** | |
> * The range that got replaced. | |
> */ | |
> readonly range: IRange; | |
> /** | |
> * The offset of the range that got replaced. | |
> */ | |
> readonly rangeOffset: number; | |
> /** | |
> * The length of the range that got replaced. | |
> */ | |
> readonly rangeLength: number; | |
> /** | |
> * The new text for the range. | |
> */ | |
> readonly text: string; | |
> } | |
> | |
> /** | |
> * An event describing a change in the text of a model. | |
> */ | |
> export interface IModelContentChangedEvent { | |
> readonly changes: IModelContentChange[]; | |
> /** | |
> * The (new) end-of-line character. | |
> */ | |
> readonly eol: string; | |
> /** | |
> * The new version id the model has transitioned to. | |
> */ | |
> readonly versionId: number; | |
> /** | |
> * Flag that indicates that this event was generated while undoing. | |
> */ | |
> readonly isUndoing: boolean; | |
> /** | |
> * Flag that indicates that this event was generated while redoing. | |
> */ | |
> readonly isRedoing: boolean; | |
> /** | |
> * Flag that indicates that all decorations were lost with this edit. | |
> * The model has been reset to a new value. | |
> */ | |
> readonly isFlush: boolean; | |
> } | |
> | |
> /** | |
> * An event describing that model decorations have changed. | |
> */ | |
> export interface IModelDecorationsChangedEvent { | |
> readonly affectsMinimap: boolean; | |
> readonly affectsOverviewRuler: boolean; | |
> } | |
> | |
> export interface IModelOptionsChangedEvent { | |
> readonly tabSize: boolean; | |
> readonly indentSize: boolean; | |
> readonly insertSpaces: boolean; | |
> readonly trimAutoWhitespace: boolean; | |
> } | |
> | |
> /** | |
> * Describes the reason the cursor has changed its position. | |
> */ | |
> export enum CursorChangeReason { | |
> /** | |
> * Unknown or not set. | |
> */ | |
> NotSet = 0, | |
> /** | |
> * A `model.setValue()` was called. | |
> */ | |
> ContentFlush = 1, | |
> /** | |
> * The `model` has been changed outside of this cursor and the cursor recovers its position from associated markers. | |
> */ | |
> RecoverFromMarkers = 2, | |
> /** | |
> * There was an explicit user gesture. | |
> */ | |
> Explicit = 3, | |
> /** | |
> * There was a Paste. | |
> */ | |
> Paste = 4, | |
> /** | |
> * There was an Undo. | |
> */ | |
> Undo = 5, | |
> /** | |
> * There was a Redo. | |
> */ | |
> Redo = 6 | |
> } | |
> | |
> /** | |
> * An event describing that the cursor position has changed. | |
> */ | |
> export interface ICursorPositionChangedEvent { | |
> /** | |
> * Primary cursor's position. | |
> */ | |
> readonly position: Position; | |
> /** | |
> * Secondary cursors' position. | |
> */ | |
> readonly secondaryPositions: Position[]; | |
> /** | |
> * Reason. | |
> */ | |
> readonly reason: CursorChangeReason; | |
> /** | |
> * Source of the call that caused the event. | |
> */ | |
> readonly source: string; | |
> } | |
> | |
> /** | |
> * An event describing that the cursor selection has changed. | |
> */ | |
> export interface ICursorSelectionChangedEvent { | |
> /** | |
> * The primary selection. | |
> */ | |
> readonly selection: Selection; | |
> /** | |
> * The secondary selections. | |
> */ | |
> readonly secondarySelections: Selection[]; | |
> /** | |
> * The model version id. | |
> */ | |
> readonly modelVersionId: number; | |
> /** | |
> * The old selections. | |
> */ | |
> readonly oldSelections: Selection[] | null; | |
> /** | |
> * The model version id the that `oldSelections` refer to. | |
> */ | |
> readonly oldModelVersionId: number; | |
> /** | |
> * Source of the call that caused the event. | |
> */ | |
> readonly source: string; | |
> /** | |
> * Reason. | |
> */ | |
> readonly reason: CursorChangeReason; | |
> } | |
> | |
> export enum AccessibilitySupport { | |
> /** | |
> * This should be the browser case where it is not known if a screen reader is attached or no. | |
> */ | |
> Unknown = 0, | |
> Disabled = 1, | |
> Enabled = 2 | |
> } | |
> | |
> /** | |
> * Configuration options for auto closing quotes and brackets | |
> */ | |
> export type EditorAutoClosingStrategy = 'always' | 'languageDefined' | 'beforeWhitespace' | 'never'; | |
> | |
> /** | |
> * Configuration options for auto wrapping quotes and brackets | |
> */ | |
> export type EditorAutoSurroundStrategy = 'languageDefined' | 'quotes' | 'brackets' | 'never'; | |
> | |
> /** | |
> * Configuration options for typing over closing quotes or brackets | |
> */ | |
> export type EditorAutoClosingEditStrategy = 'always' | 'auto' | 'never'; | |
> | |
> /** | |
> * Configuration options for auto indentation in the editor | |
> */ | |
> export enum EditorAutoIndentStrategy { | |
> None = 0, | |
> Keep = 1, | |
> Brackets = 2, | |
> Advanced = 3, | |
> Full = 4 | |
> } | |
> | |
> /** | |
> * Configuration options for the editor. | |
> */ | |
> export interface IEditorOptions { | |
> /** | |
> * This editor is used inside a diff editor. | |
> */ | |
> inDiffEditor?: boolean; | |
> /** | |
> * The aria label for the editor's textarea (when it is focused). | |
> */ | |
> ariaLabel?: string; | |
> /** | |
> * The `tabindex` property of the editor's textarea | |
> */ | |
> tabIndex?: number; | |
> /** | |
> * Render vertical lines at the specified columns. | |
> * Defaults to empty array. | |
> */ | |
> rulers?: (number | IRulerOption)[]; | |
> /** | |
> * A string containing the word separators used when doing word navigation. | |
> * Defaults to `~!@#$%^&*()-=+[{]}\\|;:\'",.<>/? | |
> */ | |
> wordSeparators?: string; | |
> /** | |
> * Enable Linux primary clipboard. | |
> * Defaults to true. | |
> */ | |
> selectionClipboard?: boolean; | |
> /** | |
> * Control the rendering of line numbers. | |
> * If it is a function, it will be invoked when rendering a line number and the return value will be rendered. | |
> * Otherwise, if it is a truthy, line numbers will be rendered normally (equivalent of using an identity function). | |
> * Otherwise, line numbers will not be rendered. | |
> * Defaults to `on`. | |
> */ | |
> lineNumbers?: LineNumbersType; | |
> /** | |
> * Controls the minimal number of visible leading and trailing lines surrounding the cursor. | |
> * Defaults to 0. | |
> */ | |
> cursorSurroundingLines?: number; | |
> /** | |
> * Controls when `cursorSurroundingLines` should be enforced | |
> * Defaults to `default`, `cursorSurroundingLines` is not enforced when cursor position is changed | |
> * by mouse. | |
> */ | |
> cursorSurroundingLinesStyle?: 'default' | 'all'; | |
> /** | |
> * Render last line number when the file ends with a newline. | |
> * Defaults to true. | |
> */ | |
> renderFinalNewline?: boolean; | |
> /** | |
> * Remove unusual line terminators like LINE SEPARATOR (LS), PARAGRAPH SEPARATOR (PS). | |
> * Defaults to 'prompt'. | |
> */ | |
> unusualLineTerminators?: 'auto' | 'off' | 'prompt'; | |
> /** | |
> * Should the corresponding line be selected when clicking on the line number? | |
> * Defaults to true. | |
> */ | |
> selectOnLineNumbers?: boolean; | |
> /** | |
> * Control the width of line numbers, by reserving horizontal space for rendering at least an amount of digits. | |
> * Defaults to 5. | |
> */ | |
> lineNumbersMinChars?: number; | |
> /** | |
> * Enable the rendering of the glyph margin. | |
> * Defaults to true in vscode and to false in monaco-editor. | |
> */ | |
> glyphMargin?: boolean; | |
> /** | |
> * The width reserved for line decorations (in px). | |
> * Line decorations are placed between line numbers and the editor content. | |
> * You can pass in a string in the format floating point followed by "ch". e.g. 1.3ch. | |
> * Defaults to 10. | |
> */ | |
> lineDecorationsWidth?: number | string; | |
> /** | |
> * When revealing the cursor, a virtual padding (px) is added to the cursor, turning it into a rectangle. | |
> * This virtual padding ensures that the cursor gets revealed before hitting the edge of the viewport. | |
> * Defaults to 30 (px). | |
> */ | |
> revealHorizontalRightPadding?: number; | |
> /** | |
> * Render the editor selection with rounded borders. | |
> * Defaults to true. | |
> */ | |
> roundedSelection?: boolean; | |
> /** | |
> * Class name to be added to the editor. | |
> */ | |
> extraEditorClassName?: string; | |
> /** | |
> * Should the editor be read only. See also `domReadOnly`. | |
> * Defaults to false. | |
> */ | |
> readOnly?: boolean; | |
> /** | |
> * Should the textarea used for input use the DOM `readonly` attribute. | |
> * Defaults to false. | |
> */ | |
> domReadOnly?: boolean; | |
> /** | |
> * Enable linked editing. | |
> * Defaults to false. | |
> */ | |
> linkedEditing?: boolean; | |
> /** | |
> * deprecated, use linkedEditing instead | |
> */ | |
> renameOnType?: boolean; | |
> /** | |
> * Should the editor render validation decorations. | |
> * Defaults to editable. | |
> */ | |
> renderValidationDecorations?: 'editable' | 'on' | 'off'; | |
> /** | |
> * Control the behavior and rendering of the scrollbars. | |
> */ | |
> scrollbar?: IEditorScrollbarOptions; | |
> /** | |
> * Control the behavior and rendering of the minimap. | |
> */ | |
> minimap?: IEditorMinimapOptions; | |
> /** | |
> * Control the behavior of the find widget. | |
> */ | |
> find?: IEditorFindOptions; | |
> /** | |
> * Display overflow widgets as `fixed`. | |
> * Defaults to `false`. | |
> */ | |
> fixedOverflowWidgets?: boolean; | |
> /** | |
> * The number of vertical lanes the overview ruler should render. | |
> * Defaults to 3. | |
> */ | |
> overviewRulerLanes?: number; | |
> /** | |
> * Controls if a border should be drawn around the overview ruler. | |
> * Defaults to `true`. | |
> */ | |
> overviewRulerBorder?: boolean; | |
> /** | |
> * Control the cursor animation style, possible values are 'blink', 'smooth', 'phase', 'expand' and 'solid'. | |
> * Defaults to 'blink'. | |
> */ | |
> cursorBlinking?: 'blink' | 'smooth' | 'phase' | 'expand' | 'solid'; | |
> /** | |
> * Zoom the font in the editor when using the mouse wheel in combination with holding Ctrl. | |
> * Defaults to false. | |
> */ | |
> mouseWheelZoom?: boolean; | |
> /** | |
> * Control the mouse pointer style, either 'text' or 'default' or 'copy' | |
> * Defaults to 'text' | |
> */ | |
> mouseStyle?: 'text' | 'default' | 'copy'; | |
> /** | |
> * Enable smooth caret animation. | |
> * Defaults to false. | |
> */ | |
> cursorSmoothCaretAnimation?: boolean; | |
> /** | |
> * Control the cursor style, either 'block' or 'line'. | |
> * Defaults to 'line'. | |
> */ | |
> cursorStyle?: 'line' | 'block' | 'underline' | 'line-thin' | 'block-outline' | 'underline-thin'; | |
> /** | |
> * Control the width of the cursor when cursorStyle is set to 'line' | |
> */ | |
> cursorWidth?: number; | |
> /** | |
> * Enable font ligatures. | |
> * Defaults to false. | |
> */ | |
> fontLigatures?: boolean | string; | |
> /** | |
> * Disable the use of `transform: translate3d(0px, 0px, 0px)` for the editor margin and lines layers. | |
> * The usage of `transform: translate3d(0px, 0px, 0px)` acts as a hint for browsers to create an extra layer. | |
> * Defaults to false. | |
> */ | |
> disableLayerHinting?: boolean; | |
> /** | |
> * Disable the optimizations for monospace fonts. | |
> * Defaults to false. | |
> */ | |
> disableMonospaceOptimizations?: boolean; | |
> /** | |
> * Should the cursor be hidden in the overview ruler. | |
> * Defaults to false. | |
> */ | |
> hideCursorInOverviewRuler?: boolean; | |
> /** | |
> * Enable that scrolling can go one screen size after the last line. | |
> * Defaults to true. | |
> */ | |
> scrollBeyondLastLine?: boolean; | |
> /** | |
> * Enable that scrolling can go beyond the last column by a number of columns. | |
> * Defaults to 5. | |
> */ | |
> scrollBeyondLastColumn?: number; | |
> /** | |
> * Enable that the editor animates scrolling to a position. | |
> * Defaults to false. | |
> */ | |
> smoothScrolling?: boolean; | |
> /** | |
> * Enable that the editor will install an interval to check if its container dom node size has changed. | |
> * Enabling this might have a severe performance impact. | |
> * Defaults to false. | |
> */ | |
> automaticLayout?: boolean; | |
> /** | |
> * Control the wrapping of the editor. | |
> * When `wordWrap` = "off", the lines will never wrap. | |
> * When `wordWrap` = "on", the lines will wrap at the viewport width. | |
> * When `wordWrap` = "wordWrapColumn", the lines will wrap at `wordWrapColumn`. | |
> * When `wordWrap` = "bounded", the lines will wrap at min(viewport width, wordWrapColumn). | |
> * Defaults to "off". | |
> */ | |
> wordWrap?: 'off' | 'on' | 'wordWrapColumn' | 'bounded'; | |
> /** | |
> * Override the `wordWrap` setting. | |
> */ | |
> wordWrapOverride1?: 'off' | 'on' | 'inherit'; | |
> /** | |
> * Override the `wordWrapOverride1` setting. | |
> */ | |
> wordWrapOverride2?: 'off' | 'on' | 'inherit'; | |
> /** | |
> * Control the wrapping of the editor. | |
> * When `wordWrap` = "off", the lines will never wrap. | |
> * When `wordWrap` = "on", the lines will wrap at the viewport width. | |
> * When `wordWrap` = "wordWrapColumn", the lines will wrap at `wordWrapColumn`. | |
> * When `wordWrap` = "bounded", the lines will wrap at min(viewport width, wordWrapColumn). | |
> * Defaults to 80. | |
> */ | |
> wordWrapColumn?: number; | |
> /** | |
> * Control indentation of wrapped lines. Can be: 'none', 'same', 'indent' or 'deepIndent'. | |
> * Defaults to 'same' in vscode and to 'none' in monaco-editor. | |
> */ | |
> wrappingIndent?: 'none' | 'same' | 'indent' | 'deepIndent'; | |
> /** | |
> * Controls the wrapping strategy to use. | |
> * Defaults to 'simple'. | |
> */ | |
> wrappingStrategy?: 'simple' | 'advanced'; | |
> /** | |
> * Configure word wrapping characters. A break will be introduced before these characters. | |
> * Defaults to '([{‘“〈《「『【〔([{「£¥$£¥++'. | |
> */ | |
> wordWrapBreakBeforeCharacters?: string; | |
> /** | |
> * Configure word wrapping characters. A break will be introduced after these characters. | |
> * Defaults to ' \t})]?|/&.,;¢°′″‰℃、。。、¢,.:;?!%・・ゝゞヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻ァィゥェォャュョッー”〉》」』】〕)]}」'. | |
> */ | |
> wordWrapBreakAfterCharacters?: string; | |
> /** | |
> * Performance guard: Stop rendering a line after x characters. | |
> * Defaults to 10000. | |
> * Use -1 to never stop rendering | |
> */ | |
> stopRenderingLineAfter?: number; | |
> /** | |
> * Configure the editor's hover. | |
> */ | |
> hover?: IEditorHoverOptions; | |
> /** | |
> * Enable detecting links and making them clickable. | |
> * Defaults to true. | |
> */ | |
> links?: boolean; | |
> /** | |
> * Enable inline color decorators and color picker rendering. | |
> */ | |
> colorDecorators?: boolean; | |
> /** | |
> * Control the behaviour of comments in the editor. | |
> */ | |
> comments?: IEditorCommentsOptions; | |
> /** | |
> * Enable custom contextmenu. | |
> * Defaults to true. | |
> */ | |
> contextmenu?: boolean; | |
> /** | |
> * A multiplier to be used on the `deltaX` and `deltaY` of mouse wheel scroll events. | |
> * Defaults to 1. | |
> */ | |
> mouseWheelScrollSensitivity?: number; | |
> /** | |
> * FastScrolling mulitplier speed when pressing `Alt` | |
> * Defaults to 5. | |
> */ | |
> fastScrollSensitivity?: number; | |
> /** | |
> * Enable that the editor scrolls only the predominant axis. Prevents horizontal drift when scrolling vertically on a trackpad. | |
> * Defaults to true. | |
> */ | |
> scrollPredominantAxis?: boolean; | |
> /** | |
> * Enable that the selection with the mouse and keys is doing column selection. | |
> * Defaults to false. | |
> */ | |
> columnSelection?: boolean; | |
> /** | |
> * The modifier to be used to add multiple cursors with the mouse. | |
> * Defaults to 'alt' | |
> */ | |
> multiCursorModifier?: 'ctrlCmd' | 'alt'; | |
> /** | |
> * Merge overlapping selections. | |
> * Defaults to true | |
> */ | |
> multiCursorMergeOverlapping?: boolean; | |
> /** | |
> * Configure the behaviour when pasting a text with the line count equal to the cursor count. | |
> * Defaults to 'spread'. | |
> */ | |
> multiCursorPaste?: 'spread' | 'full'; | |
> /** | |
> * Configure the editor's accessibility support. | |
> * Defaults to 'auto'. It is best to leave this to 'auto'. | |
> */ | |
> accessibilitySupport?: 'auto' | 'off' | 'on'; | |
> /** | |
> * Controls the number of lines in the editor that can be read out by a screen reader | |
> */ | |
> accessibilityPageSize?: number; | |
> /** | |
> * Suggest options. | |
> */ | |
> suggest?: ISuggestOptions; | |
> inlineSuggest?: IInlineSuggestOptions; | |
> /** | |
> * Smart select options. | |
> */ | |
> smartSelect?: ISmartSelectOptions; | |
> /** | |
> * | |
> */ | |
> gotoLocation?: IGotoLocationOptions; | |
> /** | |
> * Enable quick suggestions (shadow suggestions) | |
> * Defaults to true. | |
> */ | |
> quickSuggestions?: boolean | IQuickSuggestionsOptions; | |
> /** | |
> * Quick suggestions show delay (in ms) | |
> * Defaults to 10 (ms) | |
> */ | |
> quickSuggestionsDelay?: number; | |
> /** | |
> * Controls the spacing around the editor. | |
> */ | |
> padding?: IEditorPaddingOptions; | |
> /** | |
> * Parameter hint options. | |
> */ | |
> parameterHints?: IEditorParameterHintOptions; | |
> /** | |
> * Options for auto closing brackets. | |
> * Defaults to language defined behavior. | |
> */ | |
> autoClosingBrackets?: EditorAutoClosingStrategy; | |
> /** | |
> * Options for auto closing quotes. | |
> * Defaults to language defined behavior. | |
> */ | |
> autoClosingQuotes?: EditorAutoClosingStrategy; | |
> /** | |
> * Options for pressing backspace near quotes or bracket pairs. | |
> */ | |
> autoClosingDelete?: EditorAutoClosingEditStrategy; | |
> /** | |
> * Options for typing over closing quotes or brackets. | |
> */ | |
> autoClosingOvertype?: EditorAutoClosingEditStrategy; | |
> /** | |
> * Options for auto surrounding. | |
> * Defaults to always allowing auto surrounding. | |
> */ | |
> autoSurround?: EditorAutoSurroundStrategy; | |
> /** | |
> * Controls whether the editor should automatically adjust the indentation when users type, paste, move or indent lines. | |
> * Defaults to advanced. | |
> */ | |
> autoIndent?: 'none' | 'keep' | 'brackets' | 'advanced' | 'full'; | |
> /** | |
> * Emulate selection behaviour of tab characters when using spaces for indentation. | |
> * This means selection will stick to tab stops. | |
> */ | |
> stickyTabStops?: boolean; | |
> /** | |
> * Enable format on type. | |
> * Defaults to false. | |
> */ | |
> formatOnType?: boolean; | |
> /** | |
> * Enable format on paste. | |
> * Defaults to false. | |
> */ | |
> formatOnPaste?: boolean; | |
> /** | |
> * Controls if the editor should allow to move selections via drag and drop. | |
> * Defaults to false. | |
> */ | |
> dragAndDrop?: boolean; | |
> /** | |
> * Enable the suggestion box to pop-up on trigger characters. | |
> * Defaults to true. | |
> */ | |
> suggestOnTriggerCharacters?: boolean; | |
> /** | |
> * Accept suggestions on ENTER. | |
> * Defaults to 'on'. | |
> */ | |
> acceptSuggestionOnEnter?: 'on' | 'smart' | 'off'; | |
> /** | |
> * Accept suggestions on provider defined characters. | |
> * Defaults to true. | |
> */ | |
> acceptSuggestionOnCommitCharacter?: boolean; | |
> /** | |
> * Enable snippet suggestions. Default to 'true'. | |
> */ | |
> snippetSuggestions?: 'top' | 'bottom' | 'inline' | 'none'; | |
> /** | |
> * Copying without a selection copies the current line. | |
> */ | |
> emptySelectionClipboard?: boolean; | |
> /** | |
> * Syntax highlighting is copied. | |
> */ | |
> copyWithSyntaxHighlighting?: boolean; | |
> /** | |
> * The history mode for suggestions. | |
> */ | |
> suggestSelection?: 'first' | 'recentlyUsed' | 'recentlyUsedByPrefix'; | |
> /** | |
> * The font size for the suggest widget. | |
> * Defaults to the editor font size. | |
> */ | |
> suggestFontSize?: number; | |
> /** | |
> * The line height for the suggest widget. | |
> * Defaults to the editor line height. | |
> */ | |
> suggestLineHeight?: number; | |
> /** | |
> * Enable tab completion. | |
> */ | |
> tabCompletion?: 'on' | 'off' | 'onlySnippets'; | |
> /** | |
> * Enable selection highlight. | |
> * Defaults to true. | |
> */ | |
> selectionHighlight?: boolean; | |
> /** | |
> * Enable semantic occurrences highlight. | |
> * Defaults to true. | |
> */ | |
> occurrencesHighlight?: boolean; | |
> /** | |
> * Show code lens | |
> * Defaults to true. | |
> */ | |
> codeLens?: boolean; | |
> /** | |
> * Code lens font family. Defaults to editor font family. | |
> */ | |
> codeLensFontFamily?: string; | |
> /** | |
> * Code lens font size. Default to 90% of the editor font size | |
> */ | |
> codeLensFontSize?: number; | |
> /** | |
> * Control the behavior and rendering of the code action lightbulb. | |
> */ | |
> lightbulb?: IEditorLightbulbOptions; | |
> /** | |
> * Timeout for running code actions on save. | |
> */ | |
> codeActionsOnSaveTimeout?: number; | |
> /** | |
> * Enable code folding. | |
> * Defaults to true. | |
> */ | |
> folding?: boolean; | |
> /** | |
> * Selects the folding strategy. 'auto' uses the strategies contributed for the current document, 'indentation' uses the indentation based folding strategy. | |
> * Defaults to 'auto'. | |
> */ | |
> foldingStrategy?: 'auto' | 'indentation'; | |
> /** | |
> * Enable highlight for folded regions. | |
> * Defaults to true. | |
> */ | |
> foldingHighlight?: boolean; | |
> /** | |
> * Auto fold imports folding regions. | |
> * Defaults to true. | |
> */ | |
> foldingImportsByDefault?: boolean; | |
> /** | |
> * Controls whether the fold actions in the gutter stay always visible or hide unless the mouse is over the gutter. | |
> * Defaults to 'mouseover'. | |
> */ | |
> showFoldingControls?: 'always' | 'mouseover'; | |
> /** | |
> * Controls whether clicking on the empty content after a folded line will unfold the line. | |
> * Defaults to false. | |
> */ | |
> unfoldOnClickAfterEndOfLine?: boolean; | |
> /** | |
> * Enable highlighting of matching brackets. | |
> * Defaults to 'always'. | |
> */ | |
> matchBrackets?: 'never' | 'near' | 'always'; | |
> /** | |
> * Enable rendering of whitespace. | |
> * Defaults to 'selection'. | |
> */ | |
> renderWhitespace?: 'none' | 'boundary' | 'selection' | 'trailing' | 'all'; | |
> /** | |
> * Enable rendering of control characters. | |
> * Defaults to true. | |
> */ | |
> renderControlCharacters?: boolean; | |
> /** | |
> * Enable rendering of current line highlight. | |
> * Defaults to all. | |
> */ | |
> renderLineHighlight?: 'none' | 'gutter' | 'line' | 'all'; | |
> /** | |
> * Control if the current line highlight should be rendered only the editor is focused. | |
> * Defaults to false. | |
> */ | |
> renderLineHighlightOnlyWhenFocus?: boolean; | |
> /** | |
> * Inserting and deleting whitespace follows tab stops. | |
> */ | |
> useTabStops?: boolean; | |
> /** | |
> * The font family | |
> */ | |
> fontFamily?: string; | |
> /** | |
> * The font weight | |
> */ | |
> fontWeight?: string; | |
> /** | |
> * The font size | |
> */ | |
> fontSize?: number; | |
> /** | |
> * The line height | |
> */ | |
> lineHeight?: number; | |
> /** | |
> * The letter spacing | |
> */ | |
> letterSpacing?: number; | |
> /** | |
> * Controls fading out of unused variables. | |
> */ | |
> showUnused?: boolean; | |
> /** | |
> * Controls whether to focus the inline editor in the peek widget by default. | |
> * Defaults to false. | |
> */ | |
> peekWidgetDefaultFocus?: 'tree' | 'editor'; | |
> /** | |
> * Controls whether the definition link opens element in the peek widget. | |
> * Defaults to false. | |
> */ | |
> definitionLinkOpensInPeek?: boolean; | |
> /** | |
> * Controls strikethrough deprecated variables. | |
> */ | |
> showDeprecated?: boolean; | |
> /** | |
> * Control the behavior and rendering of the inline hints. | |
> */ | |
> inlayHints?: IEditorInlayHintsOptions; | |
> /** | |
> * Control if the editor should use shadow DOM. | |
> */ | |
> useShadowDOM?: boolean; | |
> /** | |
> * Controls the behavior of editor guides. | |
> */ | |
> guides?: IGuidesOptions; | |
> } | |
> | |
> export interface IDiffEditorBaseOptions { | |
> /** | |
> * Allow the user to resize the diff editor split view. | |
> * Defaults to true. | |
> */ | |
> enableSplitViewResizing?: boolean; | |
> /** | |
> * Render the differences in two side-by-side editors. | |
> * Defaults to true. | |
> */ | |
> renderSideBySide?: boolean; | |
> /** | |
> * Timeout in milliseconds after which diff computation is cancelled. | |
> * Defaults to 5000. | |
> */ | |
> maxComputationTime?: number; | |
> /** | |
> * Maximum supported file size in MB. | |
> * Defaults to 50. | |
> */ | |
> maxFileSize?: number; | |
> /** | |
> * Compute the diff by ignoring leading/trailing whitespace | |
> * Defaults to true. | |
> */ | |
> ignoreTrimWhitespace?: boolean; | |
> /** | |
> * Render +/- indicators for added/deleted changes. | |
> * Defaults to true. | |
> */ | |
> renderIndicators?: boolean; | |
> /** | |
> * Original model should be editable? | |
> * Defaults to false. | |
> */ | |
> originalEditable?: boolean; | |
> /** | |
> * Should the diff editor enable code lens? | |
> * Defaults to false. | |
> */ | |
> diffCodeLens?: boolean; | |
> /** | |
> * Is the diff editor should render overview ruler | |
> * Defaults to true | |
> */ | |
> renderOverviewRuler?: boolean; | |
> /** | |
> * Control the wrapping of the diff editor. | |
> */ | |
> diffWordWrap?: 'off' | 'on' | 'inherit'; | |
> } | |
> | |
> /** | |
> * Configuration options for the diff editor. | |
> */ | |
> export interface IDiffEditorOptions extends IEditorOptions, IDiffEditorBaseOptions { | |
> } | |
> | |
> /** | |
> * An event describing that the configuration of the editor has changed. | |
> */ | |
> export class ConfigurationChangedEvent { | |
> hasChanged(id: EditorOption): boolean; | |
> } | |
> | |
> /** | |
> * All computed editor options. | |
> */ | |
> export interface IComputedEditorOptions { | |
> get<T extends EditorOption>(id: T): FindComputedEditorOptionValueById<T>; | |
> } | |
> | |
> export interface IEditorOption<K1 extends EditorOption, V> { | |
> readonly id: K1; | |
> readonly name: string; | |
> defaultValue: V; | |
> } | |
> | |
> /** | |
> * Configuration options for editor comments | |
> */ | |
> export interface IEditorCommentsOptions { | |
> /** | |
> * Insert a space after the line comment token and inside the block comments tokens. | |
> * Defaults to true. | |
> */ | |
> insertSpace?: boolean; | |
> /** | |
> * Ignore empty lines when inserting line comments. | |
> * Defaults to true. | |
> */ | |
> ignoreEmptyLines?: boolean; | |
> } | |
> | |
> /** | |
> * The kind of animation in which the editor's cursor should be rendered. | |
> */ | |
> export enum TextEditorCursorBlinkingStyle { | |
> /** | |
> * Hidden | |
> */ | |
> Hidden = 0, | |
> /** | |
> * Blinking | |
> */ | |
> Blink = 1, | |
> /** | |
> * Blinking with smooth fading | |
> */ | |
> Smooth = 2, | |
> /** | |
> * Blinking with prolonged filled state and smooth fading | |
> */ | |
> Phase = 3, | |
> /** | |
> * Expand collapse animation on the y axis | |
> */ | |
> Expand = 4, | |
> /** | |
> * No-Blinking | |
> */ | |
> Solid = 5 | |
> } | |
> | |
> /** | |
> * The style in which the editor's cursor should be rendered. | |
> */ | |
> export enum TextEditorCursorStyle { | |
> /** | |
> * As a vertical line (sitting between two characters). | |
> */ | |
> Line = 1, | |
> /** | |
> * As a block (sitting on top of a character). | |
> */ | |
> Block = 2, | |
> /** | |
> * As a horizontal line (sitting under a character). | |
> */ | |
> Underline = 3, | |
> /** | |
> * As a thin vertical line (sitting between two characters). | |
> */ | |
> LineThin = 4, | |
> /** | |
> * As an outlined block (sitting on top of a character). | |
> */ | |
> BlockOutline = 5, | |
> /** | |
> * As a thin horizontal line (sitting under a character). | |
> */ | |
> UnderlineThin = 6 | |
> } | |
> | |
> /** | |
> * Configuration options for editor find widget | |
> */ | |
> export interface IEditorFindOptions { | |
> /** | |
> * Controls whether the cursor should move to find matches while typing. | |
> */ | |
> cursorMoveOnType?: boolean; | |
> /** | |
> * Controls if we seed search string in the Find Widget with editor selection. | |
> */ | |
> seedSearchStringFromSelection?: 'never' | 'always' | 'selection'; | |
> /** | |
> * Controls if Find in Selection flag is turned on in the editor. | |
> */ | |
> autoFindInSelection?: 'never' | 'always' | 'multiline'; | |
> addExtraSpaceOnTop?: boolean; | |
> /** | |
> * Controls whether the search automatically restarts from the beginning (or the end) when no further matches can be found | |
> */ | |
> loop?: boolean; | |
> } | |
> | |
> export type GoToLocationValues = 'peek' | 'gotoAndPeek' | 'goto'; | |
> | |
> /** | |
> * Configuration options for go to location | |
> */ | |
> export interface IGotoLocationOptions { | |
> multiple?: GoToLocationValues; | |
> multipleDefinitions?: GoToLocationValues; | |
> multipleTypeDefinitions?: GoToLocationValues; | |
> multipleDeclarations?: GoToLocationValues; | |
> multipleImplementations?: GoToLocationValues; | |
> multipleReferences?: GoToLocationValues; | |
> alternativeDefinitionCommand?: string; | |
> alternativeTypeDefinitionCommand?: string; | |
> alternativeDeclarationCommand?: string; | |
> alternativeImplementationCommand?: string; | |
> alternativeReferenceCommand?: string; | |
> } | |
> | |
> /** | |
> * Configuration options for editor hover | |
> */ | |
> export interface IEditorHoverOptions { | |
> /** | |
> * Enable the hover. | |
> * Defaults to true. | |
> */ | |
> enabled?: boolean; | |
> /** | |
> * Delay for showing the hover. | |
> * Defaults to 300. | |
> */ | |
> delay?: number; | |
> /** | |
> * Is the hover sticky such that it can be clicked and its contents selected? | |
> * Defaults to true. | |
> */ | |
> sticky?: boolean; | |
> /** | |
> * Should the hover be shown above the line if possible? | |
> * Defaults to false. | |
> */ | |
> above?: boolean; | |
> } | |
> | |
> /** | |
> * A description for the overview ruler position. | |
> */ | |
> export interface OverviewRulerPosition { | |
> /** | |
> * Width of the overview ruler | |
> */ | |
> readonly width: number; | |
> /** | |
> * Height of the overview ruler | |
> */ | |
> readonly height: number; | |
> /** | |
> * Top position for the overview ruler | |
> */ | |
> readonly top: number; | |
> /** | |
> * Right position for the overview ruler | |
> */ | |
> readonly right: number; | |
> } | |
> | |
> export enum RenderMinimap { | |
> None = 0, | |
> Text = 1, | |
> Blocks = 2 | |
> } | |
> | |
> /** | |
> * The internal layout details of the editor. | |
> */ | |
> export interface EditorLayoutInfo { | |
> /** | |
> * Full editor width. | |
> */ | |
> readonly width: number; | |
> /** | |
> * Full editor height. | |
> */ | |
> readonly height: number; | |
> /** | |
> * Left position for the glyph margin. | |
> */ | |
> readonly glyphMarginLeft: number; | |
> /** | |
> * The width of the glyph margin. | |
> */ | |
> readonly glyphMarginWidth: number; | |
> /** | |
> * Left position for the line numbers. | |
> */ | |
> readonly lineNumbersLeft: number; | |
> /** | |
> * The width of the line numbers. | |
> */ | |
> readonly lineNumbersWidth: number; | |
> /** | |
> * Left position for the line decorations. | |
> */ | |
> readonly decorationsLeft: number; | |
> /** | |
> * The width of the line decorations. | |
> */ | |
> readonly decorationsWidth: number; | |
> /** | |
> * Left position for the content (actual text) | |
> */ | |
> readonly contentLeft: number; | |
> /** | |
> * The width of the content (actual text) | |
> */ | |
> readonly contentWidth: number; | |
> /** | |
> * Layout information for the minimap | |
> */ | |
> readonly minimap: EditorMinimapLayoutInfo; | |
> /** | |
> * The number of columns (of typical characters) fitting on a viewport line. | |
> */ | |
> readonly viewportColumn: number; | |
> readonly isWordWrapMinified: boolean; | |
> readonly isViewportWrapping: boolean; | |
> readonly wrappingColumn: number; | |
> /** | |
> * The width of the vertical scrollbar. | |
> */ | |
> readonly verticalScrollbarWidth: number; | |
> /** | |
> * The height of the horizontal scrollbar. | |
> */ | |
> readonly horizontalScrollbarHeight: number; | |
> /** | |
> * The position of the overview ruler. | |
> */ | |
> readonly overviewRuler: OverviewRulerPosition; | |
> } | |
> | |
> /** | |
> * The internal layout details of the editor. | |
> */ | |
> export interface EditorMinimapLayoutInfo { | |
> readonly renderMinimap: RenderMinimap; | |
> readonly minimapLeft: number; | |
> readonly minimapWidth: number; | |
> readonly minimapHeightIsEditorHeight: boolean; | |
> readonly minimapIsSampling: boolean; | |
> readonly minimapScale: number; | |
> readonly minimapLineHeight: number; | |
> readonly minimapCanvasInnerWidth: number; | |
> readonly minimapCanvasInnerHeight: number; | |
> readonly minimapCanvasOuterWidth: number; | |
> readonly minimapCanvasOuterHeight: number; | |
> } | |
> | |
> /** | |
> * Configuration options for editor lightbulb | |
> */ | |
> export interface IEditorLightbulbOptions { | |
> /** | |
> * Enable the lightbulb code action. | |
> * Defaults to true. | |
> */ | |
> enabled?: boolean; | |
> } | |
> | |
> /** | |
> * Configuration options for editor inlayHints | |
> */ | |
> export interface IEditorInlayHintsOptions { | |
> /** | |
> * Enable the inline hints. | |
> * Defaults to true. | |
> */ | |
> enabled?: boolean; | |
> /** | |
> * Font size of inline hints. | |
> * Default to 90% of the editor font size. | |
> */ | |
> fontSize?: number; | |
> /** | |
> * Font family of inline hints. | |
> * Defaults to editor font family. | |
> */ | |
> fontFamily?: string; | |
> } | |
> | |
> /** | |
> * Configuration options for editor minimap | |
> */ | |
> export interface IEditorMinimapOptions { | |
> /** | |
> * Enable the rendering of the minimap. | |
> * Defaults to true. | |
> */ | |
> enabled?: boolean; | |
> /** | |
> * Control the side of the minimap in editor. | |
> * Defaults to 'right'. | |
> */ | |
> side?: 'right' | 'left'; | |
> /** | |
> * Control the minimap rendering mode. | |
> * Defaults to 'actual'. | |
> */ | |
> size?: 'proportional' | 'fill' | 'fit'; | |
> /** | |
> * Control the rendering of the minimap slider. | |
> * Defaults to 'mouseover'. | |
> */ | |
> showSlider?: 'always' | 'mouseover'; | |
> /** | |
> * Render the actual text on a line (as opposed to color blocks). | |
> * Defaults to true. | |
> */ | |
> renderCharacters?: boolean; | |
> /** | |
> * Limit the width of the minimap to render at most a certain number of columns. | |
> * Defaults to 120. | |
> */ | |
> maxColumn?: number; | |
> /** | |
> * Relative size of the font in the minimap. Defaults to 1. | |
> */ | |
> scale?: number; | |
> } | |
> | |
> /** | |
> * Configuration options for editor padding | |
> */ | |
> export interface IEditorPaddingOptions { | |
> /** | |
> * Spacing between top edge of editor and first line. | |
> */ | |
> top?: number; | |
> /** | |
> * Spacing between bottom edge of editor and last line. | |
> */ | |
> bottom?: number; | |
> } | |
> | |
> /** | |
> * Configuration options for parameter hints | |
> */ | |
> export interface IEditorParameterHintOptions { | |
> /** | |
> * Enable parameter hints. | |
> * Defaults to true. | |
> */ | |
> enabled?: boolean; | |
> /** | |
> * Enable cycling of parameter hints. | |
> * Defaults to false. | |
> */ | |
> cycle?: boolean; | |
> } | |
> | |
> /** | |
> * Configuration options for quick suggestions | |
> */ | |
> export interface IQuickSuggestionsOptions { | |
> other?: boolean; | |
> comments?: boolean; | |
> strings?: boolean; | |
> } | |
> | |
> export type LineNumbersType = 'on' | 'off' | 'relative' | 'interval' | ((lineNumber: number) => string); | |
> | |
> export enum RenderLineNumbersType { | |
> Off = 0, | |
> On = 1, | |
> Relative = 2, | |
> Interval = 3, | |
> Custom = 4 | |
> } | |
> | |
> export interface InternalEditorRenderLineNumbersOptions { | |
> readonly renderType: RenderLineNumbersType; | |
> readonly renderFn: ((lineNumber: number) => string) | null; | |
> } | |
> | |
> export interface IRulerOption { | |
> readonly column: number; | |
> readonly color: string | null; | |
> } | |
> | |
> /** | |
> * Configuration options for editor scrollbars | |
> */ | |
> export interface IEditorScrollbarOptions { | |
> /** | |
> * The size of arrows (if displayed). | |
> * Defaults to 11. | |
> * **NOTE**: This option cannot be updated using `updateOptions()` | |
> */ | |
> arrowSize?: number; | |
> /** | |
> * Render vertical scrollbar. | |
> * Defaults to 'auto'. | |
> */ | |
> vertical?: 'auto' | 'visible' | 'hidden'; | |
> /** | |
> * Render horizontal scrollbar. | |
> * Defaults to 'auto'. | |
> */ | |
> horizontal?: 'auto' | 'visible' | 'hidden'; | |
> /** | |
> * Cast horizontal and vertical shadows when the content is scrolled. | |
> * Defaults to true. | |
> * **NOTE**: This option cannot be updated using `updateOptions()` | |
> */ | |
> useShadows?: boolean; | |
> /** | |
> * Render arrows at the top and bottom of the vertical scrollbar. | |
> * Defaults to false. | |
> * **NOTE**: This option cannot be updated using `updateOptions()` | |
> */ | |
> verticalHasArrows?: boolean; | |
> /** | |
> * Render arrows at the left and right of the horizontal scrollbar. | |
> * Defaults to false. | |
> * **NOTE**: This option cannot be updated using `updateOptions()` | |
> */ | |
> horizontalHasArrows?: boolean; | |
> /** | |
> * Listen to mouse wheel events and react to them by scrolling. | |
> * Defaults to true. | |
> */ | |
> handleMouseWheel?: boolean; | |
> /** | |
> * Always consume mouse wheel events (always call preventDefault() and stopPropagation() on the browser events). | |
> * Defaults to true. | |
> * **NOTE**: This option cannot be updated using `updateOptions()` | |
> */ | |
> alwaysConsumeMouseWheel?: boolean; | |
> /** | |
> * Height in pixels for the horizontal scrollbar. | |
> * Defaults to 10 (px). | |
> */ | |
> horizontalScrollbarSize?: number; | |
> /** | |
> * Width in pixels for the vertical scrollbar. | |
> * Defaults to 10 (px). | |
> */ | |
> verticalScrollbarSize?: number; | |
> /** | |
> * Width in pixels for the vertical slider. | |
> * Defaults to `verticalScrollbarSize`. | |
> * **NOTE**: This option cannot be updated using `updateOptions()` | |
> */ | |
> verticalSliderSize?: number; | |
> /** | |
> * Height in pixels for the horizontal slider. | |
> * Defaults to `horizontalScrollbarSize`. | |
> * **NOTE**: This option cannot be updated using `updateOptions()` | |
> */ | |
> horizontalSliderSize?: number; | |
> /** | |
> * Scroll gutter clicks move by page vs jump to position. | |
> * Defaults to false. | |
> */ | |
> scrollByPage?: boolean; | |
> } | |
> | |
> export interface InternalEditorScrollbarOptions { | |
> readonly arrowSize: number; | |
> readonly vertical: ScrollbarVisibility; | |
> readonly horizontal: ScrollbarVisibility; | |
> readonly useShadows: boolean; | |
> readonly verticalHasArrows: boolean; | |
> readonly horizontalHasArrows: boolean; | |
> readonly handleMouseWheel: boolean; | |
> readonly alwaysConsumeMouseWheel: boolean; | |
> readonly horizontalScrollbarSize: number; | |
> readonly horizontalSliderSize: number; | |
> readonly verticalScrollbarSize: number; | |
> readonly verticalSliderSize: number; | |
> readonly scrollByPage: boolean; | |
> } | |
> | |
> export interface IInlineSuggestOptions { | |
> /** | |
> * Enable or disable the rendering of automatic inline completions. | |
> */ | |
> enabled?: boolean; | |
> /** | |
> * Configures the mode. | |
> * Use `prefix` to only show ghost text if the text to replace is a prefix of the suggestion text. | |
> * Use `subword` to only show ghost text if the replace text is a subword of the suggestion text. | |
> * Use `subwordSmart` to only show ghost text if the replace text is a subword of the suggestion text, but the subword must start after the cursor position. | |
> * Defaults to `prefix`. | |
> */ | |
> mode?: 'prefix' | 'subword' | 'subwordSmart'; | |
> } | |
> | |
> export interface IBracketPairColorizationOptions { | |
> /** | |
> * Enable or disable bracket pair colorization. | |
> */ | |
> enabled?: boolean; | |
> } | |
> | |
> export interface IGuidesOptions { | |
> /** | |
> * Enable rendering of bracket pair guides. | |
> * Defaults to false. | |
> */ | |
> bracketPairs?: boolean | 'active'; | |
> /** | |
> * Enable rendering of vertical bracket pair guides. | |
> * Defaults to 'active'. | |
> */ | |
> bracketPairsHorizontal?: boolean | 'active'; | |
> /** | |
> * Enable highlighting of the active bracket pair. | |
> * Defaults to true. | |
> */ | |
> highlightActiveBracketPair?: boolean; | |
> /** | |
> * Enable rendering of indent guides. | |
> * Defaults to true. | |
> */ | |
> indentation?: boolean; | |
> /** | |
> * Enable highlighting of the active indent guide. | |
> * Defaults to true. | |
> */ | |
> highlightActiveIndentation?: boolean; | |
> } | |
> | |
> /** | |
> * Configuration options for editor suggest widget | |
> */ | |
> export interface ISuggestOptions { | |
> /** | |
> * Overwrite word ends on accept. Default to false. | |
> */ | |
> insertMode?: 'insert' | 'replace'; | |
> /** | |
> * Enable graceful matching. Defaults to true. | |
> */ | |
> filterGraceful?: boolean; | |
> /** | |
> * Prevent quick suggestions when a snippet is active. Defaults to true. | |
> */ | |
> snippetsPreventQuickSuggestions?: boolean; | |
> /** | |
> * Favors words that appear close to the cursor. | |
> */ | |
> localityBonus?: boolean; | |
> /** | |
> * Enable using global storage for remembering suggestions. | |
> */ | |
> shareSuggestSelections?: boolean; | |
> /** | |
> * Enable or disable icons in suggestions. Defaults to true. | |
> */ | |
> showIcons?: boolean; | |
> /** | |
> * Enable or disable the suggest status bar. | |
> */ | |
> showStatusBar?: boolean; | |
> /** | |
> * Enable or disable the rendering of the suggestion preview. | |
> */ | |
> preview?: boolean; | |
> /** | |
> * Configures the mode of the preview. | |
> */ | |
> previewMode?: 'prefix' | 'subword' | 'subwordSmart'; | |
> /** | |
> * Show details inline with the label. Defaults to true. | |
> */ | |
> showInlineDetails?: boolean; | |
> /** | |
> * Show method-suggestions. | |
> */ | |
> showMethods?: boolean; | |
> /** | |
> * Show function-suggestions. | |
> */ | |
> showFunctions?: boolean; | |
> /** | |
> * Show constructor-suggestions. | |
> */ | |
> showConstructors?: boolean; | |
> /** | |
> * Show deprecated-suggestions. | |
> */ | |
> showDeprecated?: boolean; | |
> /** | |
> * Show field-suggestions. | |
> */ | |
> showFields?: boolean; | |
> /** | |
> * Show variable-suggestions. | |
> */ | |
> showVariables?: boolean; | |
> /** | |
> * Show class-suggestions. | |
> */ | |
> showClasses?: boolean; | |
> /** | |
> * Show struct-suggestions. | |
> */ | |
> showStructs?: boolean; | |
> /** | |
> * Show interface-suggestions. | |
> */ | |
> showInterfaces?: boolean; | |
> /** | |
> * Show module-suggestions. | |
> */ | |
> showModules?: boolean; | |
> /** | |
> * Show property-suggestions. | |
> */ | |
> showProperties?: boolean; | |
> /** | |
> * Show event-suggestions. | |
> */ | |
> showEvents?: boolean; | |
> /** | |
> * Show operator-suggestions. | |
> */ | |
> showOperators?: boolean; | |
> /** | |
> * Show unit-suggestions. | |
> */ | |
> showUnits?: boolean; | |
> /** | |
> * Show value-suggestions. | |
> */ | |
> showValues?: boolean; | |
> /** | |
> * Show constant-suggestions. | |
> */ | |
> showConstants?: boolean; | |
> /** | |
> * Show enum-suggestions. | |
> */ | |
> showEnums?: boolean; | |
> /** | |
> * Show enumMember-suggestions. | |
> */ | |
> showEnumMembers?: boolean; | |
> /** | |
> * Show keyword-suggestions. | |
> */ | |
> showKeywords?: boolean; | |
> /** | |
> * Show text-suggestions. | |
> */ | |
> showWords?: boolean; | |
> /** | |
> * Show color-suggestions. | |
> */ | |
> showColors?: boolean; | |
> /** | |
> * Show file-suggestions. | |
> */ | |
> showFiles?: boolean; | |
> /** | |
> * Show reference-suggestions. | |
> */ | |
> showReferences?: boolean; | |
> /** | |
> * Show folder-suggestions. | |
> */ | |
> showFolders?: boolean; | |
> /** | |
> * Show typeParameter-suggestions. | |
> */ | |
> showTypeParameters?: boolean; | |
> /** | |
> * Show issue-suggestions. | |
> */ | |
> showIssues?: boolean; | |
> /** | |
> * Show user-suggestions. | |
> */ | |
> showUsers?: boolean; | |
> /** | |
> * Show snippet-suggestions. | |
> */ | |
> showSnippets?: boolean; | |
> } | |
> | |
> export interface ISmartSelectOptions { | |
> selectLeadingAndTrailingWhitespace?: boolean; | |
> } | |
> | |
> /** | |
> * Describes how to indent wrapped lines. | |
> */ | |
> export enum WrappingIndent { | |
> /** | |
> * No indentation => wrapped lines begin at column 1. | |
> */ | |
> None = 0, | |
> /** | |
> * Same => wrapped lines get the same indentation as the parent. | |
> */ | |
> Same = 1, | |
> /** | |
> * Indent => wrapped lines get +1 indentation toward the parent. | |
> */ | |
> Indent = 2, | |
> /** | |
> * DeepIndent => wrapped lines get +2 indentation toward the parent. | |
> */ | |
> DeepIndent = 3 | |
> } | |
> | |
> export interface EditorWrappingInfo { | |
> readonly isDominatedByLongLines: boolean; | |
> readonly isWordWrapMinified: boolean; | |
> readonly isViewportWrapping: boolean; | |
> readonly wrappingColumn: number; | |
> } | |
> | |
> export enum EditorOption { | |
> acceptSuggestionOnCommitCharacter = 0, | |
> acceptSuggestionOnEnter = 1, | |
> accessibilitySupport = 2, | |
> accessibilityPageSize = 3, | |
> ariaLabel = 4, | |
> autoClosingBrackets = 5, | |
> autoClosingDelete = 6, | |
> autoClosingOvertype = 7, | |
> autoClosingQuotes = 8, | |
> autoIndent = 9, | |
> automaticLayout = 10, | |
> autoSurround = 11, | |
> bracketPairColorization = 12, | |
> guides = 13, | |
> codeLens = 14, | |
> codeLensFontFamily = 15, | |
> codeLensFontSize = 16, | |
> colorDecorators = 17, | |
> columnSelection = 18, | |
> comments = 19, | |
> contextmenu = 20, | |
> copyWithSyntaxHighlighting = 21, | |
> cursorBlinking = 22, | |
> cursorSmoothCaretAnimation = 23, | |
> cursorStyle = 24, | |
> cursorSurroundingLines = 25, | |
> cursorSurroundingLinesStyle = 26, | |
> cursorWidth = 27, | |
> disableLayerHinting = 28, | |
> disableMonospaceOptimizations = 29, | |
> domReadOnly = 30, | |
> dragAndDrop = 31, | |
> emptySelectionClipboard = 32, | |
> extraEditorClassName = 33, | |
> fastScrollSensitivity = 34, | |
> find = 35, | |
> fixedOverflowWidgets = 36, | |
> folding = 37, | |
> foldingStrategy = 38, | |
> foldingHighlight = 39, | |
> foldingImportsByDefault = 40, | |
> unfoldOnClickAfterEndOfLine = 41, | |
> fontFamily = 42, | |
> fontInfo = 43, | |
> fontLigatures = 44, | |
> fontSize = 45, | |
> fontWeight = 46, | |
> formatOnPaste = 47, | |
> formatOnType = 48, | |
> glyphMargin = 49, | |
> gotoLocation = 50, | |
> hideCursorInOverviewRuler = 51, | |
> hover = 52, | |
> inDiffEditor = 53, | |
> inlineSuggest = 54, | |
> letterSpacing = 55, | |
> lightbulb = 56, | |
> lineDecorationsWidth = 57, | |
> lineHeight = 58, | |
> lineNumbers = 59, | |
> lineNumbersMinChars = 60, | |
> linkedEditing = 61, | |
> links = 62, | |
> matchBrackets = 63, | |
> minimap = 64, | |
> mouseStyle = 65, | |
> mouseWheelScrollSensitivity = 66, | |
> mouseWheelZoom = 67, | |
> multiCursorMergeOverlapping = 68, | |
> multiCursorModifier = 69, | |
> multiCursorPaste = 70, | |
> occurrencesHighlight = 71, | |
> overviewRulerBorder = 72, | |
> overviewRulerLanes = 73, | |
> padding = 74, | |
> parameterHints = 75, | |
> peekWidgetDefaultFocus = 76, | |
> definitionLinkOpensInPeek = 77, | |
> quickSuggestions = 78, | |
> quickSuggestionsDelay = 79, | |
> readOnly = 80, | |
> renameOnType = 81, | |
> renderControlCharacters = 82, | |
> renderFinalNewline = 83, | |
> renderLineHighlight = 84, | |
> renderLineHighlightOnlyWhenFocus = 85, | |
> renderValidationDecorations = 86, | |
> renderWhitespace = 87, | |
> revealHorizontalRightPadding = 88, | |
> roundedSelection = 89, | |
> rulers = 90, | |
> scrollbar = 91, | |
> scrollBeyondLastColumn = 92, | |
> scrollBeyondLastLine = 93, | |
> scrollPredominantAxis = 94, | |
> selectionClipboard = 95, | |
> selectionHighlight = 96, | |
> selectOnLineNumbers = 97, | |
> showFoldingControls = 98, | |
> showUnused = 99, | |
> snippetSuggestions = 100, | |
> smartSelect = 101, | |
> smoothScrolling = 102, | |
> stickyTabStops = 103, | |
> stopRenderingLineAfter = 104, | |
> suggest = 105, | |
> suggestFontSize = 106, | |
> suggestLineHeight = 107, | |
> suggestOnTriggerCharacters = 108, | |
> suggestSelection = 109, | |
> tabCompletion = 110, | |
> tabIndex = 111, | |
> unusualLineTerminators = 112, | |
> useShadowDOM = 113, | |
> useTabStops = 114, | |
> wordSeparators = 115, | |
> wordWrap = 116, | |
> wordWrapBreakAfterCharacters = 117, | |
> wordWrapBreakBeforeCharacters = 118, | |
> wordWrapColumn = 119, | |
> wordWrapOverride1 = 120, | |
> wordWrapOverride2 = 121, | |
> wrappingIndent = 122, | |
> wrappingStrategy = 123, | |
> showDeprecated = 124, | |
> inlayHints = 125, | |
> editorClassName = 126, | |
> pixelRatio = 127, | |
> tabFocusMode = 128, | |
> layoutInfo = 129, | |
> wrappingInfo = 130 | |
> } | |
> | |
> export const EditorOptions: { | |
> acceptSuggestionOnCommitCharacter: IEditorOption<EditorOption.acceptSuggestionOnCommitCharacter, boolean>; | |
> acceptSuggestionOnEnter: IEditorOption<EditorOption.acceptSuggestionOnEnter, 'on' | 'off' | 'smart'>; | |
> accessibilitySupport: IEditorOption<EditorOption.accessibilitySupport, AccessibilitySupport>; | |
> accessibilityPageSize: IEditorOption<EditorOption.accessibilityPageSize, number>; | |
> ariaLabel: IEditorOption<EditorOption.ariaLabel, string>; | |
> autoClosingBrackets: IEditorOption<EditorOption.autoClosingBrackets, 'always' | 'languageDefined' | 'beforeWhitespace' | 'never'>; | |
> autoClosingDelete: IEditorOption<EditorOption.autoClosingDelete, 'always' | 'never' | 'auto'>; | |
> autoClosingOvertype: IEditorOption<EditorOption.autoClosingOvertype, 'always' | 'never' | 'auto'>; | |
> autoClosingQuotes: IEditorOption<EditorOption.autoClosingQuotes, 'always' | 'languageDefined' | 'beforeWhitespace' | 'never'>; | |
> autoIndent: IEditorOption<EditorOption.autoIndent, EditorAutoIndentStrategy>; | |
> automaticLayout: IEditorOption<EditorOption.automaticLayout, boolean>; | |
> autoSurround: IEditorOption<EditorOption.autoSurround, 'languageDefined' | 'never' | 'quotes' | 'brackets'>; | |
> bracketPairColorization: IEditorOption<EditorOption.bracketPairColorization, Readonly<Required<IBracketPairColorizationOptions>>>; | |
> bracketPairGuides: IEditorOption<EditorOption.guides, Readonly<Required<IGuidesOptions>>>; | |
> stickyTabStops: IEditorOption<EditorOption.stickyTabStops, boolean>; | |
> codeLens: IEditorOption<EditorOption.codeLens, boolean>; | |
> codeLensFontFamily: IEditorOption<EditorOption.codeLensFontFamily, string>; | |
> codeLensFontSize: IEditorOption<EditorOption.codeLensFontSize, number>; | |
> colorDecorators: IEditorOption<EditorOption.colorDecorators, boolean>; | |
> columnSelection: IEditorOption<EditorOption.columnSelection, boolean>; | |
> comments: IEditorOption<EditorOption.comments, Readonly<Required<IEditorCommentsOptions>>>; | |
> contextmenu: IEditorOption<EditorOption.contextmenu, boolean>; | |
> copyWithSyntaxHighlighting: IEditorOption<EditorOption.copyWithSyntaxHighlighting, boolean>; | |
> cursorBlinking: IEditorOption<EditorOption.cursorBlinking, TextEditorCursorBlinkingStyle>; | |
> cursorSmoothCaretAnimation: IEditorOption<EditorOption.cursorSmoothCaretAnimation, boolean>; | |
> cursorStyle: IEditorOption<EditorOption.cursorStyle, TextEditorCursorStyle>; | |
> cursorSurroundingLines: IEditorOption<EditorOption.cursorSurroundingLines, number>; | |
> cursorSurroundingLinesStyle: IEditorOption<EditorOption.cursorSurroundingLinesStyle, 'default' | 'all'>; | |
> cursorWidth: IEditorOption<EditorOption.cursorWidth, number>; | |
> disableLayerHinting: IEditorOption<EditorOption.disableLayerHinting, boolean>; | |
> disableMonospaceOptimizations: IEditorOption<EditorOption.disableMonospaceOptimizations, boolean>; | |
> domReadOnly: IEditorOption<EditorOption.domReadOnly, boolean>; | |
> dragAndDrop: IEditorOption<EditorOption.dragAndDrop, boolean>; | |
> emptySelectionClipboard: IEditorOption<EditorOption.emptySelectionClipboard, boolean>; | |
> extraEditorClassName: IEditorOption<EditorOption.extraEditorClassName, string>; | |
> fastScrollSensitivity: IEditorOption<EditorOption.fastScrollSensitivity, number>; | |
> find: IEditorOption<EditorOption.find, Readonly<Required<IEditorFindOptions>>>; | |
> fixedOverflowWidgets: IEditorOption<EditorOption.fixedOverflowWidgets, boolean>; | |
> folding: IEditorOption<EditorOption.folding, boolean>; | |
> foldingStrategy: IEditorOption<EditorOption.foldingStrategy, 'auto' | 'indentation'>; | |
> foldingHighlight: IEditorOption<EditorOption.foldingHighlight, boolean>; | |
> foldingImportsByDefault: IEditorOption<EditorOption.foldingImportsByDefault, boolean>; | |
> unfoldOnClickAfterEndOfLine: IEditorOption<EditorOption.unfoldOnClickAfterEndOfLine, boolean>; | |
> fontFamily: IEditorOption<EditorOption.fontFamily, string>; | |
> fontInfo: IEditorOption<EditorOption.fontInfo, FontInfo>; | |
> fontLigatures2: IEditorOption<EditorOption.fontLigatures, string>; | |
> fontSize: IEditorOption<EditorOption.fontSize, number>; | |
> fontWeight: IEditorOption<EditorOption.fontWeight, string>; | |
> formatOnPaste: IEditorOption<EditorOption.formatOnPaste, boolean>; | |
> formatOnType: IEditorOption<EditorOption.formatOnType, boolean>; | |
> glyphMargin: IEditorOption<EditorOption.glyphMargin, boolean>; | |
> gotoLocation: IEditorOption<EditorOption.gotoLocation, Readonly<Required<IGotoLocationOptions>>>; | |
> hideCursorInOverviewRuler: IEditorOption<EditorOption.hideCursorInOverviewRuler, boolean>; | |
> hover: IEditorOption<EditorOption.hover, Readonly<Required<IEditorHoverOptions>>>; | |
> inDiffEditor: IEditorOption<EditorOption.inDiffEditor, boolean>; | |
> letterSpacing: IEditorOption<EditorOption.letterSpacing, number>; | |
> lightbulb: IEditorOption<EditorOption.lightbulb, Readonly<Required<IEditorLightbulbOptions>>>; | |
> lineDecorationsWidth: IEditorOption<EditorOption.lineDecorationsWidth, string | number>; | |
> lineHeight: IEditorOption<EditorOption.lineHeight, number>; | |
> lineNumbers: IEditorOption<EditorOption.lineNumbers, InternalEditorRenderLineNumbersOptions>; | |
> lineNumbersMinChars: IEditorOption<EditorOption.lineNumbersMinChars, number>; | |
> linkedEditing: IEditorOption<EditorOption.linkedEditing, boolean>; | |
> links: IEditorOption<EditorOption.links, boolean>; | |
> matchBrackets: IEditorOption<EditorOption.matchBrackets, 'always' | 'never' | 'near'>; | |
> minimap: IEditorOption<EditorOption.minimap, Readonly<Required<IEditorMinimapOptions>>>; | |
> mouseStyle: IEditorOption<EditorOption.mouseStyle, 'default' | 'text' | 'copy'>; | |
> mouseWheelScrollSensitivity: IEditorOption<EditorOption.mouseWheelScrollSensitivity, number>; | |
> mouseWheelZoom: IEditorOption<EditorOption.mouseWheelZoom, boolean>; | |
> multiCursorMergeOverlapping: IEditorOption<EditorOption.multiCursorMergeOverlapping, boolean>; | |
> multiCursorModifier: IEditorOption<EditorOption.multiCursorModifier, 'altKey' | 'metaKey' | 'ctrlKey'>; | |
> multiCursorPaste: IEditorOption<EditorOption.multiCursorPaste, 'spread' | 'full'>; | |
> occurrencesHighlight: IEditorOption<EditorOption.occurrencesHighlight, boolean>; | |
> overviewRulerBorder: IEditorOption<EditorOption.overviewRulerBorder, boolean>; | |
> overviewRulerLanes: IEditorOption<EditorOption.overviewRulerLanes, number>; | |
> padding: IEditorOption<EditorOption.padding, Readonly<Required<IEditorPaddingOptions>>>; | |
> parameterHints: IEditorOption<EditorOption.parameterHints, Readonly<Required<IEditorParameterHintOptions>>>; | |
> peekWidgetDefaultFocus: IEditorOption<EditorOption.peekWidgetDefaultFocus, 'tree' | 'editor'>; | |
> definitionLinkOpensInPeek: IEditorOption<EditorOption.definitionLinkOpensInPeek, boolean>; | |
> quickSuggestions: IEditorOption<EditorOption.quickSuggestions, any>; | |
> quickSuggestionsDelay: IEditorOption<EditorOption.quickSuggestionsDelay, number>; | |
> readOnly: IEditorOption<EditorOption.readOnly, boolean>; | |
> renameOnType: IEditorOption<EditorOption.renameOnType, boolean>; | |
> renderControlCharacters: IEditorOption<EditorOption.renderControlCharacters, boolean>; | |
> renderFinalNewline: IEditorOption<EditorOption.renderFinalNewline, boolean>; | |
> renderLineHighlight: IEditorOption<EditorOption.renderLineHighlight, 'all' | 'line' | 'none' | 'gutter'>; | |
> renderLineHighlightOnlyWhenFocus: IEditorOption<EditorOption.renderLineHighlightOnlyWhenFocus, boolean>; | |
> renderValidationDecorations: IEditorOption<EditorOption.renderValidationDecorations, 'on' | 'off' | 'editable'>; | |
> renderWhitespace: IEditorOption<EditorOption.renderWhitespace, 'all' | 'none' | 'boundary' | 'selection' | 'trailing'>; | |
> revealHorizontalRightPadding: IEditorOption<EditorOption.revealHorizontalRightPadding, number>; | |
> roundedSelection: IEditorOption<EditorOption.roundedSelection, boolean>; | |
> rulers: IEditorOption<EditorOption.rulers, {}>; | |
> scrollbar: IEditorOption<EditorOption.scrollbar, InternalEditorScrollbarOptions>; | |
> scrollBeyondLastColumn: IEditorOption<EditorOption.scrollBeyondLastColumn, number>; | |
> scrollBeyondLastLine: IEditorOption<EditorOption.scrollBeyondLastLine, boolean>; | |
> scrollPredominantAxis: IEditorOption<EditorOption.scrollPredominantAxis, boolean>; | |
> selectionClipboard: IEditorOption<EditorOption.selectionClipboard, boolean>; | |
> selectionHighlight: IEditorOption<EditorOption.selectionHighlight, boolean>; | |
> selectOnLineNumbers: IEditorOption<EditorOption.selectOnLineNumbers, boolean>; | |
> showFoldingControls: IEditorOption<EditorOption.showFoldingControls, 'always' | 'mouseover'>; | |
> showUnused: IEditorOption<EditorOption.showUnused, boolean>; | |
> showDeprecated: IEditorOption<EditorOption.showDeprecated, boolean>; | |
> inlayHints: IEditorOption<EditorOption.inlayHints, Readonly<Required<IEditorInlayHintsOptions>>>; | |
> snippetSuggestions: IEditorOption<EditorOption.snippetSuggestions, 'none' | 'top' | 'bottom' | 'inline'>; | |
> smartSelect: IEditorOption<EditorOption.smartSelect, Readonly<Required<ISmartSelectOptions>>>; | |
> smoothScrolling: IEditorOption<EditorOption.smoothScrolling, boolean>; | |
> stopRenderingLineAfter: IEditorOption<EditorOption.stopRenderingLineAfter, number>; | |
> suggest: IEditorOption<EditorOption.suggest, Readonly<Required<ISuggestOptions>>>; | |
> inlineSuggest: IEditorOption<EditorOption.inlineSuggest, Readonly<Required<IInlineSuggestOptions>>>; | |
> suggestFontSize: IEditorOption<EditorOption.suggestFontSize, number>; | |
> suggestLineHeight: IEditorOption<EditorOption.suggestLineHeight, number>; | |
> suggestOnTriggerCharacters: IEditorOption<EditorOption.suggestOnTriggerCharacters, boolean>; | |
> suggestSelection: IEditorOption<EditorOption.suggestSelection, 'first' | 'recentlyUsed' | 'recentlyUsedByPrefix'>; | |
> tabCompletion: IEditorOption<EditorOption.tabCompletion, 'on' | 'off' | 'onlySnippets'>; | |
> tabIndex: IEditorOption<EditorOption.tabIndex, number>; | |
> unusualLineTerminators: IEditorOption<EditorOption.unusualLineTerminators, 'auto' | 'off' | 'prompt'>; | |
> useShadowDOM: IEditorOption<EditorOption.useShadowDOM, boolean>; | |
> useTabStops: IEditorOption<EditorOption.useTabStops, boolean>; | |
> wordSeparators: IEditorOption<EditorOption.wordSeparators, string>; | |
> wordWrap: IEditorOption<EditorOption.wordWrap, 'on' | 'off' | 'wordWrapColumn' | 'bounded'>; | |
> wordWrapBreakAfterCharacters: IEditorOption<EditorOption.wordWrapBreakAfterCharacters, string>; | |
> wordWrapBreakBeforeCharacters: IEditorOption<EditorOption.wordWrapBreakBeforeCharacters, string>; | |
> wordWrapColumn: IEditorOption<EditorOption.wordWrapColumn, number>; | |
> wordWrapOverride1: IEditorOption<EditorOption.wordWrapOverride1, 'on' | 'off' | 'inherit'>; | |
> wordWrapOverride2: IEditorOption<EditorOption.wordWrapOverride2, 'on' | 'off' | 'inherit'>; | |
> wrappingIndent: IEditorOption<EditorOption.wrappingIndent, WrappingIndent>; | |
> wrappingStrategy: IEditorOption<EditorOption.wrappingStrategy, 'simple' | 'advanced'>; | |
> editorClassName: IEditorOption<EditorOption.editorClassName, string>; | |
> pixelRatio: IEditorOption<EditorOption.pixelRatio, number>; | |
> tabFocusMode: IEditorOption<EditorOption.tabFocusMode, boolean>; | |
> layoutInfo: IEditorOption<EditorOption.layoutInfo, EditorLayoutInfo>; | |
> wrappingInfo: IEditorOption<EditorOption.wrappingInfo, EditorWrappingInfo>; | |
> }; | |
> | |
> type EditorOptionsType = typeof EditorOptions; | |
> | |
> type FindEditorOptionsKeyById<T extends EditorOption> = { | |
> [K in keyof EditorOptionsType]: EditorOptionsType[K]['id'] extends T ? K : never; | |
> }[keyof EditorOptionsType]; | |
> | |
> type ComputedEditorOptionValue<T extends IEditorOption<any, any>> = T extends IEditorOption<any, infer R> ? R : never; | |
> | |
> export type FindComputedEditorOptionValueById<T extends EditorOption> = NonNullable<ComputedEditorOptionValue<EditorOptionsType[FindEditorOptionsKeyById<T>]>>; | |
> | |
> /** | |
> * A view zone is a full horizontal rectangle that 'pushes' text down. | |
> * The editor reserves space for view zones when rendering. | |
> */ | |
> export interface IViewZone { | |
> /** | |
> * The line number after which this zone should appear. | |
> * Use 0 to place a view zone before the first line number. | |
> */ | |
> afterLineNumber: number; | |
> /** | |
> * The column after which this zone should appear. | |
> * If not set, the maxLineColumn of `afterLineNumber` will be used. | |
> */ | |
> afterColumn?: number; | |
> /** | |
> * Suppress mouse down events. | |
> * If set, the editor will attach a mouse down listener to the view zone and .preventDefault on it. | |
> * Defaults to false | |
> */ | |
> suppressMouseDown?: boolean; | |
> /** | |
> * The height in lines of the view zone. | |
> * If specified, `heightInPx` will be used instead of this. | |
> * If neither `heightInPx` nor `heightInLines` is specified, a default of `heightInLines` = 1 will be chosen. | |
> */ | |
> heightInLines?: number; | |
> /** | |
> * The height in px of the view zone. | |
> * If this is set, the editor will give preference to it rather than `heightInLines` above. | |
> * If neither `heightInPx` nor `heightInLines` is specified, a default of `heightInLines` = 1 will be chosen. | |
> */ | |
> heightInPx?: number; | |
> /** | |
> * The minimum width in px of the view zone. | |
> * If this is set, the editor will ensure that the scroll width is >= than this value. | |
> */ | |
> minWidthInPx?: number; | |
> /** | |
> * The dom node of the view zone | |
> */ | |
> domNode: HTMLElement; | |
> /** | |
> * An optional dom node for the view zone that will be placed in the margin area. | |
> */ | |
> marginDomNode?: HTMLElement | null; | |
> /** | |
> * Callback which gives the relative top of the view zone as it appears (taking scrolling into account). | |
> */ | |
> onDomNodeTop?: (top: number) => void; | |
> /** | |
> * Callback which gives the height in pixels of the view zone. | |
> */ | |
> onComputedHeight?: (height: number) => void; | |
> } | |
> | |
> /** | |
> * An accessor that allows for zones to be added or removed. | |
> */ | |
> export interface IViewZoneChangeAccessor { | |
> /** | |
> * Create a new view zone. | |
> * @param zone Zone to create | |
> * @return A unique identifier to the view zone. | |
> */ | |
> addZone(zone: IViewZone): string; | |
> /** | |
> * Remove a zone | |
> * @param id A unique identifier to the view zone, as returned by the `addZone` call. | |
> */ | |
> removeZone(id: string): void; | |
> /** | |
> * Change a zone's position. | |
> * The editor will rescan the `afterLineNumber` and `afterColumn` properties of a view zone. | |
> */ | |
> layoutZone(id: string): void; | |
> } | |
> | |
> /** | |
> * A positioning preference for rendering content widgets. | |
> */ | |
> export enum ContentWidgetPositionPreference { | |
> /** | |
> * Place the content widget exactly at a position | |
> */ | |
> EXACT = 0, | |
> /** | |
> * Place the content widget above a position | |
> */ | |
> ABOVE = 1, | |
> /** | |
> * Place the content widget below a position | |
> */ | |
> BELOW = 2 | |
> } | |
> | |
> /** | |
> * A position for rendering content widgets. | |
> */ | |
> export interface IContentWidgetPosition { | |
> /** | |
> * Desired position for the content widget. | |
> * `preference` will also affect the placement. | |
> */ | |
> position: IPosition | null; | |
> /** | |
> * Optionally, a range can be provided to further | |
> * define the position of the content widget. | |
> */ | |
> range?: IRange | null; | |
> /** | |
> * Placement preference for position, in order of preference. | |
> */ | |
> preference: ContentWidgetPositionPreference[]; | |
> } | |
> | |
> /** | |
> * A content widget renders inline with the text and can be easily placed 'near' an editor position. | |
> */ | |
> export interface IContentWidget { | |
> /** | |
> * Render this content widget in a location where it could overflow the editor's view dom node. | |
> */ | |
> allowEditorOverflow?: boolean; | |
> suppressMouseDown?: boolean; | |
> /** | |
> * Get a unique identifier of the content widget. | |
> */ | |
> getId(): string; | |
> /** | |
> * Get the dom node of the content widget. | |
> */ | |
> getDomNode(): HTMLElement; | |
> /** | |
> * Get the placement of the content widget. | |
> * If null is returned, the content widget will be placed off screen. | |
> */ | |
> getPosition(): IContentWidgetPosition | null; | |
> /** | |
> * Optional function that is invoked before rendering | |
> * the content widget. If a dimension is returned the editor will | |
> * attempt to use it. | |
> */ | |
> beforeRender?(): IDimension | null; | |
> /** | |
> * Optional function that is invoked after rendering the content | |
> * widget. Is being invoked with the selected position preference | |
> * or `null` if not rendered. | |
> */ | |
> afterRender?(position: ContentWidgetPositionPreference | null): void; | |
> } | |
> | |
> /** | |
> * A positioning preference for rendering overlay widgets. | |
> */ | |
> export enum OverlayWidgetPositionPreference { | |
> /** | |
> * Position the overlay widget in the top right corner | |
> */ | |
> TOP_RIGHT_CORNER = 0, | |
> /** | |
> * Position the overlay widget in the bottom right corner | |
> */ | |
> BOTTOM_RIGHT_CORNER = 1, | |
> /** | |
> * Position the overlay widget in the top center | |
> */ | |
> TOP_CENTER = 2 | |
> } | |
> | |
> /** | |
> * A position for rendering overlay widgets. | |
> */ | |
> export interface IOverlayWidgetPosition { | |
> /** | |
> * The position preference for the overlay widget. | |
> */ | |
> preference: OverlayWidgetPositionPreference | null; | |
> } | |
> | |
> /** | |
> * An overlay widgets renders on top of the text. | |
> */ | |
> export interface IOverlayWidget { | |
> /** | |
> * Get a unique identifier of the overlay widget. | |
> */ | |
> getId(): string; | |
> /** | |
> * Get the dom node of the overlay widget. | |
> */ | |
> getDomNode(): HTMLElement; | |
> /** | |
> * Get the placement of the overlay widget. | |
> * If null is returned, the overlay widget is responsible to place itself. | |
> */ | |
> getPosition(): IOverlayWidgetPosition | null; | |
> } | |
> | |
> /** | |
> * Type of hit element with the mouse in the editor. | |
> */ | |
> export enum MouseTargetType { | |
> /** | |
> * Mouse is on top of an unknown element. | |
> */ | |
> UNKNOWN = 0, | |
> /** | |
> * Mouse is on top of the textarea used for input. | |
> */ | |
> TEXTAREA = 1, | |
> /** | |
> * Mouse is on top of the glyph margin | |
> */ | |
> GUTTER_GLYPH_MARGIN = 2, | |
> /** | |
> * Mouse is on top of the line numbers | |
> */ | |
> GUTTER_LINE_NUMBERS = 3, | |
> /** | |
> * Mouse is on top of the line decorations | |
> */ | |
> GUTTER_LINE_DECORATIONS = 4, | |
> /** | |
> * Mouse is on top of the whitespace left in the gutter by a view zone. | |
> */ | |
> GUTTER_VIEW_ZONE = 5, | |
> /** | |
> * Mouse is on top of text in the content. | |
> */ | |
> CONTENT_TEXT = 6, | |
> /** | |
> * Mouse is on top of empty space in the content (e.g. after line text or below last line) | |
> */ | |
> CONTENT_EMPTY = 7, | |
> /** | |
> * Mouse is on top of a view zone in the content. | |
> */ | |
> CONTENT_VIEW_ZONE = 8, | |
> /** | |
> * Mouse is on top of a content widget. | |
> */ | |
> CONTENT_WIDGET = 9, | |
> /** | |
> * Mouse is on top of the decorations overview ruler. | |
> */ | |
> OVERVIEW_RULER = 10, | |
> /** | |
> * Mouse is on top of a scrollbar. | |
> */ | |
> SCROLLBAR = 11, | |
> /** | |
> * Mouse is on top of an overlay widget. | |
> */ | |
> OVERLAY_WIDGET = 12, | |
> /** | |
> * Mouse is outside of the editor. | |
> */ | |
> OUTSIDE_EDITOR = 13 | |
> } | |
> | |
> /** | |
> * Target hit with the mouse in the editor. | |
> */ | |
> export interface IMouseTarget { | |
> /** | |
> * The target element | |
> */ | |
> readonly element: Element | null; | |
> /** | |
> * The target type | |
> */ | |
> readonly type: MouseTargetType; | |
> /** | |
> * The 'approximate' editor position | |
> */ | |
> readonly position: Position | null; | |
> /** | |
> * Desired mouse column (e.g. when position.column gets clamped to text length -- clicking after text on a line). | |
> */ | |
> readonly mouseColumn: number; | |
> /** | |
> * The 'approximate' editor range | |
> */ | |
> readonly range: Range | null; | |
> /** | |
> * Some extra detail. | |
> */ | |
> readonly detail: any; | |
> } | |
> | |
> /** | |
> * A mouse event originating from the editor. | |
> */ | |
> export interface IEditorMouseEvent { | |
> readonly event: IMouseEvent; | |
> readonly target: IMouseTarget; | |
> } | |
> | |
> export interface IPartialEditorMouseEvent { | |
> readonly event: IMouseEvent; | |
> readonly target: IMouseTarget | null; | |
> } | |
> | |
> /** | |
> * A paste event originating from the editor. | |
> */ | |
> export interface IPasteEvent { | |
> readonly range: Range; | |
> readonly languageId: string | null; | |
> } | |
> | |
> export interface IEditorConstructionOptions extends IEditorOptions { | |
> /** | |
> * The initial editor dimension (to avoid measuring the container). | |
> */ | |
> dimension?: IDimension; | |
> /** | |
> * Place overflow widgets inside an external DOM node. | |
> * Defaults to an internal DOM node. | |
> */ | |
> overflowWidgetsDomNode?: HTMLElement; | |
> } | |
> | |
> export interface IDiffEditorConstructionOptions extends IDiffEditorOptions { | |
> /** | |
> * The initial editor dimension (to avoid measuring the container). | |
> */ | |
> dimension?: IDimension; | |
> /** | |
> * Place overflow widgets inside an external DOM node. | |
> * Defaults to an internal DOM node. | |
> */ | |
> overflowWidgetsDomNode?: HTMLElement; | |
> /** | |
> * Aria label for original editor. | |
> */ | |
> originalAriaLabel?: string; | |
> /** | |
> * Aria label for modified editor. | |
> */ | |
> modifiedAriaLabel?: string; | |
> /** | |
> * Is the diff editor inside another editor | |
> * Defaults to false | |
> */ | |
> isInEmbeddedEditor?: boolean; | |
> } | |
> | |
> /** | |
> * A rich code editor. | |
> */ | |
> export interface ICodeEditor extends IEditor { | |
> /** | |
> * An event emitted when the content of the current model has changed. | |
> * @event | |
> */ | |
> onDidChangeModelContent: IEvent<IModelContentChangedEvent>; | |
> /** | |
> * An event emitted when the language of the current model has changed. | |
> * @event | |
> */ | |
> onDidChangeModelLanguage: IEvent<IModelLanguageChangedEvent>; | |
> /** | |
> * An event emitted when the language configuration of the current model has changed. | |
> * @event | |
> */ | |
> onDidChangeModelLanguageConfiguration: IEvent<IModelLanguageConfigurationChangedEvent>; | |
> /** | |
> * An event emitted when the options of the current model has changed. | |
> * @event | |
> */ | |
> onDidChangeModelOptions: IEvent<IModelOptionsChangedEvent>; | |
> /** | |
> * An event emitted when the configuration of the editor has changed. (e.g. `editor.updateOptions()`) | |
> * @event | |
> */ | |
> onDidChangeConfiguration: IEvent<ConfigurationChangedEvent>; | |
> /** | |
> * An event emitted when the cursor position has changed. | |
> * @event | |
> */ | |
> onDidChangeCursorPosition: IEvent<ICursorPositionChangedEvent>; | |
> /** | |
> * An event emitted when the cursor selection has changed. | |
> * @event | |
> */ | |
> onDidChangeCursorSelection: IEvent<ICursorSelectionChangedEvent>; | |
> /** | |
> * An event emitted when the model of this editor has changed (e.g. `editor.setModel()`). | |
> * @event | |
> */ | |
> onDidChangeModel: IEvent<IModelChangedEvent>; | |
> /** | |
> * An event emitted when the decorations of the current model have changed. | |
> * @event | |
> */ | |
> onDidChangeModelDecorations: IEvent<IModelDecorationsChangedEvent>; | |
> /** | |
> * An event emitted when the text inside this editor gained focus (i.e. cursor starts blinking). | |
> * @event | |
> */ | |
> onDidFocusEditorText(listener: () => void): IDisposable; | |
> /** | |
> * An event emitted when the text inside this editor lost focus (i.e. cursor stops blinking). | |
> * @event | |
> */ | |
> onDidBlurEditorText(listener: () => void): IDisposable; | |
> /** | |
> * An event emitted when the text inside this editor or an editor widget gained focus. | |
> * @event | |
> */ | |
> onDidFocusEditorWidget(listener: () => void): IDisposable; | |
> /** | |
> * An event emitted when the text inside this editor or an editor widget lost focus. | |
> * @event | |
> */ | |
> onDidBlurEditorWidget(listener: () => void): IDisposable; | |
> /** | |
> * An event emitted after composition has started. | |
> */ | |
> onDidCompositionStart(listener: () => void): IDisposable; | |
> /** | |
> * An event emitted after composition has ended. | |
> */ | |
> onDidCompositionEnd(listener: () => void): IDisposable; | |
> /** | |
> * An event emitted when editing failed because the editor is read-only. | |
> * @event | |
> */ | |
> onDidAttemptReadOnlyEdit(listener: () => void): IDisposable; | |
> /** | |
> * An event emitted when users paste text in the editor. | |
> * @event | |
> */ | |
> onDidPaste: IEvent<IPasteEvent>; | |
> /** | |
> * An event emitted on a "mouseup". | |
> * @event | |
> */ | |
> onMouseUp: IEvent<IEditorMouseEvent>; | |
> /** | |
> * An event emitted on a "mousedown". | |
> * @event | |
> */ | |
> onMouseDown: IEvent<IEditorMouseEvent>; | |
> /** | |
> * An event emitted on a "contextmenu". | |
> * @event | |
> */ | |
> onContextMenu: IEvent<IEditorMouseEvent>; | |
> /** | |
> * An event emitted on a "mousemove". | |
> * @event | |
> */ | |
> onMouseMove: IEvent<IEditorMouseEvent>; | |
> /** | |
> * An event emitted on a "mouseleave". | |
> * @event | |
> */ | |
> onMouseLeave: IEvent<IPartialEditorMouseEvent>; | |
> /** | |
> * An event emitted on a "keyup". | |
> * @event | |
> */ | |
> onKeyUp: IEvent<IKeyboardEvent>; | |
> /** | |
> * An event emitted on a "keydown". | |
> * @event | |
> */ | |
> onKeyDown: IEvent<IKeyboardEvent>; | |
> /** | |
> * An event emitted when the layout of the editor has changed. | |
> * @event | |
> */ | |
> onDidLayoutChange: IEvent<EditorLayoutInfo>; | |
> /** | |
> * An event emitted when the content width or content height in the editor has changed. | |
> * @event | |
> */ | |
> onDidContentSizeChange: IEvent<IContentSizeChangedEvent>; | |
> /** | |
> * An event emitted when the scroll in the editor has changed. | |
> * @event | |
> */ | |
> onDidScrollChange: IEvent<IScrollEvent>; | |
> /** | |
> * An event emitted when hidden areas change in the editor (e.g. due to folding). | |
> * @event | |
> */ | |
> onDidChangeHiddenAreas: IEvent<void>; | |
> /** | |
> * Saves current view state of the editor in a serializable object. | |
> */ | |
> saveViewState(): ICodeEditorViewState | null; | |
> /** | |
> * Restores the view state of the editor from a serializable object generated by `saveViewState`. | |
> */ | |
> restoreViewState(state: ICodeEditorViewState): void; | |
> /** | |
> * Returns true if the text inside this editor or an editor widget has focus. | |
> */ | |
> hasWidgetFocus(): boolean; | |
> /** | |
> * Get a contribution of this editor. | |
> * @id Unique identifier of the contribution. | |
> * @return The contribution or null if contribution not found. | |
> */ | |
> getContribution<T extends IEditorContribution>(id: string): T; | |
> /** | |
> * Type the getModel() of IEditor. | |
> */ | |
> getModel(): ITextModel | null; | |
> /** | |
> * Sets the current model attached to this editor. | |
> * If the previous model was created by the editor via the value key in the options | |
> * literal object, it will be destroyed. Otherwise, if the previous model was set | |
> * via setModel, or the model key in the options literal object, the previous model | |
> * will not be destroyed. | |
> * It is safe to call setModel(null) to simply detach the current model from the editor. | |
> */ | |
> setModel(model: ITextModel | null): void; | |
> /** | |
> * Gets all the editor computed options. | |
> */ | |
> getOptions(): IComputedEditorOptions; | |
> /** | |
> * Gets a specific editor option. | |
> */ | |
> getOption<T extends EditorOption>(id: T): FindComputedEditorOptionValueById<T>; | |
> /** | |
> * Returns the editor's configuration (without any validation or defaults). | |
> */ | |
> getRawOptions(): IEditorOptions; | |
> /** | |
> * Get value of the current model attached to this editor. | |
> * @see {@link ITextModel.getValue} | |
> */ | |
> getValue(options?: { | |
> preserveBOM: boolean; | |
> lineEnding: string; | |
> }): string; | |
> /** | |
> * Set the value of the current model attached to this editor. | |
> * @see {@link ITextModel.setValue} | |
> */ | |
> setValue(newValue: string): void; | |
> /** | |
> * Get the width of the editor's content. | |
> * This is information that is "erased" when computing `scrollWidth = Math.max(contentWidth, width)` | |
> */ | |
> getContentWidth(): number; | |
> /** | |
> * Get the scrollWidth of the editor's viewport. | |
> */ | |
> getScrollWidth(): number; | |
> /** | |
> * Get the scrollLeft of the editor's viewport. | |
> */ | |
> getScrollLeft(): number; | |
> /** | |
> * Get the height of the editor's content. | |
> * This is information that is "erased" when computing `scrollHeight = Math.max(contentHeight, height)` | |
> */ | |
> getContentHeight(): number; | |
> /** | |
> * Get the scrollHeight of the editor's viewport. | |
> */ | |
> getScrollHeight(): number; | |
> /** | |
> * Get the scrollTop of the editor's viewport. | |
> */ | |
> getScrollTop(): number; | |
> /** | |
> * Change the scrollLeft of the editor's viewport. | |
> */ | |
> setScrollLeft(newScrollLeft: number, scrollType?: ScrollType): void; | |
> /** | |
> * Change the scrollTop of the editor's viewport. | |
> */ | |
> setScrollTop(newScrollTop: number, scrollType?: ScrollType): void; | |
> /** | |
> * Change the scroll position of the editor's viewport. | |
> */ | |
> setScrollPosition(position: INewScrollPosition, scrollType?: ScrollType): void; | |
> /** | |
> * Get an action that is a contribution to this editor. | |
> * @id Unique identifier of the contribution. | |
> * @return The action or null if action not found. | |
> */ | |
> getAction(id: string): IEditorAction; | |
> /** | |
> * Execute a command on the editor. | |
> * The edits will land on the undo-redo stack, but no "undo stop" will be pushed. | |
> * @param source The source of the call. | |
> * @param command The command to execute | |
> */ | |
> executeCommand(source: string | null | undefined, command: ICommand): void; | |
> /** | |
> * Create an "undo stop" in the undo-redo stack. | |
> */ | |
> pushUndoStop(): boolean; | |
> /** | |
> * Remove the "undo stop" in the undo-redo stack. | |
> */ | |
> popUndoStop(): boolean; | |
> /** | |
> * Execute edits on the editor. | |
> * The edits will land on the undo-redo stack, but no "undo stop" will be pushed. | |
> * @param source The source of the call. | |
> * @param edits The edits to execute. | |
> * @param endCursorState Cursor state after the edits were applied. | |
> */ | |
> executeEdits(source: string | null | undefined, edits: IIdentifiedSingleEditOperation[], endCursorState?: ICursorStateComputer | Selection[]): boolean; | |
> /** | |
> * Execute multiple (concomitant) commands on the editor. | |
> * @param source The source of the call. | |
> * @param command The commands to execute | |
> */ | |
> executeCommands(source: string | null | undefined, commands: (ICommand | null)[]): void; | |
> /** | |
> * Get all the decorations on a line (filtering out decorations from other editors). | |
> */ | |
> getLineDecorations(lineNumber: number): IModelDecoration[] | null; | |
> /** | |
> * All decorations added through this call will get the ownerId of this editor. | |
> * @see {@link ITextModel.deltaDecorations} | |
> */ | |
> deltaDecorations(oldDecorations: string[], newDecorations: IModelDeltaDecoration[]): string[]; | |
> /** | |
> * Get the layout info for the editor. | |
> */ | |
> getLayoutInfo(): EditorLayoutInfo; | |
> /** | |
> * Returns the ranges that are currently visible. | |
> * Does not account for horizontal scrolling. | |
> */ | |
> getVisibleRanges(): Range[]; | |
> /** | |
> * Get the vertical position (top offset) for the line w.r.t. to the first line. | |
> */ | |
> getTopForLineNumber(lineNumber: number): number; | |
> /** | |
> * Get the vertical position (top offset) for the position w.r.t. to the first line. | |
> */ | |
> getTopForPosition(lineNumber: number, column: number): number; | |
> /** | |
> * Returns the editor's container dom node | |
> */ | |
> getContainerDomNode(): HTMLElement; | |
> /** | |
> * Returns the editor's dom node | |
> */ | |
> getDomNode(): HTMLElement | null; | |
> /** | |
> * Add a content widget. Widgets must have unique ids, otherwise they will be overwritten. | |
> */ | |
> addContentWidget(widget: IContentWidget): void; | |
> /** | |
> * Layout/Reposition a content widget. This is a ping to the editor to call widget.getPosition() | |
> * and update appropriately. | |
> */ | |
> layoutContentWidget(widget: IContentWidget): void; | |
> /** | |
> * Remove a content widget. | |
> */ | |
> removeContentWidget(widget: IContentWidget): void; | |
> /** | |
> * Add an overlay widget. Widgets must have unique ids, otherwise they will be overwritten. | |
> */ | |
> addOverlayWidget(widget: IOverlayWidget): void; | |
> /** | |
> * Layout/Reposition an overlay widget. This is a ping to the editor to call widget.getPosition() | |
> * and update appropriately. | |
> */ | |
> layoutOverlayWidget(widget: IOverlayWidget): void; | |
> /** | |
> * Remove an overlay widget. | |
> */ | |
> removeOverlayWidget(widget: IOverlayWidget): void; | |
> /** | |
> * Change the view zones. View zones are lost when a new model is attached to the editor. | |
> */ | |
> changeViewZones(callback: (accessor: IViewZoneChangeAccessor) => void): void; | |
> /** | |
> * Get the horizontal position (left offset) for the column w.r.t to the beginning of the line. | |
> * This method works only if the line `lineNumber` is currently rendered (in the editor's viewport). | |
> * Use this method with caution. | |
> */ | |
> getOffsetForColumn(lineNumber: number, column: number): number; | |
> /** | |
> * Force an editor render now. | |
> */ | |
> render(forceRedraw?: boolean): void; | |
> /** | |
> * Get the hit test target at coordinates `clientX` and `clientY`. | |
> * The coordinates are relative to the top-left of the viewport. | |
> * | |
> * @returns Hit test target or null if the coordinates fall outside the editor or the editor has no model. | |
> */ | |
> getTargetAtClientPoint(clientX: number, clientY: number): IMouseTarget | null; | |
> /** | |
> * Get the visible position for `position`. | |
> * The result position takes scrolling into account and is relative to the top left corner of the editor. | |
> * Explanation 1: the results of this method will change for the same `position` if the user scrolls the editor. | |
> * Explanation 2: the results of this method will not change if the container of the editor gets repositioned. | |
> * Warning: the results of this method are inaccurate for positions that are outside the current editor viewport. | |
> */ | |
> getScrolledVisiblePosition(position: IPosition): { | |
> top: number; | |
> left: number; | |
> height: number; | |
> } | null; | |
> /** | |
> * Apply the same font settings as the editor to `target`. | |
> */ | |
> applyFontInfo(target: HTMLElement): void; | |
> } | |
> | |
> /** | |
> * Information about a line in the diff editor | |
> */ | |
> export interface IDiffLineInformation { | |
> readonly equivalentLineNumber: number; | |
> } | |
> | |
> /** | |
> * A rich diff editor. | |
> */ | |
> export interface IDiffEditor extends IEditor { | |
> /** | |
> * @see {@link ICodeEditor.getDomNode} | |
> */ | |
> getDomNode(): HTMLElement; | |
> /** | |
> * An event emitted when the diff information computed by this diff editor has been updated. | |
> * @event | |
> */ | |
> onDidUpdateDiff(listener: () => void): IDisposable; | |
> /** | |
> * Saves current view state of the editor in a serializable object. | |
> */ | |
> saveViewState(): IDiffEditorViewState | null; | |
> /** | |
> * Restores the view state of the editor from a serializable object generated by `saveViewState`. | |
> */ | |
> restoreViewState(state: IDiffEditorViewState): void; | |
> /** | |
> * Type the getModel() of IEditor. | |
> */ | |
> getModel(): IDiffEditorModel | null; | |
> /** | |
> * Sets the current model attached to this editor. | |
> * If the previous model was created by the editor via the value key in the options | |
> * literal object, it will be destroyed. Otherwise, if the previous model was set | |
> * via setModel, or the model key in the options literal object, the previous model | |
> * will not be destroyed. | |
> * It is safe to call setModel(null) to simply detach the current model from the editor. | |
> */ | |
> setModel(model: IDiffEditorModel | null): void; | |
> /** | |
> * Get the `original` editor. | |
> */ | |
> getOriginalEditor(): ICodeEditor; | |
> /** | |
> * Get the `modified` editor. | |
> */ | |
> getModifiedEditor(): ICodeEditor; | |
> /** | |
> * Get the computed diff information. | |
> */ | |
> getLineChanges(): ILineChange[] | null; | |
> /** | |
> * Get information based on computed diff about a line number from the original model. | |
> * If the diff computation is not finished or the model is missing, will return null. | |
> */ | |
> getDiffLineInformationForOriginal(lineNumber: number): IDiffLineInformation | null; | |
> /** | |
> * Get information based on computed diff about a line number from the modified model. | |
> * If the diff computation is not finished or the model is missing, will return null. | |
> */ | |
> getDiffLineInformationForModified(lineNumber: number): IDiffLineInformation | null; | |
> /** | |
> * Update the editor's options after the editor has been created. | |
> */ | |
> updateOptions(newOptions: IDiffEditorOptions): void; | |
> } | |
> | |
> export class FontInfo extends BareFontInfo { | |
> readonly _editorStylingBrand: void; | |
> readonly version: number; | |
> readonly isTrusted: boolean; | |
> readonly isMonospace: boolean; | |
> readonly typicalHalfwidthCharacterWidth: number; | |
> readonly typicalFullwidthCharacterWidth: number; | |
> readonly canUseHalfwidthRightwardsArrow: boolean; | |
> readonly spaceWidth: number; | |
> readonly middotWidth: number; | |
> readonly wsmiddotWidth: number; | |
> readonly maxDigitWidth: number; | |
> } | |
> | |
> export class BareFontInfo { | |
> readonly _bareFontInfoBrand: void; | |
> readonly zoomLevel: number; | |
> readonly pixelRatio: number; | |
> readonly fontFamily: string; | |
> readonly fontWeight: string; | |
> readonly fontSize: number; | |
> readonly fontFeatureSettings: string; | |
> readonly lineHeight: number; | |
> readonly letterSpacing: number; | |
> } | |
> | |
> //compatibility: | |
> export type IReadOnlyModel = ITextModel; | |
> export type IModel = ITextModel; | |
> } | |
/Users/joel/.config/yarn/global/node_modules/yargs/build/index.cjs:1 | |
"use strict";var t=require("assert");class e extends Error{constructor(t){super(t||"yargs error"),this.name="YError",Error.captureStackTrace(this,e)}}let s,i=[];function n(t,o,a,h){s=h;let l={};if(Object.prototype.hasOwnProperty.call(t,"extends")){if("string"!=typeof t.extends)return l;const r=/\.json|\..*rc$/.test(t.extends);let h=null;if(r)h=function(t,e){return s.path.resolve(t,e)}(o,t.extends);else try{h=require.resolve(t.extends)}catch(e){return t}!function(t){if(i.indexOf(t)>-1)throw new e(`Circular extended configurations: '${t}'.`)}(h),i.push(h),l=r?JSON.parse(s.readFileSync(h,"utf8")):require(t.extends),delete t.extends,l=n(l,s.path.dirname(h),a,s)}return i=[],a?r(l,t):Object.assign({},l,t)}function r(t,e){const s={};function i(t){return t&&"object"==typeof t&&!Array.isArray(t)}Object.assign(s,t);for(const n of Object.keys(e))i(e[n])&&i(s[n])?s[n]=r(t[n],e[n]):s[n]=e[n];return s}function o(t){const e=t.replace(/\s{2,}/g," ").split(/\s+(?![^[]*]|[^<]*>)/),s=/\.*[\][<>]/g,i=e.shift();if(!i)throw new Error(`No command found in: ${t}`);const n={cmd:i.replace(s,""),demanded:[],optional:[]};return e.forEach(((t,i)=>{let r=!1;t=t.replace(/\s/g,""),/\.+[\]>]/.test(t)&&i===e.length-1&&(r=!0),/^\[/.test(t)?n.optional.push({cmd:t.replace(s,"").split("|"),variadic:r}):n.demanded.push({cmd:t.replace(s,"").split("|"),variadic:r})})),n}const a=["first","second","third","fourth","fifth","sixth"];function h(t,s,i){try{let n=0;const[r,a,h]="object"==typeof t?[{demanded:[],optional:[]},t,s]:[o(`cmd ${t}`),s,i],f=[].slice.call(a);for(;f.length&&void 0===f[f.length-1];)f.pop();const d=h||f.length;if(d<r.demanded.length)throw new e(`Not enough arguments provided. Expected ${r.demanded.length} but received ${f.length}.`);const u=r.demanded.length+r.optional.length;if(d>u)throw new e(`Too many arguments provided. Expected max ${u} but received ${d}.`);r.demanded.forEach((t=>{const e=l(f.shift());0===t.cmd.filter((t=>t===e||"*"===t)).length&&c(e,t.cmd,n),n+=1})),r.optional.forEach((t=>{if(0===f.length)return;const e=l(f.shift());0===t.cmd.filter((t=>t===e||"*"===t)).length&&c(e,t.cmd,n),n+=1}))}catch(t){console.warn(t.stack)}}function l(t){return Array.isArray(t)?"array":null===t?"null":typeof t}function c(t,s,i){throw new e(`Invalid ${a[i]||"manyith"} argument. Expected ${s.join(" or ")} but received ${t}.`)}function f(t){return!!t&&!!t.then&&"function"==typeof t.then}function d(t,e,s,i){s.assert.notStrictEqual(t,e,i)}function u(t,e){e.assert.strictEqual(typeof t,"string")}function p(t){return Object.keys(t)}function g(t={},e=(()=>!0)){const s={};return p(t).forEach((i=>{e(i,t[i])&&(s[i]=t[i])})),s}function m(){return process.versions.electron&&!process.defaultApp?0:1}function y(){return process.argv[m()]}var b=Object.freeze({__proto__:null,hideBin:function(t){return t.slice(m()+1)},getProcessArgvBin:y});function v(t,e,s,i){if("a"===s&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===s?i:"a"===s?i.call(t):i?i.value:e.get(t)}function O(t,e,s,i,n){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!n)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?n.call(t,s):n?n.value=s:e.set(t,s),s}class w{constructor(t){this.globalMiddleware=[],this.frozens=[],this.yargs=t}addMiddleware(t,e,s=!0,i=!1){if(h("<array|function> [boolean] [boolean] [boolean]",[t,e,s],arguments.length),Array.isArray(t)){for(let i=0;i<t.length;i++){if("function"!=typeof t[i])throw Error("middleware must be a function");const n=t[i];n.applyBeforeValidation=e,n.global=s}Array.prototype.push.apply(this.globalMiddleware,t)}else if("function"==typeof t){const n=t;n.applyBeforeValidation=e,n.global=s,n.mutates=i,this.globalMiddleware.push(t)}return this.yargs}addCoerceMiddleware(t,e){const s=this.yargs.getAliases();return this.globalMiddleware=this.globalMiddleware.filter((t=>{const i=[...s[e]||[],e];return!t.option||!i.includes(t.option)})),t.option=e,this.addMiddleware(t,!0,!0,!0)}getMiddleware(){return this.globalMiddleware}freeze(){this.frozens.push([...this.globalMiddleware])}unfreeze(){const t=this.frozens.pop();void 0!==t&&(this.globalMiddleware=t)}reset(){this.globalMiddleware=this.globalMiddleware.filter((t=>t.global))}}function C(t,e,s,i){return s.reduce(((t,s)=>{if(s.applyBeforeValidation!==i)return t;if(s.mutates){if(s.applied)return t;s.applied=!0}if(f(t))return t.then((t=>Promise.all([t,s(t,e)]))).then((([t,e])=>Object.assign(t,e)));{const i=s(t,e);return f(i)?i.then((e=>Object.assign(t,e))):Object.assign(t,i)}}),t)}function j(t,e,s=(t=>{throw t})){try{const s="function"==typeof t?t():t;return f(s)?s.then((t=>e(t))):e(s)}catch(t){return s(t)}}const _=/(^\*)|(^\$0)/;class M{constructor(t,e,s,i){this.requireCache=new Set,this.handlers={},this.aliasMap={},this.frozens=[],this.shim=i,this.usage=t,this.globalMiddleware=s,this.validation=e}addDirectory(t,e,s,i){"boolean"!=typeof(i=i||{}).recurse&&(i.recurse=!1),Array.isArray(i.extensions)||(i.extensions=["js"]);const n="function"==typeof i.visit?i.visit:t=>t;i.visit=(t,e,s)=>{const i=n(t,e,s);if(i){if(this.requireCache.has(e))return i;this.requireCache.add(e),this.addHandler(i)}return i},this.shim.requireDirectory({require:e,filename:s},t,i)}addHandler(t,e,s,i,n,r){let a=[];const h=function(t){return t?t.map((t=>(t.applyBeforeValidation=!1,t))):[]}(n);if(i=i||(()=>{}),Array.isArray(t))if(function(t){return t.every((t=>"string"==typeof t))}(t))[t,...a]=t;else for(const e of t)this.addHandler(e);else{if(function(t){return"object"==typeof t&&!Array.isArray(t)}(t)){let e=Array.isArray(t.command)||"string"==typeof t.command?t.command:this.moduleName(t);return t.aliases&&(e=[].concat(e).concat(t.aliases)),void this.addHandler(e,this.extractDesc(t),t.builder,t.handler,t.middlewares,t.deprecated)}if(k(s))return void this.addHandler([t].concat(a),e,s.builder,s.handler,s.middlewares,s.deprecated)}if("string"==typeof t){const n=o(t);a=a.map((t=>o(t).cmd));let l=!1;const c=[n.cmd].concat(a).filter((t=>!_.test(t)||(l=!0,!1)));0===c.length&&l&&c.push("$0"),l&&(n.cmd=c[0],a=c.slice(1),t=t.replace(_,n.cmd)),a.forEach((t=>{this.aliasMap[t]=n.cmd})),!1!==e&&this.usage.command(t,e,l,a,r),this.handlers[n.cmd]={original:t,description:e,handler:i,builder:s||{},middlewares:h,deprecated:r,demanded:n.demanded,optional:n.optional},l&&(this.defaultCommand=this.handlers[n.cmd])}}getCommandHandlers(){return this.handlers}getCommands(){return Object.keys(this.handlers).concat(Object.keys(this.aliasMap))}hasDefaultCommand(){return!!this.defaultCommand}runCommand(t,e,s,i,n,r){const o=this.handlers[t]||this.handlers[this.aliasMap[t]]||this.defaultCommand,a=e.getInternalMethods().getContext(),h=a.commands.slice(),l=!t;t&&(a.commands.push(t),a.fullCommands.push(o.original));const c=this.applyBuilderUpdateUsageAndParse(l,o,e,s.aliases,h,i,n,r);return f(c)?c.then((t=>this.applyMiddlewareAndGetResult(l,o,t.innerArgv,a,n,t.aliases,e))):this.applyMiddlewareAndGetResult(l,o,c.innerArgv,a,n,c.aliases,e)}applyBuilderUpdateUsageAndParse(t,e,s,i,n,r,o,a){const h=e.builder;let l=s;if(E(h)){const c=h(s.getInternalMethods().reset(i),a);if(f(c))return c.then((i=>{var a;return l=(a=i)&&"function"==typeof a.getInternalMethods?i:s,this.parseAndUpdateUsage(t,e,l,n,r,o)}))}else(function(t){return"object"==typeof t})(h)&&(l=s.getInternalMethods().reset(i),Object.keys(e.builder).forEach((t=>{l.option(t,h[t])})));return this.parseAndUpdateUsage(t,e,l,n,r,o)}parseAndUpdateUsage(t,e,s,i,n,r){t&&s.getInternalMethods().getUsageInstance().unfreeze(),this.shouldUpdateUsage(s)&&s.getInternalMethods().getUsageInstance().usage(this.usageFromParentCommandsCommandHandler(i,e),e.description);const o=s.getInternalMethods().runYargsParserAndExecuteCommands(null,void 0,!0,n,r);return f(o)?o.then((t=>({aliases:s.parsed.aliases,innerArgv:t}))):{aliases:s.parsed.aliases,innerArgv:o}}shouldUpdateUsage(t){return!t.getInternalMethods().getUsageInstance().getUsageDisabled()&&0===t.getInternalMethods().getUsageInstance().getUsage().length}usageFromParentCommandsCommandHandler(t,e){const s=_.test(e.original)?e.original.replace(_,"").trim():e.original,i=t.filter((t=>!_.test(t)));return i.push(s),`$0 ${i.join(" ")}`}applyMiddlewareAndGetResult(t,e,s,i,n,r,o){let a={};if(n)return s;o.getInternalMethods().getHasOutput()||(a=this.populatePositionals(e,s,i,o));const h=this.globalMiddleware.getMiddleware().slice(0).concat(e.middlewares);if(s=C(s,o,h,!0),!o.getInternalMethods().getHasOutput()){const e=o.getInternalMethods().runValidation(r,a,o.parsed.error,t);s=j(s,(t=>(e(t),t)))}if(e.handler&&!o.getInternalMethods().getHasOutput()){o.getInternalMethods().setHasOutput();const i=!!o.getOptions().configuration["populate--"];o.getInternalMethods().postProcess(s,i,!1,!1),s=j(s=C(s,o,h,!1),(t=>{const s=e.handler(t);return f(s)?s.then((()=>t)):t})),t||o.getInternalMethods().getUsageInstance().cacheHelpMessage(),f(s)&&!o.getInternalMethods().hasParseCallback()&&s.catch((t=>{try{o.getInternalMethods().getUsageInstance().fail(null,t)}catch(t){}}))}return t||(i.commands.pop(),i.fullCommands.pop()),s}populatePositionals(t,e,s,i){e._=e._.slice(s.commands.length);const n=t.demanded.slice(0),r=t.optional.slice(0),o={};for(this.validation.positionalCount(n.length,e._.length);n.length;){const t=n.shift();this.populatePositional(t,e,o)}for(;r.length;){const t=r.shift();this.populatePositional(t,e,o)}return e._=s.commands.concat(e._.map((t=>""+t))),this.postProcessPositionals(e,o,this.cmdToParseOptions(t.original),i),o}populatePositional(t,e,s){const i=t.cmd[0];t.variadic?s[i]=e._.splice(0).map(String):e._.length&&(s[i]=[String(e._.shift())])}cmdToParseOptions(t){const e={array:[],default:{},alias:{},demand:{}},s=o(t);return s.demanded.forEach((t=>{const[s,...i]=t.cmd;t.variadic&&(e.array.push(s),e.default[s]=[]),e.alias[s]=i,e.demand[s]=!0})),s.optional.forEach((t=>{const[s,...i]=t.cmd;t.variadic&&(e.array.push(s),e.default[s]=[]),e.alias[s]=i})),e}postProcessPositionals(t,e,s,i){const n=Object.assign({},i.getOptions());n.default=Object.assign(s.default,n.default);for(const t of Object.keys(s.alias))n.alias[t]=(n.alias[t]||[]).concat(s.alias[t]);n.array=n.array.concat(s.array),n.config={};const r=[];if(Object.keys(e).forEach((t=>{e[t].map((e=>{n.configuration["unknown-options-as-args"]&&(n.key[t]=!0),r.push(`--${t}`),r.push(e)}))})),!r.length)return;const o=Object.assign({},n.configuration,{"populate--":!1}),a=this.shim.Parser.detailed(r,Object.assign({},n,{configuration:o}));if(a.error)i.getInternalMethods().getUsageInstance().fail(a.error.message,a.error);else{const s=Object.keys(e);Object.keys(e).forEach((t=>{s.push(...a.aliases[t])}));const n=i.getOptions().default;Object.keys(a.argv).forEach((i=>{s.includes(i)&&(e[i]||(e[i]=a.argv[i]),!Object.prototype.hasOwnProperty.call(n,i)&&Object.prototype.hasOwnProperty.call(t,i)&&Object.prototype.hasOwnProperty.call(a.argv,i)&&(Array.isArray(t[i])||Array.isArray(a.argv[i]))?t[i]=[].concat(t[i],a.argv[i]):t[i]=a.argv[i])}))}}runDefaultBuilderOn(t){if(!this.defaultCommand)return;if(this.shouldUpdateUsage(t)){const e=_.test(this.defaultCommand.original)?this.defaultCommand.original:this.defaultCommand.original.replace(/^[^[\]<>]*/,"$0 ");t.getInternalMethods().getUsageInstance().usage(e,this.defaultCommand.description)}const e=this.defaultCommand.builder;if(E(e))return e(t,!0);k(e)||Object.keys(e).forEach((s=>{t.option(s,e[s])}))}moduleName(t){const e=function(t){if("undefined"==typeof require)return null;for(let e,s=0,i=Object.keys(require.cache);s<i.length;s++)if(e=require.cache[i[s]],e.exports===t)return e;return null}(t);if(!e)throw new Error(`No command name given for module: ${this.shim.inspect(t)}`);return this.commandFromFilename(e.filename)}commandFromFilename(t){return this.shim.path.basename(t,this.shim.path.extname(t))}extractDesc({describe:t,description:e,desc:s}){for(const i of[t,e,s]){if("string"==typeof i||!1===i)return i;d(i,!0,this.shim)}return!1}freeze(){this.frozens.push({handlers:this.handlers,aliasMap:this.aliasMap,defaultCommand:this.defaultCommand})}unfreeze(){const t=this.frozens.pop();d(t,void 0,this.shim),({handlers:this.handlers,aliasMap:this.aliasMap,defaultCommand:this.defaultCommand}=t)}reset(){return this.handlers={},this.aliasMap={},this.defaultCommand=void 0,this.requireCache=new Set,this}}function k(t){return"object"==typeof t&&!!t.builder&&"function"==typeof t.handler}function E(t){return"function"==typeof t}function x(t){"undefined"!=typeof process&&[process.stdout,process.stderr].forEach((e=>{const s=e;s._handle&&s.isTTY&&"function"==typeof s._handle.setBlocking&&s._handle.setBlocking(t)}))}function A(t){return"boolean"==typeof t}function S(t,s){const i=s.y18n.__,n={},r=[];n.failFn=function(t){r.push(t)};let o=null,a=!0;n.showHelpOnFail=function(t=!0,e){const[s,i]="string"==typeof t?[!0,t]:[t,e];return o=i,a=s,n};let h=!1;n.fail=function(s,i){const l=t.getInternalMethods().getLoggerInstance();if(!r.length){if(t.getExitProcess()&&x(!0),h||(h=!0,a&&(t.showHelp("error"),l.error()),(s||i)&&l.error(s||i),o&&((s||i)&&l.error(""),l.error(o))),i=i||new e(s),t.getExitProcess())return t.exit(1);if(t.getInternalMethods().hasParseCallback())return t.exit(1,i);throw i}for(let t=r.length-1;t>=0;--t){const e=r[t];if(A(e)){if(i)throw i;if(s)throw Error(s)}else e(s,i,n)}};let l=[],c=!1;n.usage=(t,e)=>null===t?(c=!0,l=[],n):(c=!1,l.push([t,e||""]),n),n.getUsage=()=>l,n.getUsageDisabled=()=>c,n.getPositionalGroupName=()=>i("Positionals:");let f=[];n.example=(t,e)=>{f.push([t,e||""])};let d=[];n.command=function(t,e,s,i,n=!1){s&&(d=d.map((t=>(t[2]=!1,t)))),d.push([t,e||"",s,i,n])},n.getCommands=()=>d;let u={};n.describe=function(t,e){Array.isArray(t)?t.forEach((t=>{n.describe(t,e)})):"object"==typeof t?Object.keys(t).forEach((e=>{n.describe(e,t[e])})):u[t]=e},n.getDescriptions=()=>u;let p=[];n.epilog=t=>{p.push(t)};let m,y=!1;function b(){return y||(m=function(){const t=80;return s.process.stdColumns?Math.min(t,s.process.stdColumns):t}(),y=!0),m}n.wrap=t=>{y=!0,m=t};const v="__yargsString__:";function O(t,e,i){let n=0;return Array.isArray(t)||(t=Object.values(t).map((t=>[t]))),t.forEach((t=>{n=Math.max(s.stringWidth(i?`${i} ${I(t[0])}`:I(t[0]))+$(t[0]),n)})),e&&(n=Math.min(n,parseInt((.5*e).toString(),10))),n}let w;function C(e){return t.getOptions().hiddenOptions.indexOf(e)<0||t.parsed.argv[t.getOptions().showHiddenOpt]}function j(t,e){let s=`[${i("default:")} `;if(void 0===t&&!e)return null;if(e)s+=e;else switch(typeof t){case"string":s+=`"${t}"`;break;case"object":s+=JSON.stringify(t);break;default:s+=t}return`${s}]`}n.deferY18nLookup=t=>v+t,n.help=function(){if(w)return w;!function(){const e=t.getDemandedOptions(),s=t.getOptions();(Object.keys(s.alias)||[]).forEach((i=>{s.alias[i].forEach((r=>{u[r]&&n.describe(i,u[r]),r in e&&t.demandOption(i,e[r]),s.boolean.includes(r)&&t.boolean(i),s.count.includes(r)&&t.count(i),s.string.includes(r)&&t.string(i),s.normalize.includes(r)&&t.normalize(i),s.array.includes(r)&&t.array(i),s.number.includes(r)&&t.number(i)}))}))}();const e=t.customScriptName?t.$0:s.path.basename(t.$0),r=t.getDemandedOptions(),o=t.getDemandedCommands(),a=t.getDeprecatedOptions(),h=t.getGroups(),g=t.getOptions();let m=[];m=m.concat(Object.keys(u)),m=m.concat(Object.keys(r)),m=m.concat(Object.keys(o)),m=m.concat(Object.keys(g.default)),m=m.filter(C),m=Object.keys(m.reduce(((t,e)=>("_"!==e&&(t[e]=!0),t)),{}));const y=b(),_=s.cliui({width:y,wrap:!!y});if(!c)if(l.length)l.forEach((t=>{_.div({text:`${t[0].replace(/\$0/g,e)}`}),t[1]&&_.div({text:`${t[1]}`,padding:[1,0,0,0]})})),_.div();else if(d.length){let t=null;t=o._?`${e} <${i("command")}>\n`:`${e} [${i("command")}]\n`,_.div(`${t}`)}if(d.length>1||1===d.length&&!d[0][2]){_.div(i("Commands:"));const s=t.getInternalMethods().getContext(),n=s.commands.length?`${s.commands.join(" ")} `:"";!0===t.getInternalMethods().getParserConfiguration()["sort-commands"]&&(d=d.sort(((t,e)=>t[0].localeCompare(e[0]))));const r=e?`${e} `:"";d.forEach((t=>{const s=`${r}${n}${t[0].replace(/^\$0 ?/,"")}`;_.span({text:s,padding:[0,2,0,2],width:O(d,y,`${e}${n}`)+4},{text:t[1]});const o=[];t[2]&&o.push(`[${i("default")}]`),t[3]&&t[3].length&&o.push(`[${i("aliases:")} ${t[3].join(", ")}]`),t[4]&&("string"==typeof t[4]?o.push(`[${i("deprecated: %s",t[4])}]`):o.push(`[${i("deprecated")}]`)),o.length?_.div({text:o.join(" "),padding:[0,0,0,2],align:"right"}):_.div()})),_.div()}const M=(Object.keys(g.alias)||[]).concat(Object.keys(t.parsed.newAliases)||[]);m=m.filter((e=>!t.parsed.newAliases[e]&&M.every((t=>-1===(g.alias[t]||[]).indexOf(e)))));const k=i("Options:");h[k]||(h[k]=[]),function(t,e,s,i){let n=[],r=null;Object.keys(s).forEach((t=>{n=n.concat(s[t])})),t.forEach((t=>{r=[t].concat(e[t]),r.some((t=>-1!==n.indexOf(t)))||s[i].push(t)}))}(m,g.alias,h,k);const E=t=>/^--/.test(I(t)),x=Object.keys(h).filter((t=>h[t].length>0)).map((t=>({groupName:t,normalizedKeys:h[t].filter(C).map((t=>{if(M.includes(t))return t;for(let e,s=0;void 0!==(e=M[s]);s++)if((g.alias[e]||[]).includes(t))return e;return t}))}))).filter((({normalizedKeys:t})=>t.length>0)).map((({groupName:t,normalizedKeys:e})=>{const s=e.reduce(((e,s)=>(e[s]=[s].concat(g.alias[s]||[]).map((e=>t===n.getPositionalGroupName()?e:(/^[0-9]$/.test(e)?g.boolean.includes(s)?"-":"--":e.length>1?"--":"-")+e)).sort(((t,e)=>E(t)===E(e)?0:E(t)?1:-1)).join(", "),e)),{});return{groupName:t,normalizedKeys:e,switches:s}}));if(x.filter((({groupName:t})=>t!==n.getPositionalGroupName())).some((({normalizedKeys:t,switches:e})=>!t.every((t=>E(e[t])))))&&x.filter((({groupName:t})=>t!==n.getPositionalGroupName())).forEach((({normalizedKeys:t,switches:e})=>{t.forEach((t=>{var s,i;E(e[t])&&(e[t]=(s=e[t],i="-x, ".length,P(s)?{text:s.text,indentation:s.indentation+i}:{text:s,indentation:i}))}))})),x.forEach((({groupName:t,normalizedKeys:e,switches:s})=>{_.div(t),e.forEach((t=>{const e=s[t];let o=u[t]||"",h=null;o.includes(v)&&(o=i(o.substring(v.length))),g.boolean.includes(t)&&(h=`[${i("boolean")}]`),g.count.includes(t)&&(h=`[${i("count")}]`),g.string.includes(t)&&(h=`[${i("string")}]`),g.normalize.includes(t)&&(h=`[${i("string")}]`),g.array.includes(t)&&(h=`[${i("array")}]`),g.number.includes(t)&&(h=`[${i("number")}]`);const l=[t in a?(c=a[t],"string"==typeof c?`[${i("deprecated: %s",c)}]`:`[${i("deprecated")}]`):null,h,t in r?`[${i("required")}]`:null,g.choices&&g.choices[t]?`[${i("choices:")} ${n.stringifiedValues(g.choices[t])}]`:null,j(g.default[t],g.defaultDescription[t])].filter(Boolean).join(" ");var c;_.span({text:I(e),padding:[0,2,0,2+$(e)],width:O(s,y)+4},o),l?_.div({text:l,padding:[0,0,0,2],align:"right"}):_.div()})),_.div()})),f.length&&(_.div(i("Examples:")),f.forEach((t=>{t[0]=t[0].replace(/\$0/g,e)})),f.forEach((t=>{""===t[1]?_.div({text:t[0],padding:[0,2,0,2]}):_.div({text:t[0],padding:[0,2,0,2],width:O(f,y)+4},{text:t[1]})})),_.div()),p.length>0){const t=p.map((t=>t.replace(/\$0/g,e))).join("\n");_.div(`${t}\n`)}return _.toString().replace(/\s*$/,"")},n.cacheHelpMessage=function(){w=this.help()},n.clearCachedHelpMessage=function(){w=void 0},n.hasCachedHelpMessage=function(){return!!w},n.showHelp=e=>{const s=t.getInternalMethods().getLoggerInstance();e||(e="error");("function"==typeof e?e:s[e])(n.help())},n.functionDescription=t=>["(",t.name?s.Parser.decamelize(t.name,"-"):i("generated-value"),")"].join(""),n.stringifiedValues=function(t,e){let s="";const i=e||", ",n=[].concat(t);return t&&n.length?(n.forEach((t=>{s.length&&(s+=i),s+=JSON.stringify(t)})),s):s};let _=null;n.version=t=>{_=t},n.showVersion=e=>{const s=t.getInternalMethods().getLoggerInstance();e||(e="error");("function"==typeof e?e:s[e])(_)},n.reset=function(t){return o=null,h=!1,l=[],c=!1,p=[],f=[],d=[],u=g(u,(e=>!t[e])),n};const M=[];return n.freeze=function(){M.push({failMessage:o,failureOutput:h,usages:l,usageDisabled:c,epilogs:p,examples:f,commands:d,descriptions:u})},n.unfreeze=function(){const t=M.pop();t&&({failMessage:o,failureOutput:h,usages:l,usageDisabled:c,epilogs:p,examples:f,commands:d,descriptions:u}=t)},n}function P(t){return"object"==typeof t}function $(t){return P(t)?t.indentation:0}function I(t){return P(t)?t.text:t}class D{constructor(t,e,s,i){var n,r,o;this.yargs=t,this.usage=e,this.command=s,this.shim=i,this.completionKey="get-yargs-completions",this.aliases=null,this.customCompletionFunction=null,this.zshShell=null!==(o=(null===(n=this.shim.getEnv("SHELL"))||void 0===n?void 0:n.includes("zsh"))||(null===(r=this.shim.getEnv("ZSH_NAME"))||void 0===r?void 0:r.includes("zsh")))&&void 0!==o&&o}defaultCompletion(t,e,s,i){const n=this.command.getCommandHandlers();for(let e=0,s=t.length;e<s;++e)if(n[t[e]]&&n[t[e]].builder){const s=n[t[e]].builder;if(E(s)){const t=this.yargs.getInternalMethods().reset();return s(t,!0),t.argv}}const r=[];this.commandCompletions(r,t,s),this.optionCompletions(r,t,e,s),this.choicesCompletions(r,t,e,s),i(null,r)}commandCompletions(t,e,s){const i=this.yargs.getInternalMethods().getContext().commands;s.match(/^-/)||i[i.length-1]===s||this.previousArgHasChoices(e)||this.usage.getCommands().forEach((s=>{const i=o(s[0]).cmd;if(-1===e.indexOf(i))if(this.zshShell){const e=s[1]||"";t.push(i.replace(/:/g,"\\:")+":"+e)}else t.push(i)}))}optionCompletions(t,e,s,i){if((i.match(/^-/)||""===i&&0===t.length)&&!this.previousArgHasChoices(e)){const n=this.yargs.getOptions(),r=this.yargs.getGroups()[this.usage.getPositionalGroupName()]||[];Object.keys(n.key).forEach((o=>{const a=!!n.configuration["boolean-negation"]&&n.boolean.includes(o);r.includes(o)||this.argsContainKey(e,s,o,a)||(this.completeOptionKey(o,t,i),a&&n.default[o]&&this.completeOptionKey(`no-${o}`,t,i))}))}}choicesCompletions(t,e,s,i){if(this.previousArgHasChoices(e)){const s=this.getPreviousArgChoices(e);s&&s.length>0&&t.push(...s)}}getPreviousArgChoices(t){if(t.length<1)return;let e=t[t.length-1],s="";if(!e.startsWith("--")&&t.length>1&&(s=e,e=t[t.length-2]),!e.startsWith("--"))return;const i=e.replace(/-/g,""),n=this.yargs.getOptions();return Object.keys(n.key).some((t=>t===i))&&Array.isArray(n.choices[i])?n.choices[i].filter((t=>!s||t.startsWith(s))):void 0}previousArgHasChoices(t){const e=this.getPreviousArgChoices(t);return void 0!==e&&e.length>0}argsContainKey(t,e,s,i){if(-1!==t.indexOf(`--${s}`))return!0;if(i&&-1!==t.indexOf(`--no-${s}`))return!0;if(this.aliases)for(const t of this.aliases[s])if(void 0!==e[t])return!0;return!1}completeOptionKey(t,e,s){const i=this.usage.getDescriptions(),n=!/^--/.test(s)&&(t=>/^[^0-9]$/.test(t))(t)?"-":"--";if(this.zshShell){const s=i[t]||"";e.push(n+`${t.replace(/:/g,"\\:")}:${s.replace("__yargsString__:","")}`)}else e.push(n+t)}customCompletion(t,e,s,i){if(d(this.customCompletionFunction,null,this.shim),this.customCompletionFunction.length<3){const t=this.customCompletionFunction(s,e);return f(t)?t.then((t=>{this.shim.process.nextTick((()=>{i(null,t)}))})).catch((t=>{this.shim.process.nextTick((()=>{i(t,void 0)}))})):i(null,t)}return function(t){return t.length>3}(this.customCompletionFunction)?this.customCompletionFunction(s,e,((n=i)=>this.defaultCompletion(t,e,s,n)),(t=>{i(null,t)})):this.customCompletionFunction(s,e,(t=>{i(null,t)}))}getCompletion(t,e){const s=t.length?t[t.length-1]:"",i=this.yargs.parse(t,!0),n=this.customCompletionFunction?i=>this.customCompletion(t,i,s,e):i=>this.defaultCompletion(t,i,s,e);return f(i)?i.then(n):n(i)}generateCompletionScript(t,e){let s=this.zshShell?'#compdef {{app_name}}\n###-begin-{{app_name}}-completions-###\n#\n# yargs command completion script\n#\n# Installation: {{app_path}} {{completion_command}} >> ~/.zshrc\n# or {{app_path}} {{completion_command}} >> ~/.zsh_profile on OSX.\n#\n_{{app_name}}_yargs_completions()\n{\n local reply\n local si=$IFS\n IFS=$\'\n\' reply=($(COMP_CWORD="$((CURRENT-1))" COMP_LINE="$BUFFER" COMP_POINT="$CURSOR" {{app_path}} --get-yargs-completions "${words[@]}"))\n IFS=$si\n _describe \'values\' reply\n}\ncompdef _{{app_name}}_yargs_completions {{app_name}}\n###-end-{{app_name}}-completions-###\n':'###-begin-{{app_name}}-completions-###\n#\n# yargs command completion script\n#\n# Installation: {{app_path}} {{completion_command}} >> ~/.bashrc\n# or {{app_path}} {{completion_command}} >> ~/.bash_profile on OSX.\n#\n_{{app_name}}_yargs_completions()\n{\n local cur_word args type_list\n\n cur_word="${COMP_WORDS[COMP_CWORD]}"\n args=("${COMP_WORDS[@]}")\n\n # ask yargs to generate completions.\n type_list=$({{app_path}} --get-yargs-completions "${args[@]}")\n\n COMPREPLY=( $(compgen -W "${type_list}" -- ${cur_word}) )\n\n # if no match was found, fall back to filename completion\n if [ ${#COMPREPLY[@]} -eq 0 ]; then\n COMPREPLY=()\n fi\n\n return 0\n}\ncomplete -o default -F _{{app_name}}_yargs_completions {{app_name}}\n###-end-{{app_name}}-completions-###\n';const i=this.shim.path.basename(t);return t.match(/\.js$/)&&(t=`./${t}`),s=s.replace(/{{app_name}}/g,i),s=s.replace(/{{completion_command}}/g,e),s.replace(/{{app_path}}/g,t)}registerFunction(t){this.customCompletionFunction=t}setParsed(t){this.aliases=t.aliases}}function N(t,e){if(0===t.length)return e.length;if(0===e.length)return t.length;const s=[];let i,n;for(i=0;i<=e.length;i++)s[i]=[i];for(n=0;n<=t.length;n++)s[0][n]=n;for(i=1;i<=e.length;i++)for(n=1;n<=t.length;n++)e.charAt(i-1)===t.charAt(n-1)?s[i][n]=s[i-1][n-1]:i>1&&n>1&&e.charAt(i-2)===t.charAt(n-1)&&e.charAt(i-1)===t.charAt(n-2)?s[i][n]=s[i-2][n-2]+1:s[i][n]=Math.min(s[i-1][n-1]+1,Math.min(s[i][n-1]+1,s[i-1][n]+1));return s[e.length][t.length]}const H=["$0","--","_"];var z,q,W,U,F,L,V,T,R,G,K,B,Y,J,Z,X,Q,tt,et,st,it,nt,rt,ot,at,ht,lt,ct,ft,dt,ut,pt,gt;const mt=Symbol("copyDoubleDash"),yt=Symbol("copyDoubleDash"),bt=Symbol("deleteFromParserHintObject"),vt=Symbol("emitWarning"),Ot=Symbol("freeze"),wt=Symbol("getDollarZero"),Ct=Symbol("getParserConfiguration"),jt=Symbol("guessLocale"),_t=Symbol("guessVersion"),Mt=Symbol("parsePositionalNumbers"),kt=Symbol("pkgUp"),Et=Symbol("populateParserHintArray"),xt=Symbol("populateParserHintSingleValueDictionary"),At=Symbol("populateParserHintArrayDictionary"),St=Symbol("populateParserHintDictionary"),Pt=Symbol("sanitizeKey"),$t=Symbol("setKey"),It=Symbol("unfreeze"),Dt=Symbol("validateAsync"),Nt=Symbol("getCommandInstance"),Ht=Symbol("getContext"),zt=Symbol("getHasOutput"),qt=Symbol("getLoggerInstance"),Wt=Symbol("getParseContext"),Ut=Symbol("getUsageInstance"),Ft=Symbol("getValidationInstance"),Lt=Symbol("hasParseCallback"),Vt=Symbol("postProcess"),Tt=Symbol("rebase"),Rt=Symbol("reset"),Gt=Symbol("runYargsParserAndExecuteCommands"),Kt=Symbol("runValidation"),Bt=Symbol("setHasOutput"),Yt=Symbol("kTrackManuallySetKeys");class Jt{constructor(t=[],e,s,i){this.customScriptName=!1,this.parsed=!1,z.set(this,void 0),q.set(this,void 0),W.set(this,{commands:[],fullCommands:[]}),U.set(this,null),F.set(this,null),L.set(this,"show-hidden"),V.set(this,null),T.set(this,!0),R.set(this,{}),G.set(this,!0),K.set(this,[]),B.set(this,void 0),Y.set(this,{}),J.set(this,!1),Z.set(this,null),X.set(this,void 0),Q.set(this,""),tt.set(this,void 0),et.set(this,void 0),st.set(this,{}),it.set(this,null),nt.set(this,null),rt.set(this,{}),ot.set(this,{}),at.set(this,void 0),ht.set(this,!1),lt.set(this,void 0),ct.set(this,!1),ft.set(this,!1),dt.set(this,!1),ut.set(this,void 0),pt.set(this,null),gt.set(this,void 0),O(this,lt,i,"f"),O(this,at,t,"f"),O(this,q,e,"f"),O(this,et,s,"f"),O(this,B,new w(this),"f"),this.$0=this[wt](),this[Rt](),O(this,z,v(this,z,"f"),"f"),O(this,ut,v(this,ut,"f"),"f"),O(this,gt,v(this,gt,"f"),"f"),O(this,tt,v(this,tt,"f"),"f"),v(this,tt,"f").showHiddenOpt=v(this,L,"f"),O(this,X,this[yt](),"f")}addHelpOpt(t,e){return h("[string|boolean] [string]",[t,e],arguments.length),v(this,Z,"f")&&(this[bt](v(this,Z,"f")),O(this,Z,null,"f")),!1===t&&void 0===e||(O(this,Z,"string"==typeof t?t:"help","f"),this.boolean(v(this,Z,"f")),this.describe(v(this,Z,"f"),e||v(this,ut,"f").deferY18nLookup("Show help"))),this}help(t,e){return this.addHelpOpt(t,e)}addShowHiddenOpt(t,e){if(h("[string|boolean] [string]",[t,e],arguments.length),!1===t&&void 0===e)return this;const s="string"==typeof t?t:v(this,L,"f");return this.boolean(s),this.describe(s,e||v(this,ut,"f").deferY18nLookup("Show hidden options")),v(this,tt,"f").showHiddenOpt=s,this}showHidden(t,e){return this.addShowHiddenOpt(t,e)}alias(t,e){return h("<object|string|array> [string|array]",[t,e],arguments.length),this[At](this.alias.bind(this),"alias",t,e),this}array(t){return h("<array|string>",[t],arguments.length),this[Et]("array",t),this[Yt](t),this}boolean(t){return h("<array|string>",[t],arguments.length),this[Et]("boolean",t),this[Yt](t),this}check(t,e){return h("<function> [boolean]",[t,e],arguments.length),this.middleware(((e,s)=>j((()=>t(e)),(s=>(s?("string"==typeof s||s instanceof Error)&&v(this,ut,"f").fail(s.toString(),s):v(this,ut,"f").fail(v(this,lt,"f").y18n.__("Argument check failed: %s",t.toString())),e)),(t=>(v(this,ut,"f").fail(t.message?t.message:t.toString(),t),e)))),!1,e),this}choices(t,e){return h("<object|string|array> [string|array]",[t,e],arguments.length),this[At](this.choices.bind(this),"choices",t,e),this}coerce(t,s){if(h("<object|string|array> [function]",[t,s],arguments.length),Array.isArray(t)){if(!s)throw new e("coerce callback must be provided");for(const e of t)this.coerce(e,s);return this}if("object"==typeof t){for(const e of Object.keys(t))this.coerce(e,t[e]);return this}if(!s)throw new e("coerce callback must be provided");return v(this,tt,"f").key[t]=!0,v(this,B,"f").addCoerceMiddleware(((i,n)=>{let r;return j((()=>(r=n.getAliases(),s(i[t]))),(e=>{if(i[t]=e,r[t])for(const s of r[t])i[s]=e;return i}),(t=>{throw new e(t.message)}))}),t),this}conflicts(t,e){return h("<string|object> [string|array]",[t,e],arguments.length),v(this,gt,"f").conflicts(t,e),this}config(t="config",e,s){return h("[object|string] [string|function] [function]",[t,e,s],arguments.length),"object"!=typeof t||Array.isArray(t)?("function"==typeof e&&(s=e,e=void 0),this.describe(t,e||v(this,ut,"f").deferY18nLookup("Path to JSON config file")),(Array.isArray(t)?t:[t]).forEach((t=>{v(this,tt,"f").config[t]=s||!0})),this):(t=n(t,v(this,q,"f"),this[Ct]()["deep-merge-config"]||!1,v(this,lt,"f")),v(this,tt,"f").configObjects=(v(this,tt,"f").configObjects||[]).concat(t),this)}completion(t,e,s){return h("[string] [string|boolean|function] [function]",[t,e,s],arguments.length),"function"==typeof e&&(s=e,e=void 0),O(this,F,t||v(this,F,"f")||"completion","f"),e||!1===e||(e="generate completion script"),this.command(v(this,F,"f"),e),s&&v(this,U,"f").registerFunction(s),this}command(t,e,s,i,n,r){return h("<string|array|object> [string|boolean] [function|object] [function] [array] [boolean|string]",[t,e,s,i,n,r],arguments.length),v(this,z,"f").addHandler(t,e,s,i,n,r),this}commands(t,e,s,i,n,r){return this.command(t,e,s,i,n,r)}commandDir(t,e){h("<string> [object]",[t,e],arguments.length);const s=v(this,et,"f")||v(this,lt,"f").require;return v(this,z,"f").addDirectory(t,s,v(this,lt,"f").getCallerFile(),e),this}count(t){return h("<array|string>",[t],arguments.length),this[Et]("count",t),this[Yt](t),this}default(t,e,s){return h("<object|string|array> [*] [string]",[t,e,s],arguments.length),s&&(u(t,v(this,lt,"f")),v(this,tt,"f").defaultDescription[t]=s),"function"==typeof e&&(u(t,v(this,lt,"f")),v(this,tt,"f").defaultDescription[t]||(v(this,tt,"f").defaultDescription[t]=v(this,ut,"f").functionDescription(e)),e=e.call()),this[xt](this.default.bind(this),"default",t,e),this}defaults(t,e,s){return this.default(t,e,s)}demandCommand(t=1,e,s,i){return h("[number] [number|string] [string|null|undefined] [string|null|undefined]",[t,e,s,i],arguments.length),"number"!=typeof e&&(s=e,e=1/0),this.global("_",!1),v(this,tt,"f").demandedCommands._={min:t,max:e,minMsg:s,maxMsg:i},this}demand(t,e,s){return Array.isArray(e)?(e.forEach((t=>{d(s,!0,v(this,lt,"f")),this.demandOption(t,s)})),e=1/0):"number"!=typeof e&&(s=e,e=1/0),"number"==typeof t?(d(s,!0,v(this,lt,"f")),this.demandCommand(t,e,s,s)):Array.isArray(t)?t.forEach((t=>{d(s,!0,v(this,lt,"f")),this.demandOption(t,s)})):"string"==typeof s?this.demandOption(t,s):!0!==s&&void 0!==s||this.demandOption(t),this}demandOption(t,e){return h("<object|string|array> [string]",[t,e],arguments.length),this[xt](this.demandOption.bind(this),"demandedOptions",t,e),this}deprecateOption(t,e){return h("<string> [string|boolean]",[t,e],arguments.length),v(this,tt,"f").deprecatedOptions[t]=e,this}describe(t,e){return h("<object|string|array> [string]",[t,e],arguments.length),this[$t](t,!0),v(this,ut,"f").describe(t,e),this}detectLocale(t){return h("<boolean>",[t],arguments.length),O(this,T,t,"f"),this}env(t){return h("[string|boolean]",[t],arguments.length),!1===t?delete v(this,tt,"f").envPrefix:v(this,tt,"f").envPrefix=t||"",this}epilogue(t){return h("<string>",[t],arguments.length),v(this,ut,"f").epilog(t),this}epilog(t){return this.epilogue(t)}example(t,e){return h("<string|array> [string]",[t,e],arguments.length),Array.isArray(t)?t.forEach((t=>this.example(...t))):v(this,ut,"f").example(t,e),this}exit(t,e){O(this,J,!0,"f"),O(this,V,e,"f"),v(this,G,"f")&&v(this,lt,"f").process.exit(t)}exitProcess(t=!0){return h("[boolean]",[t],arguments.length),O(this,G,t,"f"),this}fail(t){if(h("<function|boolean>",[t],arguments.length),"boolean"==typeof t&&!1!==t)throw new e("Invalid first argument. Expected function or boolean 'false'");return v(this,ut,"f").failFn(t),this}getAliases(){return this.parsed?this.parsed.aliases:{}}async getCompletion(t,e){return h("<array> [function]",[t,e],arguments.length),e?v(this,U,"f").getCompletion(t,e):new Promise(((e,s)=>{v(this,U,"f").getCompletion(t,((t,i)=>{t?s(t):e(i)}))}))}getDemandedOptions(){return h([],0),v(this,tt,"f").demandedOptions}getDemandedCommands(){return h([],0),v(this,tt,"f").demandedCommands}getDeprecatedOptions(){return h([],0),v(this,tt,"f").deprecatedOptions}getDetectLocale(){return v(this,T,"f")}getExitProcess(){return v(this,G,"f")}getGroups(){return Object.assign({},v(this,Y,"f"),v(this,ot,"f"))}getHelp(){if(O(this,J,!0,"f"),!v(this,ut,"f").hasCachedHelpMessage()){if(!this.parsed){const t=this[Gt](v(this,at,"f"),void 0,void 0,0,!0);if(f(t))return t.then((()=>v(this,ut,"f").help()))}const t=v(this,z,"f").runDefaultBuilderOn(this);if(f(t))return t.then((()=>v(this,ut,"f").help()))}return Promise.resolve(v(this,ut,"f").help())}getOptions(){return v(this,tt,"f")}getStrict(){return v(this,ct,"f")}getStrictCommands(){return v(this,ft,"f")}getStrictOptions(){return v(this,dt,"f")}global(t,e){return h("<string|array> [boolean]",[t,e],arguments.length),t=[].concat(t),!1!==e?v(this,tt,"f").local=v(this,tt,"f").local.filter((e=>-1===t.indexOf(e))):t.forEach((t=>{v(this,tt,"f").local.includes(t)||v(this,tt,"f").local.push(t)})),this}group(t,e){h("<string|array> <string>",[t,e],arguments.length);const s=v(this,ot,"f")[e]||v(this,Y,"f")[e];v(this,ot,"f")[e]&&delete v(this,ot,"f")[e];const i={};return v(this,Y,"f")[e]=(s||[]).concat(t).filter((t=>!i[t]&&(i[t]=!0))),this}hide(t){return h("<string>",[t],arguments.length),v(this,tt,"f").hiddenOptions.push(t),this}implies(t,e){return h("<string|object> [number|string|array]",[t,e],arguments.length),v(this,gt,"f").implies(t,e),this}locale(t){return h("[string]",[t],arguments.length),t?(O(this,T,!1,"f"),v(this,lt,"f").y18n.setLocale(t),this):(this[jt](),v(this,lt,"f").y18n.getLocale())}middleware(t,e,s){return v(this,B,"f").addMiddleware(t,!!e,s)}nargs(t,e){return h("<string|object|array> [number]",[t,e],arguments.length),this[xt](this.nargs.bind(this),"narg",t,e),this}normalize(t){return h("<array|string>",[t],arguments.length),this[Et]("normalize",t),this}number(t){return h("<array|string>",[t],arguments.length),this[Et]("number",t),this[Yt](t),this}option(t,e){if(h("<string|object> [object]",[t,e],arguments.length),"object"==typeof t)Object.keys(t).forEach((e=>{this.options(e,t[e])}));else{"object"!=typeof e&&(e={}),this[Yt](t),!v(this,pt,"f")||"version"!==t&&"version"!==(null==e?void 0:e.alias)||this[vt](['"version" is a reserved word.',"Please do one of the following:",'- Disable version with `yargs.version(false)` if using "version" as an option',"- Use the built-in `yargs.version` method instead (if applicable)","- Use a different option key","https://yargs.js.org/docs/#api-reference-version"].join("\n"),void 0,"versionWarning"),v(this,tt,"f").key[t]=!0,e.alias&&this.alias(t,e.alias);const s=e.deprecate||e.deprecated;s&&this.deprecateOption(t,s);const i=e.demand||e.required||e.require;i&&this.demand(t,i),e.demandOption&&this.demandOption(t,"string"==typeof e.demandOption?e.demandOption:void 0),e.conflicts&&this.conflicts(t,e.conflicts),"default"in e&&this.default(t,e.default),void 0!==e.implies&&this.implies(t,e.implies),void 0!==e.nargs&&this.nargs(t,e.nargs),e.config&&this.config(t,e.configParser),e.normalize&&this.normalize(t),e.choices&&this.choices(t,e.choices),e.coerce&&this.coerce(t,e.coerce),e.group&&this.group(t,e.group),(e.boolean||"boolean"===e.type)&&(this.boolean(t),e.alias&&this.boolean(e.alias)),(e.array||"array"===e.type)&&(this.array(t),e.alias&&this.array(e.alias)),(e.number||"number"===e.type)&&(this.number(t),e.alias&&this.number(e.alias)),(e.string||"string"===e.type)&&(this.string(t),e.alias&&this.string(e.alias)),(e.count||"count"===e.type)&&this.count(t),"boolean"==typeof e.global&&this.global(t,e.global),e.defaultDescription&&(v(this,tt,"f").defaultDescription[t]=e.defaultDescription),e.skipValidation&&this.skipValidation(t);const n=e.describe||e.description||e.desc;this.describe(t,n),e.hidden&&this.hide(t),e.requiresArg&&this.requiresArg(t)}return this}options(t,e){return this.option(t,e)}parse(t,e,s){h("[string|array] [function|boolean|object] [function]",[t,e,s],arguments.length),this[Ot](),void 0===t&&(t=v(this,at,"f")),"object"==typeof e&&(O(this,nt,e,"f"),e=s),"function"==typeof e&&(O(this,it,e,"f"),e=!1),e||O(this,at,t,"f"),v(this,it,"f")&&O(this,G,!1,"f");const i=this[Gt](t,!!e),n=this.parsed;return v(this,U,"f").setParsed(this.parsed),f(i)?i.then((t=>(v(this,it,"f")&&v(this,it,"f").call(this,v(this,V,"f"),t,v(this,Q,"f")),t))).catch((t=>{throw v(this,it,"f")&&v(this,it,"f")(t,this.parsed.argv,v(this,Q,"f")),t})).finally((()=>{this[It](),this.parsed=n})):(v(this,it,"f")&&v(this,it,"f").call(this,v(this,V,"f"),i,v(this,Q,"f")),this[It](),this.parsed=n,i)}parseAsync(t,e,s){const i=this.parse(t,e,s);return f(i)?i:Promise.resolve(i)}parseSync(t,s,i){const n=this.parse(t,s,i);if(f(n))throw new e(".parseSync() must not be used with asynchronous builders, handlers, or middleware");return n}parserConfiguration(t){return h("<object>",[t],arguments.length),O(this,st,t,"f"),this}pkgConf(t,e){h("<string> [string]",[t,e],arguments.length);let s=null;const i=this[kt](e||v(this,q,"f"));return i[t]&&"object"==typeof i[t]&&(s=n(i[t],e||v(this,q,"f"),this[Ct]()["deep-merge-config"]||!1,v(this,lt,"f")),v(this,tt,"f").configObjects=(v(this,tt,"f").configObjects||[]).concat(s)),this}positional(t,e){h("<string> <object>",[t,e],arguments.length);const s=["default","defaultDescription","implies","normalize","choices","conflicts","coerce","type","describe","desc","description","alias"];e=g(e,((t,e)=>!("type"===t&&!["string","number","boolean"].includes(e))&&s.includes(t)));const i=v(this,W,"f").fullCommands[v(this,W,"f").fullCommands.length-1],n=i?v(this,z,"f").cmdToParseOptions(i):{array:[],alias:{},default:{},demand:{}};return p(n).forEach((s=>{const i=n[s];Array.isArray(i)?-1!==i.indexOf(t)&&(e[s]=!0):i[t]&&!(s in e)&&(e[s]=i[t])})),this.group(t,v(this,ut,"f").getPositionalGroupName()),this.option(t,e)}recommendCommands(t=!0){return h("[boolean]",[t],arguments.length),O(this,ht,t,"f"),this}required(t,e,s){return this.demand(t,e,s)}require(t,e,s){return this.demand(t,e,s)}requiresArg(t){return h("<array|string|object> [number]",[t],arguments.length),"string"==typeof t&&v(this,tt,"f").narg[t]||this[xt](this.requiresArg.bind(this),"narg",t,NaN),this}showCompletionScript(t,e){return h("[string] [string]",[t,e],arguments.length),t=t||this.$0,v(this,X,"f").log(v(this,U,"f").generateCompletionScript(t,e||v(this,F,"f")||"completion")),this}showHelp(t){if(h("[string|function]",[t],arguments.length),O(this,J,!0,"f"),!v(this,ut,"f").hasCachedHelpMessage()){if(!this.parsed){const e=this[Gt](v(this,at,"f"),void 0,void 0,0,!0);if(f(e))return e.then((()=>{v(this,ut,"f").showHelp(t)})),this}const e=v(this,z,"f").runDefaultBuilderOn(this);if(f(e))return e.then((()=>{v(this,ut,"f").showHelp(t)})),this}return v(this,ut,"f").showHelp(t),this}scriptName(t){return this.customScriptName=!0,this.$0=t,this}showHelpOnFail(t,e){return h("[boolean|string] [string]",[t,e],arguments.length),v(this,ut,"f").showHelpOnFail(t,e),this}showVersion(t){return h("[string|function]",[t],arguments.length),v(this,ut,"f").showVersion(t),this}skipValidation(t){return h("<array|string>",[t],arguments.length),this[Et]("skipValidation",t),this}strict(t){return h("[boolean]",[t],arguments.length),O(this,ct,!1!==t,"f"),this}strictCommands(t){return h("[boolean]",[t],arguments.length),O(this,ft,!1!==t,"f"),this}strictOptions(t){return h("[boolean]",[t],arguments.length),O(this,dt,!1!==t,"f"),this}string(t){return h("<array|string>",[t],arguments.length),this[Et]("string",t),this[Yt](t),this}terminalWidth(){return h([],0),v(this,lt,"f").process.stdColumns}updateLocale(t){return this.updateStrings(t)}updateStrings(t){return h("<object>",[t],arguments.length),O(this,T,!1,"f"),v(this,lt,"f").y18n.updateLocale(t),this}usage(t,s,i,n){if(h("<string|null|undefined> [string|boolean] [function|object] [function]",[t,s,i,n],arguments.length),void 0!==s){if(d(t,null,v(this,lt,"f")),(t||"").match(/^\$0( |$)/))return this.command(t,s,i,n);throw new e(".usage() description must start with $0 if being used as alias for .command()")}return v(this,ut,"f").usage(t),this}version(t,e,s){const i="version";if(h("[boolean|string] [string] [string]",[t,e,s],arguments.length),v(this,pt,"f")&&(this[bt](v(this,pt,"f")),v(this,ut,"f").version(void 0),O(this,pt,null,"f")),0===arguments.length)s=this[_t](),t=i;else if(1===arguments.length){if(!1===t)return this;s=t,t=i}else 2===arguments.length&&(s=e,e=void 0);return O(this,pt,"string"==typeof t?t:i,"f"),e=e||v(this,ut,"f").deferY18nLookup("Show version number"),v(this,ut,"f").version(s||void 0),this.boolean(v(this,pt,"f")),this.describe(v(this,pt,"f"),e),this}wrap(t){return h("<number|null|undefined>",[t],arguments.length),v(this,ut,"f").wrap(t),this}[(z=new WeakMap,q=new WeakMap,W=new WeakMap,U=new WeakMap,F=new WeakMap,L=new WeakMap,V=new WeakMap,T=new WeakMap,R=new WeakMap,G=new WeakMap,K=new WeakMap,B=new WeakMap,Y=new WeakMap,J=new WeakMap,Z=new WeakMap,X=new WeakMap,Q=new WeakMap,tt=new WeakMap,et=new WeakMap,st=new WeakMap,it=new WeakMap,nt=new WeakMap,rt=new WeakMap,ot=new WeakMap,at=new WeakMap,ht=new WeakMap,lt=new WeakMap,ct=new WeakMap,ft=new WeakMap,dt=new WeakMap,ut=new WeakMap,pt=new WeakMap,gt=new WeakMap,mt)](t){if(!t._||!t["--"])return t;t._.push.apply(t._,t["--"]);try{delete t["--"]}catch(t){}return t}[yt](){return{log:(...t)=>{this[Lt]()||console.log(...t),O(this,J,!0,"f"),v(this,Q,"f").length&&O(this,Q,v(this,Q,"f")+"\n","f"),O(this,Q,v(this,Q,"f")+t.join(" "),"f")},error:(...t)=>{this[Lt]()||console.error(...t),O(this,J,!0,"f"),v(this,Q,"f").length&&O(this,Q,v(this,Q,"f")+"\n","f"),O(this,Q,v(this,Q,"f")+t.join(" "),"f")}}}[bt](t){p(v(this,tt,"f")).forEach((e=>{if("configObjects"===e)return;const s=v(this,tt,"f")[e];Array.isArray(s)?s.includes(t)&&s.splice(s.indexOf(t),1):"object"==typeof s&&delete s[t]})),delete v(this,ut,"f").getDescriptions()[t]}[vt](t,e,s){v(this,R,"f")[s]||(v(this,lt,"f").process.emitWarning(t,e),v(this,R,"f")[s]=!0)}[Ot](){v(this,K,"f").push({options:v(this,tt,"f"),configObjects:v(this,tt,"f").configObjects.slice(0),exitProcess:v(this,G,"f"),groups:v(this,Y,"f"),strict:v(this,ct,"f"),strictCommands:v(this,ft,"f"),strictOptions:v(this,dt,"f"),completionCommand:v(this,F,"f"),output:v(this,Q,"f"),exitError:v(this,V,"f"),hasOutput:v(this,J,"f"),parsed:this.parsed,parseFn:v(this,it,"f"),parseContext:v(this,nt,"f")}),v(this,ut,"f").freeze(),v(this,gt,"f").freeze(),v(this,z,"f").freeze(),v(this,B,"f").freeze()}[wt](){let t,e="";return t=/\b(node|iojs|electron)(\.exe)?$/.test(v(this,lt,"f").process.argv()[0])?v(this,lt,"f").process.argv().slice(1,2):v(this,lt,"f").process.argv().slice(0,1),e=t.map((t=>{const e=this[Tt](v(this,q,"f"),t);return t.match(/^(\/|([a-zA-Z]:)?\\)/)&&e.length<t.length?e:t})).join(" ").trim(),v(this,lt,"f").getEnv("_")&&v(this,lt,"f").getProcessArgvBin()===v(this,lt,"f").getEnv("_")&&(e=v(this,lt,"f").getEnv("_").replace(`${v(this,lt,"f").path.dirname(v(this,lt,"f").process.execPath())}/`,"")),e}[Ct](){return v(this,st,"f")}[jt](){if(!v(this,T,"f"))return;const t=v(this,lt,"f").getEnv("LC_ALL")||v(this,lt,"f").getEnv("LC_MESSAGES")||v(this,lt,"f").getEnv("LANG")||v(this,lt,"f").getEnv("LANGUAGE")||"en_US";this.locale(t.replace(/[.:].*/,""))}[_t](){return this[kt]().version||"unknown"}[Mt](t){const e=t["--"]?t["--"]:t._;for(let t,s=0;void 0!==(t=e[s]);s++)v(this,lt,"f").Parser.looksLikeNumber(t)&&Number.isSafeInteger(Math.floor(parseFloat(`${t}`)))&&(e[s]=Number(t));return t}[kt](t){const e=t||"*";if(v(this,rt,"f")[e])return v(this,rt,"f")[e];let s={};try{let e=t||v(this,lt,"f").mainFilename;!t&&v(this,lt,"f").path.extname(e)&&(e=v(this,lt,"f").path.dirname(e));const i=v(this,lt,"f").findUp(e,((t,e)=>e.includes("package.json")?"package.json":void 0));d(i,void 0,v(this,lt,"f")),s=JSON.parse(v(this,lt,"f").readFileSync(i,"utf8"))}catch(t){}return v(this,rt,"f")[e]=s||{},v(this,rt,"f")[e]}[Et](t,e){(e=[].concat(e)).forEach((e=>{e=this[Pt](e),v(this,tt,"f")[t].push(e)}))}[xt](t,e,s,i){this[St](t,e,s,i,((t,e,s)=>{v(this,tt,"f")[t][e]=s}))}[At](t,e,s,i){this[St](t,e,s,i,((t,e,s)=>{v(this,tt,"f")[t][e]=(v(this,tt,"f")[t][e]||[]).concat(s)}))}[St](t,e,s,i,n){if(Array.isArray(s))s.forEach((e=>{t(e,i)}));else if((t=>"object"==typeof t)(s))for(const e of p(s))t(e,s[e]);else n(e,this[Pt](s),i)}[Pt](t){return"__proto__"===t?"___proto___":t}[$t](t,e){return this[xt](this[$t].bind(this),"key",t,e),this}[It](){var t,e,s,i,n,r,o,a,h,l,c,f;const u=v(this,K,"f").pop();let p;d(u,void 0,v(this,lt,"f")),t=this,e=this,s=this,i=this,n=this,r=this,o=this,a=this,h=this,l=this,c=this,f=this,({options:{set value(e){O(t,tt,e,"f")}}.value,configObjects:p,exitProcess:{set value(t){O(e,G,t,"f")}}.value,groups:{set value(t){O(s,Y,t,"f")}}.value,output:{set value(t){O(i,Q,t,"f")}}.value,exitError:{set value(t){O(n,V,t,"f")}}.value,hasOutput:{set value(t){O(r,J,t,"f")}}.value,parsed:this.parsed,strict:{set value(t){O(o,ct,t,"f")}}.value,strictCommands:{set value(t){O(a,ft,t,"f")}}.value,strictOptions:{set value(t){O(h,dt,t,"f")}}.value,completionCommand:{set value(t){O(l,F,t,"f")}}.value,parseFn:{set value(t){O(c,it,t,"f")}}.value,parseContext:{set value(t){O(f,nt,t,"f")}}.value}=u),v(this,tt,"f").configObjects=p,v(this,ut,"f").unfreeze(),v(this,gt,"f").unfreeze(),v(this,z,"f").unfreeze(),v(this,B,"f").unfreeze()}[Dt](t,e){return j(e,(e=>(t(e),e)))}getInternalMethods(){return{getCommandInstance:this[Nt].bind(this),getContext:this[Ht].bind(this),getHasOutput:this[zt].bind(this),getLoggerInstance:this[qt].bind(this),getParseContext:this[Wt].bind(this),getParserConfiguration:this[Ct].bind(this),getUsageInstance:this[Ut].bind(this),getValidationInstance:this[Ft].bind(this),hasParseCallback:this[Lt].bind(this),postProcess:this[Vt].bind(this),reset:this[Rt].bind(this),runValidation:this[Kt].bind(this),runYargsParserAndExecuteCommands:this[Gt].bind(this),setHasOutput:this[Bt].bind(this)}}[Nt](){return v(this,z,"f")}[Ht](){return v(this,W,"f")}[zt](){return v(this,J,"f")}[qt](){return v(this,X,"f")}[Wt](){return v(this,nt,"f")||{}}[Ut](){return v(this,ut,"f")}[Ft](){return v(this,gt,"f")}[Lt](){return!!v(this,it,"f")}[Vt](t,e,s,i){if(s)return t;if(f(t))return t;e||(t=this[mt](t));return(this[Ct]()["parse-positional-numbers"]||void 0===this[Ct]()["parse-positional-numbers"])&&(t=this[Mt](t)),i&&(t=C(t,this,v(this,B,"f").getMiddleware(),!1)),t}[Rt](t={}){O(this,tt,v(this,tt,"f")||{},"f");const e={};e.local=v(this,tt,"f").local||[],e.configObjects=v(this,tt,"f").configObjects||[];const s={};e.local.forEach((e=>{s[e]=!0,(t[e]||[]).forEach((t=>{s[t]=!0}))})),Object.assign(v(this,ot,"f"),Object.keys(v(this,Y,"f")).reduce(((t,e)=>{const i=v(this,Y,"f")[e].filter((t=>!(t in s)));return i.length>0&&(t[e]=i),t}),{})),O(this,Y,{},"f");return["array","boolean","string","skipValidation","count","normalize","number","hiddenOptions"].forEach((t=>{e[t]=(v(this,tt,"f")[t]||[]).filter((t=>!s[t]))})),["narg","key","alias","default","defaultDescription","config","choices","demandedOptions","demandedCommands","deprecatedOptions"].forEach((t=>{e[t]=g(v(this,tt,"f")[t],(t=>!s[t]))})),e.envPrefix=v(this,tt,"f").envPrefix,O(this,tt,e,"f"),O(this,ut,v(this,ut,"f")?v(this,ut,"f").reset(s):S(this,v(this,lt,"f")),"f"),O(this,gt,v(this,gt,"f")?v(this,gt,"f").reset(s):function(t,e,s){const i=s.y18n.__,n=s.y18n.__n,r={nonOptionCount:function(s){const i=t.getDemandedCommands(),r=s._.length+(s["--"]?s["--"].length:0)-t.getInternalMethods().getContext().commands.length;i._&&(r<i._.min||r>i._.max)&&(r<i._.min?void 0!==i._.minMsg?e.fail(i._.minMsg?i._.minMsg.replace(/\$0/g,r.toString()).replace(/\$1/,i._.min.toString()):null):e.fail(n("Not enough non-option arguments: got %s, need at least %s","Not enough non-option arguments: got %s, need at least %s",r,r.toString(),i._.min.toString())):r>i._.max&&(void 0!==i._.maxMsg?e.fail(i._.maxMsg?i._.maxMsg.replace(/\$0/g,r.toString()).replace(/\$1/,i._.max.toString()):null):e.fail(n("Too many non-option arguments: got %s, maximum of %s","Too many non-option arguments: got %s, maximum of %s",r,r.toString(),i._.max.toString()))))},positionalCount:function(t,s){s<t&&e.fail(n("Not enough non-option arguments: got %s, need at least %s","Not enough non-option arguments: got %s, need at least %s",s,s+"",t+""))},requiredArguments:function(t,s){let i=null;for(const e of Object.keys(s))Object.prototype.hasOwnProperty.call(t,e)&&void 0!==t[e]||(i=i||{},i[e]=s[e]);if(i){const t=[];for(const e of Object.keys(i)){const s=i[e];s&&t.indexOf(s)<0&&t.push(s)}const s=t.length?`\n${t.join("\n")}`:"";e.fail(n("Missing required argument: %s","Missing required arguments: %s",Object.keys(i).length,Object.keys(i).join(", ")+s))}},unknownArguments:function(s,i,o,a,h=!0){var l;const c=t.getInternalMethods().getCommandInstance().getCommands(),f=[],d=t.getInternalMethods().getContext();if(Object.keys(s).forEach((e=>{H.includes(e)||Object.prototype.hasOwnProperty.call(o,e)||Object.prototype.hasOwnProperty.call(t.getInternalMethods().getParseContext(),e)||r.isValidAndSomeAliasIsNotNew(e,i)||f.push(e)})),h&&(d.commands.length>0||c.length>0||a)&&s._.slice(d.commands.length).forEach((t=>{c.includes(""+t)||f.push(""+t)})),h){const e=(null===(l=t.getDemandedCommands()._)||void 0===l?void 0:l.max)||0,i=d.commands.length+e;i<s._.length&&s._.slice(i).forEach((t=>{t=String(t),d.commands.includes(t)||f.includes(t)||f.push(t)}))}f.length&&e.fail(n("Unknown argument: %s","Unknown arguments: %s",f.length,f.join(", ")))},unknownCommands:function(s){const i=t.getInternalMethods().getCommandInstance().getCommands(),r=[],o=t.getInternalMethods().getContext();return(o.commands.length>0||i.length>0)&&s._.slice(o.commands.length).forEach((t=>{i.includes(""+t)||r.push(""+t)})),r.length>0&&(e.fail(n("Unknown command: %s","Unknown commands: %s",r.length,r.join(", "))),!0)},isValidAndSomeAliasIsNotNew:function(e,s){if(!Object.prototype.hasOwnProperty.call(s,e))return!1;const i=t.parsed.newAliases;return[e,...s[e]].some((t=>!Object.prototype.hasOwnProperty.call(i,t)||!i[e]))},limitedChoices:function(s){const n=t.getOptions(),r={};if(!Object.keys(n.choices).length)return;Object.keys(s).forEach((t=>{-1===H.indexOf(t)&&Object.prototype.hasOwnProperty.call(n.choices,t)&&[].concat(s[t]).forEach((e=>{-1===n.choices[t].indexOf(e)&&void 0!==e&&(r[t]=(r[t]||[]).concat(e))}))}));const o=Object.keys(r);if(!o.length)return;let a=i("Invalid values:");o.forEach((t=>{a+=`\n ${i("Argument: %s, Given: %s, Choices: %s",t,e.stringifiedValues(r[t]),e.stringifiedValues(n.choices[t]))}`})),e.fail(a)}};let o={};function a(t,e){const s=Number(e);return"number"==typeof(e=isNaN(s)?e:s)?e=t._.length>=e:e.match(/^--no-.+/)?(e=e.match(/^--no-(.+)/)[1],e=!Object.prototype.hasOwnProperty.call(t,e)):e=Object.prototype.hasOwnProperty.call(t,e),e}r.implies=function(e,i){h("<string|object> [array|number|string]",[e,i],arguments.length),"object"==typeof e?Object.keys(e).forEach((t=>{r.implies(t,e[t])})):(t.global(e),o[e]||(o[e]=[]),Array.isArray(i)?i.forEach((t=>r.implies(e,t))):(d(i,void 0,s),o[e].push(i)))},r.getImplied=function(){return o},r.implications=function(t){const s=[];if(Object.keys(o).forEach((e=>{const i=e;(o[e]||[]).forEach((e=>{let n=i;const r=e;n=a(t,n),e=a(t,e),n&&!e&&s.push(` ${i} -> ${r}`)}))})),s.length){let t=`${i("Implications failed:")}\n`;s.forEach((e=>{t+=e})),e.fail(t)}};let l={};r.conflicts=function(e,s){h("<string|object> [array|string]",[e,s],arguments.length),"object"==typeof e?Object.keys(e).forEach((t=>{r.conflicts(t,e[t])})):(t.global(e),l[e]||(l[e]=[]),Array.isArray(s)?s.forEach((t=>r.conflicts(e,t))):l[e].push(s))},r.getConflicting=()=>l,r.conflicting=function(n){Object.keys(n).forEach((t=>{l[t]&&l[t].forEach((s=>{s&&void 0!==n[t]&&void 0!==n[s]&&e.fail(i("Arguments %s and %s are mutually exclusive",t,s))}))})),t.getInternalMethods().getParserConfiguration()["strip-dashed"]&&Object.keys(l).forEach((t=>{l[t].forEach((r=>{r&&void 0!==n[s.Parser.camelCase(t)]&&void 0!==n[s.Parser.camelCase(r)]&&e.fail(i("Arguments %s and %s are mutually exclusive",t,r))}))}))},r.recommendCommands=function(t,s){s=s.sort(((t,e)=>e.length-t.length));let n=null,r=1/0;for(let e,i=0;void 0!==(e=s[i]);i++){const s=N(t,e);s<=3&&s<r&&(r=s,n=e)}n&&e.fail(i("Did you mean %s?",n))},r.reset=function(t){return o=g(o,(e=>!t[e])),l=g(l,(e=>!t[e])),r};const c=[];return r.freeze=function(){c.push({implied:o,conflicting:l})},r.unfreeze=function(){const t=c.pop();d(t,void 0,s),({implied:o,conflicting:l}=t)},r}(this,v(this,ut,"f"),v(this,lt,"f")),"f"),O(this,z,v(this,z,"f")?v(this,z,"f").reset():function(t,e,s,i){return new M(t,e,s,i)}(v(this,ut,"f"),v(this,gt,"f"),v(this,B,"f"),v(this,lt,"f")),"f"),v(this,U,"f")||O(this,U,function(t,e,s,i){return new D(t,e,s,i)}(this,v(this,ut,"f"),v(this,z,"f"),v(this,lt,"f")),"f"),v(this,B,"f").reset(),O(this,F,null,"f"),O(this,Q,"","f"),O(this,V,null,"f"),O(this,J,!1,"f"),this.parsed=!1,this}[Tt](t,e){return v(this,lt,"f").path.relative(t,e)}[Gt](t,s,i,n=0,r=!1){let o=!!i||r;t=t||v(this,at,"f"),v(this,tt,"f").__=v(this,lt,"f").y18n.__,v(this,tt,"f").configuration=this[Ct]();const a=!!v(this,tt,"f").configuration["populate--"],h=Object.assign({},v(this,tt,"f").configuration,{"populate--":!0}),l=v(this,lt,"f").Parser.detailed(t,Object.assign({},v(this,tt,"f"),{configuration:{"parse-positional-numbers":!1,...h}})),c=Object.assign(l.argv,v(this,nt,"f"));let d;const u=l.aliases;let p=!1,g=!1;Object.keys(c).forEach((t=>{t===v(this,Z,"f")&&c[t]?p=!0:t===v(this,pt,"f")&&c[t]&&(g=!0)})),c.$0=this.$0,this.parsed=l,0===n&&v(this,ut,"f").clearCachedHelpMessage();try{if(this[jt](),s)return this[Vt](c,a,!!i,!1);if(v(this,Z,"f")){[v(this,Z,"f")].concat(u[v(this,Z,"f")]||[]).filter((t=>t.length>1)).includes(""+c._[c._.length-1])&&(c._.pop(),p=!0)}const h=v(this,z,"f").getCommands(),m=v(this,U,"f").completionKey in c,y=p||m||r;if(c._.length){if(h.length){let t;for(let e,s=n||0;void 0!==c._[s];s++){if(e=String(c._[s]),h.includes(e)&&e!==v(this,F,"f")){const t=v(this,z,"f").runCommand(e,this,l,s+1,r,p||g||r);return this[Vt](t,a,!!i,!1)}if(!t&&e!==v(this,F,"f")){t=e;break}}!v(this,z,"f").hasDefaultCommand()&&v(this,ht,"f")&&t&&!y&&v(this,gt,"f").recommendCommands(t,h)}v(this,F,"f")&&c._.includes(v(this,F,"f"))&&!m&&(v(this,G,"f")&&x(!0),this.showCompletionScript(),this.exit(0))}if(v(this,z,"f").hasDefaultCommand()&&!y){const t=v(this,z,"f").runCommand(null,this,l,0,r,p||g||r);return this[Vt](t,a,!!i,!1)}if(m){v(this,G,"f")&&x(!0);const s=(t=[].concat(t)).slice(t.indexOf(`--${v(this,U,"f").completionKey}`)+1);return v(this,U,"f").getCompletion(s,((t,s)=>{if(t)throw new e(t.message);(s||[]).forEach((t=>{v(this,X,"f").log(t)})),this.exit(0)})),this[Vt](c,!a,!!i,!1)}if(v(this,J,"f")||(p?(v(this,G,"f")&&x(!0),o=!0,this.showHelp("log"),this.exit(0)):g&&(v(this,G,"f")&&x(!0),o=!0,v(this,ut,"f").showVersion("log"),this.exit(0))),!o&&v(this,tt,"f").skipValidation.length>0&&(o=Object.keys(c).some((t=>v(this,tt,"f").skipValidation.indexOf(t)>=0&&!0===c[t]))),!o){if(l.error)throw new e(l.error.message);if(!m){const t=this[Kt](u,{},l.error);i||(d=C(c,this,v(this,B,"f").getMiddleware(),!0)),d=this[Dt](t,null!=d?d:c),f(d)&&!i&&(d=d.then((()=>C(c,this,v(this,B,"f").getMiddleware(),!1))))}}}catch(t){if(!(t instanceof e))throw t;v(this,ut,"f").fail(t.message,t)}return this[Vt](null!=d?d:c,a,!!i,!0)}[Kt](t,s,i,n){const r={...this.getDemandedOptions()};return o=>{if(i)throw new e(i.message);v(this,gt,"f").nonOptionCount(o),v(this,gt,"f").requiredArguments(o,r);let a=!1;v(this,ft,"f")&&(a=v(this,gt,"f").unknownCommands(o)),v(this,ct,"f")&&!a?v(this,gt,"f").unknownArguments(o,t,s,!!n):v(this,dt,"f")&&v(this,gt,"f").unknownArguments(o,t,{},!1,!1),v(this,gt,"f").limitedChoices(o),v(this,gt,"f").implications(o),v(this,gt,"f").conflicting(o)}}[Bt](){O(this,J,!0,"f")}[Yt](t){if("string"==typeof t)v(this,tt,"f").key[t]=!0;else for(const e of t)v(this,tt,"f").key[e]=!0}}var Zt,Xt;const{readFileSync:Qt}=require("fs"),{inspect:te}=require("util"),{resolve:ee}=require("path"),se=require("y18n"),ie=require("yargs-parser");var ne,re={assert:{notStrictEqual:t.notStrictEqual,strictEqual:t.strictEqual},cliui:require("cliui"),findUp:require("escalade/sync"),getEnv:t=>process.env[t],getCallerFile:require("get-caller-file"),getProcessArgvBin:y,inspect:te,mainFilename:null!==(Xt=null===(Zt=null===require||void 0===require?void 0:require.main)||void 0===Zt?void 0:Zt.filename)&&void 0!==Xt?Xt:process.cwd(),Parser:ie,path:require("path"),process:{argv:()=>process.argv,cwd:process.cwd,emitWarning:(t,e)=>process.emitWarning(t,e),execPath:()=>process.execPath,exit:t=>{process.exit(t)},nextTick:process.nextTick,stdColumns:void 0!==process.stdout.columns?process.stdout.columns:null},readFileSync:Qt,require:require,requireDirectory:require("require-directory"),stringWidth:require("string-width"),y18n:se({directory:ee(__dirname,"../locales"),updateFiles:!1})};const oe=(null===(ne=null===process||void 0===process?void 0:process.env)||void 0===ne?void 0:ne.YARGS_MIN_NODE_VERSION)?Number(process.env.YARGS_MIN_NODE_VERSION):12;if(process&&process.version){if(Number(process.version.match(/v([^.]+)/)[1])<oe)throw Error(`yargs supports a minimum Node.js version of ${oe}. Read our version support policy: https://github.com/yargs/yargs#supported-nodejs-versions`)}const ae=require("yargs-parser");var he,le={applyExtends:n,cjsPlatformShim:re,Yargs:(he=re,(t=[],e=he.process.cwd(),s)=>{const i=new Jt(t,e,s,he);return Object.defineProperty(i,"argv",{get:()=>i.parse(),enumerable:!0}),i.help(),i.version(),i}),argsert:h,isPromise:f,objFilter:g,parseCommand:o,Parser:ae,processArgv:b,YError:e};module.exports=le; | |
TypeError: Cannot read properties of undefined (reading 'kind') | |
at Object.isIdentifier (/Users/joel/.config/yarn/global/node_modules/typescript/lib/typescript.js:27792:21) | |
at /Users/joel/.config/yarn/global/node_modules/@ocsigen/ts2ocaml/dist/ts2ocaml.js:2:156758 | |
at En.f (/Users/joel/.config/yarn/global/node_modules/@ocsigen/ts2ocaml/dist/ts2ocaml.js:2:31822) | |
at En.GetEnumerator (/Users/joel/.config/yarn/global/node_modules/@ocsigen/ts2ocaml/dist/ts2ocaml.js:2:30744) | |
at En.[Symbol.iterator] (/Users/joel/.config/yarn/global/node_modules/@ocsigen/ts2ocaml/dist/ts2ocaml.js:2:30783) | |
at Function.from (<anonymous>) | |
at rt (/Users/joel/.config/yarn/global/node_modules/@ocsigen/ts2ocaml/dist/ts2ocaml.js:2:21219) | |
at kl (/Users/joel/.config/yarn/global/node_modules/@ocsigen/ts2ocaml/dist/ts2ocaml.js:2:157998) | |
at /Users/joel/.config/yarn/global/node_modules/@ocsigen/ts2ocaml/dist/ts2ocaml.js:2:158310 | |
at /Users/joel/.config/yarn/global/node_modules/@ocsigen/ts2ocaml/dist/ts2ocaml.js:2:33961 | |
Node.js v17.0.1 | |
~/code/ocaml/monaco-editor main | |
❯ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment