-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update: Update texts for tssln (#174)
* Update: Update texts * Update: kotlinUpgradeYarnLock * Fix: Fix around esm import * Code: Format
- Loading branch information
1 parent
2f895bf
commit c6cd4aa
Showing
7 changed files
with
86 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,7 +25,7 @@ kotlin { | |
implementation(npm("midi-file", "1.2.4")) | ||
implementation(npm("js-yaml", "4.1.0")) | ||
implementation( | ||
npm("@sevenc-nanashi/valuetree-ts", "npm:@jsr/[email protected].0"), | ||
npm("@sevenc-nanashi/valuetree-ts", "npm:@jsr/[email protected].1"), | ||
) | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,65 +1,14 @@ | ||
@file:JsModule("@sevenc-nanashi/valuetree-ts") | ||
|
||
package core.external | ||
|
||
import org.khronos.webgl.Uint8Array | ||
|
||
fun createValueTree(): ValueTree { | ||
return js("{type: '', attributes: {}, children: []}").unsafeCast<ValueTree>() | ||
} | ||
|
||
fun baseVariantType(): dynamic { | ||
return js("({type: '', value: undefined})") | ||
} | ||
|
||
fun String.toVariantType(): dynamic { | ||
val value = baseVariantType() | ||
value.type = "string" | ||
value.value = this | ||
|
||
return value | ||
} | ||
fun Int.toVariantType(): dynamic { | ||
val value = baseVariantType() | ||
value.type = "int" | ||
value.value = this | ||
|
||
return value | ||
} | ||
fun Double.toVariantType(): dynamic { | ||
val value = baseVariantType() | ||
value.type = "double" | ||
value.value = this | ||
|
||
return value | ||
} | ||
fun Boolean.toVariantType(): dynamic { | ||
val value = baseVariantType() | ||
if (this) { | ||
value.type = "boolTrue" | ||
value.value = true | ||
} else { | ||
value.type = "boolFalse" | ||
value.value = false | ||
} | ||
|
||
return value | ||
} | ||
fun Uint8Array.toVariantType(): dynamic { | ||
val value = baseVariantType() | ||
value.type = "binary" | ||
value.value = this | ||
|
||
return value | ||
} | ||
|
||
external interface ValueTree { | ||
var type: String | ||
var attributes: dynamic | ||
var children: Array<ValueTree> | ||
} | ||
|
||
@JsModule("@sevenc-nanashi/valuetree-ts") | ||
@JsNonModule | ||
external object ValueTreeTs { | ||
fun parseValueTree(text: Uint8Array): ValueTree | ||
fun dumpValueTree(tree: ValueTree): Uint8Array | ||
} | ||
external fun parseValueTree(text: Uint8Array): ValueTree | ||
external fun dumpValueTree(tree: ValueTree): Uint8Array |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
package core.model | ||
|
||
import core.external.ValueTree | ||
import org.khronos.webgl.Uint8Array | ||
|
||
fun createValueTree(): ValueTree { | ||
return js("{type: '', attributes: {}, children: []}").unsafeCast<ValueTree>() | ||
} | ||
|
||
fun baseVariantType(): dynamic { | ||
return js("({type: '', value: undefined})") | ||
} | ||
|
||
fun String.toVariantType(): dynamic { | ||
val value = baseVariantType() | ||
value.type = "string" | ||
value.value = this | ||
|
||
return value | ||
} | ||
|
||
fun Int.toVariantType(): dynamic { | ||
val value = baseVariantType() | ||
value.type = "int" | ||
value.value = this | ||
|
||
return value | ||
} | ||
|
||
fun Double.toVariantType(): dynamic { | ||
val value = baseVariantType() | ||
value.type = "double" | ||
value.value = this | ||
|
||
return value | ||
} | ||
|
||
fun Boolean.toVariantType(): dynamic { | ||
val value = baseVariantType() | ||
if (this) { | ||
value.type = "boolTrue" | ||
value.value = true | ||
} else { | ||
value.type = "boolFalse" | ||
value.value = false | ||
} | ||
|
||
return value | ||
} | ||
|
||
fun Uint8Array.toVariantType(): dynamic { | ||
val value = baseVariantType() | ||
value.type = "binary" | ||
value.value = this | ||
|
||
return value | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -472,10 +472,10 @@ | |
estree-walker "^1.0.1" | ||
picomatch "^2.2.2" | ||
|
||
"@sevenc-nanashi/valuetree-ts@npm:@jsr/[email protected].0": | ||
version "0.2.0" | ||
resolved "https://npm.jsr.io/~/11/@jsr/sevenc-nanashi__valuetree-ts/0.2.0.tgz#C54B3DEB79C6EDB635DFF2D1B9E96CA29D513BA8" | ||
integrity sha512-dKhOyTjwUxAlzOzynXhrk41Jb+dYkO/GhffXQoeo5UW/Vh62JfA6N0QKmoy004HJ1sv5SMsMD5Toqqrg9+yRKg== | ||
"@sevenc-nanashi/valuetree-ts@npm:@jsr/[email protected].1": | ||
version "0.2.1" | ||
resolved "https://npm.jsr.io/~/11/@jsr/sevenc-nanashi__valuetree-ts/0.2.1.tgz#3495BD76DAEE8C017E6445F318661B6FA8222D58" | ||
integrity sha512-I2ezsDocwuBu9ItJRNZ094Z9DTf1K1SNLfQR8NL2FVDT/YMFrzqPrjilxATwjEK7so8Qw580myZVH5e6/S3V2Q== | ||
dependencies: | ||
"@jsr/sevenc-nanashi__binaryseeker" "^1.0.0" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters