sussudio
Version:
An unofficial VS Code Internal API
36 lines (35 loc) • 1.68 kB
text/typescript
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { URI, UriComponents } from "./uri.mjs";
export interface IURITransformer {
transformIncoming(uri: UriComponents): UriComponents;
transformOutgoing(uri: UriComponents): UriComponents;
transformOutgoingURI(uri: URI): URI;
transformOutgoingScheme(scheme: string): string;
}
export interface UriParts {
scheme: string;
authority?: string;
path?: string;
query?: string;
fragment?: string;
}
export interface IRawURITransformer {
transformIncoming(uri: UriParts): UriParts;
transformOutgoing(uri: UriParts): UriParts;
transformOutgoingScheme(scheme: string): string;
}
export declare class URITransformer implements IURITransformer {
private readonly _uriTransformer;
constructor(uriTransformer: IRawURITransformer);
transformIncoming(uri: UriComponents): UriComponents;
transformOutgoing(uri: UriComponents): UriComponents;
transformOutgoingURI(uri: URI): URI;
transformOutgoingScheme(scheme: string): string;
}
export declare const DefaultURITransformer: IURITransformer;
export declare function transformOutgoingURIs<T>(obj: T, transformer: IURITransformer): T;
export declare function transformIncomingURIs<T>(obj: T, transformer: IURITransformer): T;
export declare function transformAndReviveIncomingURIs<T>(obj: T, transformer: IURITransformer): T;