Path: blob/main/src/vscode-dts/vscode.proposed.canonicalUriProvider.d.ts
3290 views
/*---------------------------------------------------------------------------------------------1* Copyright (c) Microsoft Corporation. All rights reserved.2* Licensed under the MIT License. See License.txt in the project root for license information.3*--------------------------------------------------------------------------------------------*/45declare module 'vscode' {67// https://github.com/microsoft/vscode/issues/18058289export namespace workspace {10/**11*12* @param scheme The URI scheme that this provider can provide canonical URIs for.13* A canonical URI represents the conversion of a resource's alias into a source of truth URI.14* Multiple aliases may convert to the same source of truth URI.15* @param provider A provider which can convert URIs of scheme @param scheme to16* a canonical URI which is stable across machines.17*/18export function registerCanonicalUriProvider(scheme: string, provider: CanonicalUriProvider): Disposable;1920/**21*22* @param uri The URI to provide a canonical URI for.23* @param token A cancellation token for the request.24*/25export function getCanonicalUri(uri: Uri, options: CanonicalUriRequestOptions, token: CancellationToken): ProviderResult<Uri>;26}2728export interface CanonicalUriProvider {29/**30*31* @param uri The URI to provide a canonical URI for.32* @param options Options that the provider should honor in the URI it returns.33* @param token A cancellation token for the request.34* @returns The canonical URI for the requested URI or undefined if no canonical URI can be provided.35*/36provideCanonicalUri(uri: Uri, options: CanonicalUriRequestOptions, token: CancellationToken): ProviderResult<Uri>;37}3839export interface CanonicalUriRequestOptions {40/**41*42* The desired scheme of the canonical URI.43*/44targetScheme: string;45}46}474849