Members Interface
Members for classes created by createSchema(types, inputSchemaFactory, name).
For more information about our API support guarantees, see here.
Signature
interface Members<T>
Type Parameters
| Parameter | Description |
|---|---|
| T |
Properties
| Property | Alerts | Modifiers | Type | Description |
|---|---|---|---|---|
| union | Beta | readonly | T | undefined | The child wrapped by this node has one of the types allowed by the union, or undefined if the type is one which was added to the union by a future version of this schema. |
Methods
| Method | Alerts | Return Type | Description |
|---|---|---|---|
| isValid() | Beta | boolean | Returns true, unless this node is in an invalid state. |
Property Details
union
The child wrapped by this node has one of the types allowed by the union, or undefined if the type is one which was added to the union by a future version of this schema.
For more information about our API support guarantees, see here.
Signature
readonly union: T | undefined;
Type: T | undefined
Error Handling
if isValid() is false.
Method Details
isValid
Returns true, unless this node is in an invalid state.
For more information about our API support guarantees, see here.
Signature
isValid(): boolean;
Remarks
A well behaved application should not need this API. If an application is hitting errors when accessing union, this API can be used to help detect and recover from the invalid state which causes those errors (for example by replacing the invalid nodes with new ones).
In this context "invalid" means that the internal implementation details of this node have had their invariants violated. This can happen when: - Using weakly typed construction APIs like importConcise(schema, data) or importVerbose(schema, data, options) to construct an invalid state directly. Using such APIs, even when not creating invalid nodes, is not supported for this schema, since doing so requires knowing the implementation details of this node which are subject to change. - By editing a document using a different client using a different schema for this node. - Violating the TypeScript types to directly manipulate the node internals. - A bug in this node's implementation (possibly in a different client) corrupted the node. - Corruption of the document this node is contained in.
Returns
Return type: boolean