ICodecOptions Interface
Options relating to handling of persisted data.
To use, import via fluid-framework/alpha
.
For more information about our API support guarantees, see here.
This type is "input," meaning that code outside of the library defining it should not read from it. Future versions of this type may add optional members or make typing of members more general.
Signature
export interface ICodecOptions
Properties
Property | Alerts | Modifiers | Type | Description |
---|---|---|---|---|
jsonValidator | Alpha |
readonly |
JsonValidator |
JsonValidator which SharedTree uses to validate persisted data it reads & writes matches the expected encoded format (i.e. the wire format for ops and summaries). See noopValidator and typeboxValidator for out-of-the-box implementations. This option is not "on-by-default" because JSON schema validation comes with a small but noticeable runtime performance cost, and popular schema validation libraries have relatively large bundle size. SharedTree users are still encouraged to use a non-trivial validator (i.e. not |
Property Details
jsonValidator
JsonValidator which SharedTree uses to validate persisted data it reads & writes matches the expected encoded format (i.e. the wire format for ops and summaries).
See noopValidator and typeboxValidator for out-of-the-box implementations.
This option is not "on-by-default" because JSON schema validation comes with a small but noticeable runtime performance cost, and popular schema validation libraries have relatively large bundle size.
SharedTree users are still encouraged to use a non-trivial validator (i.e. not noopValidator
) whenever reasonable: it gives better fail-fast behavior when unexpected encoded data is found, which reduces the risk of unrecoverable data corruption.
For more information about our API support guarantees, see here.
This type is "input," meaning that code outside of the library defining it should not read from it. Future versions of this type may add optional members or make typing of members more general.
Signature
readonly jsonValidator: JsonValidator;
Type: JsonValidator
See Also
CodecWriteOptions for options that are specific to encoding data.