File tree Expand file tree Collapse file tree 2 files changed +57
-0
lines changed Expand file tree Collapse file tree 2 files changed +57
-0
lines changed Original file line number Diff line number Diff line change
1
+ /// <reference path="js-beautify.d.ts" />
2
+
3
+ var simple : string = js_beautify ( "console.log('Hello world!');" ) ;
4
+
5
+ var full : string = js_beautify (
6
+ "console.log('Hello world!');" ,
7
+ {
8
+ "indent_size" : 4 ,
9
+ "indent_char" : " " ,
10
+ "eol" : "\n" ,
11
+ "indent_level" : 0 ,
12
+ "indent_with_tabs" : false ,
13
+ "preserve_newlines" : true ,
14
+ "max_preserve_newlines" : 10 ,
15
+ "jslint_happy" : false ,
16
+ "space_after_anon_function" : false ,
17
+ "brace_style" : "collapse" ,
18
+ "keep_array_indentation" : false ,
19
+ "keep_function_indentation" : false ,
20
+ "space_before_conditional" : true ,
21
+ "break_chained_methods" : false ,
22
+ "eval_code" : false ,
23
+ "unescape_strings" : false ,
24
+ "wrap_line_length" : 0 ,
25
+ "wrap_attributes" : "auto" ,
26
+ "wrap_attributes_indent_size" : 4 ,
27
+ "end_with_newline" : false
28
+ } ) ;
Original file line number Diff line number Diff line change
1
+ // Type definitions for js_beautify
2
+ // Project: https://github.com/beautify-web/js-beautify/
3
+ // Definitions by: Josh Goldberg <https://github.com/JoshuaKGoldberg/>
4
+ // Definitions: https://github.com/borisyankov/DefinitelyTyped
5
+
6
+ declare var js_beautify : {
7
+ ( js_source_text : string , options ?: {
8
+ indent_size ?: number ;
9
+ indent_char ?: string ;
10
+ eol ?: string ;
11
+ indent_level ?: number ;
12
+ indent_width_tabs ?: boolean ;
13
+ preserve_newlines ?: boolean ;
14
+ max_preserve_newlines ?: number ;
15
+ jslint_happy : boolean ;
16
+ space_after_anon_function : boolean ;
17
+ brace_style : string ;
18
+ keep_array_indentation : boolean ;
19
+ keep_function_indentation : boolean ;
20
+ space_before_conditional : boolean ;
21
+ break_chained_methods : boolean ;
22
+ eval_code : boolean ;
23
+ unescape_strings : boolean ;
24
+ wrap_line_length : number ;
25
+ wrap_attributes : string ;
26
+ wrap_attributes_indent_size : number ;
27
+ end_with_newline : boolean ;
28
+ } ) : string ;
29
+ } ;
You can’t perform that action at this time.
0 commit comments