UNPKG

@eclipse-glsp/theia-integration

Version:

Glue code to integrate GLSP clients into Eclipse Theia

55 lines 2.67 kB
/******************************************************************************** * Copyright (c) 2020-2023 EclipseSource and others. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at * http://www.eclipse.org/legal/epl-2.0. * * This Source Code may also be made available under the following Secondary * Licenses when the conditions for such availability set forth in the Eclipse * Public License v. 2.0 are satisfied: GNU General Public License, version 2 * with the GNU Classpath Exception which is available at * https://www.gnu.org/software/classpath/license.html. * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 ********************************************************************************/ import { NavigateToTargetAction } from '@eclipse-glsp/client/lib'; import { OpenerOptions } from '@theia/core/lib/browser'; import { Range } from '@theia/editor/lib/browser'; /** * Service for translating `OpenerOptions` into a `NavigateToTargetAction`. * * This service is typically used to determine requested selections from Theia * opener options on open or reveal of a diagram widget. Diagram widgets can * then dispatch the determined diagram navigation actions once the widget is * initialized. * * This service will forward the `selection` property of the `OpenerOptions` * in the form of arguments in the issued `NavigateToTargetAction` as follows: * *(a)* the property `elementIds: string[]` as element ids * *(b)* `start` with `line: number` and `character: number` * *(c)* any simple-typed properties that are direct properties of `selection` * * (bound in Theia main DI container) */ export declare class TheiaOpenerOptionsNavigationService { determineNavigations(uri: string, options?: OpenerOptions): NavigateToTargetAction[]; } export interface OptionsWithSelection { readonly selection: any; } export declare namespace OptionsWithSelection { function is(options: OpenerOptions | undefined): options is OptionsWithSelection; function elementId(options: OpenerOptions | undefined): string[] | undefined; } export interface SelectionWithElementIds { readonly elementIds: string[]; } export declare namespace SelectionWithElementIds { function is(selection: any | undefined): selection is SelectionWithElementIds; function createRange(elementIds: string[]): Range & SelectionWithElementIds; } export declare namespace SelectionWithRange { function is(selection: any | undefined): selection is Range; } //# sourceMappingURL=theia-opener-options-navigation-service.d.ts.map