SourceLocationRegistry
Defined in: source-location.ts:70
Registry for source location formatters.
Allows format-specific packages to register their own location types and formatting logic without modifying core.
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new SourceLocationRegistry():
SourceLocationRegistry
Returns
Section titled “Returns”SourceLocationRegistry
Methods
Section titled “Methods”format()
Section titled “format()”format(
location):string
Defined in: source-location.ts:109
Format a location using the registered formatter.
Parameters
Section titled “Parameters”location
Section titled “location”The location to format
Returns
Section titled “Returns”string
Formatted string, or a fallback if no formatter is registered
get(
kind):SourceLocationFormatter<BaseSourceLocation> |undefined
Defined in: source-location.ts:92
Get the formatter for a location kind.
Parameters
Section titled “Parameters”string
The location kind
Returns
Section titled “Returns”SourceLocationFormatter<BaseSourceLocation> | undefined
The formatter, or undefined if not registered
has(
kind):boolean
Defined in: source-location.ts:99
Check if a formatter is registered for a kind.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”boolean
register()
Section titled “register()”register<
T>(kind,formatter):void
Defined in: source-location.ts:79
Register a formatter for a location kind.
Type Parameters
Section titled “Type Parameters”T extends BaseSourceLocation
Parameters
Section titled “Parameters”string
The location kind (e.g., ‘csv’, ‘xml’)
formatter
Section titled “formatter”Function to format locations of this kind
Returns
Section titled “Returns”void