Accept baselines
This commit is contained in:
parent
1bd1899d5a
commit
b5883e5f54
508
tests/baselines/reference/api/tsserverlibrary.d.ts
vendored
508
tests/baselines/reference/api/tsserverlibrary.d.ts
vendored
|
@ -1,63 +1,4 @@
|
|||
/*! *****************************************************************************
|
||||
Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
||||
this file except in compliance with the License. You may obtain a copy of the
|
||||
License at http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
|
||||
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
|
||||
MERCHANTABLITY OR NON-INFRINGEMENT.
|
||||
|
||||
See the Apache Version 2.0 License for specific language governing permissions
|
||||
and limitations under the License.
|
||||
***************************************************************************** */
|
||||
|
||||
declare namespace ts {
|
||||
/** Gets a timestamp with (at least) ms resolution */
|
||||
const timestamp: () => number;
|
||||
}
|
||||
/** Performance measurements for the compiler. */
|
||||
declare namespace ts.performance {
|
||||
/**
|
||||
* Marks a performance event.
|
||||
*
|
||||
* @param markName The name of the mark.
|
||||
*/
|
||||
function mark(markName: string): void;
|
||||
/**
|
||||
* Adds a performance measurement with the specified name.
|
||||
*
|
||||
* @param measureName The name of the performance measurement.
|
||||
* @param startMarkName The name of the starting mark. If not supplied, the point at which the
|
||||
* profiler was enabled is used.
|
||||
* @param endMarkName The name of the ending mark. If not supplied, the current timestamp is
|
||||
* used.
|
||||
*/
|
||||
function measure(measureName: string, startMarkName?: string, endMarkName?: string): void;
|
||||
/**
|
||||
* Gets the number of times a marker was encountered.
|
||||
*
|
||||
* @param markName The name of the mark.
|
||||
*/
|
||||
function getCount(markName: string): number;
|
||||
/**
|
||||
* Gets the total duration of all measurements with the supplied name.
|
||||
*
|
||||
* @param measureName The name of the measure whose durations should be accumulated.
|
||||
*/
|
||||
function getDuration(measureName: string): number;
|
||||
/**
|
||||
* Iterate over each measure, performing some action
|
||||
*
|
||||
* @param cb The action to perform for each measure
|
||||
*/
|
||||
function forEachMeasure(cb: (measureName: string, duration: number) => void): void;
|
||||
/** Enables (and resets) performance measurements for the compiler. */
|
||||
function enable(): void;
|
||||
/** Disables performance measurements for the compiler. */
|
||||
function disable(): void;
|
||||
}
|
||||
declare namespace ts {
|
||||
const versionMajorMinor = "3.0";
|
||||
/** The version of the TypeScript compiler release */
|
||||
|
@ -75,15 +16,6 @@ declare namespace ts {
|
|||
interface SortedArray<T> extends Array<T> {
|
||||
" __sortedArrayBrand": any;
|
||||
}
|
||||
}
|
||||
declare namespace ts {
|
||||
type EqualityComparer<T> = (a: T, b: T) => boolean;
|
||||
type Comparer<T> = (a: T, b: T) => Comparison;
|
||||
enum Comparison {
|
||||
LessThan = -1,
|
||||
EqualTo = 0,
|
||||
GreaterThan = 1
|
||||
}
|
||||
/** ES6 Map interface, only read methods included. */
|
||||
interface ReadonlyMap<T> {
|
||||
get(key: string): T | undefined;
|
||||
|
@ -114,6 +46,15 @@ declare namespace ts {
|
|||
interface Push<T> {
|
||||
push(...values: T[]): void;
|
||||
}
|
||||
type EqualityComparer<T> = (a: T, b: T) => boolean;
|
||||
type Comparer<T> = (a: T, b: T) => Comparison;
|
||||
enum Comparison {
|
||||
LessThan = -1,
|
||||
EqualTo = 0,
|
||||
GreaterThan = 1
|
||||
}
|
||||
}
|
||||
declare namespace ts {
|
||||
/** Create a new map. If a template object is provided, the map will copy entries from it. */
|
||||
function createMap<T>(): Map<T>;
|
||||
function createMapFromEntries<T>(entries: [string, T][]): Map<T>;
|
||||
|
@ -581,7 +522,51 @@ declare namespace ts {
|
|||
function singleElementArray<T>(t: T | undefined): T[] | undefined;
|
||||
function enumerateInsertsAndDeletes<T, U>(newItems: ReadonlyArray<T>, oldItems: ReadonlyArray<U>, comparer: (a: T, b: U) => Comparison, inserted: (newItem: T) => void, deleted: (oldItem: U) => void, unchanged?: (oldItem: U, newItem: T) => void): void;
|
||||
}
|
||||
//# sourceMappingURL=core.d.ts.map
|
||||
declare namespace ts {
|
||||
/** Gets a timestamp with (at least) ms resolution */
|
||||
const timestamp: () => number;
|
||||
}
|
||||
/** Performance measurements for the compiler. */
|
||||
declare namespace ts.performance {
|
||||
/**
|
||||
* Marks a performance event.
|
||||
*
|
||||
* @param markName The name of the mark.
|
||||
*/
|
||||
function mark(markName: string): void;
|
||||
/**
|
||||
* Adds a performance measurement with the specified name.
|
||||
*
|
||||
* @param measureName The name of the performance measurement.
|
||||
* @param startMarkName The name of the starting mark. If not supplied, the point at which the
|
||||
* profiler was enabled is used.
|
||||
* @param endMarkName The name of the ending mark. If not supplied, the current timestamp is
|
||||
* used.
|
||||
*/
|
||||
function measure(measureName: string, startMarkName?: string, endMarkName?: string): void;
|
||||
/**
|
||||
* Gets the number of times a marker was encountered.
|
||||
*
|
||||
* @param markName The name of the mark.
|
||||
*/
|
||||
function getCount(markName: string): number;
|
||||
/**
|
||||
* Gets the total duration of all measurements with the supplied name.
|
||||
*
|
||||
* @param measureName The name of the measure whose durations should be accumulated.
|
||||
*/
|
||||
function getDuration(measureName: string): number;
|
||||
/**
|
||||
* Iterate over each measure, performing some action
|
||||
*
|
||||
* @param cb The action to perform for each measure
|
||||
*/
|
||||
function forEachMeasure(cb: (measureName: string, duration: number) => void): void;
|
||||
/** Enables (and resets) performance measurements for the compiler. */
|
||||
function enable(): void;
|
||||
/** Disables performance measurements for the compiler. */
|
||||
function disable(): void;
|
||||
}
|
||||
declare namespace ts {
|
||||
type Path = string & {
|
||||
__pathBrand: any;
|
||||
|
@ -5973,14 +5958,11 @@ declare namespace ts {
|
|||
}
|
||||
/** Non-internal stuff goes here */
|
||||
declare namespace ts {
|
||||
const emptyArray: never[];
|
||||
function closeFileWatcher(watcher: FileWatcher): void;
|
||||
function isExternalModuleNameRelative(moduleName: string): boolean;
|
||||
function sortAndDeduplicateDiagnostics<T extends Diagnostic>(diagnostics: ReadonlyArray<T>): T[];
|
||||
function toPath(fileName: string, basePath: string | undefined, getCanonicalFileName: (path: string) => string): Path;
|
||||
function hasEntries(map: ReadonlyUnderscoreEscapedMap<any> | undefined): map is ReadonlyUnderscoreEscapedMap<any>;
|
||||
}
|
||||
declare namespace ts {
|
||||
const emptyArray: never[];
|
||||
const resolvingEmptyArray: never[];
|
||||
const emptyMap: ReadonlyMap<never>;
|
||||
const emptyUnderscoreEscapedMap: ReadonlyUnderscoreEscapedMap<never>;
|
||||
|
@ -5988,7 +5970,9 @@ declare namespace ts {
|
|||
function getDeclarationOfKind<T extends Declaration>(symbol: Symbol, kind: T["kind"]): T | undefined;
|
||||
/** Create a new escaped identifier map. */
|
||||
function createUnderscoreEscapedMap<T>(): UnderscoreEscapedMap<T>;
|
||||
function hasEntries(map: ReadonlyUnderscoreEscapedMap<any> | undefined): map is ReadonlyUnderscoreEscapedMap<any>;
|
||||
function createSymbolTable(symbols?: ReadonlyArray<Symbol>): SymbolTable;
|
||||
function toPath(fileName: string, basePath: string | undefined, getCanonicalFileName: (path: string) => string): Path;
|
||||
function changesAffectModuleResolution(oldOptions: CompilerOptions, newOptions: CompilerOptions): boolean;
|
||||
/**
|
||||
* Iterates through the parent chain of a node and performs the callback on each parent until the callback
|
||||
|
@ -6547,6 +6531,7 @@ declare namespace ts {
|
|||
function isDeclarationNameOfEnumOrNamespace(node: Identifier): boolean;
|
||||
function getInitializedVariables(node: VariableDeclarationList): ReadonlyArray<VariableDeclaration>;
|
||||
function isWatchSet(options: CompilerOptions): boolean | undefined;
|
||||
function closeFileWatcher(watcher: FileWatcher): void;
|
||||
function getCheckFlags(symbol: Symbol): CheckFlags;
|
||||
function getDeclarationModifierFlagsFromSymbol(s: Symbol): ModifierFlags;
|
||||
function skipAlias(symbol: Symbol, checker: TypeChecker): Symbol;
|
||||
|
@ -7033,6 +7018,8 @@ declare namespace ts {
|
|||
function isTypeReferenceType(node: Node): node is TypeReferenceType;
|
||||
function guessIndentation(lines: string[]): number | undefined;
|
||||
function isStringLiteralLike(node: Node): node is StringLiteralLike;
|
||||
}
|
||||
declare namespace ts {
|
||||
/** @internal */
|
||||
function isNamedImportsOrExports(node: Node): node is NamedImportsOrExports;
|
||||
interface ObjectAllocator {
|
||||
|
@ -7170,6 +7157,9 @@ declare namespace ts {
|
|||
* segments (at indices > 0).
|
||||
*/
|
||||
function getPathFromPathComponents(pathComponents: ReadonlyArray<string>): string;
|
||||
}
|
||||
declare namespace ts {
|
||||
function getPathComponentsRelativeTo(from: string, to: string, stringEqualityComparer: (a: string, b: string) => boolean, getCanonicalFileName: GetCanonicalFileName): string[];
|
||||
function getRelativePathFromFile(from: string, to: string, getCanonicalFileName: GetCanonicalFileName): string;
|
||||
/**
|
||||
* Gets a relative path that can be used to traverse between `from` and `to`.
|
||||
|
@ -7625,7 +7615,6 @@ declare namespace ts {
|
|||
*/
|
||||
function loadModuleFromGlobalCache(moduleName: string, projectName: string | undefined, compilerOptions: CompilerOptions, host: ModuleResolutionHost, globalCache: string): ResolvedModuleWithFailedLookupLocations;
|
||||
}
|
||||
//# sourceMappingURL=parser.d.ts.map
|
||||
declare namespace ts {
|
||||
enum ModuleInstanceState {
|
||||
NonInstantiated = 0,
|
||||
|
@ -7649,7 +7638,7 @@ declare namespace ts {
|
|||
* For performance reasons, `computeTransformFlagsForNode` uses local constant values rather
|
||||
* than calling this function.
|
||||
*/
|
||||
function getTransformFlagsSubtreeExclusions(kind: SyntaxKind): TransformFlags.OuterExpressionExcludes | TransformFlags.PropertyAccessExcludes | TransformFlags.NodeExcludes | TransformFlags.ArrowFunctionExcludes | TransformFlags.FunctionExcludes | TransformFlags.ConstructorExcludes | TransformFlags.ClassExcludes | TransformFlags.ModuleExcludes | TransformFlags.TypeExcludes | TransformFlags.ObjectLiteralExcludes | TransformFlags.ArrayLiteralOrCallOrNewExcludes | TransformFlags.VariableDeclarationListExcludes | TransformFlags.CatchClauseExcludes;
|
||||
function getTransformFlagsSubtreeExclusions(kind: SyntaxKind): TransformFlags;
|
||||
}
|
||||
/** @internal */
|
||||
declare namespace ts {
|
||||
|
@ -7757,7 +7746,7 @@ declare namespace ts {
|
|||
function updateUnionTypeNode(node: UnionTypeNode, types: NodeArray<TypeNode>): UnionTypeNode;
|
||||
function createIntersectionTypeNode(types: ReadonlyArray<TypeNode>): IntersectionTypeNode;
|
||||
function updateIntersectionTypeNode(node: IntersectionTypeNode, types: NodeArray<TypeNode>): IntersectionTypeNode;
|
||||
function createUnionOrIntersectionTypeNode(kind: SyntaxKind.UnionType | SyntaxKind.IntersectionType, types: ReadonlyArray<TypeNode>): UnionTypeNode | IntersectionTypeNode;
|
||||
function createUnionOrIntersectionTypeNode(kind: SyntaxKind.UnionType | SyntaxKind.IntersectionType, types: ReadonlyArray<TypeNode>): UnionOrIntersectionTypeNode;
|
||||
function createConditionalTypeNode(checkType: TypeNode, extendsType: TypeNode, trueType: TypeNode, falseType: TypeNode): ConditionalTypeNode;
|
||||
function updateConditionalTypeNode(node: ConditionalTypeNode, checkType: TypeNode, extendsType: TypeNode, trueType: TypeNode, falseType: TypeNode): ConditionalTypeNode;
|
||||
function createInferTypeNode(typeParameter: TypeParameterDeclaration): InferTypeNode;
|
||||
|
@ -9497,16 +9486,16 @@ declare namespace ts {
|
|||
getKeys: () => ReadonlyArray<ResolvedConfigFileName>;
|
||||
};
|
||||
function createBuildContext(options: BuildOptions): BuildContext;
|
||||
function performBuild(args: string[], compilerHost: CompilerHost, buildHost: BuildHost, system?: System): void;
|
||||
function performBuild(args: string[], compilerHost: CompilerHost, buildHost: BuildHost, system?: System): number | undefined;
|
||||
/**
|
||||
* A SolutionBuilder has an immutable set of rootNames that are the "entry point" projects, but
|
||||
* can dynamically add/remove other projects based on changes on the rootNames' references
|
||||
*/
|
||||
function createSolutionBuilder(compilerHost: CompilerHost, buildHost: BuildHost, rootNames: ReadonlyArray<string>, defaultOptions: BuildOptions, system?: System): {
|
||||
buildAllProjects: () => void;
|
||||
buildAllProjects: () => number;
|
||||
getUpToDateStatus: (project: ParsedCommandLine | undefined) => UpToDateStatus;
|
||||
getUpToDateStatusOfFile: (configFileName: ResolvedConfigFileName) => UpToDateStatus;
|
||||
cleanAllProjects: () => void;
|
||||
cleanAllProjects: () => ExitStatus.Success | ExitStatus.DiagnosticsPresent_OutputsSkipped;
|
||||
resetBuildContext: (opts?: BuildOptions) => void;
|
||||
getBuildGraph: (configFileNames: ReadonlyArray<string>) => DependencyGraph | undefined;
|
||||
invalidateProject: (configFileName: string) => void;
|
||||
|
@ -9517,6 +9506,186 @@ declare namespace ts {
|
|||
};
|
||||
}
|
||||
//# sourceMappingURL=compiler.d.ts.map
|
||||
declare namespace ts.server {
|
||||
const ActionSet: ActionSet;
|
||||
const ActionInvalidate: ActionInvalidate;
|
||||
const ActionPackageInstalled: ActionPackageInstalled;
|
||||
const EventTypesRegistry: EventTypesRegistry;
|
||||
const EventBeginInstallTypes: EventBeginInstallTypes;
|
||||
const EventEndInstallTypes: EventEndInstallTypes;
|
||||
const EventInitializationFailed: EventInitializationFailed;
|
||||
namespace Arguments {
|
||||
const GlobalCacheLocation = "--globalTypingsCacheLocation";
|
||||
const LogFile = "--logFile";
|
||||
const EnableTelemetry = "--enableTelemetry";
|
||||
const TypingSafeListLocation = "--typingSafeListLocation";
|
||||
const TypesMapLocation = "--typesMapLocation";
|
||||
/**
|
||||
* This argument specifies the location of the NPM executable.
|
||||
* typingsInstaller will run the command with `${npmLocation} install ...`.
|
||||
*/
|
||||
const NpmLocation = "--npmLocation";
|
||||
}
|
||||
function hasArgument(argumentName: string): boolean;
|
||||
function findArgument(argumentName: string): string | undefined;
|
||||
function nowString(): string;
|
||||
}
|
||||
declare namespace ts.server {
|
||||
type ActionSet = "action::set";
|
||||
type ActionInvalidate = "action::invalidate";
|
||||
type ActionPackageInstalled = "action::packageInstalled";
|
||||
type EventTypesRegistry = "event::typesRegistry";
|
||||
type EventBeginInstallTypes = "event::beginInstallTypes";
|
||||
type EventEndInstallTypes = "event::endInstallTypes";
|
||||
type EventInitializationFailed = "event::initializationFailed";
|
||||
interface SortedReadonlyArray<T> extends ReadonlyArray<T> {
|
||||
" __sortedArrayBrand": any;
|
||||
}
|
||||
interface TypingInstallerResponse {
|
||||
readonly kind: ActionSet | ActionInvalidate | EventTypesRegistry | ActionPackageInstalled | EventBeginInstallTypes | EventEndInstallTypes | EventInitializationFailed;
|
||||
}
|
||||
interface TypingInstallerRequestWithProjectName {
|
||||
readonly projectName: string;
|
||||
}
|
||||
type TypingInstallerRequestUnion = DiscoverTypings | CloseProject | TypesRegistryRequest | InstallPackageRequest;
|
||||
interface DiscoverTypings extends TypingInstallerRequestWithProjectName {
|
||||
readonly fileNames: string[];
|
||||
readonly projectRootPath: Path;
|
||||
readonly compilerOptions: CompilerOptions;
|
||||
readonly typeAcquisition: TypeAcquisition;
|
||||
readonly unresolvedImports: SortedReadonlyArray<string>;
|
||||
readonly cachePath?: string;
|
||||
readonly kind: "discover";
|
||||
}
|
||||
interface CloseProject extends TypingInstallerRequestWithProjectName {
|
||||
readonly kind: "closeProject";
|
||||
}
|
||||
interface TypesRegistryRequest {
|
||||
readonly kind: "typesRegistry";
|
||||
}
|
||||
interface InstallPackageRequest extends TypingInstallerRequestWithProjectName {
|
||||
readonly kind: "installPackage";
|
||||
readonly fileName: Path;
|
||||
readonly packageName: string;
|
||||
readonly projectRootPath: Path;
|
||||
}
|
||||
interface TypesRegistryResponse extends TypingInstallerResponse {
|
||||
readonly kind: EventTypesRegistry;
|
||||
readonly typesRegistry: MapLike<MapLike<string>>;
|
||||
}
|
||||
interface PackageInstalledResponse extends ProjectResponse {
|
||||
readonly kind: ActionPackageInstalled;
|
||||
readonly success: boolean;
|
||||
readonly message: string;
|
||||
}
|
||||
interface InitializationFailedResponse extends TypingInstallerResponse {
|
||||
readonly kind: EventInitializationFailed;
|
||||
readonly message: string;
|
||||
}
|
||||
interface ProjectResponse extends TypingInstallerResponse {
|
||||
readonly projectName: string;
|
||||
}
|
||||
interface InvalidateCachedTypings extends ProjectResponse {
|
||||
readonly kind: ActionInvalidate;
|
||||
}
|
||||
interface InstallTypes extends ProjectResponse {
|
||||
readonly kind: EventBeginInstallTypes | EventEndInstallTypes;
|
||||
readonly eventId: number;
|
||||
readonly typingsInstallerVersion: string;
|
||||
readonly packagesToInstall: ReadonlyArray<string>;
|
||||
}
|
||||
interface BeginInstallTypes extends InstallTypes {
|
||||
readonly kind: EventBeginInstallTypes;
|
||||
}
|
||||
interface EndInstallTypes extends InstallTypes {
|
||||
readonly kind: EventEndInstallTypes;
|
||||
readonly installSuccess: boolean;
|
||||
}
|
||||
interface InstallTypingHost extends JsTyping.TypingResolutionHost {
|
||||
useCaseSensitiveFileNames: boolean;
|
||||
writeFile(path: string, content: string): void;
|
||||
createDirectory(path: string): void;
|
||||
watchFile?(path: string, callback: FileWatcherCallback, pollingInterval?: number): FileWatcher;
|
||||
watchDirectory?(path: string, callback: DirectoryWatcherCallback, recursive?: boolean): FileWatcher;
|
||||
}
|
||||
interface SetTypings extends ProjectResponse {
|
||||
readonly typeAcquisition: TypeAcquisition;
|
||||
readonly compilerOptions: CompilerOptions;
|
||||
readonly typings: string[];
|
||||
readonly unresolvedImports: SortedReadonlyArray<string>;
|
||||
readonly kind: ActionSet;
|
||||
}
|
||||
type TypingInstallerResponseUnion = SetTypings | InvalidateCachedTypings | TypesRegistryResponse | PackageInstalledResponse | InstallTypes | InitializationFailedResponse;
|
||||
}
|
||||
declare namespace ts.JsTyping {
|
||||
interface TypingResolutionHost {
|
||||
directoryExists(path: string): boolean;
|
||||
fileExists(fileName: string): boolean;
|
||||
readFile(path: string, encoding?: string): string | undefined;
|
||||
readDirectory(rootDir: string, extensions: ReadonlyArray<string>, excludes: ReadonlyArray<string> | undefined, includes: ReadonlyArray<string> | undefined, depth?: number): string[];
|
||||
}
|
||||
interface CachedTyping {
|
||||
typingLocation: string;
|
||||
version: Semver;
|
||||
}
|
||||
function isTypingUpToDate(cachedTyping: CachedTyping, availableTypingVersions: MapLike<string>): boolean;
|
||||
const nodeCoreModuleList: ReadonlyArray<string>;
|
||||
const nodeCoreModules: Map<true>;
|
||||
/**
|
||||
* A map of loose file names to library names that we are confident require typings
|
||||
*/
|
||||
type SafeList = ReadonlyMap<string>;
|
||||
function loadSafeList(host: TypingResolutionHost, safeListPath: Path): SafeList;
|
||||
function loadTypesMap(host: TypingResolutionHost, typesMapPath: Path): SafeList | undefined;
|
||||
/**
|
||||
* @param host is the object providing I/O related operations.
|
||||
* @param fileNames are the file names that belong to the same project
|
||||
* @param projectRootPath is the path to the project root directory
|
||||
* @param safeListPath is the path used to retrieve the safe list
|
||||
* @param packageNameToTypingLocation is the map of package names to their cached typing locations and installed versions
|
||||
* @param typeAcquisition is used to customize the typing acquisition process
|
||||
* @param compilerOptions are used as a source for typing inference
|
||||
*/
|
||||
function discoverTypings(host: TypingResolutionHost, log: ((message: string) => void) | undefined, fileNames: string[], projectRootPath: Path, safeList: SafeList, packageNameToTypingLocation: ReadonlyMap<CachedTyping>, typeAcquisition: TypeAcquisition, unresolvedImports: ReadonlyArray<string>, typesRegistry: ReadonlyMap<MapLike<string>>): {
|
||||
cachedTypingPaths: string[];
|
||||
newTypingNames: string[];
|
||||
filesToWatch: string[];
|
||||
};
|
||||
enum PackageNameValidationResult {
|
||||
Ok = 0,
|
||||
ScopedPackagesNotSupported = 1,
|
||||
EmptyName = 2,
|
||||
NameTooLong = 3,
|
||||
NameStartsWithDot = 4,
|
||||
NameStartsWithUnderscore = 5,
|
||||
NameContainsNonURISafeCharacters = 6
|
||||
}
|
||||
/**
|
||||
* Validates package name using rules defined at https://docs.npmjs.com/files/package.json
|
||||
*/
|
||||
function validatePackageName(packageName: string): PackageNameValidationResult;
|
||||
function renderPackageNameValidationFailure(result: PackageNameValidationResult, typing: string): string;
|
||||
}
|
||||
declare namespace ts {
|
||||
class Semver {
|
||||
readonly major: number;
|
||||
readonly minor: number;
|
||||
readonly patch: number;
|
||||
/**
|
||||
* If true, this is `major.minor.0-next.patch`.
|
||||
* If false, this is `major.minor.patch`.
|
||||
*/
|
||||
readonly isPrerelease: boolean;
|
||||
static parse(semver: string): Semver;
|
||||
static fromRaw({ major, minor, patch, isPrerelease }: Semver): Semver;
|
||||
private static tryParse;
|
||||
private constructor();
|
||||
readonly versionString: string;
|
||||
equals(sem: Semver): boolean;
|
||||
greaterThan(sem: Semver): boolean;
|
||||
}
|
||||
}
|
||||
//# sourceMappingURL=jsTyping.d.ts.map
|
||||
declare namespace ts {
|
||||
interface Node {
|
||||
getSourceFile(): SourceFile;
|
||||
|
@ -11839,186 +12008,6 @@ declare namespace TypeScript.Services {
|
|||
}
|
||||
declare const toolsVersion = "3.0";
|
||||
//# sourceMappingURL=services.d.ts.map
|
||||
declare namespace ts.server {
|
||||
const ActionSet: ActionSet;
|
||||
const ActionInvalidate: ActionInvalidate;
|
||||
const ActionPackageInstalled: ActionPackageInstalled;
|
||||
const EventTypesRegistry: EventTypesRegistry;
|
||||
const EventBeginInstallTypes: EventBeginInstallTypes;
|
||||
const EventEndInstallTypes: EventEndInstallTypes;
|
||||
const EventInitializationFailed: EventInitializationFailed;
|
||||
namespace Arguments {
|
||||
const GlobalCacheLocation = "--globalTypingsCacheLocation";
|
||||
const LogFile = "--logFile";
|
||||
const EnableTelemetry = "--enableTelemetry";
|
||||
const TypingSafeListLocation = "--typingSafeListLocation";
|
||||
const TypesMapLocation = "--typesMapLocation";
|
||||
/**
|
||||
* This argument specifies the location of the NPM executable.
|
||||
* typingsInstaller will run the command with `${npmLocation} install ...`.
|
||||
*/
|
||||
const NpmLocation = "--npmLocation";
|
||||
}
|
||||
function hasArgument(argumentName: string): boolean;
|
||||
function findArgument(argumentName: string): string | undefined;
|
||||
function nowString(): string;
|
||||
}
|
||||
declare namespace ts.server {
|
||||
type ActionSet = "action::set";
|
||||
type ActionInvalidate = "action::invalidate";
|
||||
type ActionPackageInstalled = "action::packageInstalled";
|
||||
type EventTypesRegistry = "event::typesRegistry";
|
||||
type EventBeginInstallTypes = "event::beginInstallTypes";
|
||||
type EventEndInstallTypes = "event::endInstallTypes";
|
||||
type EventInitializationFailed = "event::initializationFailed";
|
||||
interface SortedReadonlyArray<T> extends ReadonlyArray<T> {
|
||||
" __sortedArrayBrand": any;
|
||||
}
|
||||
interface TypingInstallerResponse {
|
||||
readonly kind: ActionSet | ActionInvalidate | EventTypesRegistry | ActionPackageInstalled | EventBeginInstallTypes | EventEndInstallTypes | EventInitializationFailed;
|
||||
}
|
||||
interface TypingInstallerRequestWithProjectName {
|
||||
readonly projectName: string;
|
||||
}
|
||||
type TypingInstallerRequestUnion = DiscoverTypings | CloseProject | TypesRegistryRequest | InstallPackageRequest;
|
||||
interface DiscoverTypings extends TypingInstallerRequestWithProjectName {
|
||||
readonly fileNames: string[];
|
||||
readonly projectRootPath: Path;
|
||||
readonly compilerOptions: CompilerOptions;
|
||||
readonly typeAcquisition: TypeAcquisition;
|
||||
readonly unresolvedImports: SortedReadonlyArray<string>;
|
||||
readonly cachePath?: string;
|
||||
readonly kind: "discover";
|
||||
}
|
||||
interface CloseProject extends TypingInstallerRequestWithProjectName {
|
||||
readonly kind: "closeProject";
|
||||
}
|
||||
interface TypesRegistryRequest {
|
||||
readonly kind: "typesRegistry";
|
||||
}
|
||||
interface InstallPackageRequest extends TypingInstallerRequestWithProjectName {
|
||||
readonly kind: "installPackage";
|
||||
readonly fileName: Path;
|
||||
readonly packageName: string;
|
||||
readonly projectRootPath: Path;
|
||||
}
|
||||
interface TypesRegistryResponse extends TypingInstallerResponse {
|
||||
readonly kind: EventTypesRegistry;
|
||||
readonly typesRegistry: MapLike<MapLike<string>>;
|
||||
}
|
||||
interface PackageInstalledResponse extends ProjectResponse {
|
||||
readonly kind: ActionPackageInstalled;
|
||||
readonly success: boolean;
|
||||
readonly message: string;
|
||||
}
|
||||
interface InitializationFailedResponse extends TypingInstallerResponse {
|
||||
readonly kind: EventInitializationFailed;
|
||||
readonly message: string;
|
||||
}
|
||||
interface ProjectResponse extends TypingInstallerResponse {
|
||||
readonly projectName: string;
|
||||
}
|
||||
interface InvalidateCachedTypings extends ProjectResponse {
|
||||
readonly kind: ActionInvalidate;
|
||||
}
|
||||
interface InstallTypes extends ProjectResponse {
|
||||
readonly kind: EventBeginInstallTypes | EventEndInstallTypes;
|
||||
readonly eventId: number;
|
||||
readonly typingsInstallerVersion: string;
|
||||
readonly packagesToInstall: ReadonlyArray<string>;
|
||||
}
|
||||
interface BeginInstallTypes extends InstallTypes {
|
||||
readonly kind: EventBeginInstallTypes;
|
||||
}
|
||||
interface EndInstallTypes extends InstallTypes {
|
||||
readonly kind: EventEndInstallTypes;
|
||||
readonly installSuccess: boolean;
|
||||
}
|
||||
interface InstallTypingHost extends JsTyping.TypingResolutionHost {
|
||||
useCaseSensitiveFileNames: boolean;
|
||||
writeFile(path: string, content: string): void;
|
||||
createDirectory(path: string): void;
|
||||
watchFile?(path: string, callback: FileWatcherCallback, pollingInterval?: number): FileWatcher;
|
||||
watchDirectory?(path: string, callback: DirectoryWatcherCallback, recursive?: boolean): FileWatcher;
|
||||
}
|
||||
interface SetTypings extends ProjectResponse {
|
||||
readonly typeAcquisition: TypeAcquisition;
|
||||
readonly compilerOptions: CompilerOptions;
|
||||
readonly typings: string[];
|
||||
readonly unresolvedImports: SortedReadonlyArray<string>;
|
||||
readonly kind: ActionSet;
|
||||
}
|
||||
type TypingInstallerResponseUnion = SetTypings | InvalidateCachedTypings | TypesRegistryResponse | PackageInstalledResponse | InstallTypes | InitializationFailedResponse;
|
||||
}
|
||||
declare namespace ts.JsTyping {
|
||||
interface TypingResolutionHost {
|
||||
directoryExists(path: string): boolean;
|
||||
fileExists(fileName: string): boolean;
|
||||
readFile(path: string, encoding?: string): string | undefined;
|
||||
readDirectory(rootDir: string, extensions: ReadonlyArray<string>, excludes: ReadonlyArray<string> | undefined, includes: ReadonlyArray<string> | undefined, depth?: number): string[];
|
||||
}
|
||||
interface CachedTyping {
|
||||
typingLocation: string;
|
||||
version: Semver;
|
||||
}
|
||||
function isTypingUpToDate(cachedTyping: CachedTyping, availableTypingVersions: MapLike<string>): boolean;
|
||||
const nodeCoreModuleList: ReadonlyArray<string>;
|
||||
const nodeCoreModules: Map<true>;
|
||||
/**
|
||||
* A map of loose file names to library names that we are confident require typings
|
||||
*/
|
||||
type SafeList = ReadonlyMap<string>;
|
||||
function loadSafeList(host: TypingResolutionHost, safeListPath: Path): SafeList;
|
||||
function loadTypesMap(host: TypingResolutionHost, typesMapPath: Path): SafeList | undefined;
|
||||
/**
|
||||
* @param host is the object providing I/O related operations.
|
||||
* @param fileNames are the file names that belong to the same project
|
||||
* @param projectRootPath is the path to the project root directory
|
||||
* @param safeListPath is the path used to retrieve the safe list
|
||||
* @param packageNameToTypingLocation is the map of package names to their cached typing locations and installed versions
|
||||
* @param typeAcquisition is used to customize the typing acquisition process
|
||||
* @param compilerOptions are used as a source for typing inference
|
||||
*/
|
||||
function discoverTypings(host: TypingResolutionHost, log: ((message: string) => void) | undefined, fileNames: string[], projectRootPath: Path, safeList: SafeList, packageNameToTypingLocation: ReadonlyMap<CachedTyping>, typeAcquisition: TypeAcquisition, unresolvedImports: ReadonlyArray<string>, typesRegistry: ReadonlyMap<MapLike<string>>): {
|
||||
cachedTypingPaths: string[];
|
||||
newTypingNames: string[];
|
||||
filesToWatch: string[];
|
||||
};
|
||||
enum PackageNameValidationResult {
|
||||
Ok = 0,
|
||||
ScopedPackagesNotSupported = 1,
|
||||
EmptyName = 2,
|
||||
NameTooLong = 3,
|
||||
NameStartsWithDot = 4,
|
||||
NameStartsWithUnderscore = 5,
|
||||
NameContainsNonURISafeCharacters = 6
|
||||
}
|
||||
/**
|
||||
* Validates package name using rules defined at https://docs.npmjs.com/files/package.json
|
||||
*/
|
||||
function validatePackageName(packageName: string): PackageNameValidationResult;
|
||||
function renderPackageNameValidationFailure(result: PackageNameValidationResult, typing: string): string;
|
||||
}
|
||||
declare namespace ts {
|
||||
class Semver {
|
||||
readonly major: number;
|
||||
readonly minor: number;
|
||||
readonly patch: number;
|
||||
/**
|
||||
* If true, this is `major.minor.0-next.patch`.
|
||||
* If false, this is `major.minor.patch`.
|
||||
*/
|
||||
readonly isPrerelease: boolean;
|
||||
static parse(semver: string): Semver;
|
||||
static fromRaw({ major, minor, patch, isPrerelease }: Semver): Semver;
|
||||
private static tryParse;
|
||||
private constructor();
|
||||
readonly versionString: string;
|
||||
equals(sem: Semver): boolean;
|
||||
greaterThan(sem: Semver): boolean;
|
||||
}
|
||||
}
|
||||
//# sourceMappingURL=jsTyping.d.ts.map
|
||||
declare namespace ts.server {
|
||||
interface CompressedData {
|
||||
length: number;
|
||||
|
@ -14127,6 +14116,5 @@ declare namespace ts.server {
|
|||
}
|
||||
}
|
||||
//# sourceMappingURL=server.d.ts.map
|
||||
//# sourceMappingURL=tsserverlibrary.d.ts.map
|
||||
export = ts;
|
||||
export as namespace ts;
|
6531
tests/baselines/reference/api/typescript.d.ts
vendored
6531
tests/baselines/reference/api/typescript.d.ts
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue