ews-javascript-api icon indicating copy to clipboard operation
ews-javascript-api copied to clipboard

Update ExchangeWebService.d.ts

Open kavin71725 opened this issue 3 years ago • 3 comments
trafficstars

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.

kavin71725 avatar Aug 06 '22 16:08 kavin71725

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)

gautamsi avatar Aug 07 '22 13:08 gautamsi

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

kavin71725 avatar Aug 08 '22 04:08 kavin71725

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.

bladerunner2020 avatar Nov 26 '23 17:11 bladerunner2020