-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #700 from CruGlobal/cyoaPageCollections
GT-2450 Add support for PageCollectionPages in CYOA tools
- Loading branch information
Showing
20 changed files
with
698 additions
and
87 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
module/parser/src/commonMain/kotlin/org/cru/godtools/shared/tool/parser/model/HasPages.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package org.cru.godtools.shared.tool.parser.model | ||
|
||
import kotlin.experimental.ExperimentalObjCRefinement | ||
import kotlin.js.ExperimentalJsExport | ||
import kotlin.js.JsExport | ||
import kotlin.js.JsName | ||
import kotlin.native.HiddenFromObjC | ||
import kotlin.reflect.KClass | ||
import org.ccci.gto.support.androidx.annotation.RestrictTo | ||
import org.ccci.gto.support.androidx.annotation.RestrictToScope | ||
import org.cru.godtools.shared.tool.parser.model.page.Page | ||
|
||
@JsExport | ||
@OptIn(ExperimentalJsExport::class, ExperimentalObjCRefinement::class) | ||
interface HasPages : Base { | ||
@JsName("_pages") | ||
val pages: List<Page> | ||
|
||
fun findPage(id: String?) = id?.let { pages.find { it.id == id } } | ||
|
||
@HiddenFromObjC | ||
@JsExport.Ignore | ||
@RestrictTo(RestrictToScope.LIBRARY) | ||
fun <T : Page> supportsPageType(type: KClass<T>): Boolean | ||
|
||
// region Kotlin/JS interop | ||
@HiddenFromObjC | ||
@JsName("pages") | ||
val jsPages get() = pages.toTypedArray() | ||
// endregion Kotlin/JS interop | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.