import { ReadonlyJSONValue } from '@lumino/coreutils' ; /**
 * An abstract base class for datastore field types.
 */ export abstract class Field < Value extends ReadonlyJSONValue , Update extends ReadonlyJSONValue , Metadata extends ReadonlyJSONValue , Change extends ReadonlyJSONValue , Patch extends ReadonlyJSONValue > { param options constructor ( options = { } ) { let opts = { description : '' , ... options } ; this . description = opts . description ; } /**
     * The human-readable description of the field.
     */ readonly description : string ; /**
     * The value type for the field.
     *
     * #### Notes
     * This type represents the user-facing value stored in the record.
     */ readonly ValueType : Value ; /**
     * The update type for the field.
     *
     * #### Notes
     * This type represents the data the user passes to the `update`
     * method of a table to update the field of a particular record.
     */ readonly UpdateType : Update ; /**
     * The metadata type for the field.
     *
     * #### Notes
     * This type represents extra bookeeping data needed by the field
     * to accurately apply updates and patches.
     *
     * This type extends the `ReadonlyJSONValue` type so that it may
     * hold readonly JSON data. However, the metadata is intended to
     * be mutated in-place and thus may also contain mutable data.
     */ readonly MetadataType : Metadata ; /**
     * The change type for the field.
     *
     * #### Notes
     * This type represents the user-facing change to the field's value.
     */ readonly ChangeType : Change ; /**
     * The patch type for the field.
     *
     * #### Notes
     * This type represents the system-facing patch to the field's value.
     */ readonly PatchType : Patch ; /**
     * The discriminated type name for the field.
     */ abstract readonly type : string ; returns abstract createValue ( ) ; returns abstract createMetadata ( ) ; param args returns abstract applyUpdate ( args ) ; param args returns abstract applyPatch ( args ) ; param args returns abstract unapplyPatch ( args ) ; param first param second returns abstract mergeChange ( first , second ) ; param first param second returns abstract mergePatch ( first , second ) ; } /**
 * The namespace for the `Field` class statics.
 */ export namespace Field { /**
     * An options object for initializing a field.
     */ export interface IOptions { /**
         * The human-readable description of the field.
         *
         * The default is `''`.
         */ description ? : string ; } /**
     * A type alias for the arguments to an update operation.
     */ export type UpdateArgs < Value , Update , Metadata > = { /**
         * The previous value of the field.
         */ readonly previous : Value ; /**
         * The user update for the field.
         */ readonly update : Update ; /**
         * The metadata for the field.
         */ readonly metadata : Metadata ; /**
         * The datastore version.
         */ readonly version : number ; /**
         * The datastore id.
         */ readonly storeId : number ; } ; /**
     * A type alias for the result of an update operation.
     */ export type UpdateResult < Value , Change , Patch > = { /**
         * The new value of the field.
         */ readonly value : Value ; /**
         * The user-facing change for the field.
         */ readonly change : Change ; /**
         * The system-facing patch for the field.
         */ readonly patch : Patch ; } ; /**
     * A type alias for the arguments to a patch operation.
     */ export type PatchArgs < Value , Patch , Metadata > = { /**
         * The previous value of the field.
         */ readonly previous : Value ; /**
         * The system patch for the field.
         */ readonly patch : Patch ; /**
         * The metadata for the field.
         */ readonly metadata : Metadata ; } ; /**
     * A type alias for the result of a patch operation.
     */ export type PatchResult < Value , Change > = { /**
         * The new value of the field.
         */ readonly value : Value ; /**
         * The user-facing change for the field.
         */ readonly change : Change ; } ; } /**
 * A type alias which is compatible with any field type.
 */ export type AnyField = Field < ReadonlyJSONValue , ReadonlyJSONValue , ReadonlyJSONValue , ReadonlyJSONValue , ReadonlyJSONValue > ;