diff --git a/README.md b/README.md index 032b7ee4..6a77447e 100644 --- a/README.md +++ b/README.md @@ -14,30 +14,22 @@ * [Features](#features) * [About DataForge](#about-dataforge) * [Modules contained in this repository](#modules-contained-in-this-repository) - * [visionforge-core](#visionforge-core) - * [visionforge-fx](#visionforge-fx) - * [visionforge-gdml](#visionforge-gdml) - * [visionforge-markdown](#visionforge-markdown) - * [visionforge-plotly](#visionforge-plotly) - * [visionforge-server](#visionforge-server) - * [visionforge-solid](#visionforge-solid) - * [visionforge-threejs](#visionforge-threejs) -* [Visualization for External Systems](#visualization-for-external-systems) +* [Visualization for External Systems](#visualization-for-external-systems) * [Demonstrations](#demonstrations) - * [Simple Example - Solid Showcase](#simple-example---solid-showcase) - * [Full-Stack Application Example - Muon Monitor](#full-stack-application-example---muon-monitor-visualization) - * [GDML Example](#gdml-example) + * [Simple Example - Solid Showcase](#simple-example---solid-showcase) + * [Full-Stack Application Example - Muon Monitor](#full-stack-application-example---muon-monitor-visualization) + * [GDML Example](#gdml-example) ## Introduction -This repository contains a [DataForge](#about-dataforge)\-based framework -used for visualization in various scientific applications. +This repository contains a [DataForge](#about-dataforge)\-based framework +used for visualization in various scientific applications. -The main framework's use case for now is 3D visualization for particle physics experiments. +The main framework's use case for now is 3D visualization for particle physics experiments. Other applications including 2D plots are planned for the future. -The project is developed as a [Kotlin multiplatform](https://kotlinlang.org/docs/reference/multiplatform.html) +The project is developed as a [Kotlin multiplatform](https://kotlinlang.org/docs/reference/multiplatform.html) application, currently targeting browser JavaScript and JVM. ## Requirements @@ -62,39 +54,14 @@ Platform uses some of the concepts and modules of DataForge, including: `Meta`, `Provider`, and some others. To learn more about DataForge, please consult the following URLs: - * [Kotlin multiplatform implementation of DataForge](https://github.com/mipt-npm/dataforge-core) - * [DataForge documentation](http://npm.mipt.ru/dataforge/) - * [Original implementation of DataForge](https://bitbucket.org/Altavir/dataforge/src/default/) +* [Kotlin multiplatform implementation of DataForge](https://github.com/mipt-npm/dataforge-core) +* [DataForge documentation](http://npm.mipt.ru/dataforge/) +* [Original implementation of DataForge](https://bitbucket.org/Altavir/dataforge/src/default/) ## Modules contained in this repository -### visionforge-core - -Contains a general hierarchy of classes and interfaces useful for visualization. -This module is not specific to 3D-visualization. - -The `visionforge-core` module also includes configuration editors for JS (in `jsMain`) and JVM (in `jvmMain`). - -**Class diagram:** - -![](docs/images/class-diag-core.png) - -### visionforge-fx - -### visionforge-gdml - -GDML bindings for 3D visualization (to be moved to gdml project). - -### visionforge-markdown - -### visionforge-plotly - -### visionforge-server - -### visionforge-solid - -Includes common classes and serializers for 3D visualization, as well as Three.js and JavaFX implementations. +$modules **Class diagram:** @@ -103,26 +70,26 @@ Includes common classes and serializers for 3D visualization, as well as Three.j ##### Prototypes One of the important features of the framework is support for 3D object prototypes (sometimes -also referred to as templates). The idea is that prototype geometry can be rendered once and reused +also referred to as templates). The idea is that prototype geometry can be rendered once and reused for multiple objects. This helps to significantly decrease memory usage. -The `prototypes` property tree is defined in `SolidGroup` class via `PrototypeHolder` interface, and +The `prototypes` property tree is defined in `SolidGroup` class via `PrototypeHolder` interface, and `SolidReference` class helps to reuse a template object. ##### Styles -`VisionGroup` has a `styleSheet` property that can optionally define styles at the Group's +`VisionGroup` has a `styleSheet` property that can optionally define styles at the Group's level. Styles are applied to child (descendant) objects using `Vision.styles: List` property. ### visionforge-threejs -## Visualization for External Systems +## Visualization for External Systems The `visionforge` framework can be used to visualize geometry and events from external, non-Kotlin based systems, such as ROOT. This will require a plugin to convert data model of the external system to that of `visionforge`. Performing such integration is a work currently in progress. - + ## Demonstrations @@ -144,7 +111,7 @@ Some shapes will also periodically change their color and visibility. ### Full-Stack Application Example - Muon Monitor Visualization -A full-stack application example, showing the +A full-stack application example, showing the [Muon Monitor](http://npm.mipt.ru/en/projects/physics#mounMonitor) experiment set-up. [More details](demo/muon-monitor/README.md) @@ -156,7 +123,7 @@ A full-stack application example, showing the ### GDML Example -Visualization example for geometry defined as GDML file. +Visualization example for geometry defined as GDML file. [More details](demo/gdml/README.md) diff --git a/build.gradle.kts b/build.gradle.kts index 625efc2c..a81d1656 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,26 +1,23 @@ plugins { id("ru.mipt.npm.gradle.project") + id("org.jetbrains.kotlinx.kover") version "0.5.0-RC" } val dataforgeVersion by extra("0.5.2") val fxVersion by extra("11") -allprojects { +subprojects { + if (name.startsWith("visionforge")) apply() + repositories { - mavenLocal() - mavenCentral() maven("https://repo.kotlin.link") + mavenCentral() maven("https://maven.jzy3d.org/releases") } group = "space.kscience" - version = "0.2.0" -} + version = "0.2.0-dev-99" -subprojects { - if (name.startsWith("visionforge")) { - plugins.apply("maven-publish") - } } ksciencePublish { @@ -30,10 +27,10 @@ ksciencePublish { } apiValidation { - validationDisabled = true ignoredPackages.add("info.laht.threekt") } +readme.readmeTemplate = file("docs/templates/README-TEMPLATE.md") //workaround for https://youtrack.jetbrains.com/issue/KT-48273 rootProject.plugins.withType(org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootPlugin::class.java) { diff --git a/demo/gdml/build.gradle.kts b/demo/gdml/build.gradle.kts index ead65970..a6c3fb0a 100644 --- a/demo/gdml/build.gradle.kts +++ b/demo/gdml/build.gradle.kts @@ -16,6 +16,7 @@ kotlin { jvm { withJava() } + js { useCommonJs() browser { @@ -24,6 +25,7 @@ kotlin { } } } + sourceSets { commonMain { dependencies { diff --git a/demo/playground/build.gradle.kts b/demo/playground/build.gradle.kts index 8bad3769..61f4e033 100644 --- a/demo/playground/build.gradle.kts +++ b/demo/playground/build.gradle.kts @@ -47,8 +47,9 @@ kotlin { implementation(projects.visionforgeGdml) implementation(projects.visionforgePlotly) implementation(projects.visionforgeMarkdown) + implementation(projects.visionforgeTables) implementation(projects.cernRootLoader) - implementation(projects.jupyter.jupyterBase) + implementation(projects.jupyter) } } @@ -56,6 +57,7 @@ kotlin { dependencies { implementation(projects.ui.ring) implementation(projects.visionforgeThreejs) + compileOnly(npm("webpack-bundle-analyzer","4.5.0")) } } @@ -66,6 +68,9 @@ kotlin { implementation("com.github.Ricky12Awesome:json-schema-serialization:0.6.6") } } + all { + languageSettings.optIn("space.kscience.dataforge.misc.DFExperimental") + } } } diff --git a/demo/playground/src/jsMain/kotlin/playgroundMain.kt b/demo/playground/src/jsMain/kotlin/playgroundMain.kt index 0ea9abe5..3ad34867 100644 --- a/demo/playground/src/jsMain/kotlin/playgroundMain.kt +++ b/demo/playground/src/jsMain/kotlin/playgroundMain.kt @@ -3,10 +3,12 @@ import space.kscience.visionforge.markup.MarkupPlugin import space.kscience.visionforge.plotly.PlotlyPlugin import space.kscience.visionforge.ring.ThreeWithControlsPlugin import space.kscience.visionforge.runVisionClient +import space.kscience.visionforge.tables.TableVisionJsPlugin @DFExperimental fun main() = runVisionClient { plugin(ThreeWithControlsPlugin) plugin(PlotlyPlugin) plugin(MarkupPlugin) + plugin(TableVisionJsPlugin) } \ No newline at end of file diff --git a/demo/playground/src/jsMain/resources/css/common.css b/demo/playground/src/jsMain/resources/css/common.css deleted file mode 100644 index 316c4f0e..00000000 --- a/demo/playground/src/jsMain/resources/css/common.css +++ /dev/null @@ -1,40 +0,0 @@ -/* Remove default bullets */ -ul, .tree { - list-style-type: none; -} - -/* Style the caret/arrow */ -.tree-caret { - cursor: pointer; - user-select: none; /* Prevent text selection */ -} - -/* Create the caret/arrow with a unicode, and style it */ -.tree-caret::before { - content: "\25B6"; - color: black; - display: inline-block; - margin-right: 6px; -} - -/* Rotate the caret/arrow icon when clicked on (using JavaScript) */ -.tree-caret-down::before { - transform: rotate(90deg); -} - -ul, .tree { - list-style-type: none; -} - -i, .tree-caret{ - display: inline-block; - margin-right: 6px; -} - -.rotate { - transform: rotate(90deg); -} - -.tree-label-inactive { - color: gray; -} diff --git a/demo/playground/src/jsMain/resources/index.html b/demo/playground/src/jsMain/resources/index.html deleted file mode 100644 index 1917c33d..00000000 --- a/demo/playground/src/jsMain/resources/index.html +++ /dev/null @@ -1,16 +0,0 @@ - - - - - Playground - - - - - -
-

Playground

-
-
- - \ No newline at end of file diff --git a/demo/playground/src/jvmMain/kotlin/allThingsDemo.kt b/demo/playground/src/jvmMain/kotlin/allThingsDemo.kt new file mode 100644 index 00000000..0ff49d40 --- /dev/null +++ b/demo/playground/src/jvmMain/kotlin/allThingsDemo.kt @@ -0,0 +1,181 @@ +package space.kscience.visionforge.examples + +import kotlinx.html.h1 +import kotlinx.html.h2 +import space.kscience.dataforge.context.Context +import space.kscience.dataforge.values.ValueType +import space.kscience.plotly.layout +import space.kscience.plotly.models.ScatterMode +import space.kscience.plotly.models.TextPosition +import space.kscience.plotly.scatter +import space.kscience.tables.ColumnHeader +import space.kscience.visionforge.html.ResourceLocation +import space.kscience.visionforge.markup.markdown +import space.kscience.visionforge.plotly.PlotlyPlugin +import space.kscience.visionforge.plotly.plotly +import space.kscience.visionforge.solid.* +import space.kscience.visionforge.tables.TableVisionPlugin +import space.kscience.visionforge.tables.columnTable +import java.nio.file.Paths + +fun main() { + val context = Context { + plugin(Solids) + plugin(PlotlyPlugin) + plugin(TableVisionPlugin) + } + + context.makeVisionFile( + Paths.get("VisionForgeDemo.html"), + resourceLocation = ResourceLocation.EMBED + ) { + markdown { + //language=markdown + """ + # VisionForge + + This is a demo for current VisionForge features. This text is written in [MarkDown](https://github.com/JetBrains/markdown) + """.trimIndent() + } + + h2 { +"3D visualization with Three-js" } + vision("3D") { + solid { + box(100, 100, 100, name = "aBox") + } + } + + h2 { +"Interactive plots with Plotly" } + vision("plot") { + plotly { + scatter { + x(1, 2, 3, 4) + y(10, 15, 13, 17) + mode = ScatterMode.markers + name = "Team A" + text("A-1", "A-2", "A-3", "A-4", "A-5") + textposition = TextPosition.`top center` + textfont { + family = "Raleway, sans-serif" + } + marker { size = 12 } + } + + scatter { + x(2, 3, 4, 5) + y(10, 15, 13, 17) + mode = ScatterMode.lines + name = "Team B" + text("B-a", "B-b", "B-c", "B-d", "B-e") + textposition = TextPosition.`bottom center` + textfont { + family = "Times New Roman" + } + marker { size = 12 } + } + + layout { + title = "Data Labels Hover" + xaxis { + range(0.75..5.25) + } + legend { + y = 0.5 + font { + family = "Arial, sans-serif" + size = 20 + color("grey") + } + } + } + } + } + h2 { +"Interactive tables with Tabulator" } + vision("table") { + val x by ColumnHeader.value(ValueType.NUMBER) + val y by ColumnHeader.value(ValueType.NUMBER) + columnTable( + x to listOf(2, 3, 4, 5), + y to listOf(10, 15, 13, 17) + ) + } + markdown { + //language=markdown + """ + ## The code for everything above + ```kotlin + markdown { + //language=markdown + ""${'"'} + # VisionForge + + This is a demo for current VisionForge features. This text is written in [MarkDown](https://github.com/JetBrains/markdown) + ""${'"'}.trimIndent() + } + + h2 { +"3D visualization with Three-js" } + vision("3D") { + solid { + box(100, 100, 100, name = "aBox") + } + } + + h2 { +"Interactive plots with Plotly" } + vision("plot") { + plotly { + scatter { + x(1, 2, 3, 4) + y(10, 15, 13, 17) + mode = ScatterMode.markers + name = "Team A" + text("A-1", "A-2", "A-3", "A-4", "A-5") + textposition = TextPosition.`top center` + textfont { + family = "Raleway, sans-serif" + } + marker { size = 12 } + } + + scatter { + x(2, 3, 4, 5) + y(10, 15, 13, 17) + mode = ScatterMode.lines + name = "Team B" + text("B-a", "B-b", "B-c", "B-d", "B-e") + textposition = TextPosition.`bottom center` + textfont { + family = "Times New Roman" + } + marker { size = 12 } + } + + layout { + title = "Data Labels Hover" + xaxis { + range(0.75..5.25) + } + legend { + y = 0.5 + font { + family = "Arial, sans-serif" + size = 20 + color("grey") + } + } + } + } + } + h2 { +"Interactive tables with Tabulator" } + vision("table") { + val x by ColumnHeader.value(ValueType.NUMBER) + val y by ColumnHeader.value(ValueType.NUMBER) + columnTable( + x to listOf(2, 3, 4, 5), + y to listOf(10, 15, 13, 17) + ) + } + ``` + """.trimIndent() + } + } +} \ No newline at end of file diff --git a/demo/playground/src/jvmMain/kotlin/markdownDemo.kt b/demo/playground/src/jvmMain/kotlin/markdownDemo.kt deleted file mode 100644 index cb4b7cf0..00000000 --- a/demo/playground/src/jvmMain/kotlin/markdownDemo.kt +++ /dev/null @@ -1,91 +0,0 @@ -package space.kscience.visionforge.examples - -import kotlinx.html.div -import kotlinx.html.h1 -import space.kscience.dataforge.context.Context -import space.kscience.plotly.layout -import space.kscience.plotly.models.ScatterMode -import space.kscience.plotly.models.TextPosition -import space.kscience.plotly.scatter -import space.kscience.visionforge.html.ResourceLocation -import space.kscience.visionforge.markup.markdown -import space.kscience.visionforge.plotly.PlotlyPlugin -import space.kscience.visionforge.plotly.plotly -import space.kscience.visionforge.solid.* - -fun main() { - val context = Context { - plugin(Solids) - plugin(PlotlyPlugin) - } - - context.makeVisionFile(resourceLocation = ResourceLocation.SYSTEM) { - markdown { - //language=markdown - """ - # Section - - **TBD** - - ## Subsection - """.trimIndent() - } - - div { - h1 { +"Canvas" } - vision("canvas") { - solid { - box(100, 100, 100) - material { - emissiveColor("red") - } - } - } - } - - vision("plot") { - plotly { - scatter { - x(1, 2, 3, 4) - y(10, 15, 13, 17) - mode = ScatterMode.markers - name = "Team A" - text("A-1", "A-2", "A-3", "A-4", "A-5") - textposition = TextPosition.`top center` - textfont { - family = "Raleway, sans-serif" - } - marker { size = 12 } - } - - scatter { - x(2, 3, 4, 5) - y(10, 15, 13, 17) - mode = ScatterMode.lines - name = "Team B" - text("B-a", "B-b", "B-c", "B-d", "B-e") - textposition = TextPosition.`bottom center` - textfont { - family = "Times New Roman" - } - marker { size = 12 } - } - - layout { - title = "Data Labels Hover" - xaxis { - range(0.75..5.25) - } - legend { - y = 0.5 - font { - family = "Arial, sans-serif" - size = 20 - color("grey") - } - } - } - } - } - } -} \ No newline at end of file diff --git a/demo/playground/src/jvmMain/kotlin/serverExtensions.kt b/demo/playground/src/jvmMain/kotlin/serverExtensions.kt index 6d9ff46c..b8bb633a 100644 --- a/demo/playground/src/jvmMain/kotlin/serverExtensions.kt +++ b/demo/playground/src/jvmMain/kotlin/serverExtensions.kt @@ -24,10 +24,13 @@ public fun Context.makeVisionFile( title: String = "VisionForge page", resourceLocation: ResourceLocation = ResourceLocation.SYSTEM, show: Boolean = true, - content: VisionTagConsumer<*>.() -> Unit + content: VisionTagConsumer<*>.() -> Unit, ): Unit { val actualPath = visionManager.page(title, content = content).makeFile(path) { actualPath -> - mapOf("playground" to scriptHeader("js/visionforge-playground.js", resourceLocation, actualPath)) + mapOf( + "playground" to scriptHeader("js/visionforge-playground.js", resourceLocation, actualPath), + //"tables" to tabulatorCssHader + ) } if (show) Desktop.getDesktop().browse(actualPath.toFile().toURI()) } diff --git a/demo/playground/src/jvmMain/kotlin/tables.kt b/demo/playground/src/jvmMain/kotlin/tables.kt new file mode 100644 index 00000000..c386ffda --- /dev/null +++ b/demo/playground/src/jvmMain/kotlin/tables.kt @@ -0,0 +1,28 @@ +package space.kscience.visionforge.examples + +import space.kscience.dataforge.context.Context +import space.kscience.dataforge.values.ValueType +import space.kscience.tables.ColumnHeader +import space.kscience.tables.valueRow +import space.kscience.visionforge.html.ResourceLocation +import space.kscience.visionforge.tables.TableVisionPlugin +import space.kscience.visionforge.tables.table +import kotlin.math.pow + +fun main() { + val context = Context { + plugin(TableVisionPlugin) + } + val x by ColumnHeader.value(ValueType.NUMBER) + val y by ColumnHeader.value(ValueType.NUMBER) + + context.makeVisionFile(resourceLocation = ResourceLocation.SYSTEM) { + vision { + table(x, y) { + repeat(100) { + valueRow(x to it, y to it.toDouble().pow(2)) + } + } + } + } +} \ No newline at end of file diff --git a/demo/playground/webpack.config.d/01.ring.js b/demo/playground/webpack.config.d/01.ring.js index 41da041c..fbde1b41 100644 --- a/demo/playground/webpack.config.d/01.ring.js +++ b/demo/playground/webpack.config.d/01.ring.js @@ -1,3 +1,22 @@ const ringConfig = require('@jetbrains/ring-ui/webpack.config').config; -config.module.rules.push(...ringConfig.module.rules) \ No newline at end of file +config.module.rules.push(...ringConfig.module.rules) + +config.module.rules.push( + { + test: /\.css$/, + exclude: [ + 'D:\\Work\\Projects\\visionforge\\build\\js\\node_modules\\@jetbrains\\ring-ui' + ], + use: [ + { + loader: 'style-loader', + options: {} + }, + { + loader: 'css-loader', + options: {} + } + ] + } +) \ No newline at end of file diff --git a/demo/playground/webpack.config.d/02.bundle.js b/demo/playground/webpack.config.d/02.bundle.js new file mode 100644 index 00000000..947253ca --- /dev/null +++ b/demo/playground/webpack.config.d/02.bundle.js @@ -0,0 +1,10 @@ +const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin; + +module.exports = { + plugins: [ + new BundleAnalyzerPlugin({ + analyzerMode: "static", + reportFilename: "bundle-report.html" + }) + ] +} \ No newline at end of file diff --git a/docs/templates/ARTIFACT-TEMPLATE.md b/docs/templates/ARTIFACT-TEMPLATE.md new file mode 100644 index 00000000..91e09096 --- /dev/null +++ b/docs/templates/ARTIFACT-TEMPLATE.md @@ -0,0 +1,26 @@ +## Artifact: + +The Maven coordinates of this project are `${group}:${name}:${version}`. + +**Gradle Groovy:** +```gradle +repositories { + maven { url 'https://repo.kotlin.link' } + mavenCentral() +} + +dependencies { + implementation '${group}:${name}:${version}' +} +``` +**Gradle Kotlin DSL:** +```kotlin +repositories { + maven("https://repo.kotlin.link") + mavenCentral() +} + +dependencies { + implementation("${group}:${name}:${version}") +} +``` \ No newline at end of file diff --git a/docs/templates/README-TEMPLATE.md b/docs/templates/README-TEMPLATE.md new file mode 100644 index 00000000..775c2b12 --- /dev/null +++ b/docs/templates/README-TEMPLATE.md @@ -0,0 +1,138 @@ +[![JetBrains Research](https://jb.gg/badges/research.svg)](https://confluence.jetbrains.com/display/ALL/JetBrains+on+GitHub) +[![DOI](https://zenodo.org/badge/174502624.svg)](https://zenodo.org/badge/latestdoi/174502624) + +![Gradle build](https://github.com/mipt-npm/visionforge/workflows/Gradle%20build/badge.svg) + +[![Slack](https://img.shields.io/badge/slack-channel-green?logo=slack)](https://kotlinlang.slack.com/archives/CEXV2QWNM) + +# DataForge Visualization Platform + +## Table of Contents + +* [Introduction](#introduction) +* [Requirements](#requirements) +* [Features](#features) +* [About DataForge](#about-dataforge) +* [Modules contained in this repository](#modules-contained-in-this-repository) +* [Visualization for External Systems](#visualization-for-external-systems) +* [Demonstrations](#demonstrations) + * [Simple Example - Solid Showcase](#simple-example---solid-showcase) + * [Full-Stack Application Example - Muon Monitor](#full-stack-application-example---muon-monitor-visualization) + * [GDML Example](#gdml-example) + + +## Introduction + +This repository contains a [DataForge](#about-dataforge)\-based framework +used for visualization in various scientific applications. + +The main framework's use case for now is 3D visualization for particle physics experiments. +Other applications including 2D plots are planned for the future. + +The project is developed as a [Kotlin multiplatform](https://kotlinlang.org/docs/reference/multiplatform.html) +application, currently targeting browser JavaScript and JVM. + +## Requirements + +JVM backend requires JDK 11 or later + +## Features + +The main framework's features for now include: +- 3D visualization of complex experimental set-ups +- Event display such as particle tracks, etc. +- Scales up to few hundred thousands of elements +- Camera move, rotate, zoom-in and zoom-out +- Scene graph as an object tree with property editor +- Settings export and import +- Multiple platform support + +## About DataForge + +DataForge is a software framework for automated scientific data processing. DataForge Visualization +Platform uses some of the concepts and modules of DataForge, including: `Meta`, `Configuration`, `Context`, +`Provider`, and some others. + +To learn more about DataForge, please consult the following URLs: +* [Kotlin multiplatform implementation of DataForge](https://github.com/mipt-npm/dataforge-core) +* [DataForge documentation](http://npm.mipt.ru/dataforge/) +* [Original implementation of DataForge](https://bitbucket.org/Altavir/dataforge/src/default/) + + +## Modules contained in this repository + +$modules + +**Class diagram:** + +![](docs/images/class-diag-solid.png) + +##### Prototypes + +One of the important features of the framework is support for 3D object prototypes (sometimes +also referred to as templates). The idea is that prototype geometry can be rendered once and reused +for multiple objects. This helps to significantly decrease memory usage. + +The `prototypes` property tree is defined in `SolidGroup` class via `PrototypeHolder` interface, and +`SolidReference` class helps to reuse a template object. + +##### Styles + +`VisionGroup` has a `styleSheet` property that can optionally define styles at the Group's +level. Styles are applied to child (descendant) objects using `Vision.styles: List` property. + +### visionforge-threejs + +## Visualization for External Systems + +The `visionforge` framework can be used to visualize geometry and events from external, +non-Kotlin based systems, such as ROOT. This will require a plugin to convert data model +of the external system to that of `visionforge`. Performing such integration is a work +currently in progress. + + +## Demonstrations + +The `demo` module contains several example projects (demonstrations) of using the `visionforge` framework. +They are briefly described in this section, for more details please consult the corresponding per-project +README file. + +### Simple Example - Solid Showcase + +Contains a simple demonstration with a grid including a few shapes that you can rotate, move camera, and so on. +Some shapes will also periodically change their color and visibility. + +[More details](demo/solid-showcase/README.md) + +**Example view:** + +![](docs/images/solid-showcase.png) + + +### Full-Stack Application Example - Muon Monitor Visualization + +A full-stack application example, showing the +[Muon Monitor](http://npm.mipt.ru/en/projects/physics#mounMonitor) experiment set-up. + +[More details](demo/muon-monitor/README.md) + +**Example view:** + +![](docs/images/muon-monitor.png) + + +### GDML Example + +Visualization example for geometry defined as GDML file. + +[More details](demo/gdml/README.md) + +##### Example view: + +![](docs/images/gdml-demo.png) + + +## Thanks and references +The original three.js bindings were made by [Lars Ivar Hatledal](https://github.com/markaren), but the project is discontinued right now. + +All other libraries are explicitly shown as dependencies. We would like to express specific thanks to JetBrains Kotlin-JS team for consulting us during the work. diff --git a/jupyter/jupyter-base/build.gradle.kts b/jupyter/build.gradle.kts similarity index 100% rename from jupyter/jupyter-base/build.gradle.kts rename to jupyter/build.gradle.kts diff --git a/jupyter/jupyter-base/src/jvmMain/kotlin/JupyterPluginBase.kt b/jupyter/src/jvmMain/kotlin/JupyterPluginBase.kt similarity index 100% rename from jupyter/jupyter-base/src/jvmMain/kotlin/JupyterPluginBase.kt rename to jupyter/src/jvmMain/kotlin/JupyterPluginBase.kt diff --git a/jupyter/jupyter-base/src/jvmMain/kotlin/VisionForgeForNotebook.kt b/jupyter/src/jvmMain/kotlin/VisionForgeForNotebook.kt similarity index 100% rename from jupyter/jupyter-base/src/jvmMain/kotlin/VisionForgeForNotebook.kt rename to jupyter/src/jvmMain/kotlin/VisionForgeForNotebook.kt diff --git a/jupyter/visionforge-jupyter-gdml/build.gradle.kts b/jupyter/visionforge-jupyter-gdml/build.gradle.kts index afb08473..4a575602 100644 --- a/jupyter/visionforge-jupyter-gdml/build.gradle.kts +++ b/jupyter/visionforge-jupyter-gdml/build.gradle.kts @@ -33,7 +33,7 @@ kotlin { commonMain { dependencies { implementation(projects.visionforgeSolid) - implementation(projects.jupyter.jupyterBase) + implementation(projects.jupyter) } } jvmMain { diff --git a/settings.gradle.kts b/settings.gradle.kts index 6d3e5961..3ae9f6f9 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -1,9 +1,14 @@ +rootProject.name = "visionforge" + +enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS") +enableFeaturePreview("VERSION_CATALOGS") + pluginManagement { val toolsVersion: String by extra repositories { - //mavenLocal() + mavenLocal() maven("https://repo.kotlin.link") mavenCentral() gradlePluginPortal() @@ -17,16 +22,12 @@ pluginManagement { } } -rootProject.name = "visionforge" - -enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS") -enableFeaturePreview("VERSION_CATALOGS") - dependencyResolutionManagement { val toolsVersion: String by extra repositories { + mavenLocal() maven("https://repo.kotlin.link") mavenCentral() } @@ -53,6 +54,7 @@ include( ":cern-root-loader", ":visionforge-server", ":visionforge-plotly", + ":visionforge-tables", ":visionforge-markdown", ":demo:solid-showcase", ":demo:gdml", @@ -61,6 +63,6 @@ include( ":demo:playground", ":demo:plotly-fx", ":demo:js-playground", - ":jupyter:jupyter-base", + ":jupyter", ":jupyter:visionforge-jupyter-gdml" ) diff --git a/ui/ring/src/main/kotlin/space.kscience.visionforge.ring/ThreeViewWithControls.kt b/ui/ring/src/main/kotlin/space.kscience.visionforge.ring/ThreeViewWithControls.kt index 97c9a083..5cdcf5c0 100644 --- a/ui/ring/src/main/kotlin/space.kscience.visionforge.ring/ThreeViewWithControls.kt +++ b/ui/ring/src/main/kotlin/space.kscience.visionforge.ring/ThreeViewWithControls.kt @@ -82,8 +82,10 @@ public val ThreeCanvasWithControls: FC = fc("Three useEffect { props.context.launch { - solid = props.builderOfSolid.await().also { - it?.setAsRoot(props.context.visionManager) + solid = props.builderOfSolid.await() + //ensure that the solid is properly rooted + if(solid?.parent == null){ + solid?.setAsRoot(props.context.visionManager) } } } diff --git a/visionforge-core/build.gradle.kts b/visionforge-core/build.gradle.kts index ecd14331..227c80dc 100644 --- a/visionforge-core/build.gradle.kts +++ b/visionforge-core/build.gradle.kts @@ -4,12 +4,6 @@ plugins { val dataforgeVersion: String by rootProject.extra -kscience{ - useSerialization{ - json() - } -} - kotlin { sourceSets { commonMain { @@ -25,4 +19,14 @@ kotlin { } } } +} + +kscience{ + useSerialization{ + json() + } +} + +readme{ + maturity = ru.mipt.npm.gradle.Maturity.DEVELOPMENT } \ No newline at end of file diff --git a/visionforge-core/src/commonMain/kotlin/space/kscience/visionforge/VisionGroupBase.kt b/visionforge-core/src/commonMain/kotlin/space/kscience/visionforge/VisionGroupBase.kt index 873b5996..7c2af29e 100644 --- a/visionforge-core/src/commonMain/kotlin/space/kscience/visionforge/VisionGroupBase.kt +++ b/visionforge-core/src/commonMain/kotlin/space/kscience/visionforge/VisionGroupBase.kt @@ -163,6 +163,6 @@ internal class RootVisionGroup(override val manager: VisionManager) : VisionGrou * Designate this [VisionGroup] as a root and assign a [VisionManager] as its parent */ public fun Vision.setAsRoot(manager: VisionManager) { - if (parent != null) error("This Vision already has a parent. It could not be set as root") + if (parent != null) error("Vision $this already has a parent. It could not be set as root") parent = RootVisionGroup(manager) } \ No newline at end of file diff --git a/visionforge-core/src/commonMain/kotlin/space/kscience/visionforge/html/VisionTagConsumer.kt b/visionforge-core/src/commonMain/kotlin/space/kscience/visionforge/html/VisionTagConsumer.kt index c9bd6857..7a17f0f5 100644 --- a/visionforge-core/src/commonMain/kotlin/space/kscience/visionforge/html/VisionTagConsumer.kt +++ b/visionforge-core/src/commonMain/kotlin/space/kscience/visionforge/html/VisionTagConsumer.kt @@ -78,6 +78,10 @@ public abstract class VisionTagConsumer( } } + /** + * Insert a vision in this HTML. + * TODO replace by multi-receiver + */ @OptIn(DFExperimental::class) public inline fun TagConsumer.vision( name: Name, @@ -122,6 +126,8 @@ public abstract class VisionTagConsumer( public const val OUTPUT_FETCH_ATTRIBUTE: String = "data-output-fetch" public const val OUTPUT_CONNECT_ATTRIBUTE: String = "data-output-connect" + public const val OUTPUT_RENDERED: String = "data-output-rendered" + public const val OUTPUT_NAME_ATTRIBUTE: String = "data-output-name" public const val OUTPUT_ENDPOINT_ATTRIBUTE: String = "data-output-endpoint" public const val DEFAULT_ENDPOINT: String = "." diff --git a/visionforge-core/src/jsMain/kotlin/space/kscience/visionforge/VisionClient.kt b/visionforge-core/src/jsMain/kotlin/space/kscience/visionforge/VisionClient.kt index 2bd6dc84..c437a5d6 100644 --- a/visionforge-core/src/jsMain/kotlin/space/kscience/visionforge/VisionClient.kt +++ b/visionforge-core/src/jsMain/kotlin/space/kscience/visionforge/VisionClient.kt @@ -19,6 +19,7 @@ import space.kscience.visionforge.html.VisionTagConsumer.Companion.OUTPUT_CONNEC import space.kscience.visionforge.html.VisionTagConsumer.Companion.OUTPUT_ENDPOINT_ATTRIBUTE import space.kscience.visionforge.html.VisionTagConsumer.Companion.OUTPUT_FETCH_ATTRIBUTE import space.kscience.visionforge.html.VisionTagConsumer.Companion.OUTPUT_NAME_ATTRIBUTE +import space.kscience.visionforge.html.VisionTagConsumer.Companion.OUTPUT_RENDERED import kotlin.reflect.KClass import kotlin.time.Duration.Companion.milliseconds @@ -64,7 +65,8 @@ public class VisionClient : AbstractPlugin() { private fun renderVision(name: String, element: Element, vision: Vision?, outputMeta: Meta) { if (vision != null) { - val renderer = findRendererFor(vision) ?: error("Could nof find renderer for $vision") + val renderer = findRendererFor(vision) + ?: error("Could not find renderer for ${visionManager.encodeToString(vision)}") renderer.render(element, vision, outputMeta) element.attributes[OUTPUT_CONNECT_ATTRIBUTE]?.let { attr -> @@ -138,10 +140,15 @@ public class VisionClient : AbstractPlugin() { * Fetch from server and render a vision, described in a given with [VisionTagConsumer.OUTPUT_CLASS] class. */ public fun renderVisionIn(element: Element) { - val name = resolveName(element) ?: error("The element is not a vision output") - logger.info { "Found DF output with name $name" } if (!element.classList.contains(VisionTagConsumer.OUTPUT_CLASS)) error("The element $element is not an output element") + val name = resolveName(element) ?: error("The element is not a vision output") + if (element.attributes[OUTPUT_RENDERED]?.value == "true") { + logger.info { "VF output in element $element is already rendered" } + return + } else { + logger.info { "Rendering VF output with name $name" } + } val outputMeta = element.getEmbeddedData(VisionTagConsumer.OUTPUT_META_CLASS)?.let { VisionManager.defaultJson.decodeFromString(MetaSerializer, it) @@ -186,6 +193,7 @@ public class VisionClient : AbstractPlugin() { } else -> error("No embedded vision data / fetch url for $name") } + element.setAttribute(OUTPUT_RENDERED, "true") } override fun content(target: String): Map = if (target == ElementVisionRenderer.TYPE) mapOf( @@ -254,5 +262,5 @@ public fun runVisionClient(contextBuilder: ContextBuilder.() -> Unit) { val visionClient = context.fetch(VisionClient) window.asDynamic()[RENDER_FUNCTION_NAME] = visionClient::renderAllVisionsById - visionClient.renderAllVisions() + //visionClient.renderAllVisions() } \ No newline at end of file diff --git a/visionforge-fx/build.gradle.kts b/visionforge-fx/build.gradle.kts index 7b522fc4..26fa13c8 100644 --- a/visionforge-fx/build.gradle.kts +++ b/visionforge-fx/build.gradle.kts @@ -19,4 +19,8 @@ dependencies { implementation("eu.mihosoft.vrl.jcsg:jcsg:0.5.7") { exclude(module = "slf4j-simple") } +} + +readme{ + maturity = ru.mipt.npm.gradle.Maturity.PROTOTYPE } \ No newline at end of file diff --git a/visionforge-plotly/src/jsMain/kotlin/space/kscience/visionforge/plotly/plotlyJs.kt b/visionforge-plotly/src/jsMain/kotlin/space/kscience/visionforge/plotly/plotlyJs.kt index e0cea767..7406986b 100644 --- a/visionforge-plotly/src/jsMain/kotlin/space/kscience/visionforge/plotly/plotlyJs.kt +++ b/visionforge-plotly/src/jsMain/kotlin/space/kscience/visionforge/plotly/plotlyJs.kt @@ -31,20 +31,16 @@ public actual class PlotlyPlugin : VisionPlugin(), ElementVisionRenderer { override fun render(element: Element, vision: Vision, meta: Meta) { val plot = (vision as? VisionOfPlotly)?.plot ?: error("VisionOfPlotly expected but ${vision::class} found") val config = PlotlyConfig.read(meta) -// println(plot.meta) -// println(plot.data[0].toMeta()) element.plot(plot, config) } - override fun content(target: String): Map { - return when (target) { - ElementVisionRenderer.TYPE -> mapOf("plotly".asName() to this) - else -> super.content(target) - } + override fun content(target: String): Map = when (target) { + ElementVisionRenderer.TYPE -> mapOf("plotly".asName() to this) + else -> super.content(target) } public actual companion object : PluginFactory { - override val tag: PluginTag = PluginTag("vision.plotly", PluginTag.DATAFORGE_GROUP) + override val tag: PluginTag = PluginTag("vision.plotly.js", PluginTag.DATAFORGE_GROUP) override val type: KClass = PlotlyPlugin::class override fun invoke(meta: Meta, context: Context): PlotlyPlugin = PlotlyPlugin() } diff --git a/visionforge-plotly/src/jvmMain/kotlin/space/kscience/visionforge/plotly/plotlyHeaders.kt b/visionforge-plotly/src/jvmMain/kotlin/space/kscience/visionforge/plotly/plotlyHeaders.kt deleted file mode 100644 index 8c986125..00000000 --- a/visionforge-plotly/src/jvmMain/kotlin/space/kscience/visionforge/plotly/plotlyHeaders.kt +++ /dev/null @@ -1,22 +0,0 @@ -package space.kscience.visionforge.plotly - -//internal val plotlyScriptLocation = "js/visionforge-three.js" -// -///** -// * A header that stores/embeds plotly bundle and registers plotly renderer in the frontend -// */ -//@OptIn(DFExperimental::class) -//public fun plotlyHeader(location: ResourceLocation, filePath: Path? = null): HtmlFragment = { -// scriptHeader( -// plotlyScriptLocation, -// resourceLocation = location, -// htmlPath = filePath -// ).invoke(this) -// script { -// type = "text/javascript" -// unsafe { -// //language=JavaScript -// +"space.kscience.visionforge.plotly.loadPlotly()" -// } -// } -//} diff --git a/visionforge-plotly/src/jvmMain/kotlin/space/kscience/visionforge/plotly/plotlyJvm.kt b/visionforge-plotly/src/jvmMain/kotlin/space/kscience/visionforge/plotly/plotlyJvm.kt index 21522664..ad7be4f3 100644 --- a/visionforge-plotly/src/jvmMain/kotlin/space/kscience/visionforge/plotly/plotlyJvm.kt +++ b/visionforge-plotly/src/jvmMain/kotlin/space/kscience/visionforge/plotly/plotlyJvm.kt @@ -9,7 +9,7 @@ import space.kscience.dataforge.meta.Meta import space.kscience.visionforge.VisionPlugin import kotlin.reflect.KClass -public actual class PlotlyPlugin : VisionPlugin(), Plugin { +public actual class PlotlyPlugin : VisionPlugin() { override val tag: PluginTag get() = Companion.tag diff --git a/visionforge-solid/build.gradle.kts b/visionforge-solid/build.gradle.kts index 8b0b1dc2..e00830d5 100644 --- a/visionforge-solid/build.gradle.kts +++ b/visionforge-solid/build.gradle.kts @@ -3,7 +3,9 @@ plugins { } kscience{ - useSerialization() + useSerialization{ + json() + } } kotlin { @@ -14,4 +16,8 @@ kotlin { } } } +} + +readme{ + maturity = ru.mipt.npm.gradle.Maturity.DEVELOPMENT } \ No newline at end of file diff --git a/visionforge-tables/build.gradle.kts b/visionforge-tables/build.gradle.kts new file mode 100644 index 00000000..55c367c5 --- /dev/null +++ b/visionforge-tables/build.gradle.kts @@ -0,0 +1,40 @@ +plugins { + id("ru.mipt.npm.gradle.mpp") +} + +val tablesVersion = "0.1.4" + +kscience { + useSerialization() +} + +kotlin { + js { + useCommonJs() + binaries.library() + browser{ + commonWebpackConfig{ + cssSupport.enabled = true + } + } + } + + sourceSets { + commonMain { + dependencies { + api(project(":visionforge-core")) + api("space.kscience:tables-kt:${tablesVersion}") + } + } + jsMain { + dependencies { + implementation(npm("tabulator-tables", "5.0.1")) + implementation(npm("@types/tabulator-tables", "5.0.1")) + } + } + } +} + +readme{ + maturity = ru.mipt.npm.gradle.Maturity.PROTOTYPE +} \ No newline at end of file diff --git a/visionforge-tables/src/commonMain/kotlin/space/kscience/visionforge/tables/TableVisionPlugin.kt b/visionforge-tables/src/commonMain/kotlin/space/kscience/visionforge/tables/TableVisionPlugin.kt new file mode 100644 index 00000000..6e632147 --- /dev/null +++ b/visionforge-tables/src/commonMain/kotlin/space/kscience/visionforge/tables/TableVisionPlugin.kt @@ -0,0 +1,30 @@ +package space.kscience.visionforge.tables + +import kotlinx.serialization.modules.SerializersModule +import kotlinx.serialization.modules.polymorphic +import kotlinx.serialization.modules.subclass +import space.kscience.dataforge.context.Context +import space.kscience.dataforge.context.PluginFactory +import space.kscience.dataforge.context.PluginTag +import space.kscience.dataforge.meta.Meta +import space.kscience.visionforge.Vision +import space.kscience.visionforge.VisionManager +import space.kscience.visionforge.VisionPlugin +import kotlin.reflect.KClass + +public class TableVisionPlugin : VisionPlugin() { + override val tag: PluginTag get() = Companion.tag + + override val visionSerializersModule: SerializersModule + get() = SerializersModule { + polymorphic(Vision::class) { + subclass(VisionOfTable.serializer()) + } + } + + public companion object : PluginFactory { + override val tag: PluginTag = PluginTag("vision.table", PluginTag.DATAFORGE_GROUP) + override val type: KClass = TableVisionPlugin::class + override fun invoke(meta: Meta, context: Context): TableVisionPlugin = TableVisionPlugin() + } +} \ No newline at end of file diff --git a/visionforge-tables/src/commonMain/kotlin/space/kscience/visionforge/tables/VisionOfTable.kt b/visionforge-tables/src/commonMain/kotlin/space/kscience/visionforge/tables/VisionOfTable.kt new file mode 100644 index 00000000..a3147236 --- /dev/null +++ b/visionforge-tables/src/commonMain/kotlin/space/kscience/visionforge/tables/VisionOfTable.kt @@ -0,0 +1,113 @@ +package space.kscience.visionforge.tables + +import kotlinx.serialization.KSerializer +import kotlinx.serialization.SerialName +import kotlinx.serialization.Serializable +import kotlinx.serialization.descriptors.SerialDescriptor +import kotlinx.serialization.encoding.Decoder +import kotlinx.serialization.encoding.Encoder +import space.kscience.dataforge.meta.* +import space.kscience.dataforge.misc.DFExperimental +import space.kscience.dataforge.values.Null +import space.kscience.dataforge.values.Value +import space.kscience.dataforge.values.asValue +import space.kscience.tables.* +import space.kscience.visionforge.VisionBase +import space.kscience.visionforge.html.VisionOutput +import kotlin.jvm.JvmName +import kotlin.reflect.typeOf + +internal object ColumnHeaderSerializer : KSerializer> { + + override val descriptor: SerialDescriptor get() = MetaSerializer.descriptor + + override fun deserialize(decoder: Decoder): ColumnHeader { + val meta = decoder.decodeSerializableValue(MetaSerializer) + return SimpleColumnHeader(meta["name"].string!!, typeOf(), meta["meta"] ?: Meta.EMPTY) + } + + override fun serialize(encoder: Encoder, value: ColumnHeader) { + val meta = Meta { + "name" put value.name + "meta" put value.meta + } + encoder.encodeSerializableValue(MetaSerializer, meta) + } +} + +public val ColumnHeader.properties: ValueColumnScheme get() = ValueColumnScheme.read(meta) + +@Serializable +@SerialName("vision.table") +public class VisionOfTable( + override val headers: List<@Serializable(ColumnHeaderSerializer::class) ColumnHeader>, +) : VisionBase(), Rows { + + public var data: List + get() = meta.getIndexed("rows").entries.sortedBy { it.key?.toInt() }.map { it.value } + set(value) { + meta["rows"] = value + } + + public val rows: List get() = data.map(::MetaRow) + + override fun rowSequence(): Sequence> = rows.asSequence() +} + +/** + * Convert a table to a serializable vision + */ +@Suppress("UNCHECKED_CAST") +public fun Table.toVision( + converter: (T?) -> Value, +): VisionOfTable = VisionOfTable(headers as TableHeader).also { vision -> + vision.data = rows.map { row -> + if (row is MetaRow) { + row.meta + } else { + Meta { + headers.forEach { + it.name put converter(row[it.name]) + } + } + } + } +} + +@JvmName("valueTableToVision") +public fun Table.toVision(): VisionOfTable = toVision { it ?: Null } + +@JvmName("stringTableToVision") +public fun Table.toVision(): VisionOfTable = toVision { (it ?: "").asValue() } + +@JvmName("numberTableToVision") +public fun Table.toVision(): VisionOfTable = toVision { (it ?: Double.NaN).asValue() } + +@DFExperimental +public inline fun VisionOutput.table( + vararg headers: ColumnHeader, + block: MutableRowTable.() -> Unit, +): VisionOfTable = RowTable(*headers, block = block).toVision() + +@DFExperimental +public inline fun VisionOutput.columnTable( + columnSize: UInt, + block: MutableColumnTable.() -> Unit, +): VisionOfTable = ColumnTable(columnSize, block).toVision() + +@DFExperimental +public fun VisionOutput.columnTable( + vararg dataAndHeaders: Pair, List>, +): VisionOfTable { + val columns = dataAndHeaders.map { (header, data) -> + ListColumn(header, data.map { Value.of(it) }) + } + return ColumnTable(columns).toVision() +} + +//public val tabulatorCssHader: HtmlFragment = { +// link { +// href = "https://unpkg.com/tabulator-tables@5.0.10/dist/css/tabulator.min.css" +// rel = "stylesheet" +// } +//} \ No newline at end of file diff --git a/visionforge-tables/src/commonTest/kotlin/space/kscience/visionforge/tables/VisionOfTableTest.kt b/visionforge-tables/src/commonTest/kotlin/space/kscience/visionforge/tables/VisionOfTableTest.kt new file mode 100644 index 00000000..5796d8e2 --- /dev/null +++ b/visionforge-tables/src/commonTest/kotlin/space/kscience/visionforge/tables/VisionOfTableTest.kt @@ -0,0 +1,32 @@ +package space.kscience.visionforge.tables + +import space.kscience.dataforge.values.Value +import space.kscience.dataforge.values.asValue +import space.kscience.dataforge.values.double +import space.kscience.dataforge.values.int +import space.kscience.tables.ColumnHeader +import space.kscience.tables.ColumnTable +import space.kscience.tables.get +import kotlin.math.pow +import kotlin.test.Test +import kotlin.test.assertEquals + +internal class VisionOfTableTest { + @Test + fun tableSerialization() { + val x by ColumnHeader.typed() + val y by ColumnHeader.typed() + + val table = ColumnTable(100U) { + x.fill { it.asValue() } + y.values = x.values.map { it?.double?.pow(2)?.asValue() } + } + + val vision = table.toVision() + //println(Json.encodeToString(VisionOfTable.serializer(), table.toVision())) + + val rows = vision.rowSequence().toList() + + assertEquals(50, rows[50][x]?.int) + } +} \ No newline at end of file diff --git a/visionforge-tables/src/jsMain/kotlin/space/kscience/visionforge/tables/TableVisionJsPlugin.kt b/visionforge-tables/src/jsMain/kotlin/space/kscience/visionforge/tables/TableVisionJsPlugin.kt new file mode 100644 index 00000000..42525847 --- /dev/null +++ b/visionforge-tables/src/jsMain/kotlin/space/kscience/visionforge/tables/TableVisionJsPlugin.kt @@ -0,0 +1,96 @@ +package space.kscience.visionforge.tables + +import kotlinext.js.jso +import org.w3c.dom.Element +import org.w3c.dom.HTMLElement +import space.kscience.dataforge.context.AbstractPlugin +import space.kscience.dataforge.context.Context +import space.kscience.dataforge.context.PluginFactory +import space.kscience.dataforge.context.PluginTag +import space.kscience.dataforge.meta.DynamicMeta +import space.kscience.dataforge.meta.Meta +import space.kscience.dataforge.meta.toDynamic +import space.kscience.dataforge.names.Name +import space.kscience.dataforge.names.asName +import space.kscience.visionforge.ElementVisionRenderer +import space.kscience.visionforge.Vision +import space.kscience.visionforge.VisionClient +import tabulator.Tabulator +import tabulator.TabulatorFull +import kotlin.reflect.KClass + +public class TableVisionJsPlugin : AbstractPlugin(), ElementVisionRenderer { + public val visionClient: VisionClient by require(VisionClient) + public val tablesBase: TableVisionPlugin by require(TableVisionPlugin) + + override val tag: PluginTag get() = Companion.tag + + override fun attach(context: Context) { + super.attach(context) + kotlinext.js.require("tabulator-tables/dist/css/tabulator.min.css") + kotlinext.js.require("tabulator-tables/src/js/modules/ResizeColumns/ResizeColumns.js") + } + + override fun rateVision(vision: Vision): Int = when (vision) { + is VisionOfTable -> ElementVisionRenderer.DEFAULT_RATING + else -> ElementVisionRenderer.ZERO_RATING + } + + override fun render(element: Element, vision: Vision, meta: Meta) { + val table: VisionOfTable = (vision as? VisionOfTable) + ?: error("VisionOfTable expected but ${vision::class} found") + + val tableOptions = jso { + columns = table.headers.map { header -> + jso { + field = header.name + title = header.properties.title ?: header.name + resizable = true + } + }.toTypedArray() + + columns = Array(table.headers.size + 1){ + if(it==0){ + jso { + field = "@index" + title = "#" + resizable = false + } + } else { + val header = table.headers[it-1] + jso { + field = header.name + title = header.properties.title ?: header.name + resizable = true + } + } + } + + + data = table.rows.mapIndexed { index, row-> + val d = row.meta.toDynamic() + d["@index"] = index + d + }.toTypedArray() + + //layout = "fitColumns" + + pagination = true + paginationSize = 10 + paginationSizeSelector = arrayOf(10, 25, 50, 100) + } + + TabulatorFull(element as HTMLElement, tableOptions) + } + + override fun content(target: String): Map = when (target) { + ElementVisionRenderer.TYPE -> mapOf("table".asName() to this) + else -> super.content(target) + } + + public companion object : PluginFactory { + override val tag: PluginTag = PluginTag("vision.table.js", PluginTag.DATAFORGE_GROUP) + override val type: KClass = TableVisionJsPlugin::class + override fun invoke(meta: Meta, context: Context): TableVisionJsPlugin = TableVisionJsPlugin() + } +} \ No newline at end of file diff --git a/visionforge-tables/src/jsMain/kotlin/tabulator/Tabulator.kt b/visionforge-tables/src/jsMain/kotlin/tabulator/Tabulator.kt new file mode 100644 index 00000000..f6efd32a --- /dev/null +++ b/visionforge-tables/src/jsMain/kotlin/tabulator/Tabulator.kt @@ -0,0 +1,2347 @@ +@file:Suppress("INTERFACE_WITH_SUPERCLASS", + "OVERRIDING_FINAL_MEMBER", + "RETURN_TYPE_MISMATCH_ON_OVERRIDE", + "CONFLICTING_OVERLOADS", + "NO_EXPLICIT_VISIBILITY_IN_API_MODE_WARNING") + +@file:JsModule("tabulator-tables") + +package tabulator + +import org.w3c.dom.Element +import org.w3c.dom.HTMLElement +import org.w3c.dom.events.MouseEvent +import org.w3c.dom.events.UIEvent +import tabulator.Tabulator.* +import kotlin.js.Promise + +external interface EventCallBackMethods { + var validationFailed: (cell: CellComponent, value: Any, validators: Array) -> Unit + var scrollHorizontal: (left: Number) -> Unit + var scrollVertical: (top: Number) -> Unit + var rowAdded: (row: RowComponent) -> Unit + var rowDeleted: (row: RowComponent) -> Unit + var rowMoved: (row: RowComponent) -> Unit + var rowUpdated: (row: RowComponent) -> Unit + var rowSelectionChanged: () -> Unit + var rowSelected: (row: RowComponent) -> Unit + var rowDeselected: (row: RowComponent) -> Unit + var rowResized: (row: RowComponent) -> Unit + var rowClick: (event: UIEvent, row: RowComponent) -> Unit + var rowDblClick: (event: UIEvent, row: RowComponent) -> Unit + var rowContext: (event: UIEvent, row: RowComponent) -> Unit + var rowTap: (event: UIEvent, row: RowComponent) -> Unit + var rowDblTap: (event: UIEvent, row: RowComponent) -> Unit + var rowTapHold: (event: UIEvent, row: RowComponent) -> Unit + var rowMouseEnter: (event: UIEvent, row: RowComponent) -> Unit + var rowMouseLeave: (event: UIEvent, row: RowComponent) -> Unit + var rowMouseOver: (event: UIEvent, row: RowComponent) -> Unit + var rowMouseOut: (event: UIEvent, row: RowComponent) -> Unit + var rowMouseMove: (event: UIEvent, row: RowComponent) -> Unit + var htmlImporting: () -> Unit + var htmlImported: () -> Unit + var ajaxError: () -> Unit + var clipboardCopied: (clipboard: String) -> Unit + var clipboardPasted: (clipboard: String, rowData: Array, rows: Array) -> Unit + var clipboardPasteError: (clipboard: String) -> Unit + var downloadComplete: () -> Unit + var dataTreeRowExpanded: (row: RowComponent, level: Number) -> Unit + var dataTreeRowCollapsed: (row: RowComponent, level: Number) -> Unit + var pageLoaded: (pageNo: Number) -> Unit + var headerClick: (event: UIEvent, column: ColumnComponent) -> Unit + var headerDblClick: (event: UIEvent, column: ColumnComponent) -> Unit + var headerContext: (event: UIEvent, column: ColumnComponent) -> Unit + var headerTap: (event: UIEvent, column: ColumnComponent) -> Unit + var headerDblTap: (event: UIEvent, column: ColumnComponent) -> Unit + var headerTapHold: (event: UIEvent, column: ColumnComponent) -> Unit + var groupClick: (event: UIEvent, group: GroupComponent) -> Unit + var groupDblClick: (event: UIEvent, group: GroupComponent) -> Unit + var groupContext: (event: UIEvent, group: GroupComponent) -> Unit + var groupTap: (event: UIEvent, group: GroupComponent) -> Unit + var groupDblTap: (event: UIEvent, group: GroupComponent) -> Unit + var groupTapHold: (event: UIEvent, group: GroupComponent) -> Unit + var tableBuilding: () -> Unit + var tableBuilt: () -> Unit + var dataLoading: (data: Array) -> Unit + var dataLoaded: (data: Array) -> Unit + var dataChanged: (data: Array) -> Unit + var dataFiltering: (filters: Array) -> Unit + var dataFiltered: (filters: Array, rows: Array) -> Unit + var dataSorting: (sorters: Sorter) -> Unit + var dataSorted: (sorters: Sorter, rows: Array) -> Unit + var movableRowsSendingStart: (toTables: Array) -> Unit + var movableRowsSent: (fromRow: RowComponent, toRow: RowComponent, toTable: Tabulator) -> Unit + var movableRowsSentFailed: (fromRow: RowComponent, toRow: RowComponent, toTable: Tabulator) -> Unit + var movableRowsSendingStop: (toTables: Array) -> Unit + var movableRowsReceivingStart: (fromRow: RowComponent, fromTable: Tabulator) -> Unit + var movableRowsReceived: (fromRow: RowComponent, toRow: RowComponent, fromTable: Tabulator) -> Unit + var movableRowsReceivedFailed: (fromRow: RowComponent, toRow: RowComponent, fromTable: Tabulator) -> Unit + var movableRowsReceivingStop: (fromTable: Tabulator) -> Unit + var movableRowsElementDrop: (event: UIEvent, element: Element, row: RowComponent) -> Unit + var dataGrouping: () -> Unit + var dataGrouped: (groups: Array) -> Unit + var groupVisibilityChanged: (group: GroupComponent, visible: Boolean) -> Unit + var localized: (locale: String, lang: Any) -> Unit + var renderStarted: () -> Unit + var renderComplete: () -> Unit + var columnMoved: (column: ColumnComponent, columns: Array) -> Unit + var columnResized: (column: ColumnComponent) -> Unit + var columnTitleChanged: (column: ColumnComponent) -> Unit + var columnVisibilityChanged: (column: ColumnComponent, visible: Boolean) -> Unit + var historyUndo: (action: String /* "cellEdit" | "rowAdd" | "rowDelete" | "rowMoved" */, component: Any, data: Array) -> Unit + var historyRedo: (action: String /* "cellEdit" | "rowAdd" | "rowDelete" | "rowMoved" */, component: Any, data: Array) -> Unit + var cellEditing: (cell: CellComponent) -> Unit + var cellEdited: (cell: CellComponent) -> Unit + var cellEditCancelled: (cell: CellComponent) -> Unit + var cellClick: (event: UIEvent, cell: CellComponent) -> Unit + var cellDblClick: (event: UIEvent, cell: CellComponent) -> Unit + var cellContext: (event: UIEvent, cell: CellComponent) -> Unit + var cellTap: (event: UIEvent, cell: CellComponent) -> Unit + var cellDblTap: (event: UIEvent, cell: CellComponent) -> Unit + var cellTapHold: (event: UIEvent, cell: CellComponent) -> Unit + var cellMouseEnter: (event: UIEvent, cell: CellComponent) -> Unit + var cellMouseLeave: (event: UIEvent, cell: CellComponent) -> Unit + var cellMouseOver: (event: UIEvent, cell: CellComponent) -> Unit + var cellMouseOut: (event: UIEvent, cell: CellComponent) -> Unit + var cellMouseMove: (event: UIEvent, cell: CellComponent) -> Unit + var dataLoadError: (error: Error) -> Unit + var dataProcessing: () -> Unit + var dataProcessed: () -> Unit +} + +external open class Tabulator { + constructor(selector: String, options: Options = definedExternally) + constructor(selector: String) + constructor(selector: HTMLElement, options: Options = definedExternally) + constructor(selector: HTMLElement) + + open var columnManager: Any + open var rowManager: Any + open var footerManager: Any + open var browser: String + open var browserSlow: Boolean + open var modules: Any + open var options: Options + open var element: HTMLElement + open var download: (downloadType: dynamic /* "csv" | "json" | "xlsx" | "pdf" | "html" | (columns: Array, data: Any, options: Any, setFileContents: Any) -> Any */, fileName: String, params: DownloadOptions, filter: String /* "visible" | "active" | "selected" | "all" */) -> Unit + open var downloadToTab: (downloadType: String /* "csv" | "json" | "xlsx" | "pdf" | "html" */, fileName: String, params: DownloadOptions) -> Unit + open var copyToClipboard: (rowRangeLookup: String /* "visible" | "active" | "selected" | "all" */) -> Unit + open var undo: () -> Boolean + open var getHistoryUndoSize: () -> dynamic + open var redo: () -> Boolean + open var getHistoryRedoSize: () -> dynamic + open var getEditedCells: () -> Array + open var clearCellEdited: (clear: dynamic /* Tabulator.CellComponent | Array */) -> Unit + open var destroy: () -> Unit + open var setDataFromLocalFile: (extensions: String) -> Unit + open var setData: (data: Any, params: Any, config: Any) -> Promise + open var clearData: () -> Unit + open var getData: (activeOnly: String /* "visible" | "active" | "selected" | "all" */) -> Array + open var getDataCount: (activeOnly: String /* "visible" | "active" | "selected" | "all" */) -> Number + open var searchRows: (field: String, type: String /* "=" | "!=" | "like" | "<" | ">" | "<=" | ">=" | "in" | "regex" | "starts" | "ends" */, value: Any) -> Array + open var searchData: (field: String, type: String /* "=" | "!=" | "like" | "<" | ">" | "<=" | ">=" | "in" | "regex" | "starts" | "ends" */, value: Any) -> Array + open var getHtml: (rowRangeLookup: String /* "visible" | "active" | "selected" | "all" */, style: Boolean, config: AddditionalExportOptions) -> Any + open var print: (rowRangeLookup: String /* "visible" | "active" | "selected" | "all" */, style: Boolean, config: AddditionalExportOptions) -> Any + open var getAjaxUrl: () -> String + open var replaceData: (data: dynamic /* Array | String */, params: Any, config: Any) -> Promise + open var updateData: (data: Array) -> Promise + open var addData: (data: Array, addToTop: Boolean, positionTarget: dynamic /* RowComponent | HTMLElement | String | Number | Array | Array */) -> Promise + open var updateOrAddData: (data: Array) -> Promise> + open var getRow: (row: dynamic /* RowComponent | HTMLElement | String | Number | Array | Array */) -> RowComponent + open var getRowFromPosition: (position: Number, activeOnly: Boolean) -> RowComponent + open var deleteRow: (index: dynamic /* RowComponent | HTMLElement | String | Number | Array | Array | Array | Array */> */) -> Unit + open var addRow: (data: Any, addToTop: Boolean, positionTarget: dynamic /* RowComponent | HTMLElement | String | Number | Array | Array */) -> Promise + open var updateOrAddRow: (row: dynamic /* RowComponent | HTMLElement | String | Number | Array | Array */, data: Any) -> Promise + open var updateRow: (row: dynamic /* RowComponent | HTMLElement | String | Number | Array | Array */, data: Any) -> Boolean + open var scrollToRow: (row: dynamic /* RowComponent | HTMLElement | String | Number | Array | Array */, position: String /* "top" | "center" | "bottom" | "nearest" */, ifVisible: Boolean) -> Promise + open var moveRow: (fromRow: dynamic /* RowComponent | HTMLElement | String | Number | Array | Array */, toRow: dynamic /* RowComponent | HTMLElement | String | Number | Array | Array */, placeAboveTarget: Boolean) -> Unit + open var getRows: (activeOnly: String /* "visible" | "active" | "selected" | "all" */) -> Array + open var getRowPosition: (row: dynamic /* RowComponent | HTMLElement | String | Number | Array | Array */, activeOnly: Boolean) -> Number + open var setColumns: (definitions: Array) -> Unit + open var getColumns: (includeColumnGroups: Boolean) -> Array + open var getColumn: (column: dynamic /* ColumnComponent | ColumnDefinition | HTMLElement | String */) -> ColumnComponent + open var getColumnDefinitions: () -> Array + open var getColumnLayout: () -> Array + open var setColumnLayout: (layout: ColumnLayout) -> Unit + open var showColumn: (column: dynamic /* ColumnComponent | ColumnDefinition | HTMLElement | String */) -> Unit + open var hideColumn: (column: dynamic /* ColumnComponent | ColumnDefinition | HTMLElement | String */) -> Unit + open var toggleColumn: (column: dynamic /* ColumnComponent | ColumnDefinition | HTMLElement | String */) -> Unit + open var addColumn: (definition: ColumnDefinition, insertRightOfTarget: Boolean, positionTarget: dynamic /* ColumnComponent | ColumnDefinition | HTMLElement | String */) -> Promise + open var deleteColumn: (column: dynamic /* ColumnComponent | ColumnDefinition | HTMLElement | String */) -> Promise + open var moveColumn: (fromColumn: dynamic /* ColumnComponent | ColumnDefinition | HTMLElement | String */, toColumn: dynamic /* ColumnComponent | ColumnDefinition | HTMLElement | String */, after: Boolean) -> Unit + open var scrollToColumn: (column: dynamic /* ColumnComponent | ColumnDefinition | HTMLElement | String */, position: String /* "left" | "center" | "middle" | "right" */, ifVisible: Boolean) -> Promise + open var updateColumnDefinition: (column: dynamic /* ColumnComponent | ColumnDefinition | HTMLElement | String */, definition: ColumnDefinition) -> Promise + open var setLocale: (locale: dynamic /* String | Boolean */) -> Unit + open var getLocale: () -> String + open var getLang: (locale: String) -> Any + open var redraw: (force: Boolean) -> Unit + open var blockRedraw: () -> Unit + open var restoreRedraw: () -> Unit + open var setHeight: (height: dynamic /* Number | String */) -> Unit + open var setSort: (sortList: dynamic /* String | Array */, dir: String /* "asc" | "desc" */) -> Unit + open var getSorters: () -> Array + open var clearSort: () -> Unit + open var setFilter: (p1: dynamic /* String | Array | Array | (data: Any, filterParams: Any) -> Boolean */, p2: dynamic /* "=" | "!=" | "like" | "<" | ">" | "<=" | ">=" | "in" | "regex" | "starts" | "ends" | Any */, value: Any, filterParams: FilterParams) -> Unit + open var addFilter: FilterFunction + open var getFilters: (includeHeaderFilters: Boolean) -> Array + open var setHeaderFilterValue: (column: dynamic /* ColumnComponent | ColumnDefinition | HTMLElement | String */, value: String) -> Unit + open var setHeaderFilterFocus: (column: dynamic /* ColumnComponent | ColumnDefinition | HTMLElement | String */) -> Unit + open var getHeaderFilters: () -> Array + open var getHeaderFilterValue: (column: dynamic /* ColumnComponent | ColumnDefinition | HTMLElement | String */) -> String + open var removeFilter: FilterFunction + open var clearFilter: (includeHeaderFilters: Boolean) -> Unit + open var clearHeaderFilter: () -> Unit + open var selectRow: (lookup: dynamic /* Array | Array */> | "visible" | "active" | "selected" | "all" | Boolean */) -> Unit + open var deselectRow: (row: dynamic /* RowComponent | HTMLElement | String | Number | Array | Array */) -> Unit + open var toggleSelectRow: (row: dynamic /* RowComponent | HTMLElement | String | Number | Array | Array */) -> Unit + open var getSelectedRows: () -> Array + open var getSelectedData: () -> Array + open var setMaxPage: (max: Number) -> Unit + open var setPage: (page: dynamic /* Number | "first" | "prev" | "next" | "last" */) -> Promise + open var setPageToRow: (row: dynamic /* RowComponent | HTMLElement | String | Number | Array | Array */) -> Promise + open var setPageSize: (size: Number) -> Unit + open var getPageSize: () -> Number + open var previousPage: () -> Promise + open var nextPage: () -> Promise + open var getPage: () -> dynamic + open var getPageMax: () -> dynamic + open var setGroupBy: (groups: dynamic /* String | Array | (data: Any) -> Any */) -> Unit + open var setGroupStartOpen: (values: dynamic /* Boolean | (value: Any, count: Number, data: Any, group: Tabulator.GroupComponent) -> Boolean */) -> Unit + open var setGroupHeader: (values: dynamic /* (value: Any, count: Number, data: Any, group: Tabulator.GroupComponent) -> String | Array<(value: Any, count: Number, data: Any) -> String> */) -> Unit + open var getGroups: () -> Array + open var getGroupedData: (activeOnly: Boolean) -> Any + open var getCalcResults: () -> Any + open var recalc: () -> Unit + open var navigatePrev: () -> Unit + open var navigateNext: () -> Unit + open var navigateLeft: () -> Unit + open var navigateRight: () -> Unit + open var navigateUp: () -> Unit + open var navigateDown: () -> Unit + open var getInvalidCells: () -> Array + open var clearCellValidation: (clearType: dynamic /* Tabulator.CellComponent | Array */) -> Unit + open var validate: () -> dynamic + open var setGroupValues: (data: GroupValuesArg) -> Unit + open var refreshFilters: () -> Unit + open var clearHistory: () -> Unit + + // open var on: (event: K, callback: Any) -> Unit + // open var off: (event: K, callback: Any) -> Unit + interface Options : OptionsGeneral, OptionsMenu, OptionsHistory, OptionsLocale, OptionsDownload, OptionsColumns, + OptionsRows, OptionsData, OptionsSorting, OptionsFiltering, OptionsRowGrouping, OptionsPagination, + OptionsPersistentConfiguration, OptionsClipboard, OptionsDataTree, OptionsCells, OptionsDebug, OptionsHTML + + interface OptionsDebug { + var invalidOptionWarning: Boolean? + get() = definedExternally + set(value) = definedExternally + var debugInvalidOptions: Boolean? + get() = definedExternally + set(value) = definedExternally + } + + interface OptionsCells : CellCallbacks { + var validationFailed: ((cell: CellComponent, value: Any, validators: dynamic /* Array | Array */) -> Unit)? + get() = definedExternally + set(value) = definedExternally + } + + interface OptionsDataTree { + var dataTree: Boolean? + get() = definedExternally + set(value) = definedExternally + var dataTreeElementColumn: dynamic /* Boolean? | String? */ + get() = definedExternally + set(value) = definedExternally + var dataTreeBranchElement: dynamic /* Boolean? | String? */ + get() = definedExternally + set(value) = definedExternally + var dataTreeChildIndent: Number? + get() = definedExternally + set(value) = definedExternally + var dataTreeChildField: String? + get() = definedExternally + set(value) = definedExternally + var dataTreeCollapseElement: dynamic /* String? | HTMLElement? | Boolean? */ + get() = definedExternally + set(value) = definedExternally + var dataTreeExpandElement: dynamic /* String? | HTMLElement? | Boolean? */ + get() = definedExternally + set(value) = definedExternally + var dataTreeStartExpanded: dynamic /* Boolean? | Array? | ((row: RowComponent, level: Number) -> Boolean)? */ + get() = definedExternally + set(value) = definedExternally + var dataTreeSelectPropagate: Boolean? + get() = definedExternally + set(value) = definedExternally + var dataTreeFilter: Boolean? + get() = definedExternally + set(value) = definedExternally + var dataTreeSort: Boolean? + get() = definedExternally + set(value) = definedExternally + } + + interface OptionsClipboard { + var clipboard: dynamic /* Boolean? | "copy" | "paste" */ + get() = definedExternally + set(value) = definedExternally + var clipboardCopyRowRange: String? /* "visible" | "active" | "selected" | "all" */ + get() = definedExternally + set(value) = definedExternally + var clipboardCopyFormatter: dynamic /* "table" | ((type: String /* "plain" | "html" */, output: String) -> String)? */ + get() = definedExternally + set(value) = definedExternally + var clipboardCopyHeader: Boolean? + get() = definedExternally + set(value) = definedExternally + var clipboardPasteParser: dynamic /* String? | ((clipboard: Any) -> Array)? */ + get() = definedExternally + set(value) = definedExternally + var clipboardPasteAction: String? /* "insert" | "update" | "replace" */ + get() = definedExternally + set(value) = definedExternally + var clipboardCopyStyled: Boolean? + get() = definedExternally + set(value) = definedExternally + var clipboardCopyConfig: dynamic /* AddditionalExportOptions? | Boolean? */ + get() = definedExternally + set(value) = definedExternally + var clipboardCopied: (() -> Unit)? + get() = definedExternally + set(value) = definedExternally + var clipboardPasted: (() -> Unit)? + get() = definedExternally + set(value) = definedExternally + var clipboardPasteError: (() -> Unit)? + get() = definedExternally + set(value) = definedExternally + var groupHeaderClipboard: dynamic /* ((value: Any, count: Number, data: Any, group: GroupComponent) -> String)? | Array<(value: Any, count: Number, data: Any) -> String>? */ + get() = definedExternally + set(value) = definedExternally + var groupHeaderHtmlOutput: dynamic /* ((value: Any, count: Number, data: Any, group: GroupComponent) -> String)? | Array<(value: Any, count: Number, data: Any) -> String>? */ + get() = definedExternally + set(value) = definedExternally + } + + interface OptionsPersistentConfiguration { + var persistenceID: String? + get() = definedExternally + set(value) = definedExternally + var persistenceMode: dynamic /* "local" | "cookie" | Boolean? */ + get() = definedExternally + set(value) = definedExternally + var persistentLayout: Boolean? + get() = definedExternally + set(value) = definedExternally + var persistentSort: Boolean? + get() = definedExternally + set(value) = definedExternally + var persistentFilter: Boolean? + get() = definedExternally + set(value) = definedExternally + var persistence: dynamic /* Boolean? | PersistenceOptions? */ + get() = definedExternally + set(value) = definedExternally + var persistenceWriterFunc: ((id: String, type: String? /* "sort" | "filter" | "group" | "page" | "columns" */, data: Any) -> Any)? + get() = definedExternally + set(value) = definedExternally + var persistenceReaderFunc: ((id: String, type: String? /* "sort" | "filter" | "group" | "page" | "columns" */) -> Any)? + get() = definedExternally + set(value) = definedExternally + } + + interface PersistenceOptions { + var sort: Boolean? + get() = definedExternally + set(value) = definedExternally + var filter: Boolean? + get() = definedExternally + set(value) = definedExternally + var group: dynamic /* Boolean? | PersistenceGroupOptions? */ + get() = definedExternally + set(value) = definedExternally + var page: dynamic /* Boolean? | PersistencePageOptions? */ + get() = definedExternally + set(value) = definedExternally + var columns: dynamic /* Boolean? | Array? */ + get() = definedExternally + set(value) = definedExternally + } + + interface PersistenceGroupOptions { + var groupBy: Boolean? + get() = definedExternally + set(value) = definedExternally + var groupStartOpen: Boolean? + get() = definedExternally + set(value) = definedExternally + var groupHeader: Boolean? + get() = definedExternally + set(value) = definedExternally + } + + interface PersistencePageOptions { + var size: Boolean? + get() = definedExternally + set(value) = definedExternally + var page: Boolean? + get() = definedExternally + set(value) = definedExternally + } + + interface OptionsPagination { + var pagination: Boolean? + get() = definedExternally + set(value) = definedExternally + var paginationMode: String? /* "remote" | "local" */ + get() = definedExternally + set(value) = definedExternally + var paginationSize: Number? + get() = definedExternally + set(value) = definedExternally + var paginationSizeSelector: dynamic /* Boolean? | Array? | Array? */ + get() = definedExternally + set(value) = definedExternally + var paginationElement: dynamic /* HTMLElement? | String? */ + get() = definedExternally + set(value) = definedExternally + var dataReceiveParams: Record? + get() = definedExternally + set(value) = definedExternally + var dataSendParams: Record? + get() = definedExternally + set(value) = definedExternally + var paginationAddRow: String? /* "table" | "page" */ + get() = definedExternally + set(value) = definedExternally + var paginationButtonCount: Number? + get() = definedExternally + set(value) = definedExternally + var paginationInitialPage: Number? + get() = definedExternally + set(value) = definedExternally + } + + interface OptionsRowGrouping { + var groupBy: dynamic /* String? | Array? | ((data: Any) -> Any)? */ + get() = definedExternally + set(value) = definedExternally + var groupValues: GroupValuesArg? + get() = definedExternally + set(value) = definedExternally + var groupHeader: dynamic /* ((value: Any, count: Number, data: Any, group: GroupComponent) -> String)? | Array<(value: Any, count: Number, data: Any) -> String>? */ + get() = definedExternally + set(value) = definedExternally + var groupHeaderPrint: dynamic /* ((value: Any, count: Number, data: Any, group: GroupComponent) -> String)? | Array<(value: Any, count: Number, data: Any) -> String>? */ + get() = definedExternally + set(value) = definedExternally + var groupStartOpen: dynamic /* Boolean? | ((value: Any, count: Number, data: Any, group: GroupComponent) -> Boolean)? */ + get() = definedExternally + set(value) = definedExternally + var groupToggleElement: dynamic /* "arrow" | "header" | Boolean? */ + get() = definedExternally + set(value) = definedExternally + var groupClosedShowCalcs: Boolean? + get() = definedExternally + set(value) = definedExternally + var dataGrouping: (() -> Unit)? + get() = definedExternally + set(value) = definedExternally + var dataGrouped: (() -> Unit)? + get() = definedExternally + set(value) = definedExternally + var groupVisibilityChanged: ((group: GroupComponent, visible: Boolean) -> Unit)? + get() = definedExternally + set(value) = definedExternally + var groupClick: GroupEventCallback? + get() = definedExternally + set(value) = definedExternally + var groupDblClick: GroupEventCallback? + get() = definedExternally + set(value) = definedExternally + var groupContext: GroupEventCallback? + get() = definedExternally + set(value) = definedExternally + var groupTap: GroupEventCallback? + get() = definedExternally + set(value) = definedExternally + var groupDblTap: GroupEventCallback? + get() = definedExternally + set(value) = definedExternally + var groupTapHold: GroupEventCallback? + get() = definedExternally + set(value) = definedExternally + var groupUpdateOnCellEdit: Boolean? + get() = definedExternally + set(value) = definedExternally + } + + interface Filter { + var field: String + var type: String /* "=" | "!=" | "like" | "<" | ">" | "<=" | ">=" | "in" | "regex" | "starts" | "ends" */ + var value: Any + } + + interface FilterParams { + var separator: String? + get() = definedExternally + set(value) = definedExternally + var matchAll: Boolean? + get() = definedExternally + set(value) = definedExternally + } + + interface OptionsFiltering { + var initialFilter: Array? + get() = definedExternally + set(value) = definedExternally + var initialHeaderFilter: Array>? + get() = definedExternally + set(value) = definedExternally + var dataFiltering: ((filters: Array) -> Unit)? + get() = definedExternally + set(value) = definedExternally + var dataFiltered: ((filters: Array, rows: Array) -> Unit)? + get() = definedExternally + set(value) = definedExternally + var headerFilterLiveFilterDelay: Number? + get() = definedExternally + set(value) = definedExternally + } + + interface OptionsSorting { + var initialSort: Array? + get() = definedExternally + set(value) = definedExternally + var sortOrderReverse: Boolean? + get() = definedExternally + set(value) = definedExternally + } + + interface Sorter { + var column: String + var dir: String /* "asc" | "desc" */ + } + + interface SorterFromTable { + var column: ColumnComponent + var field: String + var dir: String /* "asc" | "desc" */ + } + + interface OptionsData { + var index: dynamic /* Number? | String? */ + get() = definedExternally + set(value) = definedExternally + var data: Array? + get() = definedExternally + set(value) = definedExternally + var ajaxURL: String? + get() = definedExternally + set(value) = definedExternally + var ajaxParams: Any? + get() = definedExternally + set(value) = definedExternally + var ajaxConfig: dynamic /* "GET" | "POST" | AjaxConfig? */ + get() = definedExternally + set(value) = definedExternally + var ajaxContentType: dynamic /* "form" | "json" | AjaxContentType? */ + get() = definedExternally + set(value) = definedExternally + var ajaxURLGenerator: ((url: String, config: Any, params: Any) -> String)? + get() = definedExternally + set(value) = definedExternally + var ajaxRequestFunc: ((url: String, config: Any, params: Any) -> Promise)? + get() = definedExternally + set(value) = definedExternally + var ajaxFiltering: Boolean? + get() = definedExternally + set(value) = definedExternally + var ajaxSorting: Boolean? + get() = definedExternally + set(value) = definedExternally + var progressiveLoad: String? /* "load" | "scroll" */ + get() = definedExternally + set(value) = definedExternally + var progressiveLoadDelay: Number? + get() = definedExternally + set(value) = definedExternally + var progressiveLoadScrollMargin: Number? + get() = definedExternally + set(value) = definedExternally + var ajaxLoader: dynamic /* Boolean? | (() -> Boolean)? */ + get() = definedExternally + set(value) = definedExternally + var ajaxLoaderLoading: String? + get() = definedExternally + set(value) = definedExternally + var ajaxLoaderError: String? + get() = definedExternally + set(value) = definedExternally + var ajaxRequesting: ((url: String, params: Any) -> Boolean)? + get() = definedExternally + set(value) = definedExternally + var ajaxResponse: ((url: String, params: Any, response: Any) -> Any)? + get() = definedExternally + set(value) = definedExternally + var ajaxError: ((xhr: Any, textStatus: Any, errorThrown: Any) -> Unit)? + get() = definedExternally + set(value) = definedExternally + var dataLoader: Boolean? + get() = definedExternally + set(value) = definedExternally + var dataLoaderLoading: String? + get() = definedExternally + set(value) = definedExternally + var dataLoaderError: String? + get() = definedExternally + set(value) = definedExternally + var sortMode: String? /* "remote" | "local" */ + get() = definedExternally + set(value) = definedExternally + var filterMode: String? /* "remote" | "local" */ + get() = definedExternally + set(value) = definedExternally + } + + interface AjaxContentType { + var headers: JSONRecord + var body: (url: String, config: Any, params: Any) -> Any + } + + interface AjaxConfig { + var method: String? /* "GET" | "POST" */ + get() = definedExternally + set(value) = definedExternally + var headers: JSONRecord? + get() = definedExternally + set(value) = definedExternally + var mode: String? + get() = definedExternally + set(value) = definedExternally + var credentials: String? + get() = definedExternally + set(value) = definedExternally + } + + interface OptionsRows { + var rowFormatter: ((row: RowComponent) -> Any)? + get() = definedExternally + set(value) = definedExternally + var rowFormatterPrint: dynamic /* Boolean? | ((row: RowComponent) -> Any)? */ + get() = definedExternally + set(value) = definedExternally + var rowFormatterHtmlOutput: dynamic /* Boolean? | ((row: RowComponent) -> Any)? */ + get() = definedExternally + set(value) = definedExternally + var rowFormatterClipboard: dynamic /* Boolean? | ((row: RowComponent) -> Any)? */ + get() = definedExternally + set(value) = definedExternally + var addRowPos: String? /* "bottom" | "top" */ + get() = definedExternally + set(value) = definedExternally + var selectable: dynamic /* Boolean? | Number? | "highlight" */ + get() = definedExternally + set(value) = definedExternally + var selectableRangeMode: String? /* "click" */ + get() = definedExternally + set(value) = definedExternally + var selectableRollingSelection: Boolean? + get() = definedExternally + set(value) = definedExternally + var selectablePersistence: Boolean? + get() = definedExternally + set(value) = definedExternally + var selectableCheck: ((row: RowComponent) -> Boolean)? + get() = definedExternally + set(value) = definedExternally + var movableRows: Boolean? + get() = definedExternally + set(value) = definedExternally + var movableRowsConnectedTables: dynamic /* String? | Array? | HTMLElement? | Array? */ + get() = definedExternally + set(value) = definedExternally + var movableRowsSender: dynamic /* Boolean? | "delete" | ((fromRow: RowComponent, toRow: RowComponent, toTable: Tabulator) -> Any)? */ + get() = definedExternally + set(value) = definedExternally + var movableRowsReceiver: dynamic /* "insert" | "add" | "update" | "replace" | ((fromRow: RowComponent, toRow: RowComponent, fromTable: Tabulator) -> Any)? */ + get() = definedExternally + set(value) = definedExternally + var movableRowsConnectedElements: dynamic /* String? | HTMLElement? */ + get() = definedExternally + set(value) = definedExternally + var movableRowsElementDrop: ((e: MouseEvent, element: HTMLElement, row: RowComponent) -> Any)? + get() = definedExternally + set(value) = definedExternally + var resizableRows: Boolean? + get() = definedExternally + set(value) = definedExternally + var scrollToRowPosition: String? /* "top" | "center" | "bottom" | "nearest" */ + get() = definedExternally + set(value) = definedExternally + var scrollToRowIfVisible: Boolean? + get() = definedExternally + set(value) = definedExternally + var dataTreeRowExpanded: ((row: RowComponent, level: Number) -> Unit)? + get() = definedExternally + set(value) = definedExternally + var dataTreeRowCollapsed: ((row: RowComponent, level: Number) -> Unit)? + get() = definedExternally + set(value) = definedExternally + var movableRowsSendingStart: ((toTables: Array) -> Unit)? + get() = definedExternally + set(value) = definedExternally + var movableRowsSent: ((fromRow: RowComponent, toRow: RowComponent, toTable: Tabulator) -> Unit)? + get() = definedExternally + set(value) = definedExternally + var movableRowsSentFailed: ((fromRow: RowComponent, toRow: RowComponent, toTable: Tabulator) -> Unit)? + get() = definedExternally + set(value) = definedExternally + var movableRowsSendingStop: ((toTables: Array) -> Unit)? + get() = definedExternally + set(value) = definedExternally + var movableRowsReceivingStart: ((fromRow: RowComponent, toTable: Tabulator) -> Unit)? + get() = definedExternally + set(value) = definedExternally + var movableRowsReceived: ((fromRow: RowComponent, toRow: RowComponent, fromTable: Tabulator) -> Unit)? + get() = definedExternally + set(value) = definedExternally + var movableRowsReceivedFailed: ((fromRow: RowComponent, toRow: RowComponent, fromTable: Tabulator) -> Unit)? + get() = definedExternally + set(value) = definedExternally + var movableRowsReceivingStop: ((fromTable: Tabulator) -> Unit)? + get() = definedExternally + set(value) = definedExternally + var rowClick: RowEventCallback? + get() = definedExternally + set(value) = definedExternally + var rowDblClick: RowEventCallback? + get() = definedExternally + set(value) = definedExternally + var rowContext: RowEventCallback? + get() = definedExternally + set(value) = definedExternally + var rowTap: RowEventCallback? + get() = definedExternally + set(value) = definedExternally + var rowDblTap: RowEventCallback? + get() = definedExternally + set(value) = definedExternally + var rowTapHold: RowEventCallback? + get() = definedExternally + set(value) = definedExternally + var rowMouseEnter: RowEventCallback? + get() = definedExternally + set(value) = definedExternally + var rowMouseLeave: RowEventCallback? + get() = definedExternally + set(value) = definedExternally + var rowMouseOver: RowEventCallback? + get() = definedExternally + set(value) = definedExternally + var rowMouseOut: RowEventCallback? + get() = definedExternally + set(value) = definedExternally + var rowMouseMove: RowEventCallback? + get() = definedExternally + set(value) = definedExternally + var rowAdded: RowChangedCallback? + get() = definedExternally + set(value) = definedExternally + var rowUpdated: RowChangedCallback? + get() = definedExternally + set(value) = definedExternally + var rowDeleted: RowChangedCallback? + get() = definedExternally + set(value) = definedExternally + var rowMoved: RowChangedCallback? + get() = definedExternally + set(value) = definedExternally + var rowResized: RowChangedCallback? + get() = definedExternally + set(value) = definedExternally + var rowSelectionChanged: ((data: Array, rows: Array) -> Unit)? + get() = definedExternally + set(value) = definedExternally + var rowSelected: RowChangedCallback? + get() = definedExternally + set(value) = definedExternally + var rowDeselected: RowChangedCallback? + get() = definedExternally + set(value) = definedExternally + var tabEndNewRow: dynamic /* Boolean? | JSONRecord? | ((row: RowComponent) -> Any)? */ + get() = definedExternally + set(value) = definedExternally + } + + interface OptionsColumns { + var columns: Array? + get() = definedExternally + set(value) = definedExternally + var autoColumns: Boolean? + get() = definedExternally + set(value) = definedExternally + var autoColumnsDefinitions: dynamic /* ((columnDefinitions: Array) -> Array)? | Array? | Record? */ + get() = definedExternally + set(value) = definedExternally + var layout: String? /* "fitData" | "fitColumns" | "fitDataFill" | "fitDataStretch" | "fitDataTable" */ + get() = definedExternally + set(value) = definedExternally + var layoutColumnsOnNewData: Boolean? + get() = definedExternally + set(value) = definedExternally + var responsiveLayout: dynamic /* Boolean? | "hide" | "collapse" */ + get() = definedExternally + set(value) = definedExternally + var responsiveLayoutCollapseStartOpen: Boolean? + get() = definedExternally + set(value) = definedExternally + var responsiveLayoutCollapseUseFormatters: Boolean? + get() = definedExternally + set(value) = definedExternally + var responsiveLayoutCollapseFormatter: ((data: Array) -> Any)? + get() = definedExternally + set(value) = definedExternally + var movableColumns: Boolean? + get() = definedExternally + set(value) = definedExternally + var columnHeaderVertAlign: String? /* "top" | "middle" | "bottom" */ + get() = definedExternally + set(value) = definedExternally + var scrollToColumnPosition: String? /* "left" | "center" | "middle" | "right" */ + get() = definedExternally + set(value) = definedExternally + var scrollToColumnIfVisible: Boolean? + get() = definedExternally + set(value) = definedExternally + var columnCalcs: dynamic /* Boolean? | "both" | "table" | "group" */ + get() = definedExternally + set(value) = definedExternally + var nestedFieldSeparator: dynamic /* String? | Boolean? */ + get() = definedExternally + set(value) = definedExternally + var columnHeaderSortMulti: Boolean? + get() = definedExternally + set(value) = definedExternally + var columnMoved: ((column: ColumnComponent, columns: Array) -> Unit)? + get() = definedExternally + set(value) = definedExternally + var columnResized: ((column: ColumnComponent) -> Unit)? + get() = definedExternally + set(value) = definedExternally + var columnVisibilityChanged: ((column: ColumnComponent, visible: Boolean) -> Unit)? + get() = definedExternally + set(value) = definedExternally + var columnTitleChanged: ((column: ColumnComponent) -> Unit)? + get() = definedExternally + set(value) = definedExternally + var headerVisible: Boolean? + get() = definedExternally + set(value) = definedExternally + var print: Boolean? + get() = definedExternally + set(value) = definedExternally + var headerSort: Boolean? + get() = definedExternally + set(value) = definedExternally + var headerSortElement: String? + get() = definedExternally + set(value) = definedExternally + var columnDefaults: ColumnDefinition? + get() = definedExternally + set(value) = definedExternally + } + + interface OptionsCell { + var cellClick: CellEventCallback? + get() = definedExternally + set(value) = definedExternally + var cellDblClick: CellEventCallback? + get() = definedExternally + set(value) = definedExternally + var cellContext: CellEventCallback? + get() = definedExternally + set(value) = definedExternally + var cellTap: CellEventCallback? + get() = definedExternally + set(value) = definedExternally + var cellDblTap: CellEventCallback? + get() = definedExternally + set(value) = definedExternally + var cellTapHold: CellEventCallback? + get() = definedExternally + set(value) = definedExternally + var cellMouseEnter: CellEventCallback? + get() = definedExternally + set(value) = definedExternally + var cellMouseLeave: CellEventCallback? + get() = definedExternally + set(value) = definedExternally + var cellMouseOver: CellEventCallback? + get() = definedExternally + set(value) = definedExternally + var cellMouseOut: CellEventCallback? + get() = definedExternally + set(value) = definedExternally + var cellMouseMove: CellEventCallback? + get() = definedExternally + set(value) = definedExternally + var cellEditing: CellEditEventCallback? + get() = definedExternally + set(value) = definedExternally + var cellEdited: CellEditEventCallback? + get() = definedExternally + set(value) = definedExternally + var cellEditCancelled: CellEditEventCallback? + get() = definedExternally + set(value) = definedExternally + } + + interface OptionsGeneral { + var height: dynamic /* String? | Number? | Boolean? */ + get() = definedExternally + set(value) = definedExternally + var maxHeight: dynamic /* String? | Number? */ + get() = definedExternally + set(value) = definedExternally + var minHeight: dynamic /* String? | Number? */ + get() = definedExternally + set(value) = definedExternally + var renderVertical: dynamic /* "virtual" | "basic" | Renderer? */ + get() = definedExternally + set(value) = definedExternally + var renderHorizontal: dynamic /* "virtual" | "basic" | Renderer? */ + get() = definedExternally + set(value) = definedExternally + var renderVerticalBuffer: dynamic /* Boolean? | Number? */ + get() = definedExternally + set(value) = definedExternally + var placeholder: dynamic /* String? | HTMLElement? */ + get() = definedExternally + set(value) = definedExternally + var footerElement: dynamic /* String? | HTMLElement? */ + get() = definedExternally + set(value) = definedExternally + var tooltipGenerationMode: String? /* "load" | "hover" */ + get() = definedExternally + set(value) = definedExternally + var keybindings: dynamic /* Boolean? | KeyBinding? */ + get() = definedExternally + set(value) = definedExternally + var reactiveData: Boolean? + get() = definedExternally + set(value) = definedExternally + var autoResize: Boolean? + get() = definedExternally + set(value) = definedExternally + var tableBuilding: (() -> Unit)? + get() = definedExternally + set(value) = definedExternally + var tableBuilt: (() -> Unit)? + get() = definedExternally + set(value) = definedExternally + var renderStarted: (() -> Unit)? + get() = definedExternally + set(value) = definedExternally + var renderComplete: (() -> Unit)? + get() = definedExternally + set(value) = definedExternally + var htmlImporting: EmptyCallback? + get() = definedExternally + set(value) = definedExternally + var htmlImported: EmptyCallback? + get() = definedExternally + set(value) = definedExternally + var dataChanged: ((data: Any) -> Unit)? + get() = definedExternally + set(value) = definedExternally + var pageLoaded: ((pageno: Number) -> Unit)? + get() = definedExternally + set(value) = definedExternally + var dataSorting: ((sorters: Array) -> Unit)? + get() = definedExternally + set(value) = definedExternally + var dataSorted: ((sorters: Array, rows: Array) -> Unit)? + get() = definedExternally + set(value) = definedExternally + var invalidOptionWarnings: Boolean? + get() = definedExternally + set(value) = definedExternally + var scrollVertical: ((top: Any) -> Unit)? + get() = definedExternally + set(value) = definedExternally + var scrollHorizontal: ((left: Any) -> Unit)? + get() = definedExternally + set(value) = definedExternally + var validationMode: String? /* "blocking" | "highlight" | "manual" */ + get() = definedExternally + set(value) = definedExternally + var textDirection: String? /* "auto" | "ltr" | "rtl" */ + get() = definedExternally + set(value) = definedExternally + } + + interface OptionsMenu { + var rowContextMenu: dynamic /* Array | MenuSeparator */>? | ((component: RowComponent, e: MouseEvent) -> dynamic)? */ + get() = definedExternally + set(value) = definedExternally + var rowClickMenu: dynamic /* Array | MenuSeparator */>? | ((component: RowComponent, e: MouseEvent) -> dynamic)? */ + get() = definedExternally + set(value) = definedExternally + var groupClickMenu: dynamic /* Array | MenuSeparator */>? | ((component: GroupComponent, e: MouseEvent) -> dynamic)? */ + get() = definedExternally + set(value) = definedExternally + var groupContextMenu: Array>? + get() = definedExternally + set(value) = definedExternally + } + + interface MenuObject { + var label: dynamic /* String | HTMLElement | (component: T) -> dynamic */ + get() = definedExternally + set(value) = definedExternally + var action: ((e: Any, component: T) -> Any)? + get() = definedExternally + set(value) = definedExternally + var disabled: dynamic /* Boolean? | ((component: T) -> Boolean)? */ + get() = definedExternally + set(value) = definedExternally + var menu: Array>? + get() = definedExternally + set(value) = definedExternally + } + + interface MenuSeparator { + var separator: Boolean? + get() = definedExternally + set(value) = definedExternally + } + + interface DownloadOptions : DownloadCSV, DownloadXLXS, DownloadPDF, DownloadHTML { + override var documentProcessing: ((input: Any) -> Any)? + get() = definedExternally + set(value) = definedExternally + } + + interface DownloadCSV { + var delimiter: String? + get() = definedExternally + set(value) = definedExternally + var bom: Boolean? + get() = definedExternally + set(value) = definedExternally + } + + interface DownloadHTML { + var style: Boolean? + get() = definedExternally + set(value) = definedExternally + } + + interface DownloadXLXS { + var sheetName: String? + get() = definedExternally + set(value) = definedExternally + var documentProcessing: ((input: Any) -> Any)? + get() = definedExternally + set(value) = definedExternally + } + + interface DownloadPDF { + var orientation: String? /* "portrait" | "landscape" */ + get() = definedExternally + set(value) = definedExternally + var title: String? + get() = definedExternally + set(value) = definedExternally + var rowGroupStyles: Any? + get() = definedExternally + set(value) = definedExternally + var rowCalcStyles: Any? + get() = definedExternally + set(value) = definedExternally + var jsPDF: Any? + get() = definedExternally + set(value) = definedExternally + var autoTable: dynamic /* Any? | ((doc: Any) -> Any)? */ + get() = definedExternally + set(value) = definedExternally + var documentProcessing: ((doc: Any) -> Any)? + get() = definedExternally + set(value) = definedExternally + } + + interface OptionsDownload { + var downloadReady: ((fileContents: Any, blob: Any) -> Any)? + get() = definedExternally + set(value) = definedExternally + var downloadComplete: (() -> Unit)? + get() = definedExternally + set(value) = definedExternally + var downloadConfig: AddditionalExportOptions? + get() = definedExternally + set(value) = definedExternally + var downloadRowRange: String? /* "visible" | "active" | "selected" | "all" */ + get() = definedExternally + set(value) = definedExternally + } + + interface OptionsHTML { + var htmlOutputConfig: AddditionalExportOptions? + get() = definedExternally + set(value) = definedExternally + var printAsHtml: Boolean? + get() = definedExternally + set(value) = definedExternally + var printConfig: AddditionalExportOptions? + get() = definedExternally + set(value) = definedExternally + var printStyled: Boolean? + get() = definedExternally + set(value) = definedExternally + var printRowRange: dynamic /* "visible" | "active" | "selected" | "all" | (() -> Array)? */ + get() = definedExternally + set(value) = definedExternally + var printHeader: dynamic /* String? | HTMLElement? | (() -> dynamic)? */ + get() = definedExternally + set(value) = definedExternally + var printFooter: dynamic /* String? | HTMLElement? | (() -> dynamic)? */ + get() = definedExternally + set(value) = definedExternally + var printFormatter: ((tableHolderElement: Any, tableElement: Any) -> Any)? + get() = definedExternally + set(value) = definedExternally + var groupHeaderDownload: dynamic /* ((value: Any, count: Number, data: Any, group: GroupComponent) -> String)? | Array<(value: Any, count: Number, data: Any) -> String>? */ + get() = definedExternally + set(value) = definedExternally + } + + interface AddditionalExportOptions { + var columnHeaders: Boolean? + get() = definedExternally + set(value) = definedExternally + var columnGroups: Boolean? + get() = definedExternally + set(value) = definedExternally + var rowGroups: Boolean? + get() = definedExternally + set(value) = definedExternally + var columnCalcs: Boolean? + get() = definedExternally + set(value) = definedExternally + var dataTree: Boolean? + get() = definedExternally + set(value) = definedExternally + var formatCells: Boolean? + get() = definedExternally + set(value) = definedExternally + } + + interface OptionsLocale { + var locale: dynamic /* Boolean? | String? */ + get() = definedExternally + set(value) = definedExternally + var langs: Any? + get() = definedExternally + set(value) = definedExternally + var localized: ((locale: String, lang: Any) -> Unit)? + get() = definedExternally + set(value) = definedExternally + } + + interface OptionsHistory { + var history: Boolean? + get() = definedExternally + set(value) = definedExternally + var historyUndo: ((action: String? /* "cellEdit" | "rowAdd" | "rowDelete" | "rowMoved" */, component: dynamic /* CellComponent | RowComponent */, data: Any) -> Unit)? + get() = definedExternally + set(value) = definedExternally + var historyRedo: ((action: String? /* "cellEdit" | "rowAdd" | "rowDelete" | "rowMoved" */, component: dynamic /* CellComponent | RowComponent */, data: Any) -> Unit)? + get() = definedExternally + set(value) = definedExternally + } + + interface ColumnLayout { + var title: String + var field: String? + get() = definedExternally + set(value) = definedExternally + var visible: Boolean? + get() = definedExternally + set(value) = definedExternally + var width: dynamic /* Number? | String? */ + get() = definedExternally + set(value) = definedExternally + } + + interface ColumnLayoutPartial { + var title: String? + get() = definedExternally + set(value) = definedExternally + var field: String? + get() = definedExternally + set(value) = definedExternally + var visible: Boolean? + get() = definedExternally + set(value) = definedExternally + var width: dynamic /* Number? | String? */ + get() = definedExternally + set(value) = definedExternally + } + + interface ColumnDefinition : ColumnLayout, CellCallbacks { + var hozAlign: String? /* "left" | "center" | "right" */ + get() = definedExternally + set(value) = definedExternally + var headerHozAlign: String? /* "left" | "center" | "right" */ + get() = definedExternally + set(value) = definedExternally + var vertAlign: String? /* "top" | "middle" | "bottom" */ + get() = definedExternally + set(value) = definedExternally + var minWidth: Number? + get() = definedExternally + set(value) = definedExternally + var widthGrow: Number? + get() = definedExternally + set(value) = definedExternally + var widthShrink: Number? + get() = definedExternally + set(value) = definedExternally + var resizable: dynamic /* Boolean? | "header" | "cell" */ + get() = definedExternally + set(value) = definedExternally + var frozen: Boolean? + get() = definedExternally + set(value) = definedExternally + var responsive: Number? + get() = definedExternally + set(value) = definedExternally + var tooltip: dynamic /* String? | Boolean? | ((cell: CellComponent) -> String)? */ + get() = definedExternally + set(value) = definedExternally + var cssClass: String? + get() = definedExternally + set(value) = definedExternally + var rowHandle: Boolean? + get() = definedExternally + set(value) = definedExternally + var hideInHtml: Boolean? + get() = definedExternally + set(value) = definedExternally + var sorter: dynamic /* "string" | "number" | "alphanum" | "boolean" | "exists" | "date" | "time" | "datetime" | "array" | ((a: Any, b: Any, aRow: RowComponent, bRow: RowComponent, column: ColumnComponent, dir: String /* "asc" | "desc" */, sorterParams: Any) -> Number)? */ + get() = definedExternally + set(value) = definedExternally + var sorterParams: dynamic /* ColumnDefinitionSorterParams? | ColumnSorterParamLookupFunction? */ + get() = definedExternally + set(value) = definedExternally + var formatter: dynamic /* "plaintext" | "textarea" | "html" | "money" | "image" | "datetime" | "datetimediff" | "link" | "tickCross" | "color" | "star" | "traffic" | "progress" | "lookup" | "buttonTick" | "buttonCross" | "rownum" | "handle" | "rowSelection" | "responsiveCollapse" | ((cell: CellComponent, formatterParams: Any, onRendered: EmptyCallback) -> dynamic)? */ + get() = definedExternally + set(value) = definedExternally + var formatterParams: dynamic /* MoneyParams? | ImageParams? | LinkParams? | DateTimeParams? | DateTimeDifferenceParams? | TickCrossParams? | TrafficParams? | ProgressBarParams? | StarRatingParams? | RowSelectionParams? | JSONRecord? | ((cell: CellComponent) -> Any)? */ + get() = definedExternally + set(value) = definedExternally + var variableHeight: Boolean? + get() = definedExternally + set(value) = definedExternally + var editable: dynamic /* Boolean? | ((cell: CellComponent) -> Boolean)? */ + get() = definedExternally + set(value) = definedExternally + var editor: dynamic /* Boolean? | "input" | "textarea" | "number" | "range" | "tickCross" | "star" | "select" | "autocomplete" | ((cell: CellComponent, onRendered: EmptyCallback, success: ValueBooleanCallback, cancel: ValueVoidCallback, editorParams: Any) -> dynamic)? */ + get() = definedExternally + set(value) = definedExternally + var editorParams: dynamic /* NumberParams? | CheckboxParams? | SelectParams? | AutoCompleteParams? | InputParams? | TextAreaParams? | ((cell: CellComponent) -> Any)? */ + get() = definedExternally + set(value) = definedExternally + var validator: dynamic /* "required" | "unique" | "integer" | "float" | "numeric" | "string" | Array? | Validator? | Array? | String? */ + get() = definedExternally + set(value) = definedExternally + var mutator: CustomMutator? + get() = definedExternally + set(value) = definedExternally + var mutatorParams: dynamic /* Any? | ((value: Any, data: Any, type: String /* "data" | "edit" */, cell: CellComponent) -> Any)? */ + get() = definedExternally + set(value) = definedExternally + var mutatorData: CustomMutator? + get() = definedExternally + set(value) = definedExternally + var mutatorDataParams: dynamic /* Any? | ((value: Any, data: Any, type: String /* "data" | "edit" */, cell: CellComponent) -> Any)? */ + get() = definedExternally + set(value) = definedExternally + var mutatorEdit: CustomMutator? + get() = definedExternally + set(value) = definedExternally + var mutatorEditParams: dynamic /* Any? | ((value: Any, data: Any, type: String /* "data" | "edit" */, cell: CellComponent) -> Any)? */ + get() = definedExternally + set(value) = definedExternally + var mutatorClipboard: CustomMutator? + get() = definedExternally + set(value) = definedExternally + var mutatorClipboardParams: dynamic /* Any? | ((value: Any, data: Any, type: String /* "data" | "edit" */, cell: CellComponent) -> Any)? */ + get() = definedExternally + set(value) = definedExternally + var accessor: CustomAccessor? + get() = definedExternally + set(value) = definedExternally + var accessorParams: dynamic /* Any? | ((value: Any, data: Any, type: String /* "data" | "download" | "clipboard" */, column: ColumnComponent, row: RowComponent) -> Any)? */ + get() = definedExternally + set(value) = definedExternally + var accessorDownload: CustomAccessor? + get() = definedExternally + set(value) = definedExternally + var accessorDownloadParams: dynamic /* Any? | ((value: Any, data: Any, type: String /* "data" | "download" | "clipboard" */, column: ColumnComponent, row: RowComponent) -> Any)? */ + get() = definedExternally + set(value) = definedExternally + var accessorClipboard: CustomAccessor? + get() = definedExternally + set(value) = definedExternally + var accessorClipboardParams: dynamic /* Any? | ((value: Any, data: Any, type: String /* "data" | "download" | "clipboard" */, column: ColumnComponent, row: RowComponent) -> Any)? */ + get() = definedExternally + set(value) = definedExternally + var download: Boolean? + get() = definedExternally + set(value) = definedExternally + var titleDownload: String? + get() = definedExternally + set(value) = definedExternally + var topCalc: dynamic /* "avg" | "max" | "min" | "sum" | "concat" | "count" | ((values: Array, data: Array, calcParams: Any) -> Any)? */ + get() = definedExternally + set(value) = definedExternally + var topCalcParams: ColumnCalcParams? + get() = definedExternally + set(value) = definedExternally + var topCalcFormatter: dynamic /* "plaintext" | "textarea" | "html" | "money" | "image" | "datetime" | "datetimediff" | "link" | "tickCross" | "color" | "star" | "traffic" | "progress" | "lookup" | "buttonTick" | "buttonCross" | "rownum" | "handle" | "rowSelection" | "responsiveCollapse" | ((cell: CellComponent, formatterParams: Any, onRendered: EmptyCallback) -> dynamic)? */ + get() = definedExternally + set(value) = definedExternally + var topCalcFormatterParams: dynamic /* MoneyParams? | ImageParams? | LinkParams? | DateTimeParams? | DateTimeDifferenceParams? | TickCrossParams? | TrafficParams? | ProgressBarParams? | StarRatingParams? | RowSelectionParams? | JSONRecord? | ((cell: CellComponent) -> Any)? */ + get() = definedExternally + set(value) = definedExternally + var bottomCalc: dynamic /* "avg" | "max" | "min" | "sum" | "concat" | "count" | ((values: Array, data: Array, calcParams: Any) -> Any)? */ + get() = definedExternally + set(value) = definedExternally + var bottomCalcParams: ColumnCalcParams? + get() = definedExternally + set(value) = definedExternally + var bottomCalcFormatter: dynamic /* "plaintext" | "textarea" | "html" | "money" | "image" | "datetime" | "datetimediff" | "link" | "tickCross" | "color" | "star" | "traffic" | "progress" | "lookup" | "buttonTick" | "buttonCross" | "rownum" | "handle" | "rowSelection" | "responsiveCollapse" | ((cell: CellComponent, formatterParams: Any, onRendered: EmptyCallback) -> dynamic)? */ + get() = definedExternally + set(value) = definedExternally + var bottomCalcFormatterParams: dynamic /* MoneyParams? | ImageParams? | LinkParams? | DateTimeParams? | DateTimeDifferenceParams? | TickCrossParams? | TrafficParams? | ProgressBarParams? | StarRatingParams? | RowSelectionParams? | JSONRecord? | ((cell: CellComponent) -> Any)? */ + get() = definedExternally + set(value) = definedExternally + var headerSort: Boolean? + get() = definedExternally + set(value) = definedExternally + var headerSortStartingDir: String? /* "asc" | "desc" */ + get() = definedExternally + set(value) = definedExternally + var headerSortTristate: Boolean? + get() = definedExternally + set(value) = definedExternally + var headerClick: ColumnEventCallback? + get() = definedExternally + set(value) = definedExternally + var headerDblClick: ColumnEventCallback? + get() = definedExternally + set(value) = definedExternally + var headerContext: ColumnEventCallback? + get() = definedExternally + set(value) = definedExternally + var headerTap: ColumnEventCallback? + get() = definedExternally + set(value) = definedExternally + var headerDblTap: ColumnEventCallback? + get() = definedExternally + set(value) = definedExternally + var headerTapHold: ColumnEventCallback? + get() = definedExternally + set(value) = definedExternally + var headerTooltip: dynamic /* Boolean? | String? | ((column: ColumnComponent) -> String)? */ + get() = definedExternally + set(value) = definedExternally + var headerVertical: dynamic /* Boolean? | "flip" */ + get() = definedExternally + set(value) = definedExternally + var editableTitle: Boolean? + get() = definedExternally + set(value) = definedExternally + var titleFormatter: dynamic /* "plaintext" | "textarea" | "html" | "money" | "image" | "datetime" | "datetimediff" | "link" | "tickCross" | "color" | "star" | "traffic" | "progress" | "lookup" | "buttonTick" | "buttonCross" | "rownum" | "handle" | "rowSelection" | "responsiveCollapse" | ((cell: CellComponent, formatterParams: Any, onRendered: EmptyCallback) -> dynamic)? */ + get() = definedExternally + set(value) = definedExternally + var titleFormatterParams: dynamic /* MoneyParams? | ImageParams? | LinkParams? | DateTimeParams? | DateTimeDifferenceParams? | TickCrossParams? | TrafficParams? | ProgressBarParams? | StarRatingParams? | RowSelectionParams? | JSONRecord? | ((cell: CellComponent) -> Any)? */ + get() = definedExternally + set(value) = definedExternally + var headerFilter: dynamic /* Boolean? | "input" | "textarea" | "number" | "range" | "tickCross" | "star" | "select" | "autocomplete" | ((cell: CellComponent, onRendered: EmptyCallback, success: ValueBooleanCallback, cancel: ValueVoidCallback, editorParams: Any) -> dynamic)? */ + get() = definedExternally + set(value) = definedExternally + var headerFilterParams: dynamic /* NumberParams? | CheckboxParams? | SelectParams? | AutoCompleteParams? | InputParams? | TextAreaParams? | ((cell: CellComponent) -> Any)? */ + get() = definedExternally + set(value) = definedExternally + var headerFilterPlaceholder: String? + get() = definedExternally + set(value) = definedExternally + var headerFilterEmptyCheck: ValueBooleanCallback? + get() = definedExternally + set(value) = definedExternally + var headerFilterFunc: dynamic /* "=" | "!=" | "like" | "<" | ">" | "<=" | ">=" | "in" | "regex" | "starts" | "ends" | ((headerValue: Any, rowValue: Any, rowdata: Any, filterparams: Any) -> Boolean)? */ + get() = definedExternally + set(value) = definedExternally + var headerFilterFuncParams: Any? + get() = definedExternally + set(value) = definedExternally + var headerFilterLiveFilter: Boolean? + get() = definedExternally + set(value) = definedExternally + var htmlOutput: Boolean? + get() = definedExternally + set(value) = definedExternally + var clipboard: Boolean? + get() = definedExternally + set(value) = definedExternally + var columns: Array? + get() = definedExternally + set(value) = definedExternally + var headerMenu: Array | MenuSeparator */>? + get() = definedExternally + set(value) = definedExternally + var headerContextMenu: Array | MenuSeparator */>? + get() = definedExternally + set(value) = definedExternally + var contextMenu: Array | MenuSeparator */>? + get() = definedExternally + set(value) = definedExternally + var clickMenu: Array | MenuSeparator */>? + get() = definedExternally + set(value) = definedExternally + var formatterClipboard: dynamic /* "plaintext" | "textarea" | "html" | "money" | "image" | "datetime" | "datetimediff" | "link" | "tickCross" | "color" | "star" | "traffic" | "progress" | "lookup" | "buttonTick" | "buttonCross" | "rownum" | "handle" | "rowSelection" | "responsiveCollapse" | ((cell: CellComponent, formatterParams: Any, onRendered: EmptyCallback) -> dynamic)? | Boolean? */ + get() = definedExternally + set(value) = definedExternally + var formatterClipboardParams: dynamic /* MoneyParams? | ImageParams? | LinkParams? | DateTimeParams? | DateTimeDifferenceParams? | TickCrossParams? | TrafficParams? | ProgressBarParams? | StarRatingParams? | RowSelectionParams? | JSONRecord? | ((cell: CellComponent) -> Any)? */ + get() = definedExternally + set(value) = definedExternally + var formatterPrint: dynamic /* "plaintext" | "textarea" | "html" | "money" | "image" | "datetime" | "datetimediff" | "link" | "tickCross" | "color" | "star" | "traffic" | "progress" | "lookup" | "buttonTick" | "buttonCross" | "rownum" | "handle" | "rowSelection" | "responsiveCollapse" | ((cell: CellComponent, formatterParams: Any, onRendered: EmptyCallback) -> dynamic)? | Boolean? */ + get() = definedExternally + set(value) = definedExternally + var formatterPrintParams: dynamic /* MoneyParams? | ImageParams? | LinkParams? | DateTimeParams? | DateTimeDifferenceParams? | TickCrossParams? | TrafficParams? | ProgressBarParams? | StarRatingParams? | RowSelectionParams? | JSONRecord? | ((cell: CellComponent) -> Any)? */ + get() = definedExternally + set(value) = definedExternally + var accessorPrint: CustomAccessor? + get() = definedExternally + set(value) = definedExternally + var accessorPrintParams: dynamic /* Any? | ((value: Any, data: Any, type: String /* "data" | "download" | "clipboard" */, column: ColumnComponent, row: RowComponent) -> Any)? */ + get() = definedExternally + set(value) = definedExternally + var accessorHtmlOutput: CustomAccessor? + get() = definedExternally + set(value) = definedExternally + var accessorHtmlOutputParams: dynamic /* Any? | ((value: Any, data: Any, type: String /* "data" | "download" | "clipboard" */, column: ColumnComponent, row: RowComponent) -> Any)? */ + get() = definedExternally + set(value) = definedExternally + var formatterHtmlOutput: dynamic /* "plaintext" | "textarea" | "html" | "money" | "image" | "datetime" | "datetimediff" | "link" | "tickCross" | "color" | "star" | "traffic" | "progress" | "lookup" | "buttonTick" | "buttonCross" | "rownum" | "handle" | "rowSelection" | "responsiveCollapse" | ((cell: CellComponent, formatterParams: Any, onRendered: EmptyCallback) -> dynamic)? | Boolean? */ + get() = definedExternally + set(value) = definedExternally + var formatterHtmlOutputParams: dynamic /* MoneyParams? | ImageParams? | LinkParams? | DateTimeParams? | DateTimeDifferenceParams? | TickCrossParams? | TrafficParams? | ProgressBarParams? | StarRatingParams? | RowSelectionParams? | JSONRecord? | ((cell: CellComponent) -> Any)? */ + get() = definedExternally + set(value) = definedExternally + var titleClipboard: String? + get() = definedExternally + set(value) = definedExternally + var titleHtmlOutput: String? + get() = definedExternally + set(value) = definedExternally + var titlePrint: String? + get() = definedExternally + set(value) = definedExternally + var maxWidth: dynamic /* Number? | Boolean? */ + get() = definedExternally + set(value) = definedExternally + } + + interface ColumnDefinitionPartial : ColumnLayoutPartial, CellCallbacksPartial { + var hozAlign: String? /* "left" | "center" | "right" */ + get() = definedExternally + set(value) = definedExternally + var headerHozAlign: String? /* "left" | "center" | "right" */ + get() = definedExternally + set(value) = definedExternally + var vertAlign: String? /* "top" | "middle" | "bottom" */ + get() = definedExternally + set(value) = definedExternally + var minWidth: Number? + get() = definedExternally + set(value) = definedExternally + var widthGrow: Number? + get() = definedExternally + set(value) = definedExternally + var widthShrink: Number? + get() = definedExternally + set(value) = definedExternally + var resizable: dynamic /* Boolean? | "header" | "cell" */ + get() = definedExternally + set(value) = definedExternally + var frozen: Boolean? + get() = definedExternally + set(value) = definedExternally + var responsive: Number? + get() = definedExternally + set(value) = definedExternally + var tooltip: dynamic /* String? | Boolean? | ((cell: CellComponent) -> String)? */ + get() = definedExternally + set(value) = definedExternally + var cssClass: String? + get() = definedExternally + set(value) = definedExternally + var rowHandle: Boolean? + get() = definedExternally + set(value) = definedExternally + var hideInHtml: Boolean? + get() = definedExternally + set(value) = definedExternally + var sorter: dynamic /* "string" | "number" | "alphanum" | "boolean" | "exists" | "date" | "time" | "datetime" | "array" | ((a: Any, b: Any, aRow: RowComponent, bRow: RowComponent, column: ColumnComponent, dir: String /* "asc" | "desc" */, sorterParams: Any) -> Number)? */ + get() = definedExternally + set(value) = definedExternally + var sorterParams: dynamic /* ColumnDefinitionSorterParams? | ColumnSorterParamLookupFunction? */ + get() = definedExternally + set(value) = definedExternally + var formatter: dynamic /* "plaintext" | "textarea" | "html" | "money" | "image" | "datetime" | "datetimediff" | "link" | "tickCross" | "color" | "star" | "traffic" | "progress" | "lookup" | "buttonTick" | "buttonCross" | "rownum" | "handle" | "rowSelection" | "responsiveCollapse" | ((cell: CellComponent, formatterParams: Any, onRendered: EmptyCallback) -> dynamic)? */ + get() = definedExternally + set(value) = definedExternally + var formatterParams: dynamic /* MoneyParams? | ImageParams? | LinkParams? | DateTimeParams? | DateTimeDifferenceParams? | TickCrossParams? | TrafficParams? | ProgressBarParams? | StarRatingParams? | RowSelectionParams? | JSONRecord? | ((cell: CellComponent) -> Any)? */ + get() = definedExternally + set(value) = definedExternally + var variableHeight: Boolean? + get() = definedExternally + set(value) = definedExternally + var editable: dynamic /* Boolean? | ((cell: CellComponent) -> Boolean)? */ + get() = definedExternally + set(value) = definedExternally + var editor: dynamic /* Boolean? | "input" | "textarea" | "number" | "range" | "tickCross" | "star" | "select" | "autocomplete" | ((cell: CellComponent, onRendered: EmptyCallback, success: ValueBooleanCallback, cancel: ValueVoidCallback, editorParams: Any) -> dynamic)? */ + get() = definedExternally + set(value) = definedExternally + var editorParams: dynamic /* NumberParams? | CheckboxParams? | SelectParams? | AutoCompleteParams? | InputParams? | TextAreaParams? | ((cell: CellComponent) -> Any)? */ + get() = definedExternally + set(value) = definedExternally + var validator: dynamic /* "required" | "unique" | "integer" | "float" | "numeric" | "string" | Array? | Validator? | Array? | String? */ + get() = definedExternally + set(value) = definedExternally + var mutator: CustomMutator? + get() = definedExternally + set(value) = definedExternally + var mutatorParams: dynamic /* Any? | ((value: Any, data: Any, type: String /* "data" | "edit" */, cell: CellComponent) -> Any)? */ + get() = definedExternally + set(value) = definedExternally + var mutatorData: CustomMutator? + get() = definedExternally + set(value) = definedExternally + var mutatorDataParams: dynamic /* Any? | ((value: Any, data: Any, type: String /* "data" | "edit" */, cell: CellComponent) -> Any)? */ + get() = definedExternally + set(value) = definedExternally + var mutatorEdit: CustomMutator? + get() = definedExternally + set(value) = definedExternally + var mutatorEditParams: dynamic /* Any? | ((value: Any, data: Any, type: String /* "data" | "edit" */, cell: CellComponent) -> Any)? */ + get() = definedExternally + set(value) = definedExternally + var mutatorClipboard: CustomMutator? + get() = definedExternally + set(value) = definedExternally + var mutatorClipboardParams: dynamic /* Any? | ((value: Any, data: Any, type: String /* "data" | "edit" */, cell: CellComponent) -> Any)? */ + get() = definedExternally + set(value) = definedExternally + var accessor: CustomAccessor? + get() = definedExternally + set(value) = definedExternally + var accessorParams: dynamic /* Any? | ((value: Any, data: Any, type: String /* "data" | "download" | "clipboard" */, column: ColumnComponent, row: RowComponent) -> Any)? */ + get() = definedExternally + set(value) = definedExternally + var accessorDownload: CustomAccessor? + get() = definedExternally + set(value) = definedExternally + var accessorDownloadParams: dynamic /* Any? | ((value: Any, data: Any, type: String /* "data" | "download" | "clipboard" */, column: ColumnComponent, row: RowComponent) -> Any)? */ + get() = definedExternally + set(value) = definedExternally + var accessorClipboard: CustomAccessor? + get() = definedExternally + set(value) = definedExternally + var accessorClipboardParams: dynamic /* Any? | ((value: Any, data: Any, type: String /* "data" | "download" | "clipboard" */, column: ColumnComponent, row: RowComponent) -> Any)? */ + get() = definedExternally + set(value) = definedExternally + var download: Boolean? + get() = definedExternally + set(value) = definedExternally + var titleDownload: String? + get() = definedExternally + set(value) = definedExternally + var topCalc: dynamic /* "avg" | "max" | "min" | "sum" | "concat" | "count" | ((values: Array, data: Array, calcParams: Any) -> Any)? */ + get() = definedExternally + set(value) = definedExternally + var topCalcParams: ColumnCalcParams? + get() = definedExternally + set(value) = definedExternally + var topCalcFormatter: dynamic /* "plaintext" | "textarea" | "html" | "money" | "image" | "datetime" | "datetimediff" | "link" | "tickCross" | "color" | "star" | "traffic" | "progress" | "lookup" | "buttonTick" | "buttonCross" | "rownum" | "handle" | "rowSelection" | "responsiveCollapse" | ((cell: CellComponent, formatterParams: Any, onRendered: EmptyCallback) -> dynamic)? */ + get() = definedExternally + set(value) = definedExternally + var topCalcFormatterParams: dynamic /* MoneyParams? | ImageParams? | LinkParams? | DateTimeParams? | DateTimeDifferenceParams? | TickCrossParams? | TrafficParams? | ProgressBarParams? | StarRatingParams? | RowSelectionParams? | JSONRecord? | ((cell: CellComponent) -> Any)? */ + get() = definedExternally + set(value) = definedExternally + var bottomCalc: dynamic /* "avg" | "max" | "min" | "sum" | "concat" | "count" | ((values: Array, data: Array, calcParams: Any) -> Any)? */ + get() = definedExternally + set(value) = definedExternally + var bottomCalcParams: ColumnCalcParams? + get() = definedExternally + set(value) = definedExternally + var bottomCalcFormatter: dynamic /* "plaintext" | "textarea" | "html" | "money" | "image" | "datetime" | "datetimediff" | "link" | "tickCross" | "color" | "star" | "traffic" | "progress" | "lookup" | "buttonTick" | "buttonCross" | "rownum" | "handle" | "rowSelection" | "responsiveCollapse" | ((cell: CellComponent, formatterParams: Any, onRendered: EmptyCallback) -> dynamic)? */ + get() = definedExternally + set(value) = definedExternally + var bottomCalcFormatterParams: dynamic /* MoneyParams? | ImageParams? | LinkParams? | DateTimeParams? | DateTimeDifferenceParams? | TickCrossParams? | TrafficParams? | ProgressBarParams? | StarRatingParams? | RowSelectionParams? | JSONRecord? | ((cell: CellComponent) -> Any)? */ + get() = definedExternally + set(value) = definedExternally + var headerSort: Boolean? + get() = definedExternally + set(value) = definedExternally + var headerSortStartingDir: String? /* "asc" | "desc" */ + get() = definedExternally + set(value) = definedExternally + var headerSortTristate: Boolean? + get() = definedExternally + set(value) = definedExternally + var headerClick: ColumnEventCallback? + get() = definedExternally + set(value) = definedExternally + var headerDblClick: ColumnEventCallback? + get() = definedExternally + set(value) = definedExternally + var headerContext: ColumnEventCallback? + get() = definedExternally + set(value) = definedExternally + var headerTap: ColumnEventCallback? + get() = definedExternally + set(value) = definedExternally + var headerDblTap: ColumnEventCallback? + get() = definedExternally + set(value) = definedExternally + var headerTapHold: ColumnEventCallback? + get() = definedExternally + set(value) = definedExternally + var headerTooltip: dynamic /* Boolean? | String? | ((column: ColumnComponent) -> String)? */ + get() = definedExternally + set(value) = definedExternally + var headerVertical: dynamic /* Boolean? | "flip" */ + get() = definedExternally + set(value) = definedExternally + var editableTitle: Boolean? + get() = definedExternally + set(value) = definedExternally + var titleFormatter: dynamic /* "plaintext" | "textarea" | "html" | "money" | "image" | "datetime" | "datetimediff" | "link" | "tickCross" | "color" | "star" | "traffic" | "progress" | "lookup" | "buttonTick" | "buttonCross" | "rownum" | "handle" | "rowSelection" | "responsiveCollapse" | ((cell: CellComponent, formatterParams: Any, onRendered: EmptyCallback) -> dynamic)? */ + get() = definedExternally + set(value) = definedExternally + var titleFormatterParams: dynamic /* MoneyParams? | ImageParams? | LinkParams? | DateTimeParams? | DateTimeDifferenceParams? | TickCrossParams? | TrafficParams? | ProgressBarParams? | StarRatingParams? | RowSelectionParams? | JSONRecord? | ((cell: CellComponent) -> Any)? */ + get() = definedExternally + set(value) = definedExternally + var headerFilter: dynamic /* Boolean? | "input" | "textarea" | "number" | "range" | "tickCross" | "star" | "select" | "autocomplete" | ((cell: CellComponent, onRendered: EmptyCallback, success: ValueBooleanCallback, cancel: ValueVoidCallback, editorParams: Any) -> dynamic)? */ + get() = definedExternally + set(value) = definedExternally + var headerFilterParams: dynamic /* NumberParams? | CheckboxParams? | SelectParams? | AutoCompleteParams? | InputParams? | TextAreaParams? | ((cell: CellComponent) -> Any)? */ + get() = definedExternally + set(value) = definedExternally + var headerFilterPlaceholder: String? + get() = definedExternally + set(value) = definedExternally + var headerFilterEmptyCheck: ValueBooleanCallback? + get() = definedExternally + set(value) = definedExternally + var headerFilterFunc: dynamic /* "=" | "!=" | "like" | "<" | ">" | "<=" | ">=" | "in" | "regex" | "starts" | "ends" | ((headerValue: Any, rowValue: Any, rowdata: Any, filterparams: Any) -> Boolean)? */ + get() = definedExternally + set(value) = definedExternally + var headerFilterFuncParams: Any? + get() = definedExternally + set(value) = definedExternally + var headerFilterLiveFilter: Boolean? + get() = definedExternally + set(value) = definedExternally + var htmlOutput: Boolean? + get() = definedExternally + set(value) = definedExternally + var clipboard: Boolean? + get() = definedExternally + set(value) = definedExternally + var columns: Array? + get() = definedExternally + set(value) = definedExternally + var headerMenu: Array | MenuSeparator */>? + get() = definedExternally + set(value) = definedExternally + var headerContextMenu: Array | MenuSeparator */>? + get() = definedExternally + set(value) = definedExternally + var contextMenu: Array | MenuSeparator */>? + get() = definedExternally + set(value) = definedExternally + var clickMenu: Array | MenuSeparator */>? + get() = definedExternally + set(value) = definedExternally + var formatterClipboard: dynamic /* "plaintext" | "textarea" | "html" | "money" | "image" | "datetime" | "datetimediff" | "link" | "tickCross" | "color" | "star" | "traffic" | "progress" | "lookup" | "buttonTick" | "buttonCross" | "rownum" | "handle" | "rowSelection" | "responsiveCollapse" | ((cell: CellComponent, formatterParams: Any, onRendered: EmptyCallback) -> dynamic)? | Boolean? */ + get() = definedExternally + set(value) = definedExternally + var formatterClipboardParams: dynamic /* MoneyParams? | ImageParams? | LinkParams? | DateTimeParams? | DateTimeDifferenceParams? | TickCrossParams? | TrafficParams? | ProgressBarParams? | StarRatingParams? | RowSelectionParams? | JSONRecord? | ((cell: CellComponent) -> Any)? */ + get() = definedExternally + set(value) = definedExternally + var formatterPrint: dynamic /* "plaintext" | "textarea" | "html" | "money" | "image" | "datetime" | "datetimediff" | "link" | "tickCross" | "color" | "star" | "traffic" | "progress" | "lookup" | "buttonTick" | "buttonCross" | "rownum" | "handle" | "rowSelection" | "responsiveCollapse" | ((cell: CellComponent, formatterParams: Any, onRendered: EmptyCallback) -> dynamic)? | Boolean? */ + get() = definedExternally + set(value) = definedExternally + var formatterPrintParams: dynamic /* MoneyParams? | ImageParams? | LinkParams? | DateTimeParams? | DateTimeDifferenceParams? | TickCrossParams? | TrafficParams? | ProgressBarParams? | StarRatingParams? | RowSelectionParams? | JSONRecord? | ((cell: CellComponent) -> Any)? */ + get() = definedExternally + set(value) = definedExternally + var accessorPrint: CustomAccessor? + get() = definedExternally + set(value) = definedExternally + var accessorPrintParams: dynamic /* Any? | ((value: Any, data: Any, type: String /* "data" | "download" | "clipboard" */, column: ColumnComponent, row: RowComponent) -> Any)? */ + get() = definedExternally + set(value) = definedExternally + var accessorHtmlOutput: CustomAccessor? + get() = definedExternally + set(value) = definedExternally + var accessorHtmlOutputParams: dynamic /* Any? | ((value: Any, data: Any, type: String /* "data" | "download" | "clipboard" */, column: ColumnComponent, row: RowComponent) -> Any)? */ + get() = definedExternally + set(value) = definedExternally + var formatterHtmlOutput: dynamic /* "plaintext" | "textarea" | "html" | "money" | "image" | "datetime" | "datetimediff" | "link" | "tickCross" | "color" | "star" | "traffic" | "progress" | "lookup" | "buttonTick" | "buttonCross" | "rownum" | "handle" | "rowSelection" | "responsiveCollapse" | ((cell: CellComponent, formatterParams: Any, onRendered: EmptyCallback) -> dynamic)? | Boolean? */ + get() = definedExternally + set(value) = definedExternally + var formatterHtmlOutputParams: dynamic /* MoneyParams? | ImageParams? | LinkParams? | DateTimeParams? | DateTimeDifferenceParams? | TickCrossParams? | TrafficParams? | ProgressBarParams? | StarRatingParams? | RowSelectionParams? | JSONRecord? | ((cell: CellComponent) -> Any)? */ + get() = definedExternally + set(value) = definedExternally + var titleClipboard: String? + get() = definedExternally + set(value) = definedExternally + var titleHtmlOutput: String? + get() = definedExternally + set(value) = definedExternally + var titlePrint: String? + get() = definedExternally + set(value) = definedExternally + var maxWidth: dynamic /* Number? | Boolean? */ + get() = definedExternally + set(value) = definedExternally + } + + interface CellCallbacks { + var cellClick: CellEventCallback? + get() = definedExternally + set(value) = definedExternally + var cellDblClick: CellEventCallback? + get() = definedExternally + set(value) = definedExternally + var cellContext: CellEventCallback? + get() = definedExternally + set(value) = definedExternally + var cellTap: CellEventCallback? + get() = definedExternally + set(value) = definedExternally + var cellDblTap: CellEventCallback? + get() = definedExternally + set(value) = definedExternally + var cellTapHold: CellEventCallback? + get() = definedExternally + set(value) = definedExternally + var cellMouseEnter: CellEventCallback? + get() = definedExternally + set(value) = definedExternally + var cellMouseLeave: CellEventCallback? + get() = definedExternally + set(value) = definedExternally + var cellMouseOver: CellEventCallback? + get() = definedExternally + set(value) = definedExternally + var cellMouseOut: CellEventCallback? + get() = definedExternally + set(value) = definedExternally + var cellMouseMove: CellEventCallback? + get() = definedExternally + set(value) = definedExternally + var cellEditing: CellEditEventCallback? + get() = definedExternally + set(value) = definedExternally + var cellEdited: CellEditEventCallback? + get() = definedExternally + set(value) = definedExternally + var cellEditCancelled: CellEditEventCallback? + get() = definedExternally + set(value) = definedExternally + } + + interface CellCallbacksPartial { + var cellClick: CellEventCallback? + get() = definedExternally + set(value) = definedExternally + var cellDblClick: CellEventCallback? + get() = definedExternally + set(value) = definedExternally + var cellContext: CellEventCallback? + get() = definedExternally + set(value) = definedExternally + var cellTap: CellEventCallback? + get() = definedExternally + set(value) = definedExternally + var cellDblTap: CellEventCallback? + get() = definedExternally + set(value) = definedExternally + var cellTapHold: CellEventCallback? + get() = definedExternally + set(value) = definedExternally + var cellMouseEnter: CellEventCallback? + get() = definedExternally + set(value) = definedExternally + var cellMouseLeave: CellEventCallback? + get() = definedExternally + set(value) = definedExternally + var cellMouseOver: CellEventCallback? + get() = definedExternally + set(value) = definedExternally + var cellMouseOut: CellEventCallback? + get() = definedExternally + set(value) = definedExternally + var cellMouseMove: CellEventCallback? + get() = definedExternally + set(value) = definedExternally + var cellEditing: CellEditEventCallback? + get() = definedExternally + set(value) = definedExternally + var cellEdited: CellEditEventCallback? + get() = definedExternally + set(value) = definedExternally + var cellEditCancelled: CellEditEventCallback? + get() = definedExternally + set(value) = definedExternally + } + + interface ColumnDefinitionSorterParams { + var format: String? + get() = definedExternally + set(value) = definedExternally + var locale: dynamic /* String? | Boolean? */ + get() = definedExternally + set(value) = definedExternally + var alignEmptyValues: String? /* "top" | "bottom" */ + get() = definedExternally + set(value) = definedExternally + var type: String? /* "length" | "sum" | "max" | "min" | "avg" */ + get() = definedExternally + set(value) = definedExternally + } + + interface MoneyParams { + var decimal: String? + get() = definedExternally + set(value) = definedExternally + var thousand: String? + get() = definedExternally + set(value) = definedExternally + var symbol: String? + get() = definedExternally + set(value) = definedExternally + var symbolAfter: Boolean? + get() = definedExternally + set(value) = definedExternally + var precision: dynamic /* Boolean? | Number? */ + get() = definedExternally + set(value) = definedExternally + } + + interface ImageParams { + var height: String? + get() = definedExternally + set(value) = definedExternally + var width: String? + get() = definedExternally + set(value) = definedExternally + var urlPrefix: String? + get() = definedExternally + set(value) = definedExternally + var urlSuffix: String? + get() = definedExternally + set(value) = definedExternally + } + + interface LinkParams { + var labelField: String? + get() = definedExternally + set(value) = definedExternally + var label: dynamic /* String? | ((cell: CellComponent) -> String)? */ + get() = definedExternally + set(value) = definedExternally + var urlPrefix: String? + get() = definedExternally + set(value) = definedExternally + var urlField: String? + get() = definedExternally + set(value) = definedExternally + var url: dynamic /* String? | ((cell: CellComponent) -> String)? */ + get() = definedExternally + set(value) = definedExternally + var target: String? + get() = definedExternally + set(value) = definedExternally + var download: Boolean? + get() = definedExternally + set(value) = definedExternally + } + + interface DateTimeParams { + var inputFormat: String? + get() = definedExternally + set(value) = definedExternally + var outputFormat: String? + get() = definedExternally + set(value) = definedExternally + var invalidPlaceholder: dynamic /* Boolean? | String? | Number? | ValueStringCallback? */ + get() = definedExternally + set(value) = definedExternally + var timezone: String? + get() = definedExternally + set(value) = definedExternally + } + + interface DateTimeDifferenceParams : DateTimeParams { + var date: Any? + get() = definedExternally + set(value) = definedExternally + var humanize: Boolean? + get() = definedExternally + set(value) = definedExternally + var unit: String? /* "years" | "months" | "weeks" | "days" | "hours" | "minutes" | "seconds" */ + get() = definedExternally + set(value) = definedExternally + var suffix: Boolean? + get() = definedExternally + set(value) = definedExternally + } + + interface TickCrossParams { + var allowEmpty: Boolean? + get() = definedExternally + set(value) = definedExternally + var allowTruthy: Boolean? + get() = definedExternally + set(value) = definedExternally + var tickElement: dynamic /* Boolean? | String? */ + get() = definedExternally + set(value) = definedExternally + var crossElement: dynamic /* Boolean? | String? */ + get() = definedExternally + set(value) = definedExternally + } + + interface TrafficParams { + var min: Number? + get() = definedExternally + set(value) = definedExternally + var max: Number? + get() = definedExternally + set(value) = definedExternally + var color: dynamic /* String? | Array? | ValueStringCallback? */ + get() = definedExternally + set(value) = definedExternally + } + + interface ProgressBarParams : TrafficParams { + var legend: dynamic /* String? | Boolean? | ValueStringCallback? */ + get() = definedExternally + set(value) = definedExternally + var legendColor: dynamic /* String? | Array? | ValueStringCallback? */ + get() = definedExternally + set(value) = definedExternally + var legendAlign: String? /* "center" | "left" | "right" | "justify" */ + get() = definedExternally + set(value) = definedExternally + } + + interface StarRatingParams { + var stars: Number? + get() = definedExternally + set(value) = definedExternally + } + + interface RowSelectionParams { + var rowRange: String? /* "visible" | "active" | "selected" | "all" */ + get() = definedExternally + set(value) = definedExternally + } + + interface SharedEditorParams { + var elementAttributes: JSONRecord? + get() = definedExternally + set(value) = definedExternally + var mask: String? + get() = definedExternally + set(value) = definedExternally + var maskAutoFill: Boolean? + get() = definedExternally + set(value) = definedExternally + var maskLetterChar: String? + get() = definedExternally + set(value) = definedExternally + var maskNumberChar: String? + get() = definedExternally + set(value) = definedExternally + var maskWildcardChar: String? + get() = definedExternally + set(value) = definedExternally + } + + interface NumberParams : SharedEditorParams { + var min: Number? + get() = definedExternally + set(value) = definedExternally + var max: Number? + get() = definedExternally + set(value) = definedExternally + var step: Number? + get() = definedExternally + set(value) = definedExternally + var verticalNavigation: String? /* "editor" | "table" */ + get() = definedExternally + set(value) = definedExternally + } + + interface InputParams : SharedEditorParams { + var search: Boolean? + get() = definedExternally + set(value) = definedExternally + } + + interface TextAreaParams : SharedEditorParams { + var verticalNavigation: String? /* "editor" | "table" | "hybrid" */ + get() = definedExternally + set(value) = definedExternally + } + + interface CheckboxParams : SharedEditorParams { + var tristate: Boolean? + get() = definedExternally + set(value) = definedExternally + var indeterminateValue: String? + get() = definedExternally + set(value) = definedExternally + } + + interface SharedSelectAutoCompleteEditorParams { + var defaultValue: String? + get() = definedExternally + set(value) = definedExternally + var sortValuesList: String? /* "asc" | "desc" */ + get() = definedExternally + set(value) = definedExternally + } + + interface SelectParams : SharedEditorParams, SharedSelectAutoCompleteEditorParams { + var values: dynamic /* Boolean | Array | JSONRecord | Array | String */ + get() = definedExternally + set(value) = definedExternally + var listItemFormatter: ((value: String, text: String) -> String)? + get() = definedExternally + set(value) = definedExternally + var verticalNavigation: String? /* "editor" | "table" | "hybrid" */ + get() = definedExternally + set(value) = definedExternally + var multiselect: dynamic /* Boolean? | Number? */ + get() = definedExternally + set(value) = definedExternally + } + + interface SelectParamsGroup { + var label: String + var value: dynamic /* String? | Number? | Boolean? */ + get() = definedExternally + set(value) = definedExternally + var options: Array? + get() = definedExternally + set(value) = definedExternally + var elementAttributes: Any? + get() = definedExternally + set(value) = definedExternally + } + + interface SelectLabelValue { + var label: String + var value: dynamic /* String | Number | Boolean */ + get() = definedExternally + set(value) = definedExternally + } + + interface AutoCompleteParams : SharedEditorParams, SharedSelectAutoCompleteEditorParams { + var values: dynamic /* Boolean | Array | JSONRecord | String | Array */ + get() = definedExternally + set(value) = definedExternally + var listItemFormatter: ((value: String, text: String) -> String)? + get() = definedExternally + set(value) = definedExternally + var searchFunc: ((term: String, values: Array) -> dynamic)? + get() = definedExternally + set(value) = definedExternally + var allowEmpty: Boolean? + get() = definedExternally + set(value) = definedExternally + var freetext: Boolean? + get() = definedExternally + set(value) = definedExternally + var showListOnEmpty: Boolean? + get() = definedExternally + set(value) = definedExternally + var verticalNavigation: String? /* "editor" | "table" | "hybrid" */ + get() = definedExternally + set(value) = definedExternally + var searchingPlaceholder: dynamic /* String? | HTMLElement? */ + get() = definedExternally + set(value) = definedExternally + var emptyPlaceholder: dynamic /* String? | HTMLElement? */ + get() = definedExternally + set(value) = definedExternally + } + + interface Validator { + var type: dynamic /* "required" | "unique" | "integer" | "float" | "numeric" | "string" | (cell: CellComponent, value: Any, parameters: Any) -> Boolean */ + get() = definedExternally + set(value) = definedExternally + var parameters: Any? + get() = definedExternally + set(value) = definedExternally + } + + interface KeyBinding { + var navPrev: dynamic /* String? | Boolean? */ + get() = definedExternally + set(value) = definedExternally + var navNext: dynamic /* String? | Boolean? */ + get() = definedExternally + set(value) = definedExternally + var navLeft: dynamic /* String? | Boolean? */ + get() = definedExternally + set(value) = definedExternally + var navRight: dynamic /* String? | Boolean? */ + get() = definedExternally + set(value) = definedExternally + var navUp: dynamic /* String? | Boolean? */ + get() = definedExternally + set(value) = definedExternally + var navDown: dynamic /* String? | Boolean? */ + get() = definedExternally + set(value) = definedExternally + var undo: dynamic /* String? | Boolean? */ + get() = definedExternally + set(value) = definedExternally + var redo: dynamic /* String? | Boolean? */ + get() = definedExternally + set(value) = definedExternally + var scrollPageUp: dynamic /* String? | Boolean? */ + get() = definedExternally + set(value) = definedExternally + var scrollPageDown: dynamic /* String? | Boolean? */ + get() = definedExternally + set(value) = definedExternally + var scrollToStart: dynamic /* String? | Boolean? */ + get() = definedExternally + set(value) = definedExternally + var scrollToEnd: dynamic /* String? | Boolean? */ + get() = definedExternally + set(value) = definedExternally + var copyToClipboard: dynamic /* String? | Boolean? */ + get() = definedExternally + set(value) = definedExternally + } + + interface CalculationComponent { + var getData: () -> Any + var getElement: () -> HTMLElement + var getTable: () -> Tabulator + var getCells: () -> Array + var getCell: (column: dynamic /* ColumnComponent | HTMLElement | String */) -> CellComponent + } + + interface RowComponent : CalculationComponent { + var getNextRow: () -> dynamic + var getPrevRow: () -> dynamic + var getIndex: () -> Any + var getPosition: (filteredPosition: Boolean) -> Number + var getGroup: () -> GroupComponent + var delete: () -> Promise + var scrollTo: () -> Promise + var pageTo: () -> Promise + var move: (lookup: dynamic /* RowComponent | HTMLElement | Number */, belowTarget: Boolean) -> Unit + var update: (data: Any) -> Promise + var select: () -> Unit + var deselect: () -> Unit + var toggleSelect: () -> Unit + var isSelected: () -> Boolean + var normalizeHeight: () -> Unit + var reformat: () -> Unit + var freeze: () -> Unit + var unfreeze: () -> Unit + var treeExpand: () -> Unit + var treeCollapse: () -> Unit + var treeToggle: () -> Unit + var getTreeParent: () -> dynamic + var getTreeChildren: () -> Array + var addTreeChild: (rowData: Any, position: Boolean, existingRow: RowComponent) -> Unit + var validate: () -> dynamic + var isFrozen: () -> Boolean + } + + interface GroupComponent { + var getElement: () -> HTMLElement + var getTable: () -> Tabulator + var getKey: () -> Any + var getField: () -> String + var getRows: () -> Array + var getSubGroups: () -> Array + var getParentGroup: () -> dynamic + var isVisible: () -> Boolean + var show: () -> Unit + var hide: () -> Unit + var toggle: () -> Unit + } + + interface ColumnComponent { + var getElement: () -> HTMLElement + var getTable: () -> Tabulator + var getDefinition: () -> ColumnDefinition + var getField: () -> String + var getCells: () -> Array + var getNextColumn: () -> dynamic + var getPrevColumn: () -> dynamic + var move: (toColumn: dynamic /* ColumnComponent | ColumnDefinition | HTMLElement | String */, after: Boolean) -> Unit + var isVisible: () -> Boolean + var show: () -> Unit + var hide: () -> Unit + var toggle: () -> Unit + var delete: () -> Promise + var scrollTo: () -> Promise + var getSubColumns: () -> Array + var getParentColumn: () -> dynamic + var headerFilterFocus: () -> Unit + var setHeaderFilterValue: (value: Any) -> Unit + var reloadHeaderFilter: () -> Unit + var getHeaderFilterValue: () -> Any + var updateDefinition: (definition: ColumnDefinition) -> Promise + var getWidth: () -> Number + var setWidth: (width: dynamic /* Number | Boolean */) -> Unit + var validate: () -> dynamic + } + + interface CellComponent { + var getValue: () -> Any + var getOldValue: () -> Any + var restoreOldValue: () -> Any + var getInitialValue: () -> Any + var restoreInitialValue: () -> Any + var getElement: () -> HTMLElement + var getTable: () -> Tabulator + var getRow: () -> RowComponent + var getColumn: () -> ColumnComponent + var getData: () -> Any + var getField: () -> String + var setValue: (value: Any, mutate: Boolean) -> Unit + var checkHeight: () -> Unit + var edit: (ignoreEditable: Boolean) -> Unit + var cancelEdit: () -> Unit + var navigatePrev: () -> Boolean + var navigateNext: () -> Boolean + var navigateLeft: () -> Boolean + var navigateRight: () -> Boolean + var navigateUp: () -> Unit + var navigateDown: () -> Unit + var isEdited: () -> Boolean + var clearEdited: () -> Unit + var isValid: () -> Boolean + var clearValidation: () -> Unit + var validate: () -> Boolean + } + + companion object { + var defaultOptions: Options + var extendModule: (name: String, property: String, values: Any) -> Unit + var findTable: (query: String) -> Array + var registerModule: (module: Module) -> Unit + var bindModules: (__0: Any) -> Unit + } +} + +external open class Module(table: Tabulator) { + companion object { + var moduleName: String + } +} + +external open class AccessorModule + +external open class AjaxModule + +external open class ClipboardModule + +external open class ColumnCalcsModule + +external open class DataTreeModule + +external open class DownloadModule + +external open class EditModule + +external open class ExportModule + +external open class FilterModule + +external open class FormatModule + +external open class FrozenColumnsModule + +external open class FrozenRowsModule + +external open class GroupRowsModule + +external open class HistoryModule + +external open class HtmlTableImportModule + +external open class InteractionModule + +external open class KeybindingsModule + +external open class MenuModule + +external open class MoveColumnsModule + +external open class MoveRowsModule + +external open class MutatorModule + +external open class PageModule + +external open class PersistenceModule + +external open class PrintModule + +external open class PseudoRow + +external open class ReactiveDataModule + +external open class Renderer + +external open class ResizeColumnsModule + +external open class ResizeRowsModule + +external open class ResizeTableModule + +external open class ResponsiveLayoutModule + +external open class SelectRowModule + +external open class SortModule + +external open class TabulatorFull : Tabulator { + constructor(selector: String, options: Options = definedExternally) + constructor(selector: String) + constructor(selector: HTMLElement, options: Options = definedExternally) + constructor(selector: HTMLElement) +} + +external open class ValidateModule \ No newline at end of file diff --git a/visionforge-tables/src/jsMain/kotlin/tabulator/typealiases.kt b/visionforge-tables/src/jsMain/kotlin/tabulator/typealiases.kt new file mode 100644 index 00000000..28dced17 --- /dev/null +++ b/visionforge-tables/src/jsMain/kotlin/tabulator/typealiases.kt @@ -0,0 +1,45 @@ +@file:Suppress("NO_EXPLICIT_VISIBILITY_IN_API_MODE_WARNING") + +package tabulator + +import org.w3c.dom.events.UIEvent + +@Suppress("UNUSED_TYPEALIAS_PARAMETER") +internal typealias Pick = Any + +@Suppress("UNUSED_TYPEALIAS_PARAMETER") +internal typealias Record = Any + +internal typealias FilterFunction = (field: String, type: String /* "=" | "!=" | "like" | "<" | ">" | "<=" | ">=" | "in" | "regex" | "starts" | "ends" */, value: Any, filterParams: Tabulator.FilterParams) -> Unit + +internal typealias GroupValuesArg = Array> + +internal typealias CustomMutator = (value: Any, data: Any, type: String /* "data" | "edit" */, mutatorParams: Any, cell: Tabulator.CellComponent) -> Any + +internal typealias CustomAccessor = (value: Any, data: Any, type: String /* "data" | "download" | "clipboard" */, AccessorParams: Any, column: Tabulator.ColumnComponent, row: Tabulator.RowComponent) -> Any + +internal typealias ColumnCalcParams = (values: Any, data: Any) -> Any + +internal typealias ValueStringCallback = (value: Any) -> String + +internal typealias ValueBooleanCallback = (value: Any) -> Boolean + +internal typealias ValueVoidCallback = (value: Any) -> Unit + +internal typealias EmptyCallback = (callback: () -> Unit) -> Unit + +internal typealias CellEventCallback = (e: UIEvent, cell: Tabulator.CellComponent) -> Unit + +internal typealias CellEditEventCallback = (cell: Tabulator.CellComponent) -> Unit + +internal typealias ColumnEventCallback = (e: UIEvent, column: Tabulator.ColumnComponent) -> Unit + +internal typealias RowEventCallback = (e: UIEvent, row: Tabulator.RowComponent) -> Unit + +internal typealias RowChangedCallback = (row: Tabulator.RowComponent) -> Unit + +internal typealias GroupEventCallback = (e: UIEvent, group: Tabulator.GroupComponent) -> Unit + +internal typealias JSONRecord = Record + +internal typealias ColumnSorterParamLookupFunction = (column: Tabulator.ColumnComponent, dir: String /* "asc" | "desc" */) -> Any \ No newline at end of file diff --git a/visionforge-threejs/src/main/kotlin/space/kscience/visionforge/solid/three/ThreeLabelFactory.kt b/visionforge-threejs/src/main/kotlin/space/kscience/visionforge/solid/three/ThreeLabelFactory.kt index 34ee5ed1..02586120 100644 --- a/visionforge-threejs/src/main/kotlin/space/kscience/visionforge/solid/three/ThreeLabelFactory.kt +++ b/visionforge-threejs/src/main/kotlin/space/kscience/visionforge/solid/three/ThreeLabelFactory.kt @@ -5,6 +5,7 @@ import info.laht.threekt.core.Object3D import info.laht.threekt.geometries.TextBufferGeometry import info.laht.threekt.objects.Mesh import kotlinext.js.jsObject +import kotlinext.js.jso import space.kscience.dataforge.context.logger import space.kscience.dataforge.context.warn import space.kscience.visionforge.onPropertyChange @@ -18,7 +19,7 @@ public object ThreeLabelFactory : ThreeFactory { override val type: KClass get() = SolidLabel::class override fun invoke(three: ThreePlugin, obj: SolidLabel): Object3D { - val textGeo = TextBufferGeometry(obj.text, jsObject { + val textGeo = TextBufferGeometry(obj.text, jso { font = obj.fontFamily size = 20 height = 1