declare namespace TextEncodingShim {
	interface TextEncoder_Static {
		new(encoding?: string): TextEncoder_Instance;
	}

	interface TextEncoder_Instance {
		encoding: string;
		encode(input?: string): Uint8Array;
	}

	interface TextDecoderConstructorOptions {
		fatal?: boolean;
	}

	interface TextDecoderDecodeOptions {
		stream?: boolean;
	}

	interface TextDecoder_Static {
		new(encoding?: string, options?: TextDecoderConstructorOptions): TextDecoder_Instance;
	}

	interface TextDecoder_Instance {
		 encoding:  string;
		 fatal:     boolean;
		 ignoreBOM: boolean;
		 decode(input?: ArrayBufferView, options?: TextDecoderDecodeOptions): string;
 	}

	var TextEncoder: TextEncoder_Static;
	var TextDecoder: TextDecoder_Static;

}

declare module 'text-encoding-shim' {
	export = TextEncodingShim;
}