diff --git a/core/src/main/kotlin/Library.kt b/core/src/main/kotlin/Library.kt index a0cd00a..7979227 100644 --- a/core/src/main/kotlin/Library.kt +++ b/core/src/main/kotlin/Library.kt @@ -2,13 +2,12 @@ import com.sdercolin.utaformatix.data.Document import core.io.UfData -import core.model.ProjectContainer import core.model.ExportResult import core.model.Format import core.model.ImportParams import core.model.JapaneseLyricsType +import core.model.ProjectContainer import core.process.lyrics.japanese.analyseJapaneseLyricsTypeForProject -import core.process.lyrics.japanese.convertJapaneseLyrics as convertJapaneseLyricsBase import kotlinx.coroutines.DelicateCoroutinesApi import kotlinx.coroutines.GlobalScope import kotlinx.coroutines.promise @@ -17,6 +16,7 @@ import kotlinx.serialization.decodeFromString import kotlinx.serialization.json.Json import org.w3c.files.File import kotlin.js.Promise +import core.process.lyrics.japanese.convertJapaneseLyrics as convertJapaneseLyricsBase @JsExport fun parseVsqx(file: File): Promise = parse(listOf(file), Format.Vsqx) @@ -124,7 +124,7 @@ fun convertJapaneseLyrics( project: ProjectContainer, fromType: JapaneseLyricsType, targetType: JapaneseLyricsType, - convertVowelConnections: Boolean + convertVowelConnections: Boolean, ): ProjectContainer { val baseProject = project.project val newProject = core.model.Project( diff --git a/core/src/main/kotlin/core/exception/CannotReadFileException.kt b/core/src/main/kotlin/core/exception/CannotReadFileException.kt index e791bfb..d2fb139 100644 --- a/core/src/main/kotlin/core/exception/CannotReadFileException.kt +++ b/core/src/main/kotlin/core/exception/CannotReadFileException.kt @@ -1,3 +1,5 @@ package core.exception +@OptIn(ExperimentalJsExport::class) +@JsExport class CannotReadFileException : Throwable() diff --git a/core/src/main/kotlin/core/exception/EmptyProjectException.kt b/core/src/main/kotlin/core/exception/EmptyProjectException.kt index c8d98e4..43212c2 100644 --- a/core/src/main/kotlin/core/exception/EmptyProjectException.kt +++ b/core/src/main/kotlin/core/exception/EmptyProjectException.kt @@ -1,3 +1,5 @@ package core.exception +@OptIn(ExperimentalJsExport::class) +@JsExport class EmptyProjectException : Throwable("This format could not take en empty project.") diff --git a/core/src/main/kotlin/core/exception/IllegalFileException.kt b/core/src/main/kotlin/core/exception/IllegalFileException.kt index 75e1e7f..5d8c488 100644 --- a/core/src/main/kotlin/core/exception/IllegalFileException.kt +++ b/core/src/main/kotlin/core/exception/IllegalFileException.kt @@ -1,5 +1,7 @@ package core.exception +@OptIn(ExperimentalJsExport::class) +@JsExport sealed class IllegalFileException(message: String) : Throwable(message) { class UnknownVsqVersion : IllegalFileException("Cannot identify the version of the loaded vsqx file.") class XmlRootNotFound : IllegalFileException("The root element is not found in the xml file.") diff --git a/core/src/main/kotlin/core/exception/IllegalNotePositionException.kt b/core/src/main/kotlin/core/exception/IllegalNotePositionException.kt index 1bb0b7b..c80be2d 100644 --- a/core/src/main/kotlin/core/exception/IllegalNotePositionException.kt +++ b/core/src/main/kotlin/core/exception/IllegalNotePositionException.kt @@ -2,6 +2,8 @@ package core.exception import core.model.Note -class IllegalNotePositionException(note: Note, trackIndex: Int) : Throwable( +@OptIn(ExperimentalJsExport::class) +@JsExport +class IllegalNotePositionException(@Suppress("NON_EXPORTABLE_TYPE") note: Note, trackIndex: Int) : Throwable( "Failed to import because note with illegal position(${note.tickOn}) exists in Track No.${trackIndex + 1}", ) diff --git a/core/src/main/kotlin/core/exception/NotesOverlappingException.kt b/core/src/main/kotlin/core/exception/NotesOverlappingException.kt index 98ce791..7295e40 100644 --- a/core/src/main/kotlin/core/exception/NotesOverlappingException.kt +++ b/core/src/main/kotlin/core/exception/NotesOverlappingException.kt @@ -1,5 +1,7 @@ package core.exception +@OptIn(ExperimentalJsExport::class) +@JsExport class NotesOverlappingException : Throwable( "Failed to process because there are notes overlapping with each other.", ) diff --git a/core/src/main/kotlin/core/exception/UnsupportedFileFormatError.kt b/core/src/main/kotlin/core/exception/UnsupportedFileFormatError.kt index 534148e..bc04dee 100644 --- a/core/src/main/kotlin/core/exception/UnsupportedFileFormatError.kt +++ b/core/src/main/kotlin/core/exception/UnsupportedFileFormatError.kt @@ -1,5 +1,9 @@ package core.exception +@OptIn(ExperimentalJsExport::class) +@JsExport open class UnsupportedFileFormatError : Exception() +@OptIn(ExperimentalJsExport::class) +@JsExport class UnsupportedLegacyPpsfError : UnsupportedFileFormatError() diff --git a/core/src/main/kotlin/core/exception/ValueTooLargeException.kt b/core/src/main/kotlin/core/exception/ValueTooLargeException.kt index 1041d6c..0a7665f 100644 --- a/core/src/main/kotlin/core/exception/ValueTooLargeException.kt +++ b/core/src/main/kotlin/core/exception/ValueTooLargeException.kt @@ -1,5 +1,7 @@ package core.exception +@OptIn(ExperimentalJsExport::class) +@JsExport class ValueTooLargeException(value: String, maxValue: String) : Throwable( "Given value $value is larger than the maximum: $maxValue.", )