@types/prettier
Advanced tools
Comparing version 1.19.1 to 2.0.0
@@ -1,2 +0,2 @@ | ||
// Type definitions for prettier 1.19 | ||
// Type definitions for prettier 2.0 | ||
// Project: https://github.com/prettier/prettier, https://prettier.io | ||
@@ -27,8 +27,7 @@ // Definitions by: Ika <https://github.com/ikatyang>, | ||
export type BuiltInParserName = | ||
| 'babylon' // deprecated | ||
| 'babel' | ||
| 'babel-flow' | ||
| 'babel-ts' | ||
| 'flow' | ||
| 'typescript' | ||
| 'postcss' // deprecated | ||
| 'css' | ||
@@ -70,3 +69,3 @@ | 'less' | ||
* Print trailing commas wherever possible. | ||
* @default 'none' | ||
* @default 'es5' | ||
*/ | ||
@@ -121,10 +120,6 @@ trailingComma: 'none' | 'es5' | 'all'; | ||
*/ | ||
proseWrap: | ||
| boolean // deprecated | ||
| 'always' | ||
| 'never' | ||
| 'preserve'; | ||
proseWrap: 'always' | 'never' | 'preserve'; | ||
/** | ||
* Include parentheses around a sole arrow function parameter. | ||
* @default 'avoid' | ||
* @default 'always' | ||
*/ | ||
@@ -143,3 +138,3 @@ arrowParens: 'avoid' | 'always'; | ||
* Which end of line characters to apply. | ||
* @default 'auto' | ||
* @default 'lf' | ||
*/ | ||
@@ -183,7 +178,3 @@ endOfLine: 'auto' | 'lf' | 'crlf' | 'cr'; | ||
export interface Printer { | ||
print( | ||
path: FastPath, | ||
options: ParserOptions, | ||
print: (path: FastPath) => Doc, | ||
): Doc; | ||
print(path: FastPath, options: ParserOptions, print: (path: FastPath) => Doc): Doc; | ||
embed?: ( | ||
@@ -208,4 +199,16 @@ path: FastPath, | ||
ownLine?: (commentNode: any, text: string, options: ParserOptions, ast: any, isLastComment: boolean) => boolean; | ||
endOfLine?: (commentNode: any, text: string, options: ParserOptions, ast: any, isLastComment: boolean) => boolean; | ||
remaining?: (commentNode: any, text: string, options: ParserOptions, ast: any, isLastComment: boolean) => boolean; | ||
endOfLine?: ( | ||
commentNode: any, | ||
text: string, | ||
options: ParserOptions, | ||
ast: any, | ||
isLastComment: boolean, | ||
) => boolean; | ||
remaining?: ( | ||
commentNode: any, | ||
text: string, | ||
options: ParserOptions, | ||
ast: any, | ||
isLastComment: boolean, | ||
) => boolean; | ||
}; | ||
@@ -388,7 +391,5 @@ } | ||
/** | ||
* Returns an object representing the parsers, languages and file types Prettier supports. | ||
* If `version` is provided (e.g. `"1.5.0"`), information for that version will be returned, | ||
* otherwise information for the current version will be returned. | ||
* Returns an object representing the parsers, languages and file types Prettier supports for the current version. | ||
*/ | ||
export function getSupportInfo(version?: string): SupportInfo; | ||
export function getSupportInfo(): SupportInfo; | ||
@@ -402,4 +403,5 @@ /** | ||
export namespace util { | ||
function isNextLineEmpty(text: string, node: any, options: ParserOptions): boolean; | ||
function isNextLineEmpty(text: string, node: any, locEnd: (node: any) => number): boolean; | ||
function isNextLineEmptyAfterIndex(text: string, index: number): boolean; | ||
function isPreviousLineEmpty(text: string, node: any, locStart: (node: any) => number): boolean; | ||
function getNextNonSpaceNonCommentCharacterIndex(text: string, node: any, options: ParserOptions): number; | ||
@@ -506,3 +508,6 @@ function makeString(rawContent: string, enclosingQuote: "'" | '"', unescapeUnnecessaryEscapes: boolean): string; | ||
namespace printer { | ||
function printDocToString(doc: Doc, options: Options): { | ||
function printDocToString( | ||
doc: Doc, | ||
options: Options, | ||
): { | ||
formatted: string; | ||
@@ -534,3 +539,8 @@ cursorNodeStart?: number; | ||
function willBreak(doc: Doc): boolean; | ||
function traverseDoc(doc: Doc, onEnter?: (doc: Doc) => void | boolean, onExit?: (doc: Doc) => void, shouldTraverseConditionalGroups?: boolean): void; | ||
function traverseDoc( | ||
doc: Doc, | ||
onEnter?: (doc: Doc) => void | boolean, | ||
onExit?: (doc: Doc) => void, | ||
shouldTraverseConditionalGroups?: boolean, | ||
): void; | ||
function mapDoc<T>(doc: Doc, callback: (doc: Doc) => T): T; | ||
@@ -537,0 +547,0 @@ function propagateBreaks(doc: Doc): void; |
{ | ||
"name": "@types/prettier", | ||
"version": "1.19.1", | ||
"version": "2.0.0", | ||
"description": "TypeScript definitions for prettier", | ||
@@ -37,4 +37,4 @@ "license": "MIT", | ||
"dependencies": {}, | ||
"typesPublisherContentHash": "96ef5cd93f13c2840478ad6701394292ed47245d3340dd8315789b0a6892d1e4", | ||
"typesPublisherContentHash": "f122507b9079f7bb83e10509b1fd7847648b05626e8aa9222d7c59489834f8bb", | ||
"typeScriptVersion": "2.8" | ||
} |
@@ -11,3 +11,3 @@ # Installation | ||
### Additional Details | ||
* Last updated: Sun, 22 Mar 2020 21:07:03 GMT | ||
* Last updated: Thu, 02 Apr 2020 16:56:22 GMT | ||
* Dependencies: none | ||
@@ -14,0 +14,0 @@ * Global values: `prettier` |
@@ -14,6 +14,3 @@ import { CursorOptions, CursorResult, Options, Plugin } from './'; | ||
*/ | ||
export function formatWithCursor( | ||
source: string, | ||
options: CursorOptions, | ||
): CursorResult; | ||
export function formatWithCursor(source: string, options: CursorOptions): CursorResult; | ||
@@ -20,0 +17,0 @@ /** |
22603
546