LixPlugin = {
applyChanges?
: ({ file, changes, }
: {changes
:Change
[];file
:Omit
<LixFile
,"data"
> & {data?
:Uint8Array
; }; }) => {fileData
:Uint8Array
; };detectChanges?
: ({ before, after, }
: {after
:Omit
<LixFile
,"data"
> & {data
:Uint8Array
; };before?
:Omit
<LixFile
,"data"
> & {data?
:Uint8Array
; }; }) =>DetectedChange
[];detectChangesGlob?
:string
;diffUiComponent?
:CustomElementConstructor
;key
:string
; }
optional
applyChanges: ({ file, changes, }
: {changes
:Change
[];file
:Omit
<LixFile
,"data"
> & {data?
:Uint8Array
; }; }) => {fileData
:Uint8Array
; }
Parameter | Type | Description |
---|---|---|
{ file, changes, } | { changes : Change []; file : Omit <LixFile , "data" > & { data? : Uint8Array ; }; } | - |
{ file, changes, }.changes | Change [] | - |
{ file, changes, }.file | Omit <LixFile , "data" > & { data? : Uint8Array ; } | The file to which the changes should be applied. The file.data might be undefined if the file does not exist at the time of applying the changes. This can happen when merging a version that created a new file that did not exist in the target version. Or, a file has been deleted and should be restored at a later point. |
{ fileData
: Uint8Array
; }
fileData:
Uint8Array
optional
detectChanges: ({ before, after, }
: {after
:Omit
<LixFile
,"data"
> & {data
:Uint8Array
; };before?
:Omit
<LixFile
,"data"
> & {data?
:Uint8Array
; }; }) =>DetectedChange
[]
Detects changes between the before
and after
file update(s).
Before
is undefined
if the file did not exist before (
the file was created).
After
is always defined. Either the file was updated, or
deleted. If the file is deleted, lix own change control
will handle the deletion. Hence, after
is always be defined.
Parameter | Type |
---|---|
{ before, after, } | { after : Omit <LixFile , "data" > & { data : Uint8Array ; }; before? : Omit <LixFile , "data" > & { data? : Uint8Array ; }; } |
{ before, after, }.after | Omit <LixFile , "data" > & { data : Uint8Array ; } |
{ before, after, }.before? | Omit <LixFile , "data" > & { data? : Uint8Array ; } |
optional
detectChangesGlob:string
The glob pattern that should invoke detectChanges()
.
optional
diffUiComponent:CustomElementConstructor
UI components that are used to render the diff view.
key:
string