-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #266 from modelix/feature/js-model-client
Feature/js model client
- Loading branch information
Showing
6 changed files
with
548 additions
and
0 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
40 changes: 40 additions & 0 deletions
40
kotlin-utils/src/commonMain/kotlin/org/modelix/kotlin/utils/UnstableModelixFeature.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/* | ||
* Copyright (c) 2023. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.modelix.kotlin.utils | ||
|
||
/** | ||
* Marks an API as unstable. | ||
* | ||
* @param reason Describes why the feature is experimental. | ||
* @param intendedFinalization Describes when this API is intended to be finalized or removed. | ||
*/ | ||
@RequiresOptIn(message = "This API is experimental. It may be changed in the future without notice.") | ||
@Retention(AnnotationRetention.BINARY) | ||
@Target( | ||
AnnotationTarget.CLASS, | ||
AnnotationTarget.FUNCTION, | ||
AnnotationTarget.PROPERTY, | ||
AnnotationTarget.ANNOTATION_CLASS, | ||
AnnotationTarget.CONSTRUCTOR, | ||
AnnotationTarget.PROPERTY_SETTER, | ||
AnnotationTarget.PROPERTY_GETTER, | ||
AnnotationTarget.TYPEALIAS, | ||
) | ||
annotation class UnstableModelixFeature( | ||
val reason: String, | ||
val intendedFinalization: String, | ||
) |
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
57 changes: 57 additions & 0 deletions
57
model-client/src/jsMain/kotlin/org/modelix/model/client2/ChangeJS.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
/* | ||
* Copyright (c) 2023. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.modelix.model.client2 | ||
|
||
import INodeJS | ||
import org.modelix.kotlin.utils.UnstableModelixFeature | ||
|
||
@UnstableModelixFeature( | ||
reason = "The overarching task https://issues.modelix.org/issue/MODELIX-500 is in development.", | ||
intendedFinalization = "The client is intended to be finalized when the overarching task is finished.", | ||
) | ||
@JsExport | ||
sealed interface ChangeJS { | ||
val node: INodeJS | ||
} | ||
|
||
@UnstableModelixFeature( | ||
reason = "The overarching task https://issues.modelix.org/issue/MODELIX-500 is in development.", | ||
intendedFinalization = "The client is intended to be finalized when the overarching task is finished.", | ||
) | ||
@JsExport | ||
data class PropertyChanged(override val node: INodeJS, val role: String) : ChangeJS | ||
|
||
@UnstableModelixFeature( | ||
reason = "The overarching task https://issues.modelix.org/issue/MODELIX-500 is in development.", | ||
intendedFinalization = "The client is intended to be finalized when the overarching task is finished.", | ||
) | ||
@JsExport | ||
data class ChildrenChanged(override val node: INodeJS, val role: String?) : ChangeJS | ||
|
||
@UnstableModelixFeature( | ||
reason = "The overarching task https://issues.modelix.org/issue/MODELIX-500 is in development.", | ||
intendedFinalization = "The client is intended to be finalized when the overarching task is finished.", | ||
) | ||
@JsExport | ||
data class ReferenceChanged(override val node: INodeJS, val role: String) : ChangeJS | ||
|
||
@UnstableModelixFeature( | ||
reason = "The overarching task https://issues.modelix.org/issue/MODELIX-500 is in development.", | ||
intendedFinalization = "The client is intended to be finalized when the overarching task is finished.", | ||
) | ||
@JsExport | ||
data class ContainmentChanged(override val node: INodeJS) : ChangeJS |
Oops, something went wrong.