FormatSetFormatsProvider Class @beta
A mutable format provider that manages format definitions within a format set. When formats are added or removed, the underlying format set is automatically updated.
Implements
Methods
| Name | Description | |
|---|---|---|
| constructor(props: { fallbackProvider?: FormatsProvider, formatSet: FormatSet }): FormatSetFormatsProvider | ||
| addFormat(name: string, format: string | FormatDefinition): Promise<void> | Adds or updates the format definition returned for a kind of quantity. | |
| clearFallbackProvider(): void | Clears the fallback provider, if one is set. | |
| getFormat(input: string, system?: UnitSystemKey, context?: FormatsProviderContext): Promise<FormatDefinition | undefined> | Retrieves a format definition from the format set, resolving string references and consulting the fallback provider when needed. | |
| getFormatSync(input: string, system?: UnitSystemKey, context?: FormatsProviderContext): FormatDefinition | undefined | Retrieves a format definition from the format set without awaiting a provider. | |
| removeFormat(name: string): Promise<void> | Removes a format definition or string reference from the format set. |
Properties
| Name | Type | Description | |
|---|---|---|---|
| onFormatsChanged | BeEvent<(args: FormatsChangedArgs) => void> | Fired when formats are added, removed, or changed. |
Defined in
Last Updated: 05 November, 2026
Found something wrong, missing, or unclear on this page? Raise an issue in our repo.