commonMain.schemas.TableSchema.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of lf-kotlin-js Show documentation
Show all versions of lf-kotlin-js Show documentation
Kotlin integration for Lightweightform
package pt.lightweightform.lfkotlin.schemas
import pt.lightweightform.lfkotlin.AllowedValues
import pt.lightweightform.lfkotlin.Bound
import pt.lightweightform.lfkotlin.ComputedValue
import pt.lightweightform.lfkotlin.InitialValue
import pt.lightweightform.lfkotlin.IsRequired
import pt.lightweightform.lfkotlin.Schema
import pt.lightweightform.lfkotlin.Validation
internal expect fun tableSchemaImpl(
rowsSchema: ClassSchema,
isNullable: Boolean,
initialValue: Array?,
computedInitialValue: InitialValue?>?,
computedValue: ComputedValue?>?,
mismatchedComputedCode: String?,
isClientOnly: Boolean?,
isRequired: Boolean?,
computedIsRequired: IsRequired?,
isRequiredCode: String?,
allowedValues: List>?,
computedAllowedValues: AllowedValues>?,
disallowedValueCode: String?,
minSize: Int?,
computedMinSize: Bound?,
minSizeCode: String?,
maxSize: Int?,
computedMaxSize: Bound?,
maxSizeCode: String?,
validations: List>>?,
initialState: Map?,
extra: Map?
): Schema?>
/** Creates a table schema. Maps to a schema of type "table" in LF. */
@Suppress("UNCHECKED_CAST")
public fun tableSchema(
rowsSchema: ClassSchema,
initialValue: Array? = null,
computedInitialValue: InitialValue>? = null,
computedValue: ComputedValue>? = null,
mismatchedComputedCode: String? = null,
isClientOnly: Boolean? = null,
allowedValues: List>? = null,
computedAllowedValues: AllowedValues>? = null,
disallowedValueCode: String? = null,
minSize: Int? = null,
computedMinSize: Bound? = null,
minSizeCode: String? = null,
maxSize: Int? = null,
computedMaxSize: Bound? = null,
maxSizeCode: String? = null,
validations: List>>? = null,
initialState: Map? = null,
extra: Map? = null
): Schema> =
tableSchemaImpl(
rowsSchema,
false,
initialValue,
computedInitialValue,
computedValue as ComputedValue?>?,
mismatchedComputedCode,
isClientOnly,
null,
null,
null,
allowedValues,
computedAllowedValues,
disallowedValueCode,
minSize,
computedMinSize,
minSizeCode,
maxSize,
computedMaxSize,
maxSizeCode,
validations,
initialState,
extra
) as
Schema>
/**
* Creates a nullable table schema. Maps to a schema of type "table" with `isNullable` set to `true`
* in LF.
*/
public fun nullableTableSchema(
rowsSchema: ClassSchema,
initialValue: Array? = null,
computedInitialValue: InitialValue?>? = null,
computedValue: ComputedValue?>? = null,
mismatchedComputedCode: String? = null,
isClientOnly: Boolean? = null,
isRequired: Boolean? = null,
computedIsRequired: IsRequired? = null,
isRequiredCode: String? = null,
allowedValues: List>? = null,
computedAllowedValues: AllowedValues>? = null,
disallowedValueCode: String? = null,
minSize: Int? = null,
computedMinSize: Bound? = null,
minSizeCode: String? = null,
maxSize: Int? = null,
computedMaxSize: Bound? = null,
maxSizeCode: String? = null,
validations: List>>? = null,
initialState: Map? = null,
extra: Map? = null
): Schema?> =
tableSchemaImpl(
rowsSchema,
true,
initialValue,
computedInitialValue,
computedValue,
mismatchedComputedCode,
isClientOnly,
isRequired,
computedIsRequired,
isRequiredCode,
allowedValues,
computedAllowedValues,
disallowedValueCode,
minSize,
computedMinSize,
minSizeCode,
maxSize,
computedMaxSize,
maxSizeCode,
validations,
initialState,
extra
)
© 2015 - 2025 Weber Informatics LLC | Privacy Policy