@@ -340,7 +340,7 @@ export interface DocumentContent {
340
340
*/
341
341
fontName : string ;
342
342
/** the format version, this should always be 1 */
343
- formatVersion : number ;
343
+ formatVersion ? : number ;
344
344
/** the last opened page, starts at zero */
345
345
lastOpenedPage ?: number ;
346
346
/**
@@ -440,7 +440,6 @@ const documentContent = properties(
440
440
extraMetadata : values ( string ( ) ) ,
441
441
fileType : enumeration ( "epub" , "notebook" , "pdf" ) ,
442
442
fontName : string ( ) ,
443
- formatVersion : uint8 ( ) ,
444
443
lineHeight : int32 ( ) ,
445
444
orientation : enumeration ( "portrait" , "landscape" ) ,
446
445
pageCount : uint32 ( ) ,
@@ -457,6 +456,7 @@ const documentContent = properties(
457
456
customZoomPageWidth : float64 ( ) ,
458
457
customZoomScale : float64 ( ) ,
459
458
dummyDocument : boolean ( ) ,
459
+ formatVersion : uint8 ( ) ,
460
460
keyboardMetadata : properties (
461
461
{
462
462
count : uint32 ( ) ,
@@ -516,7 +516,7 @@ export interface TemplateContent {
516
516
/** semantic version for this template */
517
517
templateVersion : string ;
518
518
/** template configuration format version (currently just `1`) */
519
- formatVersion : number ;
519
+ formatVersion ? : number ;
520
520
/**
521
521
* which screens the template supports:
522
522
*
@@ -530,19 +530,23 @@ export interface TemplateContent {
530
530
items : object [ ] ;
531
531
}
532
532
533
- const templateContent = properties ( {
534
- name : string ( ) ,
535
- author : string ( ) ,
536
- iconData : string ( ) ,
537
- categories : elements ( string ( ) ) ,
538
- labels : elements ( string ( ) ) ,
539
- orientation : enumeration ( "portrait" , "landscape" ) ,
540
- templateVersion : string ( ) ,
541
- formatVersion : uint8 ( ) ,
542
- supportedScreens : elements ( enumeration ( "rm2" , "rmPP" ) ) ,
543
- constants : elements ( values ( int32 ( ) ) ) ,
544
- items : elements ( empty ( ) as CompiledSchema < object , unknown > ) ,
545
- } ) satisfies CompiledSchema < TemplateContent , unknown > ;
533
+ const templateContent = properties (
534
+ {
535
+ name : string ( ) ,
536
+ author : string ( ) ,
537
+ iconData : string ( ) ,
538
+ categories : elements ( string ( ) ) ,
539
+ labels : elements ( string ( ) ) ,
540
+ orientation : enumeration ( "portrait" , "landscape" ) ,
541
+ templateVersion : string ( ) ,
542
+ supportedScreens : elements ( enumeration ( "rm2" , "rmPP" ) ) ,
543
+ constants : elements ( values ( int32 ( ) ) ) ,
544
+ items : elements ( empty ( ) as CompiledSchema < object , unknown > ) ,
545
+ } ,
546
+ {
547
+ formatVersion : uint8 ( ) ,
548
+ } ,
549
+ ) satisfies CompiledSchema < TemplateContent , unknown > ;
546
550
547
551
/** content metadata for any item */
548
552
export type Content = CollectionContent | DocumentContent | TemplateContent ;
0 commit comments