vscode-languageserver-types
Advanced tools
Comparing version 3.8.1 to 3.8.2
@@ -505,2 +505,8 @@ /** | ||
export declare type MarkupKind = 'plaintext' | 'markdown'; | ||
export declare namespace MarkupKind { | ||
/** | ||
* Checks whether the given value is a value of the [MarkupKind](#MarkupKind) type. | ||
*/ | ||
function is(value: any): value is MarkupKind; | ||
} | ||
/** | ||
@@ -540,2 +546,8 @@ * A `MarkupContent` literal represents a string value which content is interpreted base on its | ||
} | ||
export declare namespace MarkupContent { | ||
/** | ||
* Checks whether the given value conforms to the [MarkupContent](#MarkupContent) interface. | ||
*/ | ||
function is(value: any): value is MarkupContent; | ||
} | ||
/** | ||
@@ -756,2 +768,6 @@ * The kind of a completion entry. | ||
function fromPlainText(plainText: string): string; | ||
/** | ||
* Checks whether the given value conforms to the [MarkedString](#MarkedString) type. | ||
*/ | ||
function is(value: any): value is MarkedString; | ||
} | ||
@@ -771,2 +787,8 @@ /** | ||
} | ||
export declare namespace Hover { | ||
/** | ||
* Checks whether the given value conforms to the [Hover](#Hover) interface. | ||
*/ | ||
function is(value: any): value is Hover; | ||
} | ||
/** | ||
@@ -773,0 +795,0 @@ * Represents a parameter of a callable-signature. A parameter can |
@@ -26,3 +26,3 @@ /* -------------------------------------------------------------------------------------------- | ||
var candidate = value; | ||
return Is.defined(candidate) && Is.number(candidate.line) && Is.number(candidate.character); | ||
return Is.objectLiteral(candidate) && Is.number(candidate.line) && Is.number(candidate.character); | ||
} | ||
@@ -54,3 +54,3 @@ Position.is = is; | ||
var candidate = value; | ||
return Is.defined(candidate) && Position.is(candidate.start) && Position.is(candidate.end); | ||
return Is.objectLiteral(candidate) && Position.is(candidate.start) && Position.is(candidate.end); | ||
} | ||
@@ -460,2 +460,23 @@ Range.is = is; | ||
})(MarkupKind || (MarkupKind = {})); | ||
(function (MarkupKind) { | ||
/** | ||
* Checks whether the given value is a value of the [MarkupKind](#MarkupKind) type. | ||
*/ | ||
function is(value) { | ||
var candidate = value; | ||
return candidate === MarkupKind.PlainText || candidate === MarkupKind.Markdown; | ||
} | ||
MarkupKind.is = is; | ||
})(MarkupKind || (MarkupKind = {})); | ||
export var MarkupContent; | ||
(function (MarkupContent) { | ||
/** | ||
* Checks whether the given value conforms to the [MarkupContent](#MarkupContent) interface. | ||
*/ | ||
function is(value) { | ||
var candidate = value; | ||
return Is.objectLiteral(value) && MarkupKind.is(candidate.kind) && Is.string(candidate.value); | ||
} | ||
MarkupContent.is = is; | ||
})(MarkupContent || (MarkupContent = {})); | ||
/** | ||
@@ -557,3 +578,24 @@ * The kind of a completion entry. | ||
MarkedString.fromPlainText = fromPlainText; | ||
/** | ||
* Checks whether the given value conforms to the [MarkedString](#MarkedString) type. | ||
*/ | ||
function is(value) { | ||
var candidate = value; | ||
return Is.string(candidate) || (Is.objectLiteral(candidate) && Is.string(candidate.language) && Is.string(candidate.value)); | ||
} | ||
MarkedString.is = is; | ||
})(MarkedString || (MarkedString = {})); | ||
export var Hover; | ||
(function (Hover) { | ||
/** | ||
* Checks whether the given value conforms to the [Hover](#Hover) interface. | ||
*/ | ||
function is(value) { | ||
var candidate = value; | ||
return Is.objectLiteral(candidate) && (MarkupContent.is(candidate.contents) || | ||
MarkedString.is(candidate.contents) || | ||
Is.typedArray(candidate.contents, MarkedString.is)) && (value.range === void 0 || Range.is(value.range)); | ||
} | ||
Hover.is = is; | ||
})(Hover || (Hover = {})); | ||
/** | ||
@@ -1119,2 +1161,9 @@ * The ParameterInformation namespace provides helper functions to work with | ||
Is.func = func; | ||
function objectLiteral(value) { | ||
// Strictly speaking class instances pass this check as well. Since the LSP | ||
// doesn't use classes we ignore this for now. If we do we need to add something | ||
// like this: `Object.getPrototypeOf(Object.getPrototypeOf(x)) === null` | ||
return value !== null && typeof value === 'object'; | ||
} | ||
Is.objectLiteral = objectLiteral; | ||
function typedArray(value, check) { | ||
@@ -1121,0 +1170,0 @@ return Array.isArray(value) && value.every(check); |
@@ -505,2 +505,8 @@ /** | ||
export declare type MarkupKind = 'plaintext' | 'markdown'; | ||
export declare namespace MarkupKind { | ||
/** | ||
* Checks whether the given value is a value of the [MarkupKind](#MarkupKind) type. | ||
*/ | ||
function is(value: any): value is MarkupKind; | ||
} | ||
/** | ||
@@ -540,2 +546,8 @@ * A `MarkupContent` literal represents a string value which content is interpreted base on its | ||
} | ||
export declare namespace MarkupContent { | ||
/** | ||
* Checks whether the given value conforms to the [MarkupContent](#MarkupContent) interface. | ||
*/ | ||
function is(value: any): value is MarkupContent; | ||
} | ||
/** | ||
@@ -756,2 +768,6 @@ * The kind of a completion entry. | ||
function fromPlainText(plainText: string): string; | ||
/** | ||
* Checks whether the given value conforms to the [MarkedString](#MarkedString) type. | ||
*/ | ||
function is(value: any): value is MarkedString; | ||
} | ||
@@ -771,2 +787,8 @@ /** | ||
} | ||
export declare namespace Hover { | ||
/** | ||
* Checks whether the given value conforms to the [Hover](#Hover) interface. | ||
*/ | ||
function is(value: any): value is Hover; | ||
} | ||
/** | ||
@@ -773,0 +795,0 @@ * Represents a parameter of a callable-signature. A parameter can |
@@ -36,3 +36,3 @@ (function (factory) { | ||
var candidate = value; | ||
return Is.defined(candidate) && Is.number(candidate.line) && Is.number(candidate.character); | ||
return Is.objectLiteral(candidate) && Is.number(candidate.line) && Is.number(candidate.character); | ||
} | ||
@@ -64,3 +64,3 @@ Position.is = is; | ||
var candidate = value; | ||
return Is.defined(candidate) && Position.is(candidate.start) && Position.is(candidate.end); | ||
return Is.objectLiteral(candidate) && Position.is(candidate.start) && Position.is(candidate.end); | ||
} | ||
@@ -470,2 +470,23 @@ Range.is = is; | ||
})(MarkupKind = exports.MarkupKind || (exports.MarkupKind = {})); | ||
(function (MarkupKind) { | ||
/** | ||
* Checks whether the given value is a value of the [MarkupKind](#MarkupKind) type. | ||
*/ | ||
function is(value) { | ||
var candidate = value; | ||
return candidate === MarkupKind.PlainText || candidate === MarkupKind.Markdown; | ||
} | ||
MarkupKind.is = is; | ||
})(MarkupKind = exports.MarkupKind || (exports.MarkupKind = {})); | ||
var MarkupContent; | ||
(function (MarkupContent) { | ||
/** | ||
* Checks whether the given value conforms to the [MarkupContent](#MarkupContent) interface. | ||
*/ | ||
function is(value) { | ||
var candidate = value; | ||
return Is.objectLiteral(value) && MarkupKind.is(candidate.kind) && Is.string(candidate.value); | ||
} | ||
MarkupContent.is = is; | ||
})(MarkupContent = exports.MarkupContent || (exports.MarkupContent = {})); | ||
/** | ||
@@ -567,3 +588,24 @@ * The kind of a completion entry. | ||
MarkedString.fromPlainText = fromPlainText; | ||
/** | ||
* Checks whether the given value conforms to the [MarkedString](#MarkedString) type. | ||
*/ | ||
function is(value) { | ||
var candidate = value; | ||
return Is.string(candidate) || (Is.objectLiteral(candidate) && Is.string(candidate.language) && Is.string(candidate.value)); | ||
} | ||
MarkedString.is = is; | ||
})(MarkedString = exports.MarkedString || (exports.MarkedString = {})); | ||
var Hover; | ||
(function (Hover) { | ||
/** | ||
* Checks whether the given value conforms to the [Hover](#Hover) interface. | ||
*/ | ||
function is(value) { | ||
var candidate = value; | ||
return Is.objectLiteral(candidate) && (MarkupContent.is(candidate.contents) || | ||
MarkedString.is(candidate.contents) || | ||
Is.typedArray(candidate.contents, MarkedString.is)) && (value.range === void 0 || Range.is(value.range)); | ||
} | ||
Hover.is = is; | ||
})(Hover = exports.Hover || (exports.Hover = {})); | ||
/** | ||
@@ -1130,2 +1172,9 @@ * The ParameterInformation namespace provides helper functions to work with | ||
Is.func = func; | ||
function objectLiteral(value) { | ||
// Strictly speaking class instances pass this check as well. Since the LSP | ||
// doesn't use classes we ignore this for now. If we do we need to add something | ||
// like this: `Object.getPrototypeOf(Object.getPrototypeOf(x)) === null` | ||
return value !== null && typeof value === 'object'; | ||
} | ||
Is.objectLiteral = objectLiteral; | ||
function typedArray(value, check) { | ||
@@ -1132,0 +1181,0 @@ return Array.isArray(value) && value.every(check); |
{ | ||
"name": "vscode-languageserver-types", | ||
"description": "Types used by the Language server for node", | ||
"version": "3.8.1", | ||
"version": "3.8.2", | ||
"author": "Microsoft Corporation", | ||
@@ -6,0 +6,0 @@ "license": "MIT", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
182714
5183