Type Alias

GLib-2.0GLib$ParseRecursiveVariantKeyValue

$ParseRecursiveVariantKeyValue: string extends State
    ? VariantTypeError<
        "$ParseRecursiveVariantKeyValue: 'string' is not a supported type.",
    >
    : State extends `${infer Key}${infer AfterKey}`
        ? Key extends | "s"
        | "o"
        | "g"
        | "n"
        | "q"
        | "t"
        | "d"
        | "u"
        | "i"
        | "x"
        | "y"
            ? AfterKey extends `v}${infer Remaining}`
                ? [[BasicTypeMap<Key>, unknown], Remaining]
                : $ParseRecursiveVariantValue<AfterKey> extends [
                    infer V,
                    `}${infer Remaining}`,
                ]
                    ? [[BasicTypeMap<Key>, V], Remaining]
                    : VariantTypeError<`Invalid key-value value type in: ${AfterKey}`>
            : VariantTypeError<`Invalid key-value key type: ${Key}`>
        : VariantTypeError<`Invalid key-value format: ${State}`>

Parses key-value for recursive unpacking

Type Parameters

  • State extends string