@@ -162,6 +162,8 @@ const writeFiles = function(options) {
162162 // Save the data to a file
163163 let codePointsExports = `require('./ranges.js').flatMap(r=>Array.from(r.keys()))` ;
164164 let symbolsExports = `require('./ranges.js').flatMap(r=>Array.from(r.values()))` ;
165+ let codePointsType = 'number[]' ;
166+ let symbolsType = 'string[]' ;
165167 if ( ! isCaseFoldingOrMapping ) {
166168 const encodedRanges = codePoints instanceof regenerate ? encodeRegenerate ( codePoints ) : encodeRanges ( codePoints ) ;
167169 fs . writeFileSync (
@@ -198,22 +200,28 @@ const writeFiles = function(options) {
198200 }
199201 codePointsExports = codePoints . size < 10 ? jsesc ( codePoints ) : gzipInline ( codePoints ) ;
200202 symbolsExports = codePoints . size < 10 ? jsesc ( symbols ) : gzipInline ( symbols ) ;
203+ if ( ( type === 'Case_Folding' && item === 'F' ) || type === 'Special_Casing' ) {
204+ codePointsType = 'Map<number, number[]>' ;
205+ } else {
206+ codePointsType = 'Map<number, number>' ;
207+ }
208+ symbolsType = 'Map<string, string>' ;
201209 }
202210 fs . writeFileSync (
203211 path . resolve ( dir , 'code-points.js' ) ,
204212 `module.exports=${ codePointsExports } `
205213 ) ;
206214 fs . writeFileSync (
207215 path . resolve ( dir , 'code-points.d.ts' ) ,
208- `declare const codePoints: number[] ;\nexport = codePoints;`
216+ `declare const codePoints: ${ codePointsType } ;\nexport = codePoints;`
209217 ) ;
210218 fs . writeFileSync (
211219 path . resolve ( dir , 'symbols.js' ) ,
212220 `module.exports=${ symbolsExports } `
213221 ) ;
214222 fs . writeFileSync (
215223 path . resolve ( dir , 'symbols.d.ts' ) ,
216- `declare const symbols: string[] ;\nexport = symbols;`
224+ `declare const symbols: ${ symbolsType } ;\nexport = symbols;`
217225 ) ;
218226 } ) ;
219227 if ( options . type == 'Bidi_Mirroring_Glyph' ) {
0 commit comments