mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Enable 'callable-types' tslint rule (#19654)
This commit is contained in:
@@ -69,9 +69,8 @@ namespace ts {
|
||||
|
||||
export const maxNumberOfFilesToIterateForInvalidation = 256;
|
||||
|
||||
interface GetResolutionWithResolvedFileName<T extends ResolutionWithFailedLookupLocations = ResolutionWithFailedLookupLocations, R extends ResolutionWithResolvedFileName = ResolutionWithResolvedFileName> {
|
||||
(resolution: T): R;
|
||||
}
|
||||
type GetResolutionWithResolvedFileName<T extends ResolutionWithFailedLookupLocations = ResolutionWithFailedLookupLocations, R extends ResolutionWithResolvedFileName = ResolutionWithResolvedFileName> =
|
||||
(resolution: T) => R;
|
||||
|
||||
export function createResolutionCache(resolutionHost: ResolutionCacheHost, rootDirForResolution: string): ResolutionCache {
|
||||
let filesWithChangedSetOfUnresolvedImports: Path[] | undefined;
|
||||
|
||||
@@ -2,9 +2,7 @@
|
||||
/// <reference path="diagnosticInformationMap.generated.ts"/>
|
||||
|
||||
namespace ts {
|
||||
export interface ErrorCallback {
|
||||
(message: DiagnosticMessage, length: number): void;
|
||||
}
|
||||
export type ErrorCallback = (message: DiagnosticMessage, length: number) => void;
|
||||
|
||||
/* @internal */
|
||||
export function tokenIsIdentifierOrKeyword(token: SyntaxKind): boolean {
|
||||
|
||||
@@ -2471,9 +2471,13 @@ namespace ts {
|
||||
readFile(path: string): string | undefined;
|
||||
}
|
||||
|
||||
export interface WriteFileCallback {
|
||||
(fileName: string, data: string, writeByteOrderMark: boolean, onError: ((message: string) => void) | undefined, sourceFiles: ReadonlyArray<SourceFile>): void;
|
||||
}
|
||||
export type WriteFileCallback = (
|
||||
fileName: string,
|
||||
data: string,
|
||||
writeByteOrderMark: boolean,
|
||||
onError: ((message: string) => void) | undefined,
|
||||
sourceFiles: ReadonlyArray<SourceFile>,
|
||||
) => void;
|
||||
|
||||
export class OperationCanceledException { }
|
||||
|
||||
@@ -3582,9 +3586,7 @@ namespace ts {
|
||||
}
|
||||
|
||||
/* @internal */
|
||||
export interface TypeMapper {
|
||||
(t: TypeParameter): Type;
|
||||
}
|
||||
export type TypeMapper = (t: TypeParameter) => Type;
|
||||
|
||||
export const enum InferencePriority {
|
||||
Contravariant = 1 << 0, // Inference from contravariant position
|
||||
@@ -4192,9 +4194,7 @@ namespace ts {
|
||||
}
|
||||
|
||||
/* @internal */
|
||||
export interface HasInvalidatedResolution {
|
||||
(sourceFile: Path): boolean;
|
||||
}
|
||||
export type HasInvalidatedResolution = (sourceFile: Path) => boolean;
|
||||
|
||||
export interface CompilerHost extends ModuleResolutionHost {
|
||||
getSourceFile(fileName: string, languageVersion: ScriptTarget, onError?: (message: string) => void, shouldCreateNewSourceFile?: boolean): SourceFile | undefined;
|
||||
|
||||
@@ -784,9 +784,15 @@ namespace Harness {
|
||||
? IO.newLine() + `//# sourceURL=${IO.resolvePath(tcServicesFileName)}`
|
||||
: "");
|
||||
|
||||
export interface SourceMapEmitterCallback {
|
||||
(emittedFile: string, emittedLine: number, emittedColumn: number, sourceFile: string, sourceLine: number, sourceColumn: number, sourceName: string): void;
|
||||
}
|
||||
export type SourceMapEmitterCallback = (
|
||||
emittedFile: string,
|
||||
emittedLine: number,
|
||||
emittedColumn: number,
|
||||
sourceFile: string,
|
||||
sourceLine: number,
|
||||
sourceColumn: number,
|
||||
sourceName: string,
|
||||
) => void;
|
||||
|
||||
// Settings
|
||||
export let userSpecifiedRoot = "";
|
||||
|
||||
@@ -78,9 +78,7 @@ namespace ts.server {
|
||||
|
||||
export type ProjectServiceEvent = ProjectsUpdatedInBackgroundEvent | ConfigFileDiagEvent | ProjectLanguageServiceStateEvent | ProjectInfoTelemetryEvent;
|
||||
|
||||
export interface ProjectServiceEventHandler {
|
||||
(event: ProjectServiceEvent): void;
|
||||
}
|
||||
export type ProjectServiceEventHandler = (event: ProjectServiceEvent) => void;
|
||||
|
||||
export interface SafeList {
|
||||
[name: string]: { match: RegExp, exclude?: (string | number)[][], types?: string[] };
|
||||
|
||||
@@ -98,9 +98,7 @@ namespace ts.server {
|
||||
getExternalFiles?(proj: Project): string[];
|
||||
}
|
||||
|
||||
export interface PluginModuleFactory {
|
||||
(mod: { typescript: typeof ts }): PluginModule;
|
||||
}
|
||||
export type PluginModuleFactory = (mod: { typescript: typeof ts }) => PluginModule;
|
||||
|
||||
/**
|
||||
* The project root can be script info - if root is present,
|
||||
|
||||
@@ -4,9 +4,9 @@
|
||||
namespace ts.formatting {
|
||||
|
||||
export class RuleOperationContext {
|
||||
private readonly customContextChecks: { (context: FormattingContext): boolean; }[];
|
||||
private readonly customContextChecks: ((context: FormattingContext) => boolean)[];
|
||||
|
||||
constructor(...funcs: { (context: FormattingContext): boolean; }[]) {
|
||||
constructor(...funcs: ((context: FormattingContext) => boolean)[]) {
|
||||
this.customContextChecks = funcs;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user