-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathvscode-uri.js.flow
84 lines (83 loc) · 2.51 KB
/
vscode-uri.js.flow
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
/**
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the license found in the LICENSE file in
* the root directory of this source tree.
*
* @flow
* @format
*/
declare module 'vscode-uri' {
/**
* Uniform Resource Identifier (URI) http://tools.ietf.org/html/rfc3986.
* This class is a simple parser which creates the basic component paths
* (http://tools.ietf.org/html/rfc3986#section-3) with minimal validation
* and encoding.
*
* foo://example.com:8042/over/there?name=ferret#nose
* \_/ \______________/\_________/ \_________/ \__/
* | | | | |
* scheme authority path query fragment
* | _____________________|__
* / \ / \
* urn:example:animal:ferret:nose
*
*
*/
declare export default class URI {
static isUri(thing: mixed): boolean;
/**
* scheme is the 'http' part of 'http://www.msft.com/some/path?query#fragment'.
* The part before the first colon.
*/
+scheme: string;
/**
* authority is the 'www.msft.com' part of 'http://www.msft.com/some/path?query#fragment'.
* The part between the first double slashes and the next slash.
*/
+authority: string;
/**
* path is the '/some/path' part of 'http://www.msft.com/some/path?query#fragment'.
*/
+path: string;
/**
* query is the 'query' part of 'http://www.msft.com/some/path?query#fragment'.
*/
+query: string;
/**
* fragment is the 'fragment' part of 'http://www.msft.com/some/path?query#fragment'.
*/
+fragment: string;
/**
* Returns a string representing the corresponding file system path of this URI.
* Will handle UNC paths and normalize windows drive letters to lower-case. Also
* uses the platform specific path separator. Will *not* validate the path for
* invalid characters and semantics. Will *not* look at the scheme of this URI.
*/
+fsPath: string;
with(change: {
scheme?: string,
authority?: string,
path?: string,
query?: string,
fragment?: string,
}): URI;
static parse(value: string): URI;
static file(path: string): URI;
static from(components: {
scheme?: string,
authority?: string,
path?: string,
query?: string,
fragment?: string,
}): URI;
/**
*
* @param skipEncoding Do not encode the result, default is `false`
*/
toString(skipEncoding?: boolean): string;
toJSON(): any;
static revive(data: any): URI;
}
}