index.d.ts 990 B

123456789101112131415161718192021222324
  1. /*---------------------------------------------------------------------------------------------
  2. * Copyright (c) Microsoft Corporation. All rights reserved.
  3. * Licensed under the MIT License.
  4. * REQUIREMENT: This definition is dependent on the @types/node definition.
  5. * Install with `npm install @types/node --save-dev`
  6. *--------------------------------------------------------------------------------------------*/
  7. declare module 'iconv-lite' {
  8. export function decode(buffer: NodeBuffer, encoding: string, options?: Options): string;
  9. export function encode(content: string, encoding: string, options?: Options): NodeBuffer;
  10. export function encodingExists(encoding: string): boolean;
  11. export function decodeStream(encoding: string, options?: Options): NodeJS.ReadWriteStream;
  12. export function encodeStream(encoding: string, options?: Options): NodeJS.ReadWriteStream;
  13. }
  14. export interface Options {
  15. stripBOM?: boolean;
  16. addBOM?: boolean;
  17. defaultEncoding?: string;
  18. }