Interfaces
    • 1 Minute to read
    • Dark
      Light

    Interfaces

    • Dark
      Light

    Article summary

    Methods

    setDomain

    /**
     * @param domain Specifies the domain within which this cookie should be presented.
     */
    setDomain(domain: string) => void;

    getDomain

    /**
     * @return Gets the domain name of this cookie.
     */
    getDomain() => string;

    setMaxAge

    /**
     * Sets the maximum age in seconds for this cookie.
     *
     * @param expiry Sets the maximum age in seconds for this cookie.
     */
    setMaxAge(int expiry: number) => void;

    getMaxAge

    /**
     * Gets the maximum age in seconds of this cookie.
     *
     * @return Gets the maximum age in seconds of this cookie.
     */
    getMaxAge() => number;

    setPath

    /**
     * @param uri Specifies a path for the cookie to which the client should return the cookie.
     */
    setPath(uri: string) => void;

    getPath

    /**
     * @return Returns the path on the server to which the browser returns this cookie.
     */
    getPath() => string;

    setSecure

    /**
     * @param flag Indicates to the browser whether the cookie should only be sent using a secure protocol, such as
     *             HTTPS or SSL.
     */
    setSecure(boolean flag: boolean) => void;

    isSecure

    /**
     * @return  Returns true if the browser is sending cookies only over a secure protocol, or false if the browser
     *          can send cookies using any protocol.
     */
    isSecure() => boolean;

    getName

    /**
     * @return Returns the name of the cookie.
     */
    getName() => string;

    getValue

    /**
     * @return Gets the current value of this cookie.
     */
    getValue() => string;

    setHttpOnly

    /**
     * @param isHttpOnly Marks or unmarks this cookie as HttpOnly.
     */
    setHttpOnly(isHttpOnly: boolean) => void;

    isHttpOnly

    /**
     * @return Checks whether this cookie has been marked as HttpOnly.
     */
    isHttpOnly() => boolean;

    Create your own LoggerClass to debug our Mapp Intelligence js library.

    Methods

    log

    /**
     * @param msg Debug message
     */
    log(...msg: Array<any>) => void;

    Example

    class CustomLogger implements IMappIntelligenceLogger {
    	public log(...msg: Array<any>): void {
    		console.log(...msg);
    	}
    }

    Create your own ConsumerClass to use for data transfer to Intelligence.

    Methods

    sendBatch

    /**
     * @param batchContent List of tracking requests
     *
     * @return Promise<boolean>
     */
    sendBatch(batchContent: Array<string>): Promise<boolean>;

    Example

    class TestCustomPrintConsumer implements IMappIntelligenceConsumer {
    	public sendBatch(batchContent: Array<string>): Promise<boolean> {
    		return new Promise(async function(resolve) {
                for (let request of batchContent) {
                    console.log(request);
                }
    
                resolve(true);
            });
    	}
    }


    Was this article helpful?

    What's Next