UNPKG

@microsoft/compose-language-service

Version:
26 lines (25 loc) 1.55 kB
/*!-------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See LICENSE in the project root for license information. *--------------------------------------------------------------------------------------------*/ import { type CancellationToken, DocumentLink, type DocumentLinkParams } from 'vscode-languageserver'; import type { ExtendedParams } from '../ExtendedParams'; import { ProviderBase } from './ProviderBase'; interface ParsedImageRef { /** Registry hostname (e.g. 'ghcr.io', 'mcr.microsoft.com'), or undefined for Docker Hub. */ registry: string | undefined; /** Namespace path between registry and repository (e.g. 'library', 'owner', 'dotnet/core'), or undefined. */ namespace: string | undefined; /** Repository / image name (e.g. 'alpine', 'sdk'). */ imageName: string; /** Optional tag (without the leading colon). */ tag: string | undefined; /** Length of everything except the optional ':tag' suffix — i.e. the part the link should cover. */ pathLength: number; } export declare function parseImageRef(image: string): ParsedImageRef | undefined; export declare class ImageLinkProvider extends ProviderBase<DocumentLinkParams & ExtendedParams, DocumentLink[] | undefined, never, never> { on(params: DocumentLinkParams & ExtendedParams, token: CancellationToken): Promise<DocumentLink[] | undefined>; private static getLinkForImage; } export {};