Skip to content

gaslamp


Class: RemnantFlicker

Deprecation warning manager for gaslamp.

Emits structured deprecation warnings once per function per version, and throws an error when a deprecation has expired.

Constructors

Constructor

new RemnantFlicker(): RemnantFlicker

Returns

RemnantFlicker

Properties

versions

static versions: Map\<string, VersionInfo>

Mapping of gaslamp version tags to GAS version and deprecation date.

Each key is a git tag (e.g., "0.3.0"), and its value contains: - gas: corresponding internal GAS version number - date: ISO 8601 date (e.g., "2024-11-22") when the function was deprecated

Methods

isExpired()

static isExpired(date): boolean

Check if the given ISO 8601 date is more than the expiration threshold years ago.

Parameters

date

string

ISO 8601 date string, e.g., "2024-11-22"

Returns

boolean

True if the date is older than the expiration threshold


warn()

static warn(depFnName, gitTag, altFnName?): void

Emit a deprecation warning for a function, shown only once per function@version.

Parameters

depFnName

string

Name of the deprecated function

gitTag

string

Version tag when the function was deprecated

altFnName?

string | null

Optional alternative function name to suggest

Returns

void

Throws

Error if the deprecation is older than the expiration threshold

Example

TypeScript
RemnantFlicker.warn("oldFunc", "0.50.0", "newFunc");