meo-canvas
    Preparing search index...

    Type Alias ImageSource

    ImageSource:
        | { path: string }
        | { httpOptions?: RequestInit; url: string }
        | { bytes: Uint8Array }

    Where an image's bytes come from.

    Type Declaration

    • { path: string }
      • Readonlypath: string

        A path on the machine doing the rendering, read at render time.

    • { httpOptions?: RequestInit; url: string }
      • Optional ReadonlyhttpOptions?: RequestInit

        Merged over the scene-wide httpOptions on Root for this source alone.

        Merged rather than replacing, per key, and headers per header name — so a scene-wide Authorization survives a source that only sets an Accept, which is how every other pair of settings in this package behaves.

        signal is the exception: it composes. Every other member is a value this source is stating; a signal is the caller's kill switch, and one here is composed with the scene's rather than replacing it. So a signal set here can only make this fetch stop sooner, never let it outlive an abort at the root.

        On the source and not on the node, because a URL can appear in three places: an image's src, a backgroundImage and a mask. Put on ImageProps this would cover one of them and leave the other two quietly scene-wide, which is the split that has already produced one defect here — a URL refusal written against a background image passed while Image went on encoding URLs, because the two paths each held their own copy of the branch.

      • Readonlyurl: string

        A remote address, fetched at render time.

        Refused unless the renderer was built to fetch. The core is fetch-free by default and answers a URL with an error rather than reaching the network on an input's say-so; the CLI needs --features net for the same reason.

    • { bytes: Uint8Array }
      • Readonlybytes: Uint8Array

        The encoded image itself, when the caller already holds it.