Skip to content
@drupflare/spool v1.0.0 GitHub
    Preparing search index...

    Type Alias DictionaryEncoder

    DictionaryEncoder: (
        dictionary: Uint8Array,
        input: Uint8Array,
        format: DictionaryFormat,
    ) => Promise<Uint8Array>

    Compresses input against dictionary and returns the compressed stream only. spool adds the coding's header (the magic bytes and the SHA-256 of the dictionary). For dcz the dictionary is a raw content dictionary and the window must stay at or under 8 MiB or 1.25 times the dictionary, whichever is larger. For dcb it is a Brotli prefix dictionary. It throws for a format it cannot produce, and the proxy then answers with the plain body.

    Type Declaration

      • (
            dictionary: Uint8Array,
            input: Uint8Array,
            format: DictionaryFormat,
        ): Promise<Uint8Array>
      • Parameters

        Returns Promise<Uint8Array>