File

projects/ngrx-data-lib/src/lib/data-format/format-converter.ts

Index

Methods

Methods

convertToData
convertToData(obj: any)

convert javascript object to data.

Parameters :
Name Type Optional Description
obj any No

the javascript object to convert.

Returns : ArrayBuffer
convertToObject
convertToObject(data: ArrayBuffer)

convert the data to a javascript object.

Parameters :
Name Type Optional Description
data ArrayBuffer No

the data to convert.

Returns : any
getCharset
getCharset()

return the charsets supported by this format converter.

Returns : string
getMediaType
getMediaType()

return the media type supported by this format.

Returns : string
import { FormatDataType } from '../http/response-type';


export interface IFormatConverter
{
    /**
     * return the media type supported by this format.
     */
    getMediaType(): string;

    /**
     * return the charsets supported by this format converter.
     */
    getCharset(): string;

    /**
     * convert the data to a javascript object. 
     * @param data the data to convert.
     */
    convertToObject(data: ArrayBuffer) : any;

    /**
     * convert javascript object to data.
     * @param obj the javascript object to convert.
     */
    convertToData(obj: any) : ArrayBuffer;   
}

result-matching ""

    No results matching ""