mazira / rtf-stream-parser

Contains native Node classes for transforming an RTF byte stream into tokens, and de-encapsulating HTML
MIT License
23 stars 4 forks source link

An accessor cannot be declared in an ambient context. #6

Open dev01prishusoft opened 4 years ago

dev01prishusoft commented 4 years ago

install the npm in my angular application and And put this code import * as iconvLite from 'iconv-lite'; import { deEncapsulateSync } from 'rtf-stream-parser';

const rtf = '{\rtf1\ansi\ansicpg1252\fromtext{{{{{{hello}}}}}}}'; const result = deEncapsulateSync(rtf, { decode: iconvLite.decode }); console.log(result); // { mode: 'text', text: 'hello' }

it give below error

ERROR in node_modules/rtf-stream-parser/dist/src/de-encapsulate.d.ts(90,9): error TS1086: An accessor cannot be declared in an ambient context. node_modules/rtf-stream-parser/dist/src/de-encapsulate.d.ts(91,9): error TS1086: An accessor cannot be declared in an ambient context. node_modules/rtf-stream-parser/dist/src/de-encapsulate.d.ts(92,9): error TS1086: An accessor cannot be declared in an ambient context. node_modules/rtf-stream-parser/dist/src/de-encapsulate.d.ts(93,9): error TS1086: An accessor cannot be declared in an ambient context.

image