new WritableStream([underlyingSink[, strategy]])


  • underlyingSink <Object>

    • start <Function> 创建 WritableStream 时立即调用的用户定义函数。

      ¥start <Function> A user-defined function that is invoked immediately when the WritableStream is created.

    • write <Function> 将数据块写入 WritableStream 时调用的用户定义函数。

      ¥write <Function> A user-defined function that is invoked when a chunk of data has been written to the WritableStream.

    • close <Function> WritableStream 关闭时调用的用户定义函数。

      ¥close <Function> A user-defined function that is called when the WritableStream is closed.

      • 返回:undefined 兑现的 promise。

        ¥Returns: A promise fulfilled with undefined.

    • abort <Function> 调用以突然关闭 WritableStream 的用户定义函数。

      ¥abort <Function> A user-defined function that is called to abruptly close the WritableStream.

      • reason <any>

      • 返回:undefined 兑现的 promise。

        ¥Returns: A promise fulfilled with undefined.

    • type <any> type 选项保留供将来使用,必须未定义。

      ¥type <any> The type option is reserved for future use and must be undefined.

  • strategy <Object>

    • highWaterMark <number> 应用背压之前的最大内部队列大小。

      ¥highWaterMark <number> The maximum internal queue size before backpressure is applied.

    • size <Function> 一个用户定义的函数,用于标识每个数据块的大小。

      ¥size <Function> A user-defined function used to identify the size of each chunk of data.