@unisphere/runtime-js
v1.97.0
Published
`@unisphere/runtime-js` is a core library for Unisphere, providing essential Unisphere elements declarations that are utilized by the Unisphere workspace runtime. This library serves as the foundational layer for building and managing Unisphere elements w
Readme
@unisphere/runtime-js
@unisphere/runtime-js is a core library for Unisphere, providing essential Unisphere elements declarations that are utilized by the Unisphere workspace runtime. This library serves as the foundational layer for building and managing Unisphere elements within the Unisphere ecosystem, enabling seamless interaction and integration within the workspace environment.
Features
- Unisphere Element Declarations: Contains type-safe declarations for Unisphere elements, enabling developers to create, modify, and interact with elements in the Unisphere workspace.
- Workspace Runtime Compatibility: Designed to integrate effortlessly with the Unisphere workspace runtime, allowing dynamic interaction between Unisphere elements.
- Modular & Scalable: Built to support modular design and scalability, making it suitable for large-scale applications within the Unisphere ecosystem.
Installation
Install the @unisphere/runtime-js library via npm:
npm install @unisphere/runtime-js
Or with Yarn:
yarn add @unisphere/runtime-js
Usage
After installing @unisphere/runtime-js, you can import and utilize Unisphere element declarations within your project.
import { UnisphereElement } from '@unisphere/runtime-js';
// Example: Declare a new Unisphere element
const myElement: UnisphereElement = {
id: 'unique-element-id',
type: 'custom',
properties: {
// Define properties specific to your element
name: 'My Custom Element',
description: 'An example element for demonstration purposes',
},
};
// Usage in workspace runtime
workspace.addElement(myElement);
Integration with Unisphere Workspace
The elements declared in @unisphere/runtime-js are compatible with the Unisphere workspace runtime. This allows you to register, configure, and manage elements dynamically, enabling a flexible and adaptable workspace.
Example
Here’s a basic example of using @unisphere/runtime-js within a Unisphere workspace:
import { workspace } from 'unisphere-runtime';
import { UnisphereElement } from '@unisphere/runtime-js';
const exampleElement: UnisphereElement = {
id: 'example-id',
type: 'widget',
properties: {
title: 'Example Widget',
content: 'This is a sample widget for Unisphere.',
},
};
workspace.registerElement(exampleElement);
API Reference
The following are key components provided by @unisphere/runtime-js:
• UnisphereElement: A core type for defining elements within the Unisphere workspace.
• id (string): Unique identifier for the element.
• type (string): Type of the element (e.g., widget, component).
• properties (object): Configuration properties specific to the element type.
Additional Types and Utilities
For more details on additional types and utility functions provided by @unisphere/runtime-js, refer to the full documentation (coming soon).
Contributing
Contributions are welcome! Please follow our contributing guidelines and make sure to adhere to our code of conduct.
License
This library is licensed under the MIT License. See the LICENSE file for details.
Contact & Support
If you have any questions or need assistance, please reach out to our support team or open an issue on our GitHub repository.
This `README.md` file provides a comprehensive overview of the `@unisphere/runtime-js` library with installation instructions, usage examples, API reference, and contribution guidelines. Adjust any placeholders (like links or example code) as needed for your specific setup.