SheetXL - v0.8.0-beta.9+sites.210.e2d420901
    Preparing search index...

    Type Alias Writer

    Writer: (resource: IResource, id: number) => MaybePromise<IResource.JSON | null>

    Writes a single resource wherever the caller wants it, and returns the IResource.JSON that should stand for it in the serialized model.

    Type Declaration

      • (resource: IResource, id: number): MaybePromise<IResource.JSON | null>
      • Parameters

        • resource: IResource

          The resource being written.

        • id: number

          The id the serialized model references this resource by.

        Returns MaybePromise<IResource.JSON | null>

        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.