ews-javascript-api
ews-javascript-api copied to clipboard
Update ExchangeWebService.d.ts
A temporary fix for initializing a Recurrence.XXXPattern() with arguments (overload not compatible) Using Recurrence.XXXPattern() it’s no argument first and set properties later also failed because some properties are read-only. If directly used new XXXPattern(), it indicates that XXXPattern is not a constructor.
Any other ways to fix it would also be appropriated.
provide code sample which gives you trouble here.
I have no problem using this
import {DailyPattern, DateTime} from 'ews-javascript-api';
const recurrence = new DailyPattern(DateTime.Now, 121)
exactly the same as you did but got
TypeError: ews_javascript_api_1.DailyPattern is not a constructor
or
const recurrence = new Recurrence.WeeklyPattern(DateTime.Now, 1, [DayIfTheWeek.Saturday])
got error TS2554: Expected 0 arguments, but got 3.
I guess it's compilation problem? My tsconfig.json:
target: es2017 module: commonjs strict : true esModuleInterop: true experimentalDecorators: true emitDeoratorMetadata: true allowWyntheticDefaultImports: true noIimplicitAny: false useUnknowInCatchVariables: false
provide code sample which gives you trouble here.
I have no problem using this
import {DailyPattern, DateTime} from 'ews-javascript-api'; const recurrence = new DailyPattern(DateTime.Now, 121)
I got an error with this - DailyPattern is not a contractor.
new Recurrence.DailyPattern(startDate.Date, 1); - this works, but requires // @ts-ignore.