UNPKG

@jaricardodev/ews-javascript-api

Version:
1,487 lines (1,486 loc) 910 kB
declare module "ews-javascript-api" { import * as moment from 'moment-timezone'; import { FetchStream, fetchUrl, FetchOptions } from 'fetch'; export interface IndexerWithStringKey<TValue> { [index: string]: TValue; } export interface IndexerWithNumericKey<TValue> { [index: number]: TValue; } export interface KeyValuePair<TKey, TValue> { key: TKey; value: TValue; } export interface StringKeyPicker<TValue> { (value: TValue): string; } class Dictionary<TKey, TValue> { /** get all keys */ get Keys(): TKey[]; /**get all items in key,value pair array */ get Items(): KeyValuePair<TKey, TValue>[]; /** get all values */ get Values(): TValue[]; /** get number of objects in dictionary */ get length(): number; /** get number of objects in the dictionary */ get Count(): number; constructor(keyPickerFunc: StringKeyPicker<TKey>); /** get string values of all keys */ getStringKeys(): string[]; /** add value or update the value for key */ Add(key: TKey, value: TValue): void; /** add value or update the value for key */ addUpdate(key: TKey, value: TValue): void; /** Set value for key */ set(key: TKey, value: TValue): void; /** sets the new entry with old value or optionally new value, use isnull parameter to make sure you are setting a null value instead of old value */ setEntry(oldKey: string, newKey: TKey): void; setEntry(oldKey: TKey, newKey: TKey): void; /** get value for key */ get(key: string): TValue; get(key: TKey): TValue; /**try get value for key or return exception in IOutParam.exception */ tryGetValue(key: string, outValue: IOutParam<TValue>): boolean; tryGetValue(key: TKey, outValue: IOutParam<TValue>): boolean; /**remove key and value for key */ remove(key: string): boolean; remove(key: TKey): boolean; /** check if key exist */ containsKey(key: string): boolean; containsKey(key: TKey): boolean; /** clear dictionary */ clear(): void; } export interface IndexerWithEnumKey<TKey, TValue> { [index: number]: TValue; } /** * Represents an alternate mailbox. * @sealed */ class AlternateMailbox { /** * Gets the alternate mailbox type. */ get Type(): string; /** * Gets the alternate mailbox display name. */ get DisplayName(): string; /** * Gets the alternate mailbox legacy DN. */ get LegacyDN(): string; /** * Gets the alernate mailbox server. */ get Server(): string; /** * Gets the alternate mailbox address. * It has value only when Server and LegacyDN is empty. */ get SmtpAddress(): string; /** * Gets the alternate mailbox owner SmtpAddress. */ get OwnerSmtpAddress(): string; } /** * Represents a user setting that is a collection of alternate mailboxes. * @sealed */ class AlternateMailboxCollection { entries: AlternateMailbox[]; /** * Gets the collection of alternate mailboxes. */ get Entries(): AlternateMailbox[]; /** @private set */ set Entries(value: AlternateMailbox[]); }/** * Represents an error returned by the Autodiscover service. * @sealed */ class AutodiscoverError { /** * Gets the time when the error was returned. */ get Time(): string; /** * Gets a hash of the name of the computer that is running Microsoft Exchange Server that has the Client Access server role installed. */ get Id(): string; /** * Gets the error code. */ get ErrorCode(): number; /** * Gets the error message. */ get Message(): string; /** * Gets the debug data. */ get DebugData(): string; /** * Parses the XML Js Object creates an Autodiscover error. * * @param {any} jsObject The object. * @return {AutodiscoverError} An Autodiscover error. */ Parse(jsObject: any): AutodiscoverError; } /** * Represents a collection of responses to a call to the Autodiscover service. * @typeparam {TResponse} The type of the responses in the collection. */ abstract class AutodiscoverResponseCollection<TResponse extends AutodiscoverResponse> extends AutodiscoverResponse { /** * Gets the number of responses in the collection. */ get Count(): number; /** * Gets the response at the specified index. * * @param {number} index Index. * @returns {TResponse} TResponse at the index */ __thisIndexer(index: number): TResponse; /** * Gets an enumerator that iterates through the elements of the collection. * * @return {TResponse[]} An IEnumerator for the collection. */ GetEnumerator(): TResponse[]; } /** * Represents a binding to the Exchange Autodiscover Service. * @sealed */ class AutodiscoverService extends ExchangeServiceBase { /** * Maximum number of Url (or address) redirections that will be followed by an Autodiscover call * * @static */ static AutodiscoverMaxRedirections: number; /** * Set Autodiscover hard coded url for Office 365, useful in GCC and O365 in China. This is also helpful if O365 need changing url for some reason (beta testing, transition to different url), no need to update lib * * @static * @type {string} */ static get Office365AutodiscoverUrl(): string; static set Office365AutodiscoverUrl(value: string); /** * Set Autodiscover hard coded check for header when it is auto redirected (skip 302 and follow the redirect in lib, likely browsers) * * @static * @type {string} */ static get Office365AutodiscoverRedirectHeader(): string; static set Office365AutodiscoverRedirectHeader(value: string); /** * Set Autodiscover hard coded check for header value when it is auto redirected (skip 302 and follow the redirect in lib, likely browsers) * * @static * @type {string} */ static get Office365AutodiscoverRedirectHeaderValue(): string; static set Office365AutodiscoverRedirectHeaderValue(value: string); get Domain(): string; set Domain(value: string); get Url(): Uri; set Url(value: Uri); get IsExternal(): boolean | null; set IsExternal(value: boolean | null); get RedirectionUrlValidationCallback(): AutodiscoverRedirectionUrlValidationCallback; set RedirectionUrlValidationCallback(value: AutodiscoverRedirectionUrlValidationCallback); get DnsServerAddress(): any; set DnsServerAddress(value: any); get EnableScpLookup(): boolean; set EnableScpLookup(value: boolean); /** * Initializes a new instance of the **AutodiscoverService** class. */ constructor(); /** * Initializes a new instance of the **AutodiscoverService** class. * * @param {ExchangeVersion} requestedServerVersion The requested server version. */ constructor(requestedServerVersion: ExchangeVersion); /** * Initializes a new instance of the **AutodiscoverService** class. * * @param {string} domain The domain that will be used to determine the URL of the service. */ constructor(domain: string); /** * Initializes a new instance of the **AutodiscoverService** class. * * @param {Uri} url The URL of the service. * @param {string} domain The domain that will be used to determine the URL of the service. * @param {ExchangeVersion} requestedServerVersion The requested server version. */ constructor(domain: string, requestedServerVersion: ExchangeVersion); /** * Initializes a new instance of the **AutodiscoverService** class. * * @param {Uri} url The URL of the service. */ constructor(url: Uri); /** * Initializes a new instance of the **AutodiscoverService** class. * * @param {Uri} url The URL of the service. * @param {ExchangeVersion} requestedServerVersion The requested server version. */ constructor(url: Uri, requestedServerVersion: ExchangeVersion); /** * Disables SCP lookup if duplicate email address redirection. * * @param {string} emailAddress The email address to use. * @param {string[]} redirectionEmailAddresses The list of prior redirection email addresses. */ DisableScpLookupIfDuplicateRedirection(emailAddress: string, redirectionEmailAddresses: string[]): void; /** * Retrieves the specified settings for a set of domains. * * @param {string[]} domains The SMTP addresses of the domains. * @param {ExchangeVersion} requestedVersion Requested version of the Exchange service. * @param {...DomainSettingName[]} domainSettingNames The domain setting names. * @return {Promise<GetDomainSettingsResponseCollection>} A GetDomainSettingsResponseCollection object containing the responses for each individual domain. */ GetDomainSettings(domains: string[], requestedVersion: ExchangeVersion, ...domainSettingNames: DomainSettingName[]): Promise<GetDomainSettingsResponseCollection>; /** * Retrieves the specified settings for a domain. * * @param {string} domain The domain. * @param {ExchangeVersion} requestedVersion Requested version of the Exchange service. * @param {...DomainSettingName[]} domainSettingNames The domain setting names. * @return {Promise<GetDomainSettingsResponse>} A DomainResponse object containing the requested settings for the specified domain. */ GetDomainSettings(domain: string, requestedVersion: ExchangeVersion, ...domainSettingNames: DomainSettingName[]): Promise<GetDomainSettingsResponse>; /** * Retrieves the specified settings for single SMTP address. * @remarks This method handles will run the entire Autodiscover "discovery" algorithm and will follow address and URL redirections. * @param {string} userSmtpAddress The SMTP addresses of the user. * @param {UserSettingName[]} userSettingNames The user setting names. * @return {Promise<GetUserSettingsResponse>} A UserResponse object containing the requested settings for the specified user. */ GetUserSettings(userSmtpAddress: string, userSettingNames: UserSettingName[]): Promise<GetUserSettingsResponse>; /** * Retrieves the specified settings for a set of users. * * @param {string[]} userSmtpAddresses The SMTP addresses of the users. * @param {...UserSettingName[]} userSettingNames The user setting names. * @return {Promise<GetUserSettingsResponseCollection>} A GetUserSettingsResponseCollection object containing the responses for each individual user. */ GetUsersSettings(userSmtpAddresses: string[], ...userSettingNames: UserSettingName[]): Promise<GetUserSettingsResponseCollection>; ProcessHttpErrorResponse(httpWebResponse: XMLHttpRequest, webException: any): any; TraceResponse(response: XMLHttpRequest, memoryStream: any): any; ThrowIfDuplicateRedirection(emailAddress: string, redirectionEmailAddresses: IRefParam<string[]>): void; } export interface GetSettingsMethod<TGetSettingsResponseCollection, TSettingName> { (smtpAddresses: string[], settings: TSettingName[], requestedVersion: ExchangeVersion, autodiscoverUrl: IRefParam<Uri>): Promise<TGetSettingsResponseCollection>; } export interface AutodiscoverRedirectionUrlValidationCallback { (redirectionUrl: string): boolean; } class OutlookUser { static AvailableUserSettings: UserSettingName[]; ConvertToUserSettings(requestedSettings: UserSettingName[], response: GetUserSettingsResponse): any; } class DirectoryHelper { Service: ExchangeServiceBase; GetAutodiscoverScpUrlsForDomain(domainName: string): string[]; GetScpUrlList(domainName: string, ldapPath: string, maxHops: any): string[]; GetSiteName(): string; TraceMessage(message: string): any; } /** * Represents a sharing location. * @sealed */ class DocumentSharingLocation { /** * Gets the URL of the web service to use to manipulate documents at the sharing location. */ get ServiceUrl(): string; /** * Gets the URL of the sharing location (for viewing the contents in a web browser). */ get LocationUrl(): string; /** * Gets the display name of the location. */ get DisplayName(): string; /** * Gets the space-separated list of file extensions that are allowed at the location. * @remarks Example: "docx pptx xlsx" */ get SupportedFileExtensions(): string[]; /** * Gets a flag indicating whether external users (outside the enterprise/tenant) can view documents at the location. */ get ExternalAccessAllowed(): boolean; /** * Gets a flag indicating whether anonymous users can view documents at the location. */ get AnonymousAccessAllowed(): boolean; /** * Gets a flag indicating whether the user can modify permissions for documents at the location. * @remarks This will be true for the user's "My Site," for example. However, documents at team and project sites will typically be ACLed by the site owner, so the user will not be able to modify permissions. This will most likely by false even if the caller is the owner, to avoid surprises. They should go to SharePoint to modify permissions for team and project sites. */ get CanModifyPermissions(): boolean; /** * Gets a flag indicating whether this location is the user's default location. This will generally be their My Site. */ get IsDefault(): boolean; } /** * Represents a user setting that is a collection of alternate mailboxes. * @sealed */ class DocumentSharingLocationCollection { /** * Gets the collection of alternate mailboxes. */ get Entries(): DocumentSharingLocation[]; } /** * Represents an error from a GetDomainSettings request. * @sealed */ class DomainSettingError { /** * Gets the error code. */ get ErrorCode(): AutodiscoverErrorCode; /** * Gets the error message. */ get ErrorMessage(): string; /** * Gets the name of the setting. */ get SettingName(): string; } /** * Represents the email Protocol connection settings for pop/imap/smtp protocols. * @sealed */ class ProtocolConnection { /** * Gets or sets the encryption method. */ get EncryptionMethod(): string; set EncryptionMethod(value: string); /** * Gets or sets the Hostname. */ get Hostname(): string; set Hostname(value: string); /** * Gets or sets the port number. */ get Port(): number; set Port(value: number); } /** * Represents a user setting that is a collection of protocol connection. * @sealed */ class ProtocolConnectionCollection { get Connections(): ProtocolConnection[]; set Connections(value: ProtocolConnection[]); }/** * Represents the base class for all responses returned by the Autodiscover service. */ abstract class AutodiscoverResponse { /** * Gets the error code that was returned by the service. */ get ErrorCode(): AutodiscoverErrorCode; /** * Gets the error message that was returned by the service. */ get ErrorMessage(): string; set RedirectionUrl(value: Uri); } /** * Represents the response to a GetDomainSettings call for an individual domain. * @sealed */ class GetDomainSettingsResponse extends AutodiscoverResponse { /** * Gets the domain this response applies to. */ get Domain(): string; /** * Gets the redirectionTarget (URL or email address) */ get RedirectTarget(): string; /** * Gets the requested settings for the domain. */ get Settings(): Dictionary<DomainSettingName, any>; /** * Gets error information for settings that could not be returned. */ get DomainSettingErrors(): DomainSettingError[]; /** * Initializes a new instance of the **GetDomainSettingsResponse** class. */ constructor(); } /** * Represents a collection of responses to GetDomainSettings * @sealed */ class GetDomainSettingsResponseCollection extends AutodiscoverResponseCollection<GetDomainSettingsResponse> { /** * Initializes a new instance of the **GetDomainSettingsResponseCollection<GetDomainSettingsResponse>** class. */ constructor(); } /** * Represents the response to a GetUsersSettings call for an individual user. * @sealed */ class GetUserSettingsResponse extends AutodiscoverResponse { /** * Gets the SMTP address this response applies to. */ get SmtpAddress(): string; /** * Gets the redirectionTarget (URL or email address) */ get RedirectTarget(): string; /** * Gets the requested settings for the user. */ get Settings(): Dictionary<UserSettingName, any>; /** * Gets error information for settings that could not be returned. */ get UserSettingErrors(): UserSettingError[]; /** * Initializes a new instance of the **GetUserSettingsResponse** class. */ constructor(); /** * Reads user setting from XML jsObject. * * @param {any} jsObject Json Object converted from XML. */ ReadSettingFromXmlJsObject(jsObject: any): void; /** * Tries the get the user setting value. * * @param {UserSettingName} setting The setting. * @return {T} The setting value. */ GetSettingValue<T>(setting: UserSettingName): T; } /** * Represents a collection of responses to GetUserSettings * @sealed */ class GetUserSettingsResponseCollection extends AutodiscoverResponseCollection<GetUserSettingsResponse> { /** * Initializes a new instance of the **GetUserSettingsResponseCollection<GetUserSettingsResponse>** class. */ constructor(); } /** * Represents an error from a GetUserSettings request. * @sealed */ class UserSettingError { /** * Gets the error code. */ get ErrorCode(): AutodiscoverErrorCode; /** * Gets the error message. */ get ErrorMessage(): string; /** * Gets the name of the setting. */ get SettingName(): string; } /** * Represents the URL of the Exchange web client. * @sealed */ class WebClientUrl { /** * Gets the authentication methods. */ get AuthenticationMethods(): string; /** * Gets the URL. */ get Url(): string; } /** * Represents a user setting that is a collection of Exchange web client URLs. * @sealed */ class WebClientUrlCollection { /** * Gets the URLs. */ get Urls(): WebClientUrl[]; } /** * Represents an AddressEntity object. */ class AddressEntity extends ExtractedEntity { /** * Gets the meeting suggestion Location. */ Address: string; /** * Initializes a new instance of the **AddressEntity** class. */ constructor(); } /** * Represents a collection of AddressEntity objects. */ class AddressEntityCollection extends ComplexPropertyCollection<AddressEntity> { } class AppointmentOccurrenceId extends ItemId { get OccurrenceIndex(): number; set OccurrenceIndex(value: number); constructor(recurringMasterUniqueId: string, occurrenceIndex: number); GetXmlElementName(): string; InternalToJson(service: ExchangeService): any; } class ApprovalRequestData extends ComplexProperty { IsUndecidedApprovalRequest: boolean; ApprovalDecision: number; ApprovalDecisionMaker: string; ApprovalDecisionTime: Date; LoadFromJson(jsonProperty: JsonObject, service: ExchangeService): any; } /** * Represents the archive tag of an item or folder. */ class ArchiveTag extends RetentionTagBase { /** * Initializes a new instance of the **ArchiveTag** class. */ constructor(); /** * Initializes a new instance of the **ArchiveTag** class. * * @param {boolean} isExplicit Is explicit. * @param {Guid} retentionId Retention id. */ constructor(isExplicit: boolean, retentionId: Guid); } /** * Represents an attachment to an item. */ class Attachment extends ComplexProperty { /** * Gets the Id of the attachment. */ get Id(): string; set Id(value: string); /*** * Gets or sets the name of the attachment. */ get Name(): string; set Name(value: string); /** * Gets or sets the content type of the attachment. */ get ContentType(): string; set ContentType(value: string); /** * Gets or sets the content Id of the attachment. ContentId can be used as a custom way to identify an attachment in order to reference it from within the body of the item the attachment belongs to. */ get ContentId(): string; set ContentId(value: string); /** * Gets or sets the content location of the attachment. ContentLocation can be used to associate an attachment with a Url defining its location on the Web. */ get ContentLocation(): string; set ContentLocation(value: string); /** * Gets the size of the attachment. */ get Size(): number; set Size(value: number); /** * Gets the date and time when this attachment was last modified. */ get LastModifiedTime(): DateTime; set LastModifiedTime(value: DateTime); /** * Gets or sets a value indicating whether this is an inline attachment. Inline attachments are not visible to end users. */ get IsInline(): boolean; set IsInline(value: boolean); /** * Gets the name of the XML element. * * @return {string} XML element name. */ GetXmlElementName(): string; /** * Loads the attachment. Calling this method results in a call to EWS. */ Load(): Promise<void>; } /** * Represents an item's attachment collection. */ class AttachmentCollection extends ComplexPropertyCollection<Attachment> implements IOwnedProperty { ___typeGenerics: string[]; /** * @interface:IOwnedProperty The owner of this attachment collection. */ get Owner(): ServiceObject; set Owner(value: ServiceObject); /** * Adds a file attachment to the collection. - isContent parameter is required to be true to be able to use bas64 content directly * * @param {string} name The display name of the new attachment. * @param {string} fileContent base64 ontent of the file representing the content of the attachment. * @return {FileAttachment} A FileAttachment instance. */ AddFileAttachment(name: string, content: string): FileAttachment; /** * Adds an item attachment to the collection * * @type <TItem> The type of the item to attach. * * @param {any*} TItem Item type, not instance * @param {string} TItemElementName XML Element Name of the Item class * @return {ItemAttachmentOf<TItem>} An ItemAttachment instance. */ AddItemAttachment<TItem extends Item>(TItem: typeof Item, TItemElementName: string): ItemAttachmentOf<TItem>; /** * Removes all attachments from this collection. */ Clear(): void; CreateDefaultComplexProperty(): Attachment; /** * Removes the specified attachment. * * @param {Attachment} attachment The attachment to remove. * @return {boolean} True if the attachment was successfully removed from the collection, false otherwise. */ Remove(attachment: Attachment): boolean; /** * Removes the attachment at the specified index. * * @param {number} index Index of the attachment to remove. */ RemoveAt(index: number): void; } /** * Represents an attendee to a meeting. */ class Attendee extends EmailAddress { /** * Gets the type of response the attendee gave to the meeting invitation it received. */ get ResponseType(): MeetingResponseType; /** * Gets the date and time when the attendee last responded to a meeting invitation or update. */ get LastResponseTime(): DateTime; /** * Initializes a new instance of the **Attendee** class. */ constructor(); /** * Initializes a new instance of the **Attendee** class. * * @param {string} name The name used to initialize the Attendee. */ constructor(smtpAddress: string); /** * Initializes a new instance of the **Attendee** class. * * @param {string} name The name used to initialize the Attendee. * @param {string} smtpAddress The SMTP address used to initialize the Attendee. */ constructor(name: string, smtpAddress: string); /** * Initializes a new instance of the **Attendee** class. * * @param {string} name The name used to initialize the Attendee. * @param {string} smtpAddress The SMTP address used to initialize the Attendee. * @param {string} routingType The routing type used to initialize the Attendee. */ constructor(name: string, smtpAddress: string, routingType: string); /** * Initializes a new instance of the **Attendee** class from an EmailAddress. * * @param {EmailAddress} mailbox The mailbox used to initialize the Attendee. */ constructor(mailbox: EmailAddress); } /** * Represents a collection of attendees. */ class AttendeeCollection extends ComplexPropertyCollection<Attendee> { /** * Adds an attendee to the collection. * * @param {Attendee} attendee The attendee to add. */ Add(attendee: Attendee): void; /** * Adds a attendee to the collection. * * @param {string} smtpAddress The SMTP address of the attendee. * @return {Attendee} An Attendee instance initialized with the provided name and SMTP address. */ Add(smtpAddress: string): Attendee; /** * Adds a attendee to the collection. * * @param {string} name The name of the attendee. * @param {string} smtpAddress The SMTP address of the attendee. * @return {Attendee} An Attendee instance initialized with the provided name and SMTP address. */ Add(name: string, smtpAddress: string): Attendee; /** * Clears the collection. */ Clear(): void; /** * Removes an attendee from the collection. * * @param {Attendee} attendee The attendee to remove. * @return {boolean} True if the attendee was successfully removed from the collection, false otherwise. */ Remove(attendee: Attendee): boolean; /** * Removes an attendee from the collection. * * @param {number} index The index of the attendee to remove. */ RemoveAt(index: number): void; } class CalendarEvent extends ComplexProperty { get StartTime(): DateTime; get EndTime(): DateTime; get FreeBusyStatus(): LegacyFreeBusyStatus; get Details(): CalendarEventDetails; LoadFromJson(jsonProperty: any, service: ExchangeService): any; LoadFromXmlJsObject(jsonProperty: any, service: ExchangeService): void; } class CalendarEventDetails extends ComplexProperty { get StoreId(): string; get Subject(): string; get Location(): string; get IsMeeting(): boolean; get IsRecurring(): boolean; get IsException(): boolean; get IsReminderSet(): boolean; get IsPrivate(): boolean; LoadFromJson(jsonProperty: any, service: ExchangeService): any; LoadFromXmlJsObject(jsonProperty: any, service: ExchangeService): void; } class Conflict extends ComplexProperty { get ConflictType(): ConflictType; get NumberOfMembers(): number; get NumberOfMembersAvailable(): number; get NumberOfMembersWithConflict(): number; get NumberOfMembersWithNoData(): number; get FreeBusyStatus(): LegacyFreeBusyStatus; constructor(conflictType: ConflictType); LoadFromXmlJsObject(jsonProperty: any, service: ExchangeService): void; } /** * Represents a user's Out of Office (OOF) settings. */ class OofSettings extends ComplexProperty implements ISelfValidate { /** * Gets or sets the user's OOF state. * * @value The user's OOF state. */ get State(): OofState; set State(value: OofState); /** * Gets or sets a value indicating who should receive external OOF messages. */ get ExternalAudience(): OofExternalAudience; set ExternalAudience(value: OofExternalAudience); /** * Gets or sets the duration of the OOF status when State is set to OofState.Scheduled. */ get Duration(): TimeWindow; set Duration(value: TimeWindow); /** * Gets or sets the OOF response sent other users in the user's domain or trusted domain. */ get InternalReply(): OofReply; set InternalReply(value: OofReply); /** * Gets or sets the OOF response sent to addresses outside the user's domain or trusted domain. */ get ExternalReply(): OofReply; set ExternalReply(value: OofReply); /** * Gets a value indicating the authorized external OOF notifications. */ get AllowExternalOof(): OofExternalAudience; set AllowExternalOof(value: OofExternalAudience); /** * Initializes a new instance of OofSettings. */ constructor(); /** * Validates this instance. */ Validate(): void; } class Suggestion extends ComplexProperty { get Date(): DateTime; get Quality(): SuggestionQuality; get TimeSuggestions(): TimeSuggestion[]; constructor(); LoadFromXmlJsObject(jsonProperty: any, service: ExchangeService): void; } class TimeSuggestion extends ComplexProperty { get MeetingTime(): DateTime; get IsWorkTime(): boolean; get Quality(): SuggestionQuality; get Conflicts(): Conflict[]; constructor(); LoadFromXmlJsObject(jsonProperty: any, service: ExchangeService): void; } class WorkingHours extends ComplexProperty { LegacyTimeZone: LegacyAvailabilityTimeZone; get TimeZone(): TimeZoneInfo; get DaysOfTheWeek(): DayOfTheWeek[]; get StartTime(): TimeSpan; get EndTime(): TimeSpan; LoadFromJson(jsonProperty: any, service: ExchangeService): any; LoadFromXmlJsObject(jsonProperty: any, service: ExchangeService): void; } class WorkingPeriod extends ComplexProperty { get DaysOfWeek(): DayOfTheWeek[]; get StartTime(): TimeSpan; get EndTime(): TimeSpan; constructor(); LoadFromJson(jsonProperty: any, service: ExchangeService): any; ReadElementsFromXmlJsObject(reader: any): boolean; LoadFromXmlJsObject(jsonProperty: any, service: ExchangeService): void; } class ByteArrayArray extends ComplexProperty { get Content(): string[]; InternalToJson(service: ExchangeService): any; LoadFromXmlJsObject(jsonCollection: any, serviceExchangeService: any): void; } /** * Encapsulates information on the changehighlights of a meeting request. * * @sealed */ class ChangeHighlights extends ComplexProperty { /** * Gets a value indicating whether the location has changed. */ get HasLocationChanged(): boolean; /** * Gets the old location */ get Location(): string; /** * Gets a value indicating whether the the start time has changed. */ get HasStartTimeChanged(): boolean; /** * Gets the old start date and time of the meeting. */ get Start(): DateTime; /** * Gets a value indicating whether the the end time has changed. */ get HasEndTimeChanged(): boolean; /** * Gets the old end date and time of the meeting. */ get End(): DateTime; } /** * Represents a client token access request */ class ClientAccessTokenRequest extends ComplexProperty { /** * Gets the App Id. */ get Id(): string; /** * Gets token type. */ get TokenType(): ClientAccessTokenType; /** * Gets the token scope. */ get Scope(): string; /** * Initializes a new instance of the **ClientAccessTokenRequest** class. * * @param {string} id id * @param {ClientAccessTokenType} tokenType The tokenType. * @param {string} scope The scope. */ constructor(id: string, tokenType: ClientAccessTokenType); /** * Initializes a new instance of the **ClientAccessTokenRequest** class. * * @param {string} id id * @param {ClientAccessTokenType} tokenType The tokenType. * @param {string} scope The scope. */ constructor(id: string, tokenType: ClientAccessTokenType, scope: string); } /** * Represents a app in GetAppManifests response. * * @sealed */ class ClientApp extends ComplexProperty { /** * The manifest for the app. * * internal set */ Manifest: string; /** * Metadata related to the app. * * internal set */ Metadata: ClientAppMetadata; /** * Initializes a new instance of the **ClientApp** class. */ constructor(); } /** * Represents a ClientAppMetadata object. * * @sealed */ class ClientAppMetadata extends ComplexProperty { /** * The End node url for the app. * * @private set */ EndNodeUrl: string; /** * The action url for the app. * * @private set */ ActionUrl: string; /** * The app status for the app. * * @private set */ AppStatus: string; /** * Initializes a new instance of the **ClientAppMetadata** class. */ constructor(); } class ClientExtension extends ComplexProperty { Type: ExtensionType; Scope: ExtensionInstallScope; ManifestStream: any; MarketplaceAssetID: string; MarketplaceContentMarket: string; AppStatus: string; Etoken: string; IsAvailable: boolean; IsMandatory: boolean; IsEnabledByDefault: boolean; ProvidedTo: ClientExtensionProvidedTo; SpecificUsers: StringList; } /** * Represents the complete name of a contact. */ class CompleteName extends ComplexProperty { /** * Gets the contact's title. */ get Title(): string; /** * Gets the given name (first name) of the contact. */ get GivenName(): string; /** * Gets the middle name of the contact. */ get MiddleName(): string; /** * Gets the surname (last name) of the contact. */ get Surname(): string; /** * Gets the suffix of the contact. */ get Suffix(): string; /** * Gets the initials of the contact. */ get Initials(): string; /** * Gets the full name of the contact. */ get FullName(): string; /** * Gets the nickname of the contact. */ get NickName(): string; /** * Gets the Yomi given name (first name) of the contact. */ get YomiGivenName(): string; /** * Gets the Yomi surname (last name) of the contact. */ get YomiSurname(): string; } /** * Represents a property that can be sent to or retrieved from EWS. */ class ComplexProperty { OnChange: ComplexPropertyChangedDelegate[]; constructor(); Changed(): void; ClearChangeLog(): void; InternalLoadFromXmlJsObject(jsObject: any, service: ExchangeService, //xmlNamespace: XmlNamespace, xmlElementName: string, readAction: (jsonProperty: any, service: ExchangeService) => void): void; InternalValidate(): void; LoadFromXmlJsObject(jsObject: any, service: ExchangeService): void; SetFieldValue<T>(field: IRefParam<T>, value: T): void; ReadElementsFromXmlJsObject(jsonProperty: any, service: ExchangeService): void; ReadElementsFromXmlJsObjectToPatch(jsonProperty: any, service: ExchangeService): void; UpdateFromXmlJsObject(jsObject: any, service: ExchangeService): void; Validate(): void; } /** * Represents a collection of properties that can be sent to and retrieved from EWS. * * @type <TComplexProperty> ComplexProperty type. */ abstract class ComplexPropertyCollection<TComplexProperty extends ComplexProperty> extends ComplexProperty implements IEnumerable<TComplexProperty>, ICustomUpdateSerializer { ___typeGenerics: string[]; /** * Gets the total number of properties in the collection. */ get Count(): number; /** * Gets the property at the specified index. * * @param {number} index The zero-based index of the property to get. * @return {TComplexProperty} The property at the specified index. */ _getItem(index: number): TComplexProperty; /** * Determines whether a specific property is in the collection. * * @param {TComplexProperty} complexProperty The property to locate in the collection. * @return {boolean} True if the property was found in the collection, false otherwise. */ Contains(complexProperty: TComplexProperty): boolean; /** * Returns an enumerator that iterates through the collection. this case this.items */ GetEnumerator(): TComplexProperty[]; /** * Searches for a specific property and return its zero-based index within the collection. * * @param {TComplexProperty} complexProperty The property to locate in the collection. * @return {number} The zero-based index of the property within the collection. */ IndexOf(complexProperty: TComplexProperty): number; /** * @private Add complex property. * * @param {TComplexProperty} complexProperty The complex property. * @param {boolean} loading If true, collection is being loaded. */ InternalAdd(complexProperty: TComplexProperty, loading: boolean): void; } /** * Represents an ContactEntity object. */ class ContactEntity extends ExtractedEntity { /** * Gets the contact entity PersonName. */ PersonName: string; /** * Gets the contact entity BusinessName. */ BusinessName: string; /** * Gets the contact entity PhoneNumbers. */ PhoneNumbers: ContactPhoneEntityCollection; /** * Gets the contact entity Urls. */ Urls: StringList; /** * Gets the contact entity EmailAddresses. */ EmailAddresses: StringList; /** * Gets the contact entity Addresses. */ Addresses: StringList; /** * Gets the contact entity ContactString. */ ContactString: string; /** * Initializes a new instance of the **ContactEntity** class. */ constructor(); } /** * Represents a collection of ContactEntity objects. */ class ContactEntityCollection extends ComplexPropertyCollection<ContactEntity> { } /** * Represents an ContactPhoneEntity object. */ class ContactPhoneEntity extends ComplexProperty { /** * Gets the phone entity OriginalPhoneString. */ OriginalPhoneString: string; /** * Gets the phone entity PhoneString. */ PhoneString: string; /** * Gets the phone entity Type. */ Type: string; /** * Initializes a new instance of the **ContactPhoneEntity** class. */ constructor(); } /** * Represents a collection of ContactPhoneEntity objects. */ class ContactPhoneEntityCollection extends ComplexPropertyCollection<ContactPhoneEntity> { } /** * Represents the Id of a Conversation. */ class ConversationId extends ServiceId { /** * Initializes a new instance of **ConversationId**. */ constructor(); /** * Initializes a new instance of **ConversationId**. * * @param {string} uniqueId The unique Id used to initialize the **ConversationId**. */ constructor(uniqueId: string); /** * Gets a string representation of the Conversation Id. * * @return {string} The string representation of the conversation id. */ ToString(): string; toString(): string; } /** * Represents the response to a GetConversationItems operation. * * @sealed */ class ConversationNode extends ComplexProperty { /** * Gets or sets the Internet message id of the node. */ InternetMessageId: string; /** * Gets or sets the Internet message id of the parent node. */ ParentInternetMessageId: string; /** * Gets or sets the items. */ Items: Item[]; } /** * Represents a collection of conversation items. * * @sealed */ class ConversationNodeCollection extends ComplexPropertyCollection<ConversationNode> { } /** * * * @sealed */ class ConversationRequest extends ComplexProperty implements ISelfValidate { /** * Gets or sets the conversation id. */ ConversationId: ConversationId; /** * Gets or sets the sync state representing the current state of the conversation for synchronization purposes. */ SyncState: string; /** * Initializes a new instance of the **ConversationRequest** class. */ constructor(); /** * Initializes a new instance of the **ConversationRequest** class. * * @param {ConversationId} conversationId The conversation id. * @param {string} syncState State of the sync. */ constructor(conversationId: ConversationId, syncState: string); } /** * * * @sealed */ class ConversationResponse extends ComplexProperty { /** * Gets the conversation id. * * internal set */ ConversationId: ConversationId; /** * Gets the sync state. * * internal set */ SyncState: string; /** * Gets the conversation nodes. * * internal set */ ConversationNodes: ConversationNodeCollection; } /** * Represents an operation to create a new rule. * * @sealed */ class CreateRuleOperation extends RuleOperation { /** * Gets or sets the rule to be created. */ get Rule(): Rule; set Rule(value: Rule); /** * Initializes a new instance of the **CreateRuleOperation** class. */ constructor(); /** * Initializes a new instance of the **CreateRuleOperation** class. * * @param {Rule} rule The inbox rule to create. */ constructor(rule: Rule); } /** * Represents the permissions of a delegate user. * * @sealed */ class DelegatePermissions extends ComplexProperty { /** * Gets or sets the delegate user's permission on the principal's calendar. */ get CalendarFolderPermissionLevel(): DelegateFolderPermissionLevel; set CalendarFolderPermissionLevel(value: DelegateFolderPermissionLevel); /** * Gets or sets the delegate user's permission on the principal's tasks folder. */ get TasksFolderPermissionLevel(): DelegateFolderPermissionLevel; set TasksFolderPermissionLevel(value: DelegateFolderPermissionLevel); /** * Gets or sets the delegate user's permission on the principal's inbox. */ get InboxFolderPermissionLevel(): DelegateFolderPermissionLevel; set InboxFolderPermissionLevel(value: DelegateFolderPermissionLevel); /** * Gets or sets the delegate user's permission on the principal's contacts folder. */ get ContactsFolderPermissionLevel(): DelegateFolderPermissionLevel; set ContactsFolderPermissionLevel(value: DelegateFolderPermissionLevel); /** * Gets or sets the delegate user's permission on the principal's notes folder. */ get NotesFolderPermissionLevel(): DelegateFolderPermissionLevel; set NotesFolderPermissionLevel(value: DelegateFolderPermissionLevel); /** * Gets or sets the delegate user's permission on the principal's journal folder. */ get JournalFolderPermissionLevel(): DelegateFolderPermissionLevel; set JournalFolderPermissionLevel(value: DelegateFolderPermissionLevel); } /** * Represents a delegate user. * * @sealed */ class DelegateUser extends ComplexProperty { /** * Gets the user Id of the delegate user. */ get UserId(): UserId; /** * Gets the list of delegate user's permissions. */ get Permissions(): DelegatePermissions; /** * Gets or sets a value indicating if the delegate user should receive copies of meeting requests. */ get ReceiveCopiesOfMeetingMessages(): boolean; set ReceiveCopiesOfMeetingMessages(value: boolean); /** * Gets or sets a value indicating if the delegate user should be able to view the principal's private items. */ get ViewPrivateItems(): boolean; set ViewPrivateItems(value: boolean); /** * Initializes a new instance of the **DelegateUser** class. */ constructor(); /** * Initializes a new instance of the **DelegateUser** class. * * @param {string} primarySmtpAddress The primary SMTP address of the delegate user. */ constructor(primarySmtpAddress: string); /** * Initializes a new instance of the **DelegateUser** class. * * @param {StandardUser} standardUser The standard delegate user. */ constructor(standardUser: StandardUser); } /** * Encapsulates information on the deleted occurrence of a recurring appointment. */ class DeletedOccurrenceInfo extends ComplexProperty { /** * Gets the original start date and time of the deleted occurrence. */ get OriginalStart(): DateTime; } /** * Represents a collection of deleted occurrence objects. */ class DeletedOccurrenceInfoCollection extends ComplexPropertyCollection<DeletedOccurrenceInfo> { } /** * Represents an operation to delete an existing rule. * * @sealed */ class DeleteRuleOperation extends RuleOperation { /** * Gets or sets the Id of the rule to delete. */ get RuleId(): string; set RuleId(value: string); /** * Initializes a new instance of the **DeleteRuleOperation** class. */ constructor(); /** * Initializes a new instance of the **DeleteRuleOperation** class. * * @param {string} ruleId The Id of the inbox rule to delete. */ constructor(ruleId: string); } /** * Represents an entry of a DictionaryProperty object. * @remarks All descendants of DictionaryEntryProperty must implement a parameterless constructor. That constructor does not have to be public. * @typeparam {TKey} The type of the key used by this dictionary. * [EditorBrowsable(EditorBrowsableState.Never)] */ class DictionaryEntryProperty<TKey> extends ComplexProperty { /** ews-javascript-api specific workaround for inheritance */ protected keyType: any; /** * Gets or sets the key. * @value The key. */ get Key(): TKey; set Key(value: TKey); } /** * Represents a generic dictionary that can be sent to or retrieved from EWS. * * @typeparam <TKey> The type of key. * @typeparam <TEntry> The type of entry. */ abstract class DictionaryProperty<TKey, TEntry extends DictionaryEntryProperty<TKey>> extends ComplexProperty implements ICustomUpdateSerializer { /** * Gets the entries. * * @value The entries. */ get Entries(): Dictionary<TKey, TEntry>; /** * Determines whether this instance contains the specified key. * * @param {TKey} key The key. * @return {boolean} true if this instance contains the specified key; otherwise, false. */ Contains(key: TKey): boolean; /** * Remove entry based on key. * * @param {TKey} key The key. */ InternalRemove(key: TKey): void; } /** * Represents an e-mail address. */ class EmailAddress extends ComplexProperty implements ISearchStringProvider { /** * SMTP routing type. */ static SmtpRoutingType: string; /** * Gets or sets the name associated with the e-mail address. */ get Name(): string; set Name(value: string); /** * Gets or sets the actual address associated with the e-mail address. The type o