The resource being written.
The id the serialized model references this resource by.
The JSON to record for the resource, or null to record nothing.
Called once per resource that the write actually touched, never for unused ones.
Returning { uri } is the useful case: the bytes go wherever the writer put them and the
model keeps a pointer, which reads back as an external resource with no reader changes.
Ids are positions, so a null leaves a {} placeholder rather than shifting the resources
after it. If every resource returns null no resources are recorded at all — for a writer
that emits the bytes itself and only needs the ids, such as the xlsx writer.
Writes a single resource wherever the caller wants it, and returns the IResource.JSON that should stand for it in the serialized model.