Packages > @fluidframework/tree > FieldSchema
FieldSchema Class
All policy for a specific field, including functionality that does not have to be kept consistent across versions or deterministic.
This can include policy for how to use this schema for “view” purposes, and well as how to expose editing APIs. Use SchemaFactory to create the FieldSchema instances, for example optional(t, props) .
Signature
/** @sealed */
export declare class FieldSchema<out Kind extends FieldKind = FieldKind, out Types extends ImplicitAllowedTypes = ImplicitAllowedTypes>
Type Parameters
Parameter | Constraint | Default | Description |
---|---|---|---|
Kind | FieldKind | FieldKind | |
Types | ImplicitAllowedTypes | ImplicitAllowedTypes |
Properties
Property | Modifiers | Type | Description |
---|---|---|---|
_typeCheck |
optional
|
MakeNominal | This class is used with instanceof, and therefore should have nominal typing. This field enforces that. |
allowedTypes |
readonly
|
Types | What types of tree nodes are allowed in this field. |
allowedTypeSet |
readonly
|
ReadonlySet<TreeNodeSchema> | What types of tree nodes are allowed in this field. |
kind |
readonly
|
Kind | The kind of this field. Determines the multiplicity, viewing and editing APIs as well as the merge resolution policy. |
props |
optional , readonly
|
FieldProps | undefined | Optional properties associated with the field. |
Property Details
_typeCheck
This class is used with instanceof, and therefore should have nominal typing. This field enforces that.
Signature
protected _typeCheck?: MakeNominal;
allowedTypes
What types of tree nodes are allowed in this field.
Signature
readonly allowedTypes: Types;
allowedTypeSet
What types of tree nodes are allowed in this field.
Signature
get allowedTypeSet(): ReadonlySet<TreeNodeSchema>;
Remarks
Counterpart to allowedTypes , with any lazy definitions evaluated.
kind
The kind of this field. Determines the multiplicity, viewing and editing APIs as well as the merge resolution policy.
Signature
readonly kind: Kind;
props
Optional properties associated with the field.
Signature
readonly props?: FieldProps | undefined;