1 |
|
2 | import { PortablePath } from '@yarnpkg/fslib';
|
3 | import querystring from 'querystring';
|
4 | import { Configuration } from './Configuration';
|
5 | import { Workspace } from './Workspace';
|
6 | import { Ident, Descriptor, Locator, Package } from './types';
|
7 | export declare function makeIdent(scope: string | null, name: string): Ident;
|
8 | export declare function makeDescriptor(ident: Ident, range: string): Descriptor;
|
9 | export declare function makeLocator(ident: Ident, reference: string): Locator;
|
10 | export declare function convertToIdent(source: Descriptor | Locator | Package): Ident;
|
11 | export declare function convertDescriptorToLocator(descriptor: Descriptor): Locator;
|
12 | export declare function convertLocatorToDescriptor(locator: Locator): Descriptor;
|
13 | export declare function convertPackageToLocator(pkg: Package): Locator;
|
14 | export declare function renamePackage(pkg: Package, locator: Locator): Package;
|
15 | export declare function copyPackage(pkg: Package): Package;
|
16 | export declare function virtualizeDescriptor(descriptor: Descriptor, entropy: string): Descriptor;
|
17 | export declare function virtualizePackage(pkg: Package, entropy: string): Package;
|
18 | export declare function isVirtualDescriptor(descriptor: Descriptor): boolean;
|
19 | export declare function isVirtualLocator(locator: Locator): boolean;
|
20 | export declare function devirtualizeDescriptor(descriptor: Descriptor): Descriptor;
|
21 | export declare function devirtualizeLocator(locator: Locator): Locator;
|
22 | export declare function bindDescriptor(descriptor: Descriptor, params: {
|
23 | [key: string]: string;
|
24 | }): Descriptor;
|
25 | export declare function bindLocator(locator: Locator, params: {
|
26 | [key: string]: string;
|
27 | }): Locator;
|
28 | export declare function areIdentsEqual(a: Ident, b: Ident): boolean;
|
29 | export declare function areDescriptorsEqual(a: Descriptor, b: Descriptor): boolean;
|
30 | export declare function areLocatorsEqual(a: Locator, b: Locator): boolean;
|
31 |
|
32 |
|
33 |
|
34 |
|
35 |
|
36 | export declare function areVirtualPackagesEquivalent(a: Package, b: Package): boolean;
|
37 | export declare function parseIdent(string: string): Ident;
|
38 | export declare function tryParseIdent(string: string): Ident | null;
|
39 | export declare function parseDescriptor(string: string, strict?: boolean): Descriptor;
|
40 | export declare function tryParseDescriptor(string: string, strict?: boolean): Descriptor | null;
|
41 | export declare function parseLocator(string: string, strict?: boolean): Locator;
|
42 | export declare function tryParseLocator(string: string, strict?: boolean): Locator | null;
|
43 | declare type ParseRangeOptions = {
|
44 | requireBindings?: boolean;
|
45 | requireProtocol?: boolean | string;
|
46 | requireSource?: boolean;
|
47 | parseSelector?: boolean;
|
48 | };
|
49 | declare type ParseRangeReturnType<Opts extends ParseRangeOptions> = ({
|
50 | params: Opts extends {
|
51 | requireBindings: true;
|
52 | } ? querystring.ParsedUrlQuery : querystring.ParsedUrlQuery | null;
|
53 | }) & ({
|
54 | protocol: Opts extends {
|
55 | requireProtocol: true | string;
|
56 | } ? string : string | null;
|
57 | }) & ({
|
58 | source: Opts extends {
|
59 | requireSource: true;
|
60 | } ? string : string | null;
|
61 | }) & ({
|
62 | selector: Opts extends {
|
63 | parseSelector: true;
|
64 | } ? querystring.ParsedUrlQuery : string;
|
65 | });
|
66 | export declare function parseRange<Opts extends ParseRangeOptions>(range: string, opts?: Opts): ParseRangeReturnType<Opts>;
|
67 | export declare function parseFileStyleRange(range: string, { protocol }: {
|
68 | protocol: string;
|
69 | }): {
|
70 | parentLocator: Locator;
|
71 | path: PortablePath;
|
72 | };
|
73 | export declare function makeRange({ protocol, source, selector, params }: {
|
74 | protocol: string | null;
|
75 | source: string | null;
|
76 | selector: string;
|
77 | params: querystring.ParsedUrlQuery | null;
|
78 | }): string;
|
79 |
|
80 |
|
81 |
|
82 |
|
83 |
|
84 |
|
85 | export declare function convertToManifestRange(range: string): string;
|
86 | export declare function requirableIdent(ident: Ident): string;
|
87 | export declare function stringifyIdent(ident: Ident): string;
|
88 | export declare function stringifyDescriptor(descriptor: Descriptor): string;
|
89 | export declare function stringifyLocator(locator: Locator): string;
|
90 | export declare function slugifyIdent(ident: Ident): string;
|
91 | export declare function slugifyLocator(locator: Locator): import("@yarnpkg/fslib").Filename;
|
92 | export declare function prettyIdent(configuration: Configuration, ident: Ident): string;
|
93 | export declare function prettyRange(configuration: Configuration, range: string): string;
|
94 | export declare function prettyDescriptor(configuration: Configuration, descriptor: Descriptor): string;
|
95 | export declare function prettyReference(configuration: Configuration, reference: string): string;
|
96 | export declare function prettyLocator(configuration: Configuration, locator: Locator): string;
|
97 | export declare function prettyLocatorNoColors(locator: Locator): string;
|
98 | export declare function sortDescriptors(descriptors: Iterable<Descriptor>): Descriptor[];
|
99 | export declare function prettyWorkspace(configuration: Configuration, workspace: Workspace): string;
|
100 |
|
101 |
|
102 |
|
103 |
|
104 |
|
105 |
|
106 |
|
107 |
|
108 |
|
109 |
|
110 |
|
111 | export declare function getIdentVendorPath(ident: Ident): PortablePath;
|
112 | export {};
|