@@ -31,8 +31,8 @@ import { EditMonsterModal } from "./modal";
3131export default class StatblockSettingTab extends PluginSettingTab {
3232 importer : Importer ;
3333 results : Partial < Monster > [ ] = [ ] ;
34- filter : Setting ;
35- $UI : Creatures ;
34+ filter ! : Setting ;
35+ $UI ! : Creatures ;
3636 constructor ( app : App , private plugin : StatBlockPlugin ) {
3737 super ( app , plugin ) ;
3838 this . importer = new Importer ( this . plugin ) ;
@@ -192,8 +192,7 @@ export default class StatblockSettingTab extends PluginSettingTab {
192192 this . plugin . settings . renderDice ,
193193 showFormula : false ,
194194 showParens : false ,
195- expectedValue : ExpectedValue . Average ,
196- text : null
195+ expectedValue : ExpectedValue . Average
197196 }
198197 ) ;
199198 }
@@ -378,18 +377,18 @@ export default class StatblockSettingTab extends PluginSettingTab {
378377 } ) ;
379378 inputFile . onchange = async ( ) => {
380379 const { files } = inputFile ;
381- if ( ! files . length ) return ;
380+ if ( ! files ? .length ) return ;
382381 try {
383382 const { files } = inputFile ;
384- if ( ! files . length ) return ;
383+ if ( ! files ? .length ) return ;
385384 for ( const file of Array . from ( files ) ) {
386385 await new Promise < void > ( ( resolve , reject ) => {
387386 const reader = new FileReader ( ) ;
388387
389388 reader . onload = async ( event ) => {
390389 try {
391390 const layout : Layout = JSON . parse (
392- event . target . result as string
391+ event . target ? .result as string
393392 ) ;
394393 if ( ! layout ) {
395394 reject (
@@ -446,7 +445,7 @@ export default class StatblockSettingTab extends PluginSettingTab {
446445 } ) ;
447446 }
448447 await this . plugin . saveSettings ( ) ;
449- inputFile . value = null ;
448+ inputFile . value = "" ;
450449 this . buildCustomLayouts ( layoutContainer , containerEl ) ;
451450 } catch ( e ) { }
452451 } ;
@@ -613,7 +612,7 @@ export default class StatblockSettingTab extends PluginSettingTab {
613612 b . setIcon ( "undo" ) . onClick ( async ( ) => {
614613 const defLayout = DefaultLayouts . find (
615614 ( { id } ) => id == layout . id
616- ) ;
615+ ) ! ;
617616 delete this . plugin . settings . defaultLayouts [ layout . id ] ;
618617 await this . plugin . saveSettings ( ) ;
619618 this . plugin . manager . updateDefaultLayout (
@@ -782,10 +781,10 @@ export default class StatblockSettingTab extends PluginSettingTab {
782781
783782 inputAppFile . onchange = async ( ) => {
784783 const { files } = inputAppFile ;
785- if ( ! files . length ) return ;
784+ if ( ! files ? .length ) return ;
786785 try {
787786 const { files } = inputAppFile ;
788- if ( ! files . length ) return ;
787+ if ( ! files ? .length ) return ;
789788 const monsters = await this . importer . import ( files , "appfile" ) ;
790789 if ( monsters && monsters . length ) {
791790 await this . plugin . saveMonsters ( monsters ) ;
@@ -817,10 +816,10 @@ export default class StatblockSettingTab extends PluginSettingTab {
817816
818817 inputImprovedInitiative . onchange = async ( ) => {
819818 const { files } = inputImprovedInitiative ;
820- if ( ! files . length ) return ;
819+ if ( ! files ? .length ) return ;
821820 try {
822821 const { files } = inputImprovedInitiative ;
823- if ( ! files . length ) return ;
822+ if ( ! files ? .length ) return ;
824823 const monsters = await this . importer . import ( files , "improved" ) ;
825824 if ( monsters && monsters . length ) {
826825 await this . plugin . saveMonsters ( monsters ) ;
@@ -852,10 +851,10 @@ export default class StatblockSettingTab extends PluginSettingTab {
852851
853852 inputCritterDB . onchange = async ( ) => {
854853 const { files } = inputCritterDB ;
855- if ( ! files . length ) return ;
854+ if ( ! files ? .length ) return ;
856855 try {
857856 const { files } = inputCritterDB ;
858- if ( ! files . length ) return ;
857+ if ( ! files ? .length ) return ;
859858 const monsters = await this . importer . import ( files , "critter" ) ;
860859 if ( monsters && monsters . length ) {
861860 await this . plugin . saveMonsters ( monsters ) ;
@@ -887,7 +886,7 @@ export default class StatblockSettingTab extends PluginSettingTab {
887886
888887 input5eTools . onchange = async ( ) => {
889888 const { files } = input5eTools ;
890- if ( ! files . length ) return ;
889+ if ( ! files ? .length ) return ;
891890 const monsters = await this . importer . import ( files , "5e" ) ;
892891 if ( monsters && monsters . length ) {
893892 await this . plugin . saveMonsters ( monsters ) ;
@@ -916,7 +915,7 @@ export default class StatblockSettingTab extends PluginSettingTab {
916915 } ) ;
917916 inputTetra . onchange = async ( ) => {
918917 const { files } = inputTetra ;
919- if ( ! files . length ) return ;
918+ if ( ! files ? .length ) return ;
920919 const monsters = await this . importer . import ( files , "tetra" ) ;
921920 if ( monsters && monsters . length ) {
922921 await this . plugin . saveMonsters ( monsters ) ;
@@ -944,7 +943,7 @@ export default class StatblockSettingTab extends PluginSettingTab {
944943 } ) ;
945944 inputPF2EMonsterTools . onchange = async ( ) => {
946945 const { files } = inputPF2EMonsterTools ;
947- if ( ! files . length ) return ;
946+ if ( ! files ? .length ) return ;
948947 const monsters = await this . importer . import ( files , "PF2eMonsterTool" ) ;
949948 if ( monsters && monsters . length ) {
950949 await this . plugin . saveMonsters ( monsters ) ;
@@ -982,7 +981,7 @@ export default class StatblockSettingTab extends PluginSettingTab {
982981 } ) ;
983982 inputGeneric . onchange = async ( ) => {
984983 const { files } = inputGeneric ;
985- if ( ! files . length ) return ;
984+ if ( ! files ? .length ) return ;
986985 const monsters = await this . importer . import ( files , "generic" ) ;
987986 if ( monsters && monsters . length ) {
988987 await this . plugin . saveMonsters ( monsters ) ;
@@ -1014,7 +1013,7 @@ export default class StatblockSettingTab extends PluginSettingTab {
10141013 } ) ;
10151014 } ) ;
10161015
1017- const ancestor = this . containerEl . closest ( ".statblock-settings" ) ;
1016+ const ancestor = this . containerEl . closest ( ".statblock-settings" ) ! ;
10181017 const { backgroundColor, paddingTop } = getComputedStyle ( ancestor ) ;
10191018
10201019 this . $UI = new Creatures ( {
@@ -1032,7 +1031,7 @@ export default class StatblockSettingTab extends PluginSettingTab {
10321031}
10331032
10341033class CreateStatblockModal extends FantasyStatblockModal {
1035- creator : LayoutEditor ;
1034+ creator ! : LayoutEditor ;
10361035 layout : Layout ;
10371036 saved : boolean = false ;
10381037 constructor (
0 commit comments