diff options
Diffstat (limited to 'src/fields/FieldUpdatedArgs.ts')
-rw-r--r-- | src/fields/FieldUpdatedArgs.ts | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/fields/FieldUpdatedArgs.ts b/src/fields/FieldUpdatedArgs.ts new file mode 100644 index 000000000..23ccf2a5a --- /dev/null +++ b/src/fields/FieldUpdatedArgs.ts @@ -0,0 +1,27 @@ +import { Field, Opt } from "./Field"; +import { Document } from "./Document"; +import { Key } from "./Key"; + +export enum FieldUpdatedAction { + Add, + Remove, + Replace, + Update +} + +export interface FieldUpdatedArgs { + field: Field; + action: FieldUpdatedAction; +} + +export interface DocumentUpdatedArgs { + field: Document; + key: Key; + + oldValue: Opt<Field>; + newValue: Opt<Field>; + + fieldArgs?: FieldUpdatedArgs; + + action: FieldUpdatedAction; +} |