API reference

petty.settings

petty.settings.get

get(key: string): T | null

Returns the stored value, or the manifest-declared default, or null.

petty.settings.set

set(key: string, value: unknown): void

Writes the value and dispatches settings:changed locally. Pass null to delete the stored override.

petty.settings.onChange

onChange(key: string, callback: (newValue: T) => void): void

Registers a callback fired whenever the named setting changes. The callback receives the new value directly (not the {key,value} envelope).