ViewableTree Interface
A tree from which a TreeView can be created.
For more information about our API support guarantees, see here.
Signature
/** @sealed */
export interface ViewableTree
Methods
Method | Return Type | Description |
---|---|---|
viewWith(config) | TreeView<TRoot> | Returns a TreeView using the provided schema. If the stored schema is compatible with the view schema specified by config , the returned TreeView will expose the root with a schema-aware API based on the provided view schema. If the provided schema is incompatible with the stored schema, the view will instead expose a status indicating the incompatibility. |
Method Details
viewWith
Returns a TreeView using the provided schema. If the stored schema is compatible with the view schema specified by config
, the returned TreeView will expose the root with a schema-aware API based on the provided view schema. If the provided schema is incompatible with the stored schema, the view will instead expose a status indicating the incompatibility.
For more information about our API support guarantees, see here.
Signature
viewWith<TRoot extends ImplicitFieldSchema>(config: TreeViewConfiguration<TRoot>): TreeView<TRoot>;
Type Parameters
Parameter | Constraint | Description |
---|---|---|
TRoot | ImplicitFieldSchema |
Remarks
If the tree is uninitialized (has no schema and no content), use initialize(content) on the returned view to set the schema and content together. Using viewWith
followed by upgradeSchema() to initialize only the schema for a document is technically valid when the schema permits trees with no content.
Note that other clients can modify the document at any time, causing the view to change its compatibility status: see events for how to handle invalidation in these cases.
Only one schematized view may exist for a given ITree at a time. If creating a second, the first must be disposed before calling viewWith
again.
Parameters
Parameter | Type | Description |
---|---|---|
config | TreeViewConfiguration<TRoot> |
Returns
Return type: TreeView<TRoot>