/*
 * Copyright (c) 2017 NumberFour AG.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *   NumberFour AG - Initial API and implementation
 */

export external public function debuglog(section: string): {function(msg: string, ...param: any[]): void};
export external public function deprecate(func: Function, msg: string): Function;
export external public function format(formatString: string, ...params: any[]): string;
export external public function inherits(constructor: Function, superConstructor: Function): void;
export external public function inspect(object: Object+, options: ~Object with {
    showHidden: boolean;
    depth: number;
    colors: boolean;
    customInspect: boolean;
}=): string;
export external public function log(string: string): void;

export external public class TextEncoder {
     public constructor();
     
     public get encoding(): string;
     
     public encode(str: string): Uint8Array; 
}

export external public interface ~TextDecodeOptions {
    public get stream(): boolean;
}

export external public class TextDecoder {
     public constructor(utflabel: string=, options: TextDecodeOptions=);
     
     public get encoding(): string;
     public get fatal(): boolean;
     public get ignoreBOM(): boolean;
     
     public decode(buffer: ArrayBuffer|ArrayBufferView=, options: TextDecodeOptions=): string; 
}
