insert
ts
function Delta.insert(
ops: Delta,
content: string | EmbedValue,
attributes?: OpAttributes | null,
): DeltaAdds an insert operation to the delta.
Example
ts
import { Delta } from "@monstermann/delta";
Delta.insert([], "Hello");
// [{ insert: "Hello" }]
Delta.insert([], "Hello", { bold: true });
// [{ insert: "Hello", attributes: { bold: true } }]ts
import { Delta } from "@monstermann/delta";
pipe([], Delta.insert("Hello"));
// [{ insert: "Hello" }]
pipe(
[],
Delta.insert("Hello", { bold: true }),
Delta.insert(" world", { italic: true }),
);
// [{ insert: "Hello", attributes: { bold: true } },
// { insert: " world", attributes: { italic: true } }]