state
TelemetryStateβ
Defined in: state.ts:14
Propertiesβ
enabledβ
enabled: boolean;
Defined in: state.ts:15
lastSentConfigsβ
lastSentConfigs: string[];
Defined in: state.ts:17
noticeVersionβ
noticeVersion: number;
Defined in: state.ts:16
reason?β
optional reason?: string;
Defined in: state.ts:18
getStatePath()β
function getStatePath(dir?): string;
Defined in: state.ts:21
Parametersβ
dir?β
string = ...
Returnsβ
string
readState()β
function readState(path?): TelemetryState | null | undefined;
Defined in: state.ts:47
Reads the state file.
Parametersβ
path?β
string = ...
Returnsβ
TelemetryState | null | undefined
the state, undefined when the file does not exist, or null when
it is unreadable or corrupt (telemetry is then disabled for this run).
writeState()β
function writeState(next, path?): TelemetryState;
Defined in: state.ts:69
Atomically writes the state (temp file + rename). Re-reads the current file
and merges lastSentConfigs first so parallel runs do not lose entries.
Parametersβ
nextβ
Partial<TelemetryState>
path?β
string = ...
Returnsβ
the state that was written.