日本語
@eightkk/vue-weave / core / StructureDiffOptions
Interface: StructureDiffOptions<T>
Defined in: src/core/structureDiff.ts:9
Type Parameters
T
T
Properties
equals?
optionalequals?: (before,after,field) =>boolean
Defined in: src/core/structureDiff.ts:25
Whether two values of one field are equal. Default: Object.is, so objects and arrays compare by reference.
Parameters
before
unknown
after
unknown
field
string
Returns
boolean
fields?
optionalfields?: readonly (keyofT&string)[] | ((item) =>Readonly<Record<string,unknown>>)
Defined in: src/core/structureDiff.ts:18
The compared fields. A list of property names is compared in list order. A function returns the field values of one item; its fields are compared in order of first appearance (the before item's, then the after item's new ones). Default: the own enumerable properties of both items in order of first appearance, without the properties named by key and parentKey when those are property names.
key
key:
StructureKeyAccessor<T,string>
Defined in: src/core/structureDiff.ts:11
The item key that matches the two versions: a non-empty string, unique within each version.
parentKey?
optionalparentKey?:StructureKeyAccessor<T,string|null|undefined>
Defined in: src/core/structureDiff.ts:23
The parent key of a tree-shaped collection; undefined or null for a root. A parent must be a key of the same version. Items whose parent differs between the versions are reported in moved. Omit for a flat collection.