Line

You are reading the unreleased docs (next). See latest (v0.9)

ui/server/src/pageChanges

thin glue between the core change tracker (src/file-change-tracker.mjs), the core diff view model (src/text-diff.mjs) and the Pages Editor routes.

Cockpit server, next. Source: ui/server/src/pageChanges.mjs.

Variables#

pageChangeTracker#

const pageChangeTracker: object

Defined in: ui/server/src/pageChanges.mjs:9

Type Declaration#

adopt

adopt: (key, content) => void

Parameters
key

string

content

string

Returns

void

dismiss

dismiss: (key) => void

Parameters
key

string

Returns

void

getLastChange

getLastChange: (key) => any

Parameters
key

string

Returns

any

observe

observe: (key, content) => any

Parameters
key

string

content

string

Returns

any

Functions#

adoptOwnWrite()#

adoptOwnWrite(absPath, content, tracker?): void

Defined in: ui/server/src/pageChanges.mjs:33

Called by the editor's own save path so its writes are never reported as external.

Parameters#

absPath

any

content

any

tracker?
adopt

(key, content) => void

dismiss

(key) => void

getLastChange

(key) => any

observe

(key, content) => any

Returns#

void


describePageChange()#

describePageChange(absPath, tracker?): object

Defined in: ui/server/src/pageChanges.mjs:22

Observe the file's current disk content and describe its last external change (or null). The change is per-file (by absolute path) and persists until dismissed or until the editor itself saves the file.

Parameters#

absPath

any

tracker?
adopt

(key, content) => void

dismiss

(key) => void

getLastChange

(key) => any

observe

(key, content) => any

Returns#

object

change

change: object

change.afterHash

afterHash: any

change.at

at: any

change.beforeHash

beforeHash: any

change.rows

rows: object[]

change.stats

stats: object

change.stats.added

added: number

change.stats.removed

removed: number