@gmb/bitmark-parser - v7.21.2
    Preparing search index...

    Type Alias PatchValueFor<P, O>

    PatchValueFor: IsBitmarkPath<P> extends true
        ? string | null
        : O extends "test"
            ? unknown
            : P extends `${infer Base}[${string}]`
                ? NonNullable<PathValue<AnyBit, Base>> extends readonly (infer E)[]
                    ? E
                    : PathValue<AnyBit, P>
                : PathValue<AnyBit, P>

    Build a PatchEntry with the value typed from the literal path, resolved against AnyBit. A bitmark path ($… or […], PLAN-209) takes bitmark source: its value is a string (or null for a valueless tag).

    At an index (id[-], id[1]), the value is typed as an element of the array at the path.

    Type Parameters

    • P extends string
    • O extends PatchOp
    patchEntry("instruction", "add", [{ type: "paragraph", content: [] }]);
    patchEntry("id[-]", "add", "1234");
    patchEntry("cards[0].question", "remove");
    patchEntry("$card[1][-]", "add", "green");