|
| 1 | +declare var FourSlash: any; |
| 2 | +declare enum IncrementalEditValidation { |
| 3 | + None, |
| 4 | + SyntacticOnly, |
| 5 | + Complete, |
| 6 | +} |
| 7 | +declare enum TypingFidelity { |
| 8 | + /** Performs typing and formatting (if formatting is enabled) */ |
| 9 | + Low, |
| 10 | + /** Performs typing, checks completion lists, signature help, and formatting (if enabled) */ |
| 11 | + High, |
| 12 | +} |
| 13 | +declare enum EmitReturnStatus { |
| 14 | + Succeeded = 0, |
| 15 | + AllOutputGenerationSkipped = 1, |
| 16 | + JSGeneratedWithSemanticErrors = 2, |
| 17 | + DeclarationGenerationSkipped = 3, |
| 18 | + EmitErrorsEncountered = 4, |
| 19 | +} |
| 20 | +declare module FourSlashInterface { |
| 21 | + interface Marker { |
| 22 | + fileName: string; |
| 23 | + position: number; |
| 24 | + data?: any; |
| 25 | + } |
| 26 | + interface Range { |
| 27 | + fileName: string; |
| 28 | + start: number; |
| 29 | + end: number; |
| 30 | + marker?: Marker; |
| 31 | + } |
| 32 | + interface TextSpan { |
| 33 | + start: number; |
| 34 | + end: number; |
| 35 | + } |
| 36 | + class test_ { |
| 37 | + markers(): Marker[]; |
| 38 | + ranges(): Range[]; |
| 39 | + } |
| 40 | + class diagnostics { |
| 41 | + validateTypeAtCurrentPosition(): any; |
| 42 | + validateTypesAtPositions(...positions: number[]): any; |
| 43 | + setEditValidation(validation: IncrementalEditValidation): void; |
| 44 | + setTypingFidelity(fidelity: TypingFidelity): void; |
| 45 | + } |
| 46 | + class goTo { |
| 47 | + marker(name?: string): void; |
| 48 | + bof(): void; |
| 49 | + eof(): void; |
| 50 | + definition(definitionIndex?: number): void; |
| 51 | + position(position: number, fileIndex?: number): any; |
| 52 | + position(position: number, fileName?: string): any; |
| 53 | + file(index: number): any; |
| 54 | + file(name: string): any; |
| 55 | + } |
| 56 | + class verifyNegatable { |
| 57 | + private negative; |
| 58 | + not: verifyNegatable; |
| 59 | + constructor(negative?: boolean); |
| 60 | + memberListContains(symbol: string, type?: string, docComment?: string, fullSymbolName?: string, kind?: string): void; |
| 61 | + memberListCount(expectedCount: number): void; |
| 62 | + completionListContains(symbol: string, type?: string, docComment?: string, fullSymbolName?: string, kind?: string): void; |
| 63 | + completionListItemsCountIsGreaterThan(count: number): void; |
| 64 | + completionListIsEmpty(): void; |
| 65 | + memberListIsEmpty(): void; |
| 66 | + referencesCountIs(count: number): void; |
| 67 | + referencesAtPositionContains(range: Range, isWriteAccess?: boolean): void; |
| 68 | + implementorsCountIs(count: number): void; |
| 69 | + currentParameterIsVariable(): void; |
| 70 | + signatureHelpPresent(): void; |
| 71 | + errorExistsBetweenMarkers(startMarker: string, endMarker: string): void; |
| 72 | + errorExistsAfterMarker(markerName?: string): void; |
| 73 | + errorExistsBeforeMarker(markerName?: string): void; |
| 74 | + quickInfoIs(typeName?: string, docComment?: string, symbolName?: string, kind?: string): void; |
| 75 | + quickInfoSymbolNameIs(symbolName: any): void; |
| 76 | + quickInfoExists(): void; |
| 77 | + definitionLocationExists(): void; |
| 78 | + } |
| 79 | + class verify extends verifyNegatable { |
| 80 | + caretAtMarker(markerName?: string): void; |
| 81 | + indentationIs(numberOfSpaces: number): void; |
| 82 | + indentationAtPositionIs(fileName: string, position: number, numberOfSpaces: number): void; |
| 83 | + textAtCaretIs(text: string): void; |
| 84 | + /** |
| 85 | + Compiles the current file and evaluates 'expr' in a context containing |
| 86 | + the emitted output, then compares (using ===) the result of that expression |
| 87 | + to 'value'. Do not use this function with external modules as it is not supported. |
| 88 | + */ |
| 89 | + eval(expr: string, value: any): void; |
| 90 | + emitOutput(expectedState: EmitReturnStatus, expectedFilename?: string): void; |
| 91 | + currentLineContentIs(text: string): void; |
| 92 | + currentFileContentIs(text: string): void; |
| 93 | + currentParameterHelpArgumentNameIs(name: string): void; |
| 94 | + currentParameterSpanIs(parameter: string): void; |
| 95 | + currentParameterHelpArgumentDocCommentIs(docComment: string): void; |
| 96 | + currentSignatureHelpDocCommentIs(docComment: string): void; |
| 97 | + signatureHelpCountIs(expected: number): void; |
| 98 | + currentSignatureParamterCountIs(expected: number): void; |
| 99 | + currentSignatureTypeParamterCountIs(expected: number): void; |
| 100 | + currentSignatureHelpIs(expected: string): void; |
| 101 | + numberOfErrorsInCurrentFile(expected: number): void; |
| 102 | + baselineCurrentFileBreakpointLocations(): void; |
| 103 | + baselineCurrentFileNameOrDottedNameSpans(): void; |
| 104 | + nameOrDottedNameSpanTextIs(text: string): void; |
| 105 | + outliningSpansInCurrentFile(spans: TextSpan[]): void; |
| 106 | + todoCommentsInCurrentFile(descriptors: string[]): void; |
| 107 | + matchingBracePositionInCurrentFile(bracePosition: number, expectedMatchPosition: number): void; |
| 108 | + noMatchingBracePositionInCurrentFile(bracePosition: number): void; |
| 109 | + setVerifyDocComments(val: boolean): void; |
| 110 | + getScriptLexicalStructureListCount(count: number): void; |
| 111 | + getScriptLexicalStructureListContains(name: string, kind: string, fileName?: string, parentName?: string, isAdditionalSpan?: boolean, markerPosition?: number): void; |
| 112 | + navigationItemsListCount(count: number, searchValue: string, matchKind?: string): void; |
| 113 | + navigationItemsListContains(name: string, kind: string, searchValue: string, matchKind: string, fileName?: string, parenetName?: string): void; |
| 114 | + occurrencesAtPositionContains(range: Range, isWriteAccess?: boolean): void; |
| 115 | + occurrencesAtPositionCount(expectedCount: number): void; |
| 116 | + completionEntryDetailIs(entryName: string, type: string, docComment?: string, fullSymbolName?: string, kind?: string): void; |
| 117 | + } |
| 118 | + class edit { |
| 119 | + backspace(count?: number): void; |
| 120 | + deleteAtCaret(times?: number): void; |
| 121 | + replace(start: number, length: number, text: string): void; |
| 122 | + paste(text: string): void; |
| 123 | + insert(text: string): void; |
| 124 | + insertLine(text: string): void; |
| 125 | + insertLines(...lines: string[]): void; |
| 126 | + moveRight(count?: number): void; |
| 127 | + moveLeft(count?: number): void; |
| 128 | + enableFormatting(): void; |
| 129 | + disableFormatting(): void; |
| 130 | + } |
| 131 | + class debug { |
| 132 | + printCurrentParameterHelp(): void; |
| 133 | + printCurrentFileState(): void; |
| 134 | + printCurrentFileStateWithWhitespace(): void; |
| 135 | + printCurrentFileStateWithoutCaret(): void; |
| 136 | + printCurrentQuickInfo(): void; |
| 137 | + printCurrentSignatureHelp(): void; |
| 138 | + printMemberListMembers(): void; |
| 139 | + printCompletionListMembers(): void; |
| 140 | + printBreakpointLocation(pos: number): void; |
| 141 | + printBreakpointAtCurrentLocation(): void; |
| 142 | + printNameOrDottedNameSpans(pos: number): void; |
| 143 | + printErrorList(): void; |
| 144 | + printNavigationItems(searchValue?: string): void; |
| 145 | + printScriptLexicalStructureItems(): void; |
| 146 | + printReferences(): void; |
| 147 | + printContext(): void; |
| 148 | + } |
| 149 | + class format { |
| 150 | + document(): void; |
| 151 | + selection(startMarker: string, endMarker: string): void; |
| 152 | + setOption(name: string, value: number): any; |
| 153 | + setOption(name: string, value: string): any; |
| 154 | + setOption(name: string, value: boolean): any; |
| 155 | + } |
| 156 | + class cancellation { |
| 157 | + resetCancelled(): void; |
| 158 | + setCancelled(numberOfCalls?: number): void; |
| 159 | + } |
| 160 | +} |
| 161 | +declare module fs { |
| 162 | + var test: FourSlashInterface.test_; |
| 163 | + var goTo: FourSlashInterface.goTo; |
| 164 | + var verify: FourSlashInterface.verify; |
| 165 | + var edit: FourSlashInterface.edit; |
| 166 | + var debug: FourSlashInterface.debug; |
| 167 | + var format: FourSlashInterface.format; |
| 168 | + var diagnostics: FourSlashInterface.diagnostics; |
| 169 | + var cancellation: FourSlashInterface.cancellation; |
| 170 | +} |
| 171 | +declare function verifyOperationIsCancelled(f: any): void; |
| 172 | +declare var test: FourSlashInterface.test_; |
| 173 | +declare var goTo: FourSlashInterface.goTo; |
| 174 | +declare var verify: FourSlashInterface.verify; |
| 175 | +declare var edit: FourSlashInterface.edit; |
| 176 | +declare var debug: FourSlashInterface.debug; |
| 177 | +declare var format: FourSlashInterface.format; |
| 178 | +declare var diagnostics: FourSlashInterface.diagnostics; |
| 179 | +declare var cancellation: FourSlashInterface.cancellation; |
0 commit comments