@@ -14,6 +14,7 @@ interface DtsCreatorOptions {
14
14
searchDir ?: string ;
15
15
outDir ?: string ;
16
16
camelCase ?: CamelCaseOption ;
17
+ singleQuote ?: boolean ;
17
18
dropExtension ?: boolean ;
18
19
EOL ?: string ;
19
20
loaderPlugins ?: Plugin < any > [ ] ;
@@ -26,6 +27,7 @@ export class DtsCreator {
26
27
private loader : FileSystemLoader ;
27
28
private inputDirectory : string ;
28
29
private outputDirectory : string ;
30
+ private singleQuote ?: boolean ;
29
31
private camelCase : boolean | 'dashes' | undefined ;
30
32
private dropExtension : boolean ;
31
33
private EOL : string ;
@@ -38,6 +40,7 @@ export class DtsCreator {
38
40
this . loader = new FileSystemLoader ( this . rootDir , options . loaderPlugins ) ;
39
41
this . inputDirectory = path . join ( this . rootDir , this . searchDir ) ;
40
42
this . outputDirectory = path . join ( this . rootDir , this . outDir ) ;
43
+ this . singleQuote = options . singleQuote ;
41
44
this . camelCase = options . camelCase ;
42
45
this . dropExtension = ! ! options . dropExtension ;
43
46
this . EOL = options . EOL || os . EOL ;
@@ -63,10 +66,11 @@ export class DtsCreator {
63
66
64
67
const result = keys
65
68
. map ( k => convertKey ( k ) )
66
- . map ( k => ' readonly "' + k + '" : string;' )
69
+ . map ( k => ` readonly ${ k . includes ( '-' ) ? `" ${ k } "` : k } : string;` ) ;
67
70
68
71
const content = new DtsContent ( {
69
72
dropExtension : this . dropExtension ,
73
+ singleQuote : this . singleQuote ,
70
74
rootDir : this . rootDir ,
71
75
searchDir : this . searchDir ,
72
76
outDir : this . outDir ,
0 commit comments