forked from microsoft/vscode-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.d.ts
More file actions
157 lines (155 loc) · 4.94 KB
/
index.d.ts
File metadata and controls
157 lines (155 loc) · 4.94 KB
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
declare module '@phosphor/coreutils' {
export class PromiseDelegate<T> {
/**
* The promise wrapped by the delegate.
*/
public readonly promise: Promise<T>;
/**
* Construct a new promise delegate.
*/
constructor();
/**
* Reject the wrapped promise with the given value.
*
* @reason - The reason for rejecting the promise.
*/
reject(reason: any): void;
/**
* Resolve the wrapped promise with the given value.
*
* @param value - The value to use for resolving the promise.
*/
resolve(value: T | PromiseLike<T>): void;
}
/**
* A type definition for the MimeData class.
* Based on http://phosphorjs.github.io/phosphor/api/coreutils/classes/mimedata.html
*/
export class MimeData {
private _types: string[];
private _values: any[];
public clear(): void;
public clearData(mime: string): void;
public getData(mime: string): any | undefined;
public hasData(mime: string): boolean;
public setData(mime: string, data: any): void;
public types(): string[];
}
/**
* The namespace for UUID related functionality.
*/
export namespace UUID {
/**
* A function which generates UUID v4 identifiers.
* @returns A new UUID v4 string.
*/
const uuid4: () => string;
}
/**
* A type alias for a JSON primitive.
*/
export type JSONPrimitive = boolean | number | string | null | undefined;
/**
* A type alias for a JSON value.
*/
export type JSONValue = JSONPrimitive | JSONObject | JSONArray;
/**
* A type definition for a JSON object.
*/
export interface JSONObject {
[key: string]: JSONValue;
}
/**
* A type definition for a JSON array.
*/
export interface JSONArray extends Array<JSONValue> { }
/**
* A type definition for a readonly JSON object.
*/
export interface ReadonlyJSONObject {
readonly [key: string]: ReadonlyJSONValue;
}
/**
* A type definition for a readonly JSON array.
*/
export interface ReadonlyJSONArray extends ReadonlyArray<ReadonlyJSONValue> { }
/**
* A type alias for a readonly JSON value.
*/
export type ReadonlyJSONValue = JSONPrimitive | ReadonlyJSONObject | ReadonlyJSONArray;
/**
* The namespace for JSON-specific functions.
*/
export namespace JSONExt {
/**
* A shared frozen empty JSONObject
*/
const emptyObject: ReadonlyJSONObject;
/**
* A shared frozen empty JSONArray
*/
const emptyArray: ReadonlyJSONArray;
/**
* Test whether a JSON value is a primitive.
*
* @param value - The JSON value of interest.
*
* @returns `true` if the value is a primitive,`false` otherwise.
*/
function isPrimitive(value: ReadonlyJSONValue): value is JSONPrimitive;
/**
* Test whether a JSON value is an array.
*
* @param value - The JSON value of interest.
*
* @returns `true` if the value is a an array, `false` otherwise.
*/
function isArray(value: JSONValue): value is JSONArray;
function isArray(value: ReadonlyJSONValue): value is ReadonlyJSONArray;
/**
* Test whether a JSON value is an object.
*
* @param value - The JSON value of interest.
*
* @returns `true` if the value is a an object, `false` otherwise.
*/
function isObject(value: JSONValue): value is JSONObject;
function isObject(value: ReadonlyJSONValue): value is ReadonlyJSONObject;
/**
* Compare two JSON values for deep equality.
*
* @param first - The first JSON value of interest.
*
* @param second - The second JSON value of interest.
*
* @returns `true` if the values are equivalent, `false` otherwise.
*/
function deepEqual(first: ReadonlyJSONValue, second: ReadonlyJSONValue): boolean;
/**
* Create a deep copy of a JSON value.
*
* @param value - The JSON value to copy.
*
* @returns A deep copy of the given JSON value.
*/
function deepCopy<T extends ReadonlyJSONValue>(value: T): T;
}
export class Token<T> {
/**
* The human readable name for the token.
*
* #### Notes
* This can be useful for debugging and logging.
*/
public readonly name: string;
private _tokenStructuralPropertyT;
/**
* Construct a new token.
*
* @param name - A human readable name for the token.
*/
constructor(name: string);
}
}