Header menu logo FSharp.ATProto

Labels Module

Functions and values

Function or value Description

builtInLabels

Full Usage: builtInLabels

Returns: LabelDefinition list

The built-in AT Protocol label definitions.

Returns: LabelDefinition list

createLabelMap customLabels

Full Usage: createLabelMap customLabels

Parameters:
Returns: Map<(string * string), LabelDefinition>

Merge built-in labels with custom labeler-defined labels into a lookup map. Custom labels are keyed by (labelerDid, identifier). Built-in labels use ("", identifier). When looking up, the label source DID is used to prefer custom definitions from the same labeler, falling back to built-in definitions.

customLabels : LabelDefinition list
Returns: Map<(string * string), LabelDefinition>

findLabel identifier

Full Usage: findLabel identifier

Parameters:
    identifier : string

Returns: LabelDefinition option

Find a built-in label definition by its identifier string.

identifier : string
Returns: LabelDefinition option

findLabelWithCustom labelMap labelerDid identifier

Full Usage: findLabelWithCustom labelMap labelerDid identifier

Parameters:
    labelMap : Map<(string * string), LabelDefinition>
    labelerDid : string
    identifier : string

Returns: LabelDefinition option

Find a label definition by identifier and optional labeler DID. First checks for a custom definition from the given labeler, then falls back to the built-in definition.

labelMap : Map<(string * string), LabelDefinition>
labelerDid : string
identifier : string
Returns: LabelDefinition option

interpretLabelValueDefinition def definedBy

Full Usage: interpretLabelValueDefinition def definedBy

Parameters:
Returns: LabelDefinition

Interpret a custom label value definition from a labeler into a LabelDefinition. Follows the TypeScript SDK's interpretLabelValueDefinition pattern: maps severity/blurs to context-specific behaviors, sets configurable=true, and adds NoSelf + optional Adult flags.

def : CustomLabelValueDef
definedBy : string option
Returns: LabelDefinition

interpretLabelValueDefinitions labelerDid defs

Full Usage: interpretLabelValueDefinitions labelerDid defs

Parameters:
Returns: LabelDefinition list

Interpret multiple custom label value definitions from a labeler. Filters to only valid custom label identifiers (not system labels starting with '!').

labelerDid : string
defs : CustomLabelValueDef list
Returns: LabelDefinition list

isCustomLabelValue identifier

Full Usage: isCustomLabelValue identifier

Parameters:
    identifier : string

Returns: bool

Check whether a label identifier matches the custom label value pattern (lowercase letters and hyphens).

identifier : string
Returns: bool

Type something to start searching.