共用方式為


ContentStream class

固定或無限長度的數據流,包含要譯碼的內容。

建構函式

ContentStream(string, PayloadAssembler)

初始化 contentStream 類別 的新實例。

屬性

contentType

取得這個 ContentStream中包含的物件型別名稱。

id
length

取得這個 ContentStream的長度。

方法

cancel()

關閉組合器。

getStream()

取得這個 ContentStream中包含的數據。

readAsJson<T>()

取得 SubscribableStream 內容做為具類型的 JSON 物件。

readAsString()

取得 SubscribableStream 內容做為字串。

建構函式詳細資料

ContentStream(string, PayloadAssembler)

初始化 contentStream 類別 的新實例。

new ContentStream(id: string, assembler: PayloadAssembler)

參數

id

string

指派給這個實例的標識碼。

assembler
PayloadAssembler

指派給這個實例 PayloadAssembler

屬性詳細資料

contentType

取得這個 ContentStream中包含的物件型別名稱。

string | PayloadTypes contentType

屬性值

string | PayloadTypes

這個 ContentStreamPayloadType

id

id: string

屬性值

string

length

取得這個 ContentStream的長度。

number length

屬性值

number

數位,表示這個 ContentStream長度。

方法詳細資料

cancel()

關閉組合器。

function cancel()

getStream()

取得這個 ContentStream中包含的數據。

function getStream(): SubscribableStream

傳回

這個 ContentStream 的SubscribableStream

readAsJson<T>()

取得 SubscribableStream 內容做為具類型的 JSON 物件。

function readAsJson<T>(): Promise<T>

傳回

Promise<T>

具有 SubscribableStream 內容的具類型物件 Promise。

readAsString()

取得 SubscribableStream 內容做為字串。

function readAsString(): Promise<string>

傳回

Promise<string>

具有 SubscribableStream 內容的字串 Promise。