@@ -152,6 +152,12 @@ function commentFromSchema(schema: TypeSchema | NamespaceSchema | NameDesc) {
152
152
} else if ( type . unsupported ) {
153
153
doclines . push ( `@deprecated Unsupported on Firefox at this time.` ) ;
154
154
}
155
+ if ( type . min_manifest_version ) {
156
+ doclines . push ( `Needs at least manifest version ${ type . min_manifest_version } .` ) ;
157
+ }
158
+ if ( type . max_manifest_version ) {
159
+ doclines . push ( `Not supported on manifest versions above ${ type . max_manifest_version } .` ) ;
160
+ }
155
161
if ( type . returns && type . returns . description ) {
156
162
doclines . push ( `@returns ${ descToMarkdown ( type . returns . description ) } ` ) ;
157
163
}
@@ -225,6 +231,8 @@ export default class Converter {
225
231
description : namespace . description ,
226
232
permissions : [ ] ,
227
233
allowedContexts : [ ] ,
234
+ min_manifest_version : namespace . min_manifest_version ,
235
+ max_manifest_version : namespace . max_manifest_version ,
228
236
} ;
229
237
this . namespaces [ namespace . namespace ] = resNamespace ;
230
238
} else {
@@ -351,7 +359,9 @@ export default class Converter {
351
359
convertedProperties . push (
352
360
`${ commentFromSchema ( propertyType ) } ${ name } ${
353
361
type . properties [ name ] . optional ? '?' : ''
354
- } : ${ this . convertType ( propertyType ) } `
362
+ } : ${ this . convertType ( propertyType ) } ${
363
+ type . properties [ name ] . optional ? ' | undefined' : ''
364
+ } `
355
365
) ;
356
366
}
357
367
}
@@ -981,9 +991,15 @@ export default class Converter {
981
991
let out = '' ;
982
992
983
993
if ( data . $import ) {
984
- let skipKeys = [ 'namespace' , 'description' , 'permissions' ] ;
994
+ let skipKeys = [
995
+ 'namespace' ,
996
+ 'description' ,
997
+ 'permissions' ,
998
+ 'max_manifest_version' ,
999
+ 'min_manifest_version' ,
1000
+ ] ;
985
1001
_ . mergeWith ( data , this . namespaces [ data . $import ] , ( objValue , srcValue , key ) => {
986
- if ( skipKeys . includes ( key ) ) return objValue ;
1002
+ if ( skipKeys . includes ( key ) ) return objValue === undefined ? null : objValue ;
987
1003
if ( _ . isArray ( objValue ) ) {
988
1004
return _ . uniqWith ( objValue . concat ( srcValue ) , ( arrVal , othVal ) => {
989
1005
return (
@@ -1031,6 +1047,14 @@ export default class Converter {
1031
1047
doclines . push ( `Manifest keys: ${ manifestKeys . map ( ( p ) => `\`${ p } \`` ) . join ( ', ' ) } ` ) ;
1032
1048
}
1033
1049
}
1050
+ // Manifest version
1051
+ if ( data . min_manifest_version ) {
1052
+ doclines . push ( `Needs at least manifest version ${ data . min_manifest_version } .` ) ;
1053
+ }
1054
+ if ( data . max_manifest_version ) {
1055
+ doclines . push ( `Not supported on manifest versions above ${ data . max_manifest_version } .` ) ;
1056
+ }
1057
+
1034
1058
// Allowed contexts
1035
1059
let contexts = formatContexts ( data . allowedContexts , true ) ;
1036
1060
if ( contexts ) {
0 commit comments