import { Schema, MsgpackEncodingData, MsgpackRawStringProvider, JSONEncodingData, PrepareJSONOptions } from '../encoding.js'; /** * OptionalSchema allows for another schema-defined value to be optional. * * This expands the set of values which can be represented by the given schema to include `undefined`. * * Note that this schema considers `undefined` _and_ any default values from the underlying schema * to all be default values. This means that when using NamedMapSchema to omit default values, an * `undefined` value is indistinguishable from the given schema's default value; in this respect, * OptionalSchema does not affect the encoding of NamedMapSchema values, but rather allows the * application to restore omitted values as `undefined` instead of their default value. * * Upon decoding, this schema also allows null/undefined values to be acceptable as values. */ export declare class OptionalSchema extends Schema { readonly valueSchema: Schema; constructor(valueSchema: Schema); defaultValue(): undefined; isDefaultValue(data: unknown): boolean; prepareMsgpack(data: unknown): MsgpackEncodingData; fromPreparedMsgpack(encoded: MsgpackEncodingData, rawStringProvider: MsgpackRawStringProvider): unknown; prepareJSON(data: unknown, options: PrepareJSONOptions): JSONEncodingData; fromPreparedJSON(encoded: JSONEncodingData): unknown; }