diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index e377cd02ab..de68dd4e47 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -3576,8 +3576,8 @@ /types/react-native-vector-icons/ @iRoachie @timwangdev /types/react-native-version-number/ @VincentLanglet /types/react-native-video/ @huhuanming -/types/react-navigation/v1/ @huhuanming @mhcgrq @fangpenlin @petejkim @iRoachie @phanalpha @charlesfamu @timwangdev @bang88 @svbutko @levito @robertohuertasm @YourGamesBeOver @ArmandoAssuncao @cliedeman @Slessi -/types/react-navigation/ @huhuanming @mhcgrq @fangpenlin @petejkim @iRoachie @phanalpha @charlesfamu @timwangdev @bang88 @svbutko @levito @robertohuertasm @YourGamesBeOver @ArmandoAssuncao @cliedeman @Slessi @magrinj @TizioFittizio @stigi +/types/react-navigation/v1/ @huhuanming @mhcgrq @fangpenlin @petejkim @iRoachie @phanalpha @charlesfamu @timwangdev @bang88 @svbutko @levito @YourGamesBeOver @ArmandoAssuncao @cliedeman @Slessi +/types/react-navigation/ @huhuanming @mhcgrq @fangpenlin @petejkim @iRoachie @phanalpha @charlesfamu @timwangdev @bang88 @svbutko @levito @YourGamesBeOver @ArmandoAssuncao @cliedeman @Slessi @magrinj @TizioFittizio @stigi /types/react-notification-system/ @GiedriusGrabauskas @DeividasBakanas @LKay @sztobar /types/react-notification-system-redux/ @LKay /types/react-notify-toast/ @klaascuvelier @@ -4557,7 +4557,7 @@ /types/webvr-api/ @efokschaner /types/week/ @sindrenm /types/weighted/ @ccitro -/types/weixin-app/ @taoqf @AlexStacker +/types/weixin-app/ @taoqf @AlexStacker @Jimexist /types/wellknown/ @yairtawil /types/wepy/ @Jimexist /types/wepy-redux/ @Jimexist diff --git a/notNeededPackages.json b/notNeededPackages.json index a51dce496f..4e66976014 100644 --- a/notNeededPackages.json +++ b/notNeededPackages.json @@ -156,12 +156,6 @@ "sourceRepoURL": "https://github.com/brianloveswords/base64url", "asOfVersion": "2.0.0" }, - { - "libraryName": "better-scroll", - "typingsPackageName": "better-scroll", - "sourceRepoURL": "https://github.com/ustbhuangyi/better-scroll", - "asOfVersion": "1.5.0" - }, { "libraryName": "BigInteger.js", "typingsPackageName": "big-integer", diff --git a/types/algoliasearch/index.d.ts b/types/algoliasearch/index.d.ts index 5a49eaea18..0c2d244b05 100644 --- a/types/algoliasearch/index.d.ts +++ b/types/algoliasearch/index.d.ts @@ -1776,6 +1776,14 @@ declare namespace algoliasearch { facets?: { [facetName: string]: { [facetValue: string]: number }; }; + facets_stats?: { + [facetName: string]: { + avg: number, + max: number, + min: number, + sum: number, + }; + }; } interface MultiResponse { diff --git a/types/algoliasearch/lite/index.d.ts b/types/algoliasearch/lite/index.d.ts index acd2b30988..4f068d5647 100644 --- a/types/algoliasearch/lite/index.d.ts +++ b/types/algoliasearch/lite/index.d.ts @@ -4,6 +4,7 @@ // Haroen Viaene // Aurélien Hervé // Samuel Vaillant +// Claas Brüggemann // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.2 @@ -570,6 +571,14 @@ declare namespace algoliasearch { facets?: { [facetName: string]: { [facetValue: string]: number }; }; + facets_stats?: { + [facetName: string]: { + avg: number, + max: number, + min: number, + sum: number, + }; + }; } interface MultiResponse { diff --git a/types/angular-q-extras/angular-q-extras-tests.ts b/types/angular-q-extras/angular-q-extras-tests.ts new file mode 100644 index 0000000000..0832b6dae0 --- /dev/null +++ b/types/angular-q-extras/angular-q-extras-tests.ts @@ -0,0 +1,34 @@ +interface MyService { + getFirstname(): ng.IPromise; + getLastname(): ng.IPromise; +} + +function TestCtrl($q: ng.IQService, MyService: MyService) { + function arrayCallback(result: [ng.PromiseValue, ng.PromiseValue]) { + const firstnameOk: boolean = $q.isFulfilledState(result[0]); + const lastnameOk: boolean = $q.isFulfilledState(result[1]); + } + + function objectCallback(result: {firstname: ng.PromiseValue, lastname: ng.PromiseValue}) { + const firstnameOk: boolean = $q.isFulfilledState(result.firstname); + const lastnameOk: boolean = $q.isFulfilledState(result.lastname); + } + + $q + .allSettled([ + MyService.getFirstname(), + MyService.getLastname() + ]) + .then(arrayCallback); + + $q + .allSettled({ + firstname: MyService.getFirstname(), + lastname: MyService.getLastname() + }) + .then(objectCallback); +} + +TestCtrl.$inject = ['$q', 'MyService']; + +angular.module('test').controller('TestCtrl', TestCtrl); diff --git a/types/angular-q-extras/index.d.ts b/types/angular-q-extras/index.d.ts new file mode 100644 index 0000000000..f73724ab43 --- /dev/null +++ b/types/angular-q-extras/index.d.ts @@ -0,0 +1,42 @@ +// Type definitions for angular-q-extras 1.1 +// Project: https://github.com/niqdev/angular-q-extras +// Definitions by: Damien Sorel +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +declare var _: string; +export = _; + +import * as angular from 'angular'; + +declare module 'angular' { + type PromiseState = 'fulfilled' | 'rejected'; + + interface PromiseValue { + state: PromiseState; + value?: T; + reason?: any; + } + + // tslint:disable-next-line interface-name + interface IQService { + // tslint:disable:max-line-length + allSettled(values: [T1 | IPromise, T2 | IPromise, T3 | IPromise, T4 | IPromise, T5 | IPromise, T6 | IPromise, T7 | IPromise, T8 | IPromise, T9 | IPromise, T10 | IPromise]): IPromise<[PromiseValue, PromiseValue, PromiseValue, PromiseValue, PromiseValue, PromiseValue, PromiseValue, PromiseValue, PromiseValue, PromiseValue]>; + allSettled(values: [T1 | IPromise, T2 | IPromise, T3 | IPromise, T4 | IPromise, T5 | IPromise, T6 | IPromise, T7 | IPromise, T8 | IPromise, T9 | IPromise]): IPromise<[PromiseValue, PromiseValue, PromiseValue, PromiseValue, PromiseValue, PromiseValue, PromiseValue, PromiseValue, PromiseValue]>; + allSettled(values: [T1 | IPromise, T2 | IPromise, T3 | IPromise, T4 | IPromise, T5 | IPromise, T6 | IPromise, T7 | IPromise, T8 | IPromise]): IPromise<[PromiseValue, PromiseValue, PromiseValue, PromiseValue, PromiseValue, PromiseValue, PromiseValue, PromiseValue]>; + allSettled(values: [T1 | IPromise, T2 | IPromise, T3 | IPromise, T4 | IPromise, T5 | IPromise, T6 | IPromise, T7 | IPromise]): IPromise<[PromiseValue, PromiseValue, PromiseValue, PromiseValue, PromiseValue, PromiseValue, PromiseValue]>; + allSettled(values: [T1 | IPromise, T2 | IPromise, T3 | IPromise, T4 | IPromise, T5 | IPromise, T6 | IPromise]): IPromise<[PromiseValue, PromiseValue, PromiseValue, PromiseValue, PromiseValue, PromiseValue]>; + allSettled(values: [T1 | IPromise, T2 | IPromise, T3 | IPromise, T4 | IPromise, T5 | IPromise]): IPromise<[PromiseValue, PromiseValue, PromiseValue, PromiseValue, PromiseValue]>; + allSettled(values: [T1 | IPromise, T2 | IPromise, T3 | IPromise, T4 | IPromise]): IPromise<[PromiseValue, PromiseValue, PromiseValue, PromiseValue]>; + allSettled(values: [T1 | IPromise, T2 | IPromise, T3 | IPromise]): IPromise<[PromiseValue, PromiseValue, PromiseValue]>; + allSettled(values: [T1 | IPromise, T2 | IPromise]): IPromise<[PromiseValue, PromiseValue]>; + // tslint:enable:max-line-length + + allSettled(promises: Array>): IPromise>>; + + allSettled(promises: { [K in keyof T]: (T[K] | IPromise); }): IPromise<{ [K in keyof T]: PromiseValue; }>; + + isFulfilledState(promise: PromiseValue): boolean; + isRejectedState(promise: PromiseValue): boolean; + } +} diff --git a/types/angular-q-extras/tsconfig.json b/types/angular-q-extras/tsconfig.json new file mode 100644 index 0000000000..3047a809eb --- /dev/null +++ b/types/angular-q-extras/tsconfig.json @@ -0,0 +1,23 @@ +{ + "files": [ + "index.d.ts", + "angular-q-extras-tests.ts" + ], + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + } +} diff --git a/types/angular-q-extras/tslint.json b/types/angular-q-extras/tslint.json new file mode 100644 index 0000000000..d88586e5bd --- /dev/null +++ b/types/angular-q-extras/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} diff --git a/types/applicationinsights-js/applicationinsights-js-tests.ts b/types/applicationinsights-js/applicationinsights-js-tests.ts index 49c68181f8..6588c3fcd3 100644 --- a/types/applicationinsights-js/applicationinsights-js-tests.ts +++ b/types/applicationinsights-js/applicationinsights-js-tests.ts @@ -17,17 +17,24 @@ const config: Microsoft.ApplicationInsights.IConfig = { autoTrackPageVisitTime: true, disableExceptionTracking: false, disableAjaxTracking: false, + disableFetchTracking: true, overridePageViewDuration: false, maxAjaxCallsPerView: -1, disableDataLossAnalysis: true, disableCorrelationHeaders: true, + correlationHeaderExcludedDomains: [], disableFlushOnBeforeUnload: false, enableSessionStorageBuffer: false, cookieDomain: "", isCookieUseDisabled: true, isRetryDisabled: true, - isPerfAnalyzerEnabled: true, - isStorageUseDisabled: true + url: "url", + isStorageUseDisabled: true, + isBeaconApiDisabled: false, + sdkExtension: "sdkExtension", + isBrowserLinkTrackingEnabled: false, + appId: "appId", + enableCorsCorrelation: false }; appInsights = { @@ -175,3 +182,8 @@ const traceObj = new Microsoft.ApplicationInsights.Telemetry.Trace("message", nu const traceData = new Microsoft.ApplicationInsights.Telemetry.Common.Data(Microsoft.ApplicationInsights.Telemetry.Trace.dataType, traceObj); const traceEnvelope = new Microsoft.ApplicationInsights.Telemetry.Common.Envelope(traceData, Microsoft.ApplicationInsights.Telemetry.Trace.envelopeType); context.track(traceEnvelope); + +// UtilHelpers +let Util: typeof Microsoft.ApplicationInsights.UtilHelpers; + +Util.newId(); diff --git a/types/applicationinsights-js/index.d.ts b/types/applicationinsights-js/index.d.ts index 4214837ddf..517324cde4 100644 --- a/types/applicationinsights-js/index.d.ts +++ b/types/applicationinsights-js/index.d.ts @@ -1,6 +1,7 @@ // Type definitions for ApplicationInsights-JS 1.0 // Project: https://github.com/Microsoft/ApplicationInsights-JS // Definitions by: Kamil Szostak +// Mark Wolff // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped declare module AI { @@ -560,19 +561,24 @@ declare module Microsoft.ApplicationInsights { samplingPercentage?: number; autoTrackPageVisitTime?: boolean; disableAjaxTracking?: boolean; + disableFetchTracking?: boolean; overridePageViewDuration?: boolean; maxAjaxCallsPerView?: number; disableDataLossAnalysis?: boolean; disableCorrelationHeaders?: boolean; + correlationHeaderExcludedDomains?: string[]; disableFlushOnBeforeUnload?: boolean; enableSessionStorageBuffer?: boolean; isCookieUseDisabled?: boolean; cookieDomain?: string; isRetryDisabled?: boolean; - isPerfAnalyzerEnabled?: boolean; url?: string; isStorageUseDisabled?: boolean; isBeaconApiDisabled?: boolean; + sdkExtension?: string; + isBrowserLinkTrackingEnabled?: boolean; + appId?: string; + enableCorsCorrelation?: boolean; } /** @@ -793,10 +799,18 @@ declare module Microsoft.ApplicationInsights { */ _onerror(message: string, url: string, lineNumber: number, columnNumber: number, error: Error): any; } + + class UtilHelpers { + /** + * Generate a random ID string + */ + static newId(): string; + } } declare module 'applicationinsights-js' { const AppInsights: Microsoft.ApplicationInsights.IAppInsights; + const Util: typeof Microsoft.ApplicationInsights.UtilHelpers; } declare var appInsights: Microsoft.ApplicationInsights.IAppInsights; diff --git a/types/better-scroll/better-scroll-tests.ts b/types/better-scroll/better-scroll-tests.ts new file mode 100644 index 0000000000..282e6185ab --- /dev/null +++ b/types/better-scroll/better-scroll-tests.ts @@ -0,0 +1,68 @@ +import BScroll from 'better-scroll'; + +const BScroll1 = new BScroll('#wrapper'); +const BScroll2 = new BScroll('#wrapper', { scrollX: false, scrollY: false }); +const BScroll3 = new BScroll('#wrapper', { + snap: true, + wheel: false, + scrollbar: false, + pullDownRefresh: false, +}); +const BScroll4 = new BScroll('#wrapper', { + wheel: { + selectedIndex: 0, + }, +}); +const BScroll6 = new BScroll('#wrapper', { + snap: { + loop: false, + el: document.querySelector('div-test') as Element, + threshold: 0.1, + stepX: 100, + stepY: 100, + listenFlick: true, + }, +}); +const BScroll7 = new BScroll('#wrapper', { + scrollbar: { + fade: true, + }, +}); + +const BScroll8 = new BScroll('#wrapper', { + pullDownRefresh: { + threshold: 50, + stop: 20, + }, +}); + +BScroll1.refresh(); +BScroll1.scrollTo(0, 100); +BScroll1.scrollTo(0, 100, 200); + +BScroll1.scrollToElement('selectedElement'); +BScroll1.scrollToElement('selectedElement', 250); + +BScroll1.scrollToElement(document.getElementById('selectedElement') as HTMLElement); +BScroll1.scrollToElement(document.getElementById('selectedElement') as HTMLElement, 250); + +BScroll2.on('scrollStart', () => { console.log('scroll started'); }); + +const BScroll9 = new BScroll(document.getElementById('wrapper') as HTMLElement); +const BScroll10 = new BScroll(document.getElementById('wrapper') as HTMLElement, { freeScroll: true }); +const BScroll11 = new BScroll(document.getElementById('wrapper') as HTMLElement, { + preventDefaultException: { + tagName: /^(INPUT|TEXTAREA|BUTTON|SELECT)$/, + }, +}); +const BScroll12 = new BScroll(document.getElementById('wrapper') as HTMLElement, { + preventDefaultException: { + className: /(^|\s)test(\s|$)/, + }, +}); + +const BScroll13 = new BScroll(document.getElementById('wrapper') as HTMLElement, { + swipeBounceTime: 1000, +}); + +const BScroll14 = new BScroll('#wrapper', { disableMouse: true, disableTouch: false }); diff --git a/types/better-scroll/index.d.ts b/types/better-scroll/index.d.ts new file mode 100644 index 0000000000..326dd2c3a0 --- /dev/null +++ b/types/better-scroll/index.d.ts @@ -0,0 +1,238 @@ +// Type definitions for better-scroll 1.12 +// Project: https://github.com/ustbhuangyi/better-scroll +// Definitions by: cloudstone +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +// TypeScript Version: 2.2 +export interface WheelOption { + selectedIndex: number; + rotate: number; + adjustTime: number; + wheelWrapperClass: string; + wheelItemClass: string; +} + +export interface PageOption { + x: number; + y: number; + pageX: number; + pageY: number; +} + +export interface SlideOption { + loop: boolean; + el: Element; + threshold: number; + stepX: number; + stepY: number; + speed: number; + listenFlick: boolean; +} + +export interface ScrollBarOption { + fade: boolean; +} + +export interface PullDownOption { + threshold: number; + stop: number; +} + +export interface PullUpOption { + threshold: number; +} + +export interface BounceObjectOption { + top?: boolean; + bottom?: boolean; + left?: boolean; + right?: boolean; +} + +export interface EaseOption { + swipe?: { + style: string; + fn: (t: number) => number; + }; + swipeBounce?: { + style: string; + fn: (t: number) => number; + }; + bounce?: { + style: string; + fn: (t: number) => number; + }; +} + +export interface BsOption { + startX: number; + startY: number; + scrollX: boolean; + scrollY: boolean; + freeScroll: boolean; + directionLockThreshold: number; + eventPassthrough: string | boolean; + click: boolean; + tap: boolean; + bounce: boolean | BounceObjectOption; + bounceTime: number; + momentum: boolean; + momentumLimitTime: number; + momentumLimitDistance: number; + swipeTime: number; + swipeBounceTime: number; + deceleration: number; + flickLimitTime: number; + flickLimitDistance: number; + resizePolling: number; + probeType: number; + preventDefault: boolean; + preventDefaultException: object; + HWCompositing: boolean; + useTransition: boolean; + useTransform: boolean; + bindToWrapper: boolean; + disableMouse: boolean; + disableTouch: boolean; + observeDOM: boolean; + autoBlur: boolean; + stopPropagation: boolean; + /** + * for picker + * wheel: { + * selectedIndex: 0, + * rotate: 25, + * adjustTime: 400 + * } + */ + wheel: Partial | boolean; + /** + * for slide + * snap: { + * loop: boolean, + * el: domEl, + * threshold: 0.1, + * stepX: 100, + * stepY: 100, + * listenFlick: true + * } + */ + snap: Partial | boolean; + /** + * for scrollbar + * scrollbar: { + * fade: true + * } + */ + scrollbar: Partial | boolean; + /** + * for pull down and refresh + * pullDownRefresh: { + * threshold: 50, + * stop: 20 + * } + */ + pullDownRefresh: Partial | boolean; + /** + * for pull up and load + * pullUpLoad: { + * threshold: 50 + * } + */ + pullUpLoad: Partial | boolean; +} + +export interface Position { + x: number; + y: number; +} + +export default class BScroll { + constructor(element: Element | string, options?: Partial); + + x: number; + y: number; + maxScrollX: number; + maxScrollY: number; + movingDirectionX: number; + movingDirectionY: number; + directionX: number; + directionY: number; + enabled: boolean; + isInTransition: boolean; + isAnimating: boolean; + options: BsOption; + + refresh(): void; + + enable(): void; + + disable(): void; + + scrollBy(x: number, y: number, time?: number, easing?: object): void; + + scrollTo(x: number, y: number, time?: number, easing?: object): void; + + scrollToElement(el: HTMLElement | string, time?: number, offsetX?: number | boolean, offsetY?: number | boolean, easing?: object): void; + + stop(): void; + + destroy(): void; + + goToPage(x: number, y: number, time?: number, easing?: object): void; + + next(time?: number, easing?: object): void; + + prev(time?: number, easing?: object): void; + + getCurrentPage(): PageOption; + + wheelTo(index: number): void; + + getSelectedIndex(): number; + + finishPullDown(): void; + + finishPullUp(): void; + + on( + type: + 'beforeScrollStart' | + 'scrollStart' | + 'scrollCancel' | + 'beforeScrollStart' | + 'flick' | + 'refresh' | + 'destroy' | + 'pullingDown' | + 'pullingUp', + fn: () => any + ): void; + + on( + type: + 'scroll' | + 'scrollEnd' | + 'touchEnd', + fn: (pos: Position) => any + ): void; + + off( + type: + 'beforeScrollStart' | + 'scrollStart' | + 'scroll' | + 'scrollCancel' | + 'beforeScrollStart' | + 'scrollEnd' | + 'touchEnd' | + 'flick' | + 'refresh' | + 'destroy' | + 'pullingDown' | + 'pullingUp', + fn: (...args: any[]) => void + ): void; + + trigger(type: string): void; +} diff --git a/types/better-scroll/tsconfig.json b/types/better-scroll/tsconfig.json new file mode 100644 index 0000000000..26f43ee3bd --- /dev/null +++ b/types/better-scroll/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictFunctionTypes": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "better-scroll-tests.ts" + ] +} diff --git a/types/better-scroll/tslint.json b/types/better-scroll/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/better-scroll/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/bull/index.d.ts b/types/bull/index.d.ts index a11ae0257a..ac820290f2 100644 --- a/types/bull/index.d.ts +++ b/types/bull/index.d.ts @@ -9,6 +9,7 @@ // David Koblas // Bond Akinmade // Wuha Team +// Alec Brunelle // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 diff --git a/types/bull/v2/index.d.ts b/types/bull/v2/index.d.ts index 3c89655101..4ea3f82df7 100644 --- a/types/bull/v2/index.d.ts +++ b/types/bull/v2/index.d.ts @@ -54,6 +54,24 @@ declare module "bull" { * since pubsub does not give any guarantees. */ finished(): Promise; + + /** + * Moves a job to the `completed` queue. Pulls a job from 'waiting' to + * 'active' and returns a tuple containing the next jobs data and id. If no + * job is in the `waiting` queue, returns null. + * @param returnValue The jobs success message. + * @param ignoreLock True when wanting to ignore the redis lock on this job. + * @returns Contains the next jobs data and id or null if job left in 'waiting' queue. + */ + moveToCompleted(returnValue: string, ignoreLock: boolean): Promise; + + /** + * Moves a job to the failed queue. + * @param errorInfo The jobs error message. + * @param ignoreLock True when wanting to ignore the redis lock on this job. + * @returns void + */ + moveToFailed(errorInfo: ErrorMessage, ignoreLock: boolean): Promise; } export interface Backoff { @@ -204,7 +222,7 @@ declare module "bull" { * Returns a promise that will return the job instance associated with the jobId parameter. * If the specified job cannot be located, the promise callback parameter will be set to null. */ - getJob(jobId: string): Promise; + getJob(jobId: string): Promise; /** * Tells the queue remove all jobs created outside of a grace period in milliseconds. @@ -217,6 +235,18 @@ declare module "bull" { * 'ready', 'error', 'activ', 'progress', 'completed', 'failed', 'paused', 'resumed', 'cleaned' */ on(eventName: string, callback: EventCallback): void; + + /** + * Moves the next job from 'waiting' to 'active'. + * Sets the processedOn timestamp to the current datetime. + * @param jobId If specified, will move a specific job from 'waiting' to 'active', + * @returns Returns the job moved from waiting to active queue. + */ + getNextJob:(jobId?: string) => Promise; + } + + interface ErrorMessage { + message: string; } interface EventCallback { diff --git a/types/cheerio/index.d.ts b/types/cheerio/index.d.ts index d264f4b8da..cb8031705e 100644 --- a/types/cheerio/index.d.ts +++ b/types/cheerio/index.d.ts @@ -214,6 +214,7 @@ interface CheerioOptionsInterface { recognizeCDATA?: boolean; recognizeSelfClosing?: boolean; normalizeWhitespace?: boolean; + ignoreWhitespace?: boolean; } interface CheerioSelector { diff --git a/types/dd-trace/dd-trace-tests.ts b/types/dd-trace/dd-trace-tests.ts index 18f5daae10..007ccc30a4 100644 --- a/types/dd-trace/dd-trace-tests.ts +++ b/types/dd-trace/dd-trace-tests.ts @@ -1,7 +1,7 @@ -import * as ddTrace from 'dd-trace'; +import * as tracer from 'dd-trace'; import SpanContext = require('dd-trace/src/opentracing/span_context'); -const tracer = ddTrace.init({ +tracer.init({ service: 'MyLovelyService', hostname: 'localhost', port: 8126, @@ -14,7 +14,7 @@ const tracer = ddTrace.init({ tracer .trace('web.request', { service: 'my_service', - childOf: new SpanContext({ traceId: 1337, spanId: 42 }), + childOf: new SpanContext({ traceId: 1337, spanId: 42 }), // Childof must be an instance of this type. See: https://github.com/DataDog/dd-trace-js/blob/master/src/opentracing/tracer.js#L99 tags: { env: 'dev' } @@ -23,3 +23,13 @@ tracer span.setTag('my_tag', 'my_value'); span.finish(); }); + +const parentScope = tracer.scopeManager().active(); +const span = tracer.startSpan('memcached', { + childOf: parentScope && parentScope.span(), + tags: { + 'service.name': 'my-memcached', + 'resource.name': 'get', + 'span.type': 'memcached', + }, +}); diff --git a/types/dd-trace/index.d.ts b/types/dd-trace/index.d.ts index 11bcdb42f2..a6bbe7dde9 100644 --- a/types/dd-trace/index.d.ts +++ b/types/dd-trace/index.d.ts @@ -1,11 +1,11 @@ -// Type definitions for dd-trace-js 0.2 +// Type definitions for dd-trace-js 0.5 // Project: https://github.com/DataDog/dd-trace-js // Definitions by: Colin Bradley +// Eloy Durán // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -import Tracer = require('./src/opentracing/tracer'); -import Span = require('./src/opentracing/span'); -import SpanContext = require('./src/opentracing/span_context'); +import { Tracer, Span, SpanContext } from "opentracing"; +import DatadogSpanContext = require('./src/opentracing/span_context'); declare var trace: TraceProxy; export = trace; @@ -42,6 +42,11 @@ declare class TraceProxy extends Tracer { * @returns The current span or null if outside a trace context. */ currentSpan(): Span | null; + + /** + * Get the scope manager to manager context propagation for the tracer. + */ + scopeManager(): ScopeManager; } interface TracerOptions { @@ -139,11 +144,44 @@ interface TraceOptions { /** * The parent span or span context for the new span. Generally this is not needed as it will be * fetched from the current context. + * If creating your own, this must be an instance of DatadogSpanContext from ./src/opentracing/span_context + * See: https://github.com/DataDog/dd-trace-js/blob/master/src/opentracing/tracer.js#L99 */ - childOf?: Span | SpanContext; + childOf?: Span | SpanContext | DatadogSpanContext; /** * Global tags that should be assigned to every span. */ tags?: { [key: string]: any } | string; } + +declare class ScopeManager { + /** + * Get the current active scope or null if there is none. + * + * @todo The dd-trace source returns null, but opentracing's childOf span + * option is typed as taking undefined or a scope, so using undefined + * here instead. + */ + active(): Scope | undefined; + + /** + * Activate a new scope wrapping the provided span. + * + * @param span The span for which to activate the new scope. + * @param finishSpanOnClose Whether to automatically finish the span when the scope is closed. + */ + activate(span: Span, finishSpanOnClose?: boolean): Scope; +} + +declare class Scope { + /** + * Get the span wrapped by this scope. + */ + span(): Span; + + /** + * Close the scope, and finish the span if the scope was created with `finishSpanOnClose` set to true. + */ + close(): void; +} diff --git a/types/dd-trace/src/opentracing/span.d.ts b/types/dd-trace/src/opentracing/span.d.ts deleted file mode 100644 index cf9286210b..0000000000 --- a/types/dd-trace/src/opentracing/span.d.ts +++ /dev/null @@ -1,121 +0,0 @@ -import Tracer = require('./tracer'); -import SpanContext = require('./span_context'); -import { Span } from 'opentracing'; - -declare class DatadogSpan extends Span { - /** - * Returns the SpanContext object associated with this Span. - */ - context(): SpanContext; - - /** - * Returns the Tracer object used to create this Span. - */ - tracer(): Tracer; - - /** - * Sets the string name for the logical operation this span represents. - */ - setOperationName(name: string): this; - - /** - * Sets a key:value pair on this Span that also propagates to future - * children of the associated Span. - * - * setBaggageItem() enables powerful functionality given a full-stack - * opentracing integration (e.g., arbitrary application data from a web - * client can make it, transparently, all the way into the depths of a - * storage system), and with it some powerful costs: use this feature with - * care. - * - * IMPORTANT NOTE #1: setBaggageItem() will only propagate baggage items to - * *future* causal descendants of the associated Span. - * - * IMPORTANT NOTE #2: Use this thoughtfully and with care. Every key and - * value is copied into every local *and remote* child of the associated - * Span, and that can add up to a lot of network and cpu overhead. - */ - setBaggageItem(key: string, value: string): this; - - /** - * Returns the value for a baggage item given its key. - * - * @param key - * The key for the given trace attribute. - * @return String value for the given key, or undefined if the key does not - * correspond to a set trace attribute. - */ - getBaggageItem(key: string): string | undefined; - - /** - * Adds a single tag to the span. See `addTags()` for details. - */ - setTag(key: string, value: any): this; - - /** - * Adds the given key value pairs to the set of span tags. - * - * Multiple calls to addTags() results in the tags being the superset of - * all calls. - * - * The behavior of setting the same key multiple times on the same span - * is undefined. - * - * The supported type of the values is implementation-dependent. - * Implementations are expected to safely handle all types of values but - * may choose to ignore unrecognized / unhandle-able values (e.g. objects - * with cyclic references, function objects). - */ - addTags(keyValueMap: { - [key: string]: any; - }): this; - - /** - * Add a log record to this Span, optionally at a user-provided timestamp. - * - * For example: - * - * span.log({ - * size: rpc.size(), // numeric value - * URI: rpc.URI(), // string value - * payload: rpc.payload(), // Object value - * "keys can be arbitrary strings": rpc.foo(), - * }); - * - * span.log({ - * "error.description": someError.description(), - * }, someError.timestampMillis()); - * - * @param keyValuePairs - * An object mapping string keys to arbitrary value types. All - * Tracer implementations should support bool, string, and numeric - * value types, and some may also support Object values. - * @param timestamp - * An optional parameter specifying the timestamp in milliseconds - * since the Unix epoch. Fractional values are allowed so that - * timestamps with sub-millisecond accuracy can be represented. If - * not specified, the implementation is expected to use its notion - * of the current time of the call. - */ - - log(keyValuePairs: { - [key: string]: any; - }, timestamp?: number): this; - - /** - * Sets the end timestamp and finalizes Span state. - * - * With the exception of calls to Span.context() (which are always allowed), - * finish() must be the last call made to any span instance, and to do - * otherwise leads to undefined behavior. - * - * @param finishTime - * Optional finish time in milliseconds as a Unix timestamp. Decimal - * values are supported for timestamps with sub-millisecond accuracy. - * If not specified, the current time (as defined by the - * implementation) will be used. - */ - finish(finishTime?: number): void; -} - -export = DatadogSpan; diff --git a/types/dd-trace/src/opentracing/span_context.d.ts b/types/dd-trace/src/opentracing/span_context.d.ts index cf9565d5a5..d966771c2f 100644 --- a/types/dd-trace/src/opentracing/span_context.d.ts +++ b/types/dd-trace/src/opentracing/span_context.d.ts @@ -1,40 +1,28 @@ import { SpanContext } from 'opentracing'; -/** - * SpanContext represents Span state that must propagate to descendant Spans - * and across process boundaries. - * - * SpanContext is logically divided into two pieces: the user-level "Baggage" - * (see setBaggageItem and getBaggageItem) that propagates across Span - * boundaries and any Tracer-implementation-specific fields that are needed to - * identify or otherwise contextualize the associated Span instance (e.g., a - * tuple). - */ declare class DatadogSpanContext extends SpanContext { /** - * Use to create references to parent spans. + * Used to create references to parent spans. + * See: https://github.com/DataDog/dd-trace-js/blob/master/src/opentracing/tracer.js#L99 */ constructor(props: SpanContextLike); +} - public traceId: number; +interface SpanContextLike { + traceId: number; - public spanId: number; + spanId: number; - public parentId?: number | null; + parentId?: number | null; - public sampled?: boolean; + sampled?: boolean; - public baggageItems?: { [key: string]: string }; + baggageItems?: { [key: string]: string }; - public trace?: { + trace?: { started: number[], finished: number[] } } -interface SpanContextLike { - traceId: number; - spanId: number; -} - export = DatadogSpanContext; diff --git a/types/dd-trace/src/opentracing/tracer.d.ts b/types/dd-trace/src/opentracing/tracer.d.ts deleted file mode 100644 index 252a0d558c..0000000000 --- a/types/dd-trace/src/opentracing/tracer.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { Tracer } from 'opentracing'; - -/** - * Tracer is the entry-point between the instrumentation API and the tracing - * implementation. - */ -declare class DatadogTracer extends Tracer { - -} - -export = DatadogTracer; diff --git a/types/dialogflow/index.d.ts b/types/dialogflow/index.d.ts index c847b662c2..6a3faa8618 100644 --- a/types/dialogflow/index.d.ts +++ b/types/dialogflow/index.d.ts @@ -550,7 +550,7 @@ export interface DetectIntentResponse { export interface QueryResult { queryText: string; - laugnageCode: string; + languageCode: string; speechRecognitionConfidence: number; action: string; parameters: any; @@ -760,8 +760,8 @@ export enum MatchMode { } export interface Credentials { - clientEmail?: string; - privateKey?: string; + client_email: string; + private_key: string; } export interface ClientOptions { diff --git a/types/echarts/index.d.ts b/types/echarts/index.d.ts index bfbd7af809..dc525231e6 100644 --- a/types/echarts/index.d.ts +++ b/types/echarts/index.d.ts @@ -500,7 +500,7 @@ declare namespace echarts { /** * Chart height. */ - heiight?: number | string, + height?: number | string, /** * Specify whether or not to prevent triggering events. diff --git a/types/ember-mocha/ember-mocha-tests.ts b/types/ember-mocha/ember-mocha-tests.ts index 75d1154a87..09662096b6 100644 --- a/types/ember-mocha/ember-mocha-tests.ts +++ b/types/ember-mocha/ember-mocha-tests.ts @@ -1,7 +1,8 @@ import { describeComponent, describeModel, describeModule, setResolver, setupAcceptanceTest, setupComponentTest, - setupModelTest, setupTest + setupModelTest, setupTest, setupRenderingTest, + setupApplicationTest } from 'ember-mocha'; import { describe, it, beforeEach, afterEach, before, after } from 'mocha'; import chai = require('chai'); @@ -96,8 +97,6 @@ describeModule('component:x-foo', 'TestModule callbacks', function() { }); describe('setupTest', function() { - setupTest(); - setupTest('service:ajax'); setupTest('service:ajax', { @@ -193,3 +192,62 @@ it('can calculate the result', function(assert) { it.skip('disabled test'); it.skip('disabled test', function() { }); + +// New testing APIs of ember-mocha 0.14 + +describe('setupTest', function() { + setupTest(); + + setupTest({ resolver: Ember.DefaultResolver.create() }); + + const hooks = setupTest(); + hooks.beforeEach(function() { + this.owner.lookup('service:foo'); + }); + hooks.afterEach(function() { + this.owner.factoryFor('service:foo'); + }); + + setupRenderingTest(); + + setupRenderingTest({ resolver: Ember.DefaultResolver.create() }); + + const hooks2 = setupRenderingTest(); + hooks2.beforeEach(function() { + this.owner.lookup('service:foo'); + }); + + hooks2.afterEach(function() { + this.owner.factoryFor('service:foo'); + }); + + setupApplicationTest(); + + setupApplicationTest({ resolver: Ember.DefaultResolver.create() }); + + const hooks3 = setupApplicationTest(); + hooks3.beforeEach(function() { + this.owner.lookup('service:foo'); + }); + + hooks3.afterEach(function() { + this.owner.factoryFor('service:foo'); + }); + + it('test', function() { + }); +}); + +describe('rendering test', function() { + setupRenderingTest(); + + it('renders', async function() { + // setup the outer context + this.set('value', 'cat'); + + // render the component + await this.render(hbs`{{ x-foo value=value}}`); + + chai.expect(this.element.querySelector('div>.value').textContent.trim()).to.equal('cat', 'The component shows the correct value'); + }); +}); diff --git a/types/ember-mocha/index.d.ts b/types/ember-mocha/index.d.ts index 84510eee38..638edb8542 100644 --- a/types/ember-mocha/index.d.ts +++ b/types/ember-mocha/index.d.ts @@ -1,6 +1,7 @@ -// Type definitions for ember-mocha 0.12 +// Type definitions for ember-mocha 0.14 // Project: https://github.com/emberjs/ember-mocha#readme // Definitions by: Derek Wickern +// Simon Ihmig // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.4 @@ -36,6 +37,17 @@ declare module 'ember-mocha' { (callbacks: ModuleCallbacks): void; } + interface TestHooks { + beforeEach: mochaBeforeEach; + afterEach: mochaAfterEach; + } + + interface SetupOptions { + resolver: Ember.Resolver; + } + + type NewSetupTest = (options?: SetupOptions) => TestHooks; + /** @deprecated Use setupTest instead */ export const describeModule: ContextDefinition; @@ -45,11 +57,14 @@ declare module 'ember-mocha' { /** @deprecated Use setupModelTest instead */ export const describeModel: ContextDefinition; - export const setupTest: SetupTest; + export const setupTest: NewSetupTest & SetupTest; export const setupAcceptanceTest: SetupTest; export const setupComponentTest: SetupTest; export const setupModelTest: SetupTest; + export const setupRenderingTest: NewSetupTest; + export const setupApplicationTest: NewSetupTest; + export const it: typeof mochaIt; /** diff --git a/types/evaporate/index.d.ts b/types/evaporate/index.d.ts index 92f02c9c73..8e959f6b64 100644 --- a/types/evaporate/index.d.ts +++ b/types/evaporate/index.d.ts @@ -52,7 +52,7 @@ declare namespace Evaporate { customAuthMethod?: null | (( signParams: string, signHeaders: string, - stringToSign: () => string | undefined, + stringToSign: string, signatureDateTime: string, canonicalRequest: string ) => Promise); diff --git a/types/express-wechat-access/express-wechat-access-tests.ts b/types/express-wechat-access/express-wechat-access-tests.ts new file mode 100644 index 0000000000..60cc5d9d88 --- /dev/null +++ b/types/express-wechat-access/express-wechat-access-tests.ts @@ -0,0 +1,18 @@ +import express = require('express'); +import * as weAccessMiddleware from 'express-wechat-access'; + +const app: express.Application = express(); + +const options: weAccessMiddleware.WeAccessMidOption = { + appId: 'xxxxx', + appSecret: 'xxxxx' +}; + +app.use( + weAccessMiddleware( + options, + e => { + console.error(e); + } + ) +); diff --git a/types/express-wechat-access/index.d.ts b/types/express-wechat-access/index.d.ts new file mode 100644 index 0000000000..fb0d58701d --- /dev/null +++ b/types/express-wechat-access/index.d.ts @@ -0,0 +1,38 @@ +// Type definitions for express-wechat-access 1.1 +// Project: https://github.com/simmons8616/express-wechat-access +// Definitions by: Simmons Zhang +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +/// + +import { Response, NextFunction } from 'express'; +import * as http from 'http'; +import { EventEmitter } from 'events'; + +type WeMiddleware = (req: any, res: Response | http.ServerResponse, next: NextFunction) => any; + +declare function weAccessMiddleware( + options: { + accessTokenUrl?: string; + ticketUrl?: string; + appId: string; + appSecret: string; + https?: boolean; + }, + errorHandler?: (e: any) => any +): WeMiddleware; + +declare namespace weAccessMiddleware { + interface WeAccessMidOption { + accessTokenUrl?: string; + ticketUrl?: string; + appId: string; + appSecret: string; + https?: boolean; + } + + interface WeAccessMiddleware extends WeMiddleware, EventEmitter, Function {} +} + +export = weAccessMiddleware; diff --git a/types/express-wechat-access/tsconfig.json b/types/express-wechat-access/tsconfig.json new file mode 100644 index 0000000000..e24d740f2c --- /dev/null +++ b/types/express-wechat-access/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictFunctionTypes": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "express-wechat-access-tests.ts" + ] +} diff --git a/types/express-wechat-access/tslint.json b/types/express-wechat-access/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/express-wechat-access/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/fibjs/declare/DgramSocket.d.ts b/types/fibjs/declare/DgramSocket.d.ts index 6618ae9c1c..22486d5832 100644 --- a/types/fibjs/declare/DgramSocket.d.ts +++ b/types/fibjs/declare/DgramSocket.d.ts @@ -45,7 +45,7 @@ declare class Class_DgramSocket extends Class_EventEmitter { * * @async */ - bind(opts: Object): void; + bind(opts: object): void; /** * diff --git a/types/fibjs/declare/Digest.d.ts b/types/fibjs/declare/Digest.d.ts index d440f31486..71c62f0386 100644 --- a/types/fibjs/declare/Digest.d.ts +++ b/types/fibjs/declare/Digest.d.ts @@ -52,23 +52,13 @@ declare class Class_Digest extends Class__object { /** * * @brief 计算并返回摘要 - * @param data 二进制数据块,此数据块将在计算前更新进摘要 - * @return 返回摘要的二进制数据 + * @param codec 指定编码格式,允许值为:"buffer", "hex", "base64", "utf8", 或者系统支持的字符集 + * @return 返回指定编码的摘要表示 * * * */ - digest(data: Class_Buffer): Class_Buffer; - - /** - * - * @brief 计算并返回摘要 - * @return 返回摘要的二进制数据 - * - * - * - */ - digest(): Class_Buffer; + digest(codec?: string/** = "buffer"*/): any; } /** endof class */ diff --git a/types/fibjs/declare/EventEmitter.d.ts b/types/fibjs/declare/EventEmitter.d.ts index 608b6f2edb..0008b2faa3 100644 --- a/types/fibjs/declare/EventEmitter.d.ts +++ b/types/fibjs/declare/EventEmitter.d.ts @@ -56,7 +56,7 @@ declare class Class_EventEmitter extends Class__object { * * */ - on(ev: string, func: Function): Object; + on(ev: string, func: Function): object; /** * @@ -67,7 +67,7 @@ declare class Class_EventEmitter extends Class__object { * * */ - on(map: Object): Object; + on(map: object): object; /** * @@ -79,7 +79,7 @@ declare class Class_EventEmitter extends Class__object { * * */ - addListener(ev: string, func: Function): Object; + addListener(ev: string, func: Function): object; /** * @@ -90,7 +90,7 @@ declare class Class_EventEmitter extends Class__object { * * */ - addListener(map: Object): Object; + addListener(map: object): object; /** * @@ -102,7 +102,7 @@ declare class Class_EventEmitter extends Class__object { * * */ - prependListener(ev: string, func: Function): Object; + prependListener(ev: string, func: Function): object; /** * @@ -113,7 +113,7 @@ declare class Class_EventEmitter extends Class__object { * * */ - prependListener(map: Object): Object; + prependListener(map: object): object; /** * @@ -125,7 +125,7 @@ declare class Class_EventEmitter extends Class__object { * * */ - once(ev: string, func: Function): Object; + once(ev: string, func: Function): object; /** * @@ -136,7 +136,7 @@ declare class Class_EventEmitter extends Class__object { * * */ - once(map: Object): Object; + once(map: object): object; /** * @@ -148,7 +148,7 @@ declare class Class_EventEmitter extends Class__object { * * */ - prependOnceListener(ev: string, func: Function): Object; + prependOnceListener(ev: string, func: Function): object; /** * @@ -159,7 +159,7 @@ declare class Class_EventEmitter extends Class__object { * * */ - prependOnceListener(map: Object): Object; + prependOnceListener(map: object): object; /** * @@ -171,7 +171,7 @@ declare class Class_EventEmitter extends Class__object { * * */ - off(ev: string, func: Function): Object; + off(ev: string, func: Function): object; /** * @@ -182,7 +182,7 @@ declare class Class_EventEmitter extends Class__object { * * */ - off(ev: string): Object; + off(ev: string): object; /** * @@ -193,7 +193,7 @@ declare class Class_EventEmitter extends Class__object { * * */ - off(map: Object): Object; + off(map: object): object; /** * @@ -205,7 +205,7 @@ declare class Class_EventEmitter extends Class__object { * * */ - removeListener(ev: string, func: Function): Object; + removeListener(ev: string, func: Function): object; /** * @@ -216,7 +216,7 @@ declare class Class_EventEmitter extends Class__object { * * */ - removeListener(ev: string): Object; + removeListener(ev: string): object; /** * @@ -227,7 +227,7 @@ declare class Class_EventEmitter extends Class__object { * * */ - removeListener(map: Object): Object; + removeListener(map: object): object; /** * @@ -238,7 +238,7 @@ declare class Class_EventEmitter extends Class__object { * * */ - removeAllListeners(evs?: any[]/** = v8::Array::New(isolate)*/): Object; + removeAllListeners(evs?: any[]/** = v8::Array::New(isolate)*/): object; /** * diff --git a/types/fibjs/declare/EventInfo.d.ts b/types/fibjs/declare/EventInfo.d.ts index a7c43a70a7..f60190d315 100644 --- a/types/fibjs/declare/EventInfo.d.ts +++ b/types/fibjs/declare/EventInfo.d.ts @@ -70,7 +70,7 @@ declare class Class_EventInfo extends Class__object { * @type Object */ - target: Object + target: object diff --git a/types/fibjs/declare/Handler.d.ts b/types/fibjs/declare/Handler.d.ts index ae7af823a2..df2ef6463f 100644 --- a/types/fibjs/declare/Handler.d.ts +++ b/types/fibjs/declare/Handler.d.ts @@ -44,7 +44,7 @@ declare class Class_Handler extends Class__object { * * */ - constructor(map: Object); + constructor(map: object); /** * diff --git a/types/fibjs/declare/HandlerEx.d.ts b/types/fibjs/declare/HandlerEx.d.ts index 504ab42c1a..22bca1ce76 100644 --- a/types/fibjs/declare/HandlerEx.d.ts +++ b/types/fibjs/declare/HandlerEx.d.ts @@ -81,7 +81,7 @@ declare class Class_HandlerEx extends Class_Handler { * * */ - onerror(hdlrs: Object): void; + onerror(hdlrs: object): void; } /** endof class */ diff --git a/types/fibjs/declare/HeapSnapshot.d.ts b/types/fibjs/declare/HeapSnapshot.d.ts index c65282165c..0a10a6b68f 100644 --- a/types/fibjs/declare/HeapSnapshot.d.ts +++ b/types/fibjs/declare/HeapSnapshot.d.ts @@ -71,7 +71,7 @@ declare class Class_HeapSnapshot extends Class__object { * * */ - diff(before: Class_HeapSnapshot): Object; + diff(before: Class_HeapSnapshot): object; /** * diff --git a/types/fibjs/declare/HttpClient.d.ts b/types/fibjs/declare/HttpClient.d.ts index 580e90c70c..7c9f6c073f 100644 --- a/types/fibjs/declare/HttpClient.d.ts +++ b/types/fibjs/declare/HttpClient.d.ts @@ -96,6 +96,30 @@ declare class Class_HttpClient extends Class__object { userAgent: string + /** + * class prop + * + * + * @brief 查询和设置 keep-alive 最大缓存连接数,缺省 128 + * + * + * @type Integer + */ + + poolSize: number + + /** + * class prop + * + * + * @brief 查询和设置 keep-alive 缓存连接超时时间,缺省 10000 ms + * + * + * @type Integer + */ + + poolTimeout: number + /** @@ -139,7 +163,7 @@ declare class Class_HttpClient extends Class__object { * * @async */ - request(method: string, url: string, opts?: Object/** = v8::Object::New(isolate)*/): Class_HttpResponse; + request(method: string, url: string, opts?: object/** = v8::Object::New(isolate)*/): Class_HttpResponse; /** * @@ -161,7 +185,7 @@ declare class Class_HttpClient extends Class__object { * * @async */ - get(url: string, opts?: Object/** = v8::Object::New(isolate)*/): Class_HttpResponse; + get(url: string, opts?: object/** = v8::Object::New(isolate)*/): Class_HttpResponse; /** * @@ -183,7 +207,7 @@ declare class Class_HttpClient extends Class__object { * * @async */ - post(url: string, opts?: Object/** = v8::Object::New(isolate)*/): Class_HttpResponse; + post(url: string, opts?: object/** = v8::Object::New(isolate)*/): Class_HttpResponse; /** * @@ -205,7 +229,7 @@ declare class Class_HttpClient extends Class__object { * * @async */ - del(url: string, opts?: Object/** = v8::Object::New(isolate)*/): Class_HttpResponse; + del(url: string, opts?: object/** = v8::Object::New(isolate)*/): Class_HttpResponse; /** * @@ -227,7 +251,7 @@ declare class Class_HttpClient extends Class__object { * * @async */ - put(url: string, opts?: Object/** = v8::Object::New(isolate)*/): Class_HttpResponse; + put(url: string, opts?: object/** = v8::Object::New(isolate)*/): Class_HttpResponse; /** * @@ -249,7 +273,7 @@ declare class Class_HttpClient extends Class__object { * * @async */ - patch(url: string, opts?: Object/** = v8::Object::New(isolate)*/): Class_HttpResponse; + patch(url: string, opts?: object/** = v8::Object::New(isolate)*/): Class_HttpResponse; } /** endof class */ diff --git a/types/fibjs/declare/HttpCollection.d.ts b/types/fibjs/declare/HttpCollection.d.ts index 5aa34c40bb..1936011e1d 100644 --- a/types/fibjs/declare/HttpCollection.d.ts +++ b/types/fibjs/declare/HttpCollection.d.ts @@ -75,7 +75,7 @@ declare class Class_HttpCollection extends Class__object { * * */ - add(map: Object): void; + add(map: object): void; /** * @@ -96,7 +96,7 @@ declare class Class_HttpCollection extends Class__object { * * */ - set(map: Object): void; + set(map: object): void; /** * diff --git a/types/fibjs/declare/HttpCookie.d.ts b/types/fibjs/declare/HttpCookie.d.ts index 5be7604293..b7c3980150 100644 --- a/types/fibjs/declare/HttpCookie.d.ts +++ b/types/fibjs/declare/HttpCookie.d.ts @@ -118,7 +118,7 @@ declare class Class_HttpCookie extends Class__object { * * */ - constructor(opts?: Object/** = v8::Object::New(isolate)*/); + constructor(opts?: object/** = v8::Object::New(isolate)*/); /** * @@ -130,7 +130,7 @@ declare class Class_HttpCookie extends Class__object { * * */ - constructor(name: string, value: string, opts?: Object/** = v8::Object::New(isolate)*/); + constructor(name: string, value: string, opts?: object/** = v8::Object::New(isolate)*/); /** * diff --git a/types/fibjs/declare/HttpMessage.d.ts b/types/fibjs/declare/HttpMessage.d.ts index 89ef9c96c6..1d64ba5c5f 100644 --- a/types/fibjs/declare/HttpMessage.d.ts +++ b/types/fibjs/declare/HttpMessage.d.ts @@ -151,7 +151,7 @@ declare class Class_HttpMessage extends Class_Message { * * */ - addHeader(map: Object): void; + addHeader(map: object): void; /** * @@ -172,7 +172,7 @@ declare class Class_HttpMessage extends Class_Message { * * */ - setHeader(map: Object): void; + setHeader(map: object): void; /** * diff --git a/types/fibjs/declare/HttpResponse.d.ts b/types/fibjs/declare/HttpResponse.d.ts index 4ecf06866d..7f69b8509a 100644 --- a/types/fibjs/declare/HttpResponse.d.ts +++ b/types/fibjs/declare/HttpResponse.d.ts @@ -80,7 +80,7 @@ declare class Class_HttpResponse extends Class_HttpMessage { * * */ - writeHead(statusCode: number, statusMessage: string, headers?: Object/** = v8::Object::New(isolate)*/): void; + writeHead(statusCode: number, statusMessage: string, headers?: object/** = v8::Object::New(isolate)*/): void; /** * @@ -91,7 +91,7 @@ declare class Class_HttpResponse extends Class_HttpMessage { * * */ - writeHead(statusCode: number, headers?: Object/** = v8::Object::New(isolate)*/): void; + writeHead(statusCode: number, headers?: object/** = v8::Object::New(isolate)*/): void; /** * diff --git a/types/fibjs/declare/HttpServer.d.ts b/types/fibjs/declare/HttpServer.d.ts index 157c951ea8..75ba24c290 100644 --- a/types/fibjs/declare/HttpServer.d.ts +++ b/types/fibjs/declare/HttpServer.d.ts @@ -143,7 +143,7 @@ declare class Class_HttpServer extends Class_TcpServer { * * */ - onerror(hdlrs: Object): void; + onerror(hdlrs: object): void; /** * diff --git a/types/fibjs/declare/LevelDB.d.ts b/types/fibjs/declare/LevelDB.d.ts index feb6ce2b6b..c9721bf337 100644 --- a/types/fibjs/declare/LevelDB.d.ts +++ b/types/fibjs/declare/LevelDB.d.ts @@ -78,7 +78,7 @@ declare class Class_LevelDB extends Class__object { * * */ - mset(map: Object): void; + mset(map: object): void; /** * diff --git a/types/fibjs/declare/LruCache.d.ts b/types/fibjs/declare/LruCache.d.ts index 884bb65d26..f68ac413cd 100644 --- a/types/fibjs/declare/LruCache.d.ts +++ b/types/fibjs/declare/LruCache.d.ts @@ -134,7 +134,7 @@ declare class Class_LruCache extends Class_EventEmitter { * * */ - set(map: Object): void; + set(map: object): void; /** * diff --git a/types/fibjs/declare/MongoCollection.d.ts b/types/fibjs/declare/MongoCollection.d.ts index 4b1f07478b..e721feabcd 100644 --- a/types/fibjs/declare/MongoCollection.d.ts +++ b/types/fibjs/declare/MongoCollection.d.ts @@ -36,7 +36,7 @@ declare class Class_MongoCollection extends Class__object { * * */ - find(query?: Object/** = v8::Object::New(isolate)*/, projection?: Object/** = v8::Object::New(isolate)*/): Class_MongoCursor; + find(query?: object/** = v8::Object::New(isolate)*/, projection?: object/** = v8::Object::New(isolate)*/): Class_MongoCursor; /** * @@ -48,7 +48,7 @@ declare class Class_MongoCollection extends Class__object { * * */ - findOne(query?: Object/** = v8::Object::New(isolate)*/, projection?: Object/** = v8::Object::New(isolate)*/): Object; + findOne(query?: object/** = v8::Object::New(isolate)*/, projection?: object/** = v8::Object::New(isolate)*/): object; /** * @@ -59,7 +59,7 @@ declare class Class_MongoCollection extends Class__object { * * */ - findAndModify(query: Object): Object; + findAndModify(query: object): object; /** * @@ -79,7 +79,7 @@ declare class Class_MongoCollection extends Class__object { * * */ - insert(document: Object): void; + insert(document: object): void; /** * @@ -89,7 +89,7 @@ declare class Class_MongoCollection extends Class__object { * * */ - save(document: Object): void; + save(document: object): void; /** * @@ -102,7 +102,7 @@ declare class Class_MongoCollection extends Class__object { * * */ - update(query: Object, document: Object, upsert?: boolean/** = false*/, multi?: boolean/** = false*/): void; + update(query: object, document: object, upsert?: boolean/** = false*/, multi?: boolean/** = false*/): void; /** * @@ -114,7 +114,7 @@ declare class Class_MongoCollection extends Class__object { * * */ - update(query: Object, document: Object, options: Object): void; + update(query: object, document: object, options: object): void; /** * @@ -124,7 +124,7 @@ declare class Class_MongoCollection extends Class__object { * * */ - remove(query: Object): void; + remove(query: object): void; /** * @@ -135,7 +135,7 @@ declare class Class_MongoCollection extends Class__object { * * */ - runCommand(cmd: Object): Object; + runCommand(cmd: object): object; /** * @@ -147,7 +147,7 @@ declare class Class_MongoCollection extends Class__object { * * */ - runCommand(cmd: string, arg?: Object/** = v8::Object::New(isolate)*/): Object; + runCommand(cmd: string, arg?: object/** = v8::Object::New(isolate)*/): object; /** * @@ -166,7 +166,7 @@ declare class Class_MongoCollection extends Class__object { * * */ - ensureIndex(keys: Object, options?: Object/** = v8::Object::New(isolate)*/): void; + ensureIndex(keys: object, options?: object/** = v8::Object::New(isolate)*/): void; /** * @@ -176,7 +176,7 @@ declare class Class_MongoCollection extends Class__object { * * */ - reIndex(): Object; + reIndex(): object; /** * @@ -187,7 +187,7 @@ declare class Class_MongoCollection extends Class__object { * * */ - dropIndex(name: string): Object; + dropIndex(name: string): object; /** * @@ -197,7 +197,7 @@ declare class Class_MongoCollection extends Class__object { * * */ - dropIndexes(): Object; + dropIndexes(): object; /** * diff --git a/types/fibjs/declare/MongoCursor.d.ts b/types/fibjs/declare/MongoCursor.d.ts index d9e26b833f..2dc99b5e96 100644 --- a/types/fibjs/declare/MongoCursor.d.ts +++ b/types/fibjs/declare/MongoCursor.d.ts @@ -57,7 +57,7 @@ declare class Class_MongoCursor extends Class__object { * * */ - sort(opts: Object): Class_MongoCursor; + sort(opts: object): Class_MongoCursor; /** * @@ -77,7 +77,7 @@ declare class Class_MongoCursor extends Class__object { * * */ - next(): Object; + next(): object; /** * @@ -140,7 +140,7 @@ declare class Class_MongoCursor extends Class__object { * * */ - hint(opts: Object): Class_MongoCursor; + hint(opts: object): Class_MongoCursor; } /** endof class */ diff --git a/types/fibjs/declare/MongoDB.d.ts b/types/fibjs/declare/MongoDB.d.ts index c0bf5432bd..11bcf1456d 100644 --- a/types/fibjs/declare/MongoDB.d.ts +++ b/types/fibjs/declare/MongoDB.d.ts @@ -46,7 +46,7 @@ declare class Class_MongoDB extends Class__object { * * */ - runCommand(cmd: Object): Object; + runCommand(cmd: object): object; /** * @@ -58,7 +58,7 @@ declare class Class_MongoDB extends Class__object { * * */ - runCommand(cmd: string, arg: any): Object; + runCommand(cmd: string, arg: any): object; /** * diff --git a/types/fibjs/declare/PKey.d.ts b/types/fibjs/declare/PKey.d.ts index 0c3f939e3e..297cfb2a13 100644 --- a/types/fibjs/declare/PKey.d.ts +++ b/types/fibjs/declare/PKey.d.ts @@ -144,7 +144,7 @@ declare class Class_PKey extends Class__object { * * */ - constructor(jsonKey: Object); + constructor(jsonKey: object); /** * @@ -258,7 +258,7 @@ declare class Class_PKey extends Class__object { * * */ - importKey(jsonKey: Object): void; + importKey(jsonKey: object): void; /** * @@ -299,7 +299,7 @@ declare class Class_PKey extends Class__object { * * */ - exportJson(): Object; + exportJson(): object; /** * diff --git a/types/fibjs/declare/Redis.d.ts b/types/fibjs/declare/Redis.d.ts index 4c5201d62c..384e0e4d80 100644 --- a/types/fibjs/declare/Redis.d.ts +++ b/types/fibjs/declare/Redis.d.ts @@ -90,7 +90,7 @@ declare class Class_Redis extends Class__object { * * */ - mset(kvs: Object): void; + mset(kvs: object): void; /** * @@ -108,7 +108,7 @@ declare class Class_Redis extends Class__object { * * */ - msetNX(kvs: Object): void; + msetNX(kvs: object): void; /** * @@ -383,7 +383,7 @@ declare class Class_Redis extends Class__object { * * */ - sub(map: Object): void; + sub(map: object): void; /** * @@ -424,7 +424,7 @@ declare class Class_Redis extends Class__object { * * */ - unsub(map: Object): void; + unsub(map: object): void; /** * @@ -445,7 +445,7 @@ declare class Class_Redis extends Class__object { * * */ - psub(map: Object): void; + psub(map: object): void; /** * @@ -486,7 +486,7 @@ declare class Class_Redis extends Class__object { * * */ - unpsub(map: Object): void; + unpsub(map: object): void; /** * diff --git a/types/fibjs/declare/RedisHash.d.ts b/types/fibjs/declare/RedisHash.d.ts index 0c8c9ea362..0c16eef47d 100644 --- a/types/fibjs/declare/RedisHash.d.ts +++ b/types/fibjs/declare/RedisHash.d.ts @@ -53,7 +53,7 @@ declare class Class_RedisHash extends Class__object { * * */ - mset(kvs: Object): void; + mset(kvs: object): void; /** * diff --git a/types/fibjs/declare/RedisSortedSet.d.ts b/types/fibjs/declare/RedisSortedSet.d.ts index ed2bcfaf5c..1769fb0a79 100644 --- a/types/fibjs/declare/RedisSortedSet.d.ts +++ b/types/fibjs/declare/RedisSortedSet.d.ts @@ -34,7 +34,7 @@ declare class Class_RedisSortedSet extends Class__object { * * */ - add(sms: Object): number; + add(sms: object): number; /** * diff --git a/types/fibjs/declare/Routing.d.ts b/types/fibjs/declare/Routing.d.ts index c06bc4e887..aef820feae 100644 --- a/types/fibjs/declare/Routing.d.ts +++ b/types/fibjs/declare/Routing.d.ts @@ -34,7 +34,7 @@ declare class Class_Routing extends Class_Handler { * * */ - constructor(map?: Object/** = v8::Object::New(isolate)*/); + constructor(map?: object/** = v8::Object::New(isolate)*/); /** * @@ -45,7 +45,7 @@ declare class Class_Routing extends Class_Handler { * * */ - constructor(method: string, map: Object); + constructor(method: string, map: object); /** * @@ -67,7 +67,7 @@ declare class Class_Routing extends Class_Handler { * * */ - append(map: Object): Class_Routing; + append(map: object): Class_Routing; /** * @@ -103,7 +103,7 @@ declare class Class_Routing extends Class_Handler { * * */ - all(map: Object): Class_Routing; + all(map: object): Class_Routing; /** * @@ -126,7 +126,7 @@ declare class Class_Routing extends Class_Handler { * * */ - get(map: Object): Class_Routing; + get(map: object): Class_Routing; /** * @@ -149,7 +149,7 @@ declare class Class_Routing extends Class_Handler { * * */ - post(map: Object): Class_Routing; + post(map: object): Class_Routing; /** * @@ -172,7 +172,7 @@ declare class Class_Routing extends Class_Handler { * * */ - del(map: Object): Class_Routing; + del(map: object): Class_Routing; /** * @@ -195,7 +195,7 @@ declare class Class_Routing extends Class_Handler { * * */ - put(map: Object): Class_Routing; + put(map: object): Class_Routing; /** * @@ -218,7 +218,7 @@ declare class Class_Routing extends Class_Handler { * * */ - patch(map: Object): Class_Routing; + patch(map: object): Class_Routing; /** * @@ -241,7 +241,7 @@ declare class Class_Routing extends Class_Handler { * * */ - find(map: Object): Class_Routing; + find(map: object): Class_Routing; /** * diff --git a/types/fibjs/declare/SandBox.d.ts b/types/fibjs/declare/SandBox.d.ts index 31f9dc53ce..fc3152b232 100644 --- a/types/fibjs/declare/SandBox.d.ts +++ b/types/fibjs/declare/SandBox.d.ts @@ -34,7 +34,20 @@ declare class Class_SandBox extends Class__object { * @type Object */ - global: Object + global: object + + /** + * class prop + * + * + * @brief 查询沙箱中现存的所有模块的字典对象 + * + * + * @readonly + * @type Object + */ + + modules: object @@ -46,7 +59,7 @@ declare class Class_SandBox extends Class__object { * * */ - constructor(mods: Object); + constructor(mods: object); /** * @@ -57,7 +70,7 @@ declare class Class_SandBox extends Class__object { * * */ - constructor(mods: Object, require: Function); + constructor(mods: object, require: Function); /** * @@ -68,7 +81,7 @@ declare class Class_SandBox extends Class__object { * * */ - constructor(mods: Object, global: Object); + constructor(mods: object, global: object); /** * @@ -80,7 +93,7 @@ declare class Class_SandBox extends Class__object { * * */ - constructor(mods: Object, require: Function, global: Object); + constructor(mods: object, require: Function, global: object); /** * @@ -101,7 +114,7 @@ declare class Class_SandBox extends Class__object { * * */ - add(mods: Object): void; + add(mods: object): void; /** * @@ -125,6 +138,17 @@ declare class Class_SandBox extends Class__object { */ remove(id: string): void; + /** + * + * @brief 从沙箱中检测基础模块是否存在 + * @param id 指定要检测的模块名称,此路径与当前运行脚本无关,必须为绝对路径或者模块名 + * @return 是否存在 + * + * + * + */ + has(id: string): boolean; + /** * * @brief 复制当前沙箱,新沙箱包含当前沙箱的模块,以及相同的名称和 require 函数 @@ -135,6 +159,22 @@ declare class Class_SandBox extends Class__object { */ clone(): Class_SandBox; + /** + * + * @brief 冻结当前沙箱,冻结后的沙箱,对 global 所做的修改将被忽略 + * + * + */ + freeze(): void; + + /** + * + * @brief 重新加载沙箱内的模块,此操作只会重新初始化模块,复位模块内的变量,不更新模块代码 + * + * + */ + refresh(): void; + /** * * @brief 运行一个脚本 @@ -170,6 +210,44 @@ declare class Class_SandBox extends Class__object { */ require(id: string, base: string): any; + /** + * + * @brief 对指定的 extname 添加 compiler, extname 不可为系统内置扩展名 (包括 {'.js', '.json', '.jsc', '.wasm'}), compiler 需返回有效的 javascript 脚本. + * + * ```JavaScript + * var vm = require('vm'); + * var sbox = new vm.SandBox({ + * }); + * + * // 编译 typescript 脚本为 js 并加载 + * sbox.setModuleCompiler('.ts', tsCompiler); + * var mod_ts = sbox.require('./a.ts'); + * + * // 编译 coffee 脚本为 js 并加载 + * sbox.setModuleCompiler('.coffee', cafeCompiler); + * var mod_coffee = sbox.require('./a.coffee'); + * + * // 编译 jsx 脚本为 js 并加载 + * sbox.setModuleCompiler('.jsx', reactCompiler); + * var mod_react = sbox.require('./a.jsx'); + * + * // 编译 yml 脚本为自定义的内容(如 API 集合) 并加载 + * sbox.setModuleCompiler('.yml', yaml2Rest) + * sbox.setModuleCompiler('.yaml', yaml2Rest) + * + * // 编译 markdown 为自定义的内容(如 html 字符串或 XmlDocument 对象) 并加载 + * sbox.setModuleCompiler('.md', mdCompiler) + * sbox.setModuleCompiler('.markdown', mdCompiler) + * ``` + * + * @param extname 指定的 extname, 必须以 '.' 开头, 且为非系统内置扩展名 + * @param compiler 编译回调函数, 所有带 extname 的文件仅会 require 一次. 该回调函数格式为 `compiler(buf, requireInfo)`, buf 为读取到的文件 Buffer, requireInfo 结构为 `{filename: string}`. + * + * + * + */ + setModuleCompiler(extname: string, compiler: Function): void; + } /** endof class */ /** endof `module Or Internal Object` */ diff --git a/types/fibjs/declare/Service.d.ts b/types/fibjs/declare/Service.d.ts index 6ca8feab53..7816e2d8bc 100644 --- a/types/fibjs/declare/Service.d.ts +++ b/types/fibjs/declare/Service.d.ts @@ -84,7 +84,7 @@ declare class Class_Service extends Class_EventEmitter { * * */ - constructor(name: string, worker: Function, event?: Object/** = v8::Object::New(isolate)*/); + constructor(name: string, worker: Function, event?: object/** = v8::Object::New(isolate)*/); /** * diff --git a/types/fibjs/declare/UrlObject.d.ts b/types/fibjs/declare/UrlObject.d.ts index 578d3b5079..5baa5b2d7d 100644 --- a/types/fibjs/declare/UrlObject.d.ts +++ b/types/fibjs/declare/UrlObject.d.ts @@ -216,7 +216,7 @@ declare class Class_UrlObject extends Class__object { * * */ - constructor(args: Object); + constructor(args: object); /** * @@ -250,7 +250,7 @@ declare class Class_UrlObject extends Class__object { * * */ - format(args: Object): void; + format(args: object): void; /** * diff --git a/types/fibjs/declare/Worker.d.ts b/types/fibjs/declare/Worker.d.ts index 1bbc793b85..c427f6f41c 100644 --- a/types/fibjs/declare/Worker.d.ts +++ b/types/fibjs/declare/Worker.d.ts @@ -47,7 +47,7 @@ declare class Class_Worker extends Class_EventEmitter { * * */ - constructor(path: string, opts?: Object/** = v8::Object::New(isolate)*/); + constructor(path: string, opts?: object/** = v8::Object::New(isolate)*/); /** * diff --git a/types/fibjs/declare/X509Req.d.ts b/types/fibjs/declare/X509Req.d.ts index 6317e9afa1..502c078402 100644 --- a/types/fibjs/declare/X509Req.d.ts +++ b/types/fibjs/declare/X509Req.d.ts @@ -146,7 +146,7 @@ declare class Class_X509Req extends Class__object { * * @async */ - sign(issuer: string, key: Class_PKey, opts?: Object/** = v8::Object::New(isolate)*/): Class_X509Cert; + sign(issuer: string, key: Class_PKey, opts?: object/** = v8::Object::New(isolate)*/): Class_X509Cert; } /** endof class */ diff --git a/types/fibjs/declare/bson.d.ts b/types/fibjs/declare/bson.d.ts index 920a1ace79..f9eeab19cb 100644 --- a/types/fibjs/declare/bson.d.ts +++ b/types/fibjs/declare/bson.d.ts @@ -217,7 +217,7 @@ declare module "bson" { * * */ - export function encode(data: Object): Class_Buffer; + export function encode(data: object): Class_Buffer; /** * @@ -228,7 +228,7 @@ declare module "bson" { * * */ - export function decode(data: Class_Buffer): Object; + export function decode(data: Class_Buffer): object; } /** end of `module bson` */ export = bson diff --git a/types/fibjs/declare/console.d.ts b/types/fibjs/declare/console.d.ts index 7a657ecd93..43f8603c2e 100644 --- a/types/fibjs/declare/console.d.ts +++ b/types/fibjs/declare/console.d.ts @@ -391,7 +391,7 @@ declare module "console" { * * */ - export function add(cfg: Object): void; + export function add(cfg: object): void; /** * diff --git a/types/fibjs/declare/dgram.d.ts b/types/fibjs/declare/dgram.d.ts index e925eac7af..0d3ccd20a9 100644 --- a/types/fibjs/declare/dgram.d.ts +++ b/types/fibjs/declare/dgram.d.ts @@ -238,7 +238,7 @@ declare module "dgram" { * * */ - export function createSocket(opts: Object): Class_DgramSocket; + export function createSocket(opts: object): Class_DgramSocket; /** * @@ -260,7 +260,7 @@ declare module "dgram" { * * */ - export function createSocket(opts: Object, callback: Function): Class_DgramSocket; + export function createSocket(opts: object, callback: Function): Class_DgramSocket; /** * diff --git a/types/fibjs/declare/fs.d.ts b/types/fibjs/declare/fs.d.ts index ec22c54c3d..b0971e3ee5 100644 --- a/types/fibjs/declare/fs.d.ts +++ b/types/fibjs/declare/fs.d.ts @@ -647,6 +647,27 @@ declare module "fs" { */ export function appendFile(fname: string, data: Class_Buffer): void; + /** + * + * @brief 设置 zip 虚拟文件映射 + * @param fname 指定映射路径 + * @param data 指定映射的 zip 文件数据 + * + * + * + */ + export function setZipFS(fname: string, data: Class_Buffer): void; + + /** + * + * @brief 清除 zip 虚拟文件映射 + * @param fname 指定映射路径,缺省清除全部缓存 + * + * + * + */ + export function clearZipFS(fname?: string/** = ""*/): void; + } /** end of `module fs` */ export = fs } diff --git a/types/fibjs/declare/global.d.ts b/types/fibjs/declare/global.d.ts index 3c58e8289c..19d539d932 100644 --- a/types/fibjs/declare/global.d.ts +++ b/types/fibjs/declare/global.d.ts @@ -379,7 +379,7 @@ declare module "global" { * * */ - export function setTimeout(callback: Function, timeout: number, ...args: any[]): Class_Timer; + export function setTimeout(callback: Function, timeout?: number/** = 1*/, ...args: any[]): Class_Timer; /** * diff --git a/types/fibjs/declare/gui.d.ts b/types/fibjs/declare/gui.d.ts index e2522b8331..60768a9d93 100644 --- a/types/fibjs/declare/gui.d.ts +++ b/types/fibjs/declare/gui.d.ts @@ -293,7 +293,7 @@ declare module "gui" { * * */ - export function open(url: string, opt?: Object/** = v8::Object::New(isolate)*/): Class_WebView; + export function open(url: string, opt?: object/** = v8::Object::New(isolate)*/): Class_WebView; } /** end of `module gui` */ export = gui diff --git a/types/fibjs/declare/http.d.ts b/types/fibjs/declare/http.d.ts index 2712b08370..000f4a6b79 100644 --- a/types/fibjs/declare/http.d.ts +++ b/types/fibjs/declare/http.d.ts @@ -196,7 +196,7 @@ /** module Or Internal Object */ /** - * @brief 超文本传输协议模块,用以支持 http 协议处理 + * @brief 超文本传输协议模块,用以支持 http 协议处理,模块别名:https * @detail */ declare module "http" { @@ -205,6 +205,14 @@ declare module "http" { module http { + /** + * + * @brief 返回标准的 HTTP 响应状态码的集合,以及各自的简短描述。 + * + * + */ + export const STATUS_CODES: any[]; + /** * * @brief 返回http客户端的 HttpCookie 对象列表 @@ -253,6 +261,22 @@ declare module "http" { */ export const userAgent: string; + /** + * + * @brief 查询和设置 keep-alive 最大缓存连接数,缺省 128 + * + * + */ + export const poolSize: number; + + /** + * + * @brief 查询和设置 keep-alive 缓存连接超时时间,缺省 10000 ms + * + * + */ + export const poolTimeout: number; + /** * @@ -333,7 +357,7 @@ declare module "http" { * * */ - export function fileHandler(root: string, mimes?: Object/** = v8::Object::New(isolate)*/, autoIndex?: boolean/** = false*/): Class_Handler; + export function fileHandler(root: string, mimes?: object/** = v8::Object::New(isolate)*/, autoIndex?: boolean/** = false*/): Class_Handler; /** * @@ -368,7 +392,7 @@ declare module "http" { * * @async */ - export function request(method: string, url: string, opts?: Object/** = v8::Object::New(isolate)*/): Class_HttpResponse; + export function request(method: string, url: string, opts?: object/** = v8::Object::New(isolate)*/): Class_HttpResponse; /** * @@ -390,7 +414,7 @@ declare module "http" { * * @async */ - export function get(url: string, opts?: Object/** = v8::Object::New(isolate)*/): Class_HttpResponse; + export function get(url: string, opts?: object/** = v8::Object::New(isolate)*/): Class_HttpResponse; /** * @@ -412,7 +436,7 @@ declare module "http" { * * @async */ - export function post(url: string, opts?: Object/** = v8::Object::New(isolate)*/): Class_HttpResponse; + export function post(url: string, opts?: object/** = v8::Object::New(isolate)*/): Class_HttpResponse; /** * @@ -434,7 +458,7 @@ declare module "http" { * * @async */ - export function del(url: string, opts?: Object/** = v8::Object::New(isolate)*/): Class_HttpResponse; + export function del(url: string, opts?: object/** = v8::Object::New(isolate)*/): Class_HttpResponse; /** * @@ -456,7 +480,7 @@ declare module "http" { * * @async */ - export function put(url: string, opts?: Object/** = v8::Object::New(isolate)*/): Class_HttpResponse; + export function put(url: string, opts?: object/** = v8::Object::New(isolate)*/): Class_HttpResponse; /** * @@ -478,7 +502,7 @@ declare module "http" { * * @async */ - export function patch(url: string, opts?: Object/** = v8::Object::New(isolate)*/): Class_HttpResponse; + export function patch(url: string, opts?: object/** = v8::Object::New(isolate)*/): Class_HttpResponse; } /** end of `module http` */ export = http diff --git a/types/fibjs/declare/index.d.ts b/types/fibjs/declare/index.d.ts index 53be0766e3..df0e02e683 100644 --- a/types/fibjs/declare/index.d.ts +++ b/types/fibjs/declare/index.d.ts @@ -14,54 +14,54 @@ -/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// /// /// /// /// -/// -/// -/// -/// -/// -/// -/// /// -/// -/// -/// -/// -/// /// -/// /// -/// /// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// /// +/// +/// +/// +/// +/// +/// /// -/// -/// -/// +/// +/// /// /// /// -/// /// -/// -/// -/// +/// import _Global from 'global'; import _Process from 'process'; diff --git a/types/fibjs/declare/net.d.ts b/types/fibjs/declare/net.d.ts index 831b958124..8c2bf58055 100644 --- a/types/fibjs/declare/net.d.ts +++ b/types/fibjs/declare/net.d.ts @@ -284,7 +284,7 @@ declare module "net" { * * */ - export function info(): Object; + export function info(): object; /** * diff --git a/types/fibjs/declare/os.d.ts b/types/fibjs/declare/os.d.ts index d98d2b58d5..977fc4c6ce 100644 --- a/types/fibjs/declare/os.d.ts +++ b/types/fibjs/declare/os.d.ts @@ -380,7 +380,7 @@ declare module "os" { * * */ - export function userInfo(options?: Object/** = v8::Object::New(isolate)*/): Object; + export function userInfo(options?: object/** = v8::Object::New(isolate)*/): object; /** * @@ -390,7 +390,7 @@ declare module "os" { * * */ - export function networkInterfaces(): Object; + export function networkInterfaces(): object; /** * @@ -470,7 +470,7 @@ declare module "os" { * * */ - export function memoryUsage(): Object; + export function memoryUsage(): object; } /** end of `module os` */ export = os diff --git a/types/fibjs/declare/path.d.ts b/types/fibjs/declare/path.d.ts index 2764664778..9b6ae9cfec 100644 --- a/types/fibjs/declare/path.d.ts +++ b/types/fibjs/declare/path.d.ts @@ -341,6 +341,19 @@ declare module "path" { */ export function resolve(...ps: any[]): string; + /** + * + * @brief 求 _from 到 to 的相对路径 + * + * @param _from 源路径 + * @param to 目标路径 + * @return 返回得到的相对路径 + * + * + * + */ + export function relative(_from: string, to: string): string; + /** * * @brief 转换成 namespace-prefixed 路径。只在 windows 有效,其他系统直接返回。 diff --git a/types/fibjs/declare/path_posix.d.ts b/types/fibjs/declare/path_posix.d.ts index e28fbfee0a..bfeea21068 100644 --- a/types/fibjs/declare/path_posix.d.ts +++ b/types/fibjs/declare/path_posix.d.ts @@ -341,6 +341,19 @@ declare module "path_posix" { */ export function resolve(...ps: any[]): string; + /** + * + * @brief 求 _from 到 to 的相对路径 + * + * @param _from 源路径 + * @param to 目标路径 + * @return 返回得到的相对路径 + * + * + * + */ + export function relative(_from: string, to: string): string; + /** * * @brief 转换成 namespace-prefixed 路径。只在 windows 有效,其他系统直接返回。 diff --git a/types/fibjs/declare/path_win32.d.ts b/types/fibjs/declare/path_win32.d.ts index 80f236ba50..25ce64db09 100644 --- a/types/fibjs/declare/path_win32.d.ts +++ b/types/fibjs/declare/path_win32.d.ts @@ -341,6 +341,19 @@ declare module "path_win32" { */ export function resolve(...ps: any[]): string; + /** + * + * @brief 求 _from 到 to 的相对路径 + * + * @param _from 源路径 + * @param to 目标路径 + * @return 返回得到的相对路径 + * + * + * + */ + export function relative(_from: string, to: string): string; + /** * * @brief 转换成 namespace-prefixed 路径。只在 windows 有效,其他系统直接返回。 diff --git a/types/fibjs/declare/process.d.ts b/types/fibjs/declare/process.d.ts index 669eff12d2..1e6e1c8739 100644 --- a/types/fibjs/declare/process.d.ts +++ b/types/fibjs/declare/process.d.ts @@ -416,7 +416,7 @@ declare module "process" { * * */ - export function memoryUsage(): Object; + export function memoryUsage(): object; /** * @@ -448,7 +448,7 @@ declare module "process" { * * */ - export function open(command: string, args: any[], opts?: Object/** = v8::Object::New(isolate)*/): Class_SubProcess; + export function open(command: string, args: any[], opts?: object/** = v8::Object::New(isolate)*/): Class_SubProcess; /** * @@ -468,7 +468,7 @@ declare module "process" { * * */ - export function open(command: string, opts?: Object/** = v8::Object::New(isolate)*/): Class_SubProcess; + export function open(command: string, opts?: object/** = v8::Object::New(isolate)*/): Class_SubProcess; /** * @@ -489,7 +489,7 @@ declare module "process" { * * */ - export function start(command: string, args: any[], opts?: Object/** = v8::Object::New(isolate)*/): Class_SubProcess; + export function start(command: string, args: any[], opts?: object/** = v8::Object::New(isolate)*/): Class_SubProcess; /** * @@ -509,7 +509,7 @@ declare module "process" { * * */ - export function start(command: string, opts?: Object/** = v8::Object::New(isolate)*/): Class_SubProcess; + export function start(command: string, opts?: object/** = v8::Object::New(isolate)*/): Class_SubProcess; /** * @@ -530,7 +530,7 @@ declare module "process" { * * */ - export function run(command: string, args: any[], opts?: Object/** = v8::Object::New(isolate)*/): number; + export function run(command: string, args: any[], opts?: object/** = v8::Object::New(isolate)*/): number; /** * @@ -550,7 +550,7 @@ declare module "process" { * * */ - export function run(command: string, opts?: Object/** = v8::Object::New(isolate)*/): number; + export function run(command: string, opts?: object/** = v8::Object::New(isolate)*/): number; } /** end of `module process` */ export = process diff --git a/types/fibjs/declare/profiler.d.ts b/types/fibjs/declare/profiler.d.ts index 36a89b2644..5d3459ddbb 100644 --- a/types/fibjs/declare/profiler.d.ts +++ b/types/fibjs/declare/profiler.d.ts @@ -416,7 +416,7 @@ declare module "profiler" { * * */ - export function diff(test: Function): Object; + export function diff(test: Function): object; /** * diff --git a/types/fibjs/declare/querystring.d.ts b/types/fibjs/declare/querystring.d.ts index 9010d119e5..bd939a0621 100644 --- a/types/fibjs/declare/querystring.d.ts +++ b/types/fibjs/declare/querystring.d.ts @@ -242,7 +242,7 @@ declare module "querystring" { * * */ - export function parse(str: string, sep?: string/** = "&"*/, eq?: string/** = "="*/, opt?: Object/** = v8::Object::New(isolate)*/): Class_HttpCollection; + export function parse(str: string, sep?: string/** = "&"*/, eq?: string/** = "="*/, opt?: object/** = v8::Object::New(isolate)*/): Class_HttpCollection; /** * @@ -256,7 +256,7 @@ declare module "querystring" { * * */ - export function stringify(obj: Object, sep?: string/** = "&"*/, eq?: string/** = "="*/, opt?: Object/** = v8::Object::New(isolate)*/): string; + export function stringify(obj: object, sep?: string/** = "&"*/, eq?: string/** = "="*/, opt?: object/** = v8::Object::New(isolate)*/): string; } /** end of `module querystring` */ export = querystring diff --git a/types/fibjs/declare/ssl.d.ts b/types/fibjs/declare/ssl.d.ts index 2799f59be3..e331eeb691 100644 --- a/types/fibjs/declare/ssl.d.ts +++ b/types/fibjs/declare/ssl.d.ts @@ -196,7 +196,7 @@ /** module Or Internal Object */ /** - * @brief ssl/tls 模块 + * @brief ssl/tls 模块,模块别名:tls * @detail */ declare module "ssl" { diff --git a/types/fibjs/declare/timers.d.ts b/types/fibjs/declare/timers.d.ts index 7469a7ea68..8de6e72812 100644 --- a/types/fibjs/declare/timers.d.ts +++ b/types/fibjs/declare/timers.d.ts @@ -219,7 +219,7 @@ declare module "timers" { * * */ - export function setTimeout(callback: Function, timeout: number, ...args: any[]): Class_Timer; + export function setTimeout(callback: Function, timeout?: number/** = 1*/, ...args: any[]): Class_Timer; /** * @@ -313,6 +313,19 @@ declare module "timers" { */ export function clearImmediate(t: any): void; + /** + * + * @brief 调用给定的函数,并在超时时间到期时中断函数运行 + * @param func 指定要运行的函数 + * @param timeout 指定超时时间 + * @param args 额外的参数,传入到指定的 callback 内,可选。 + * @return 返回 func 的运行结果 + * + * + * + */ + export function call(func: Function, timeout: number, ...args: any[]): any; + } /** end of `module timers` */ export = timers } diff --git a/types/fibjs/declare/url.d.ts b/types/fibjs/declare/url.d.ts index 7728d433a2..545b516cd2 100644 --- a/types/fibjs/declare/url.d.ts +++ b/types/fibjs/declare/url.d.ts @@ -217,7 +217,7 @@ declare module "url" { * * */ - export function format(args: Object): string; + export function format(args: object): string; /** * diff --git a/types/fibjs/declare/util.d.ts b/types/fibjs/declare/util.d.ts index 6998b4aab1..1b38c49399 100644 --- a/types/fibjs/declare/util.d.ts +++ b/types/fibjs/declare/util.d.ts @@ -274,7 +274,7 @@ declare module "util" { * * */ - export function inspect(obj: Object, options?: Object/** = v8::Object::New(isolate)*/): string; + export function inspect(obj: object, options?: object/** = v8::Object::New(isolate)*/): string; /** * @@ -637,6 +637,17 @@ declare module "util" { */ export function clone(v: any): any; + /** + * + * @brief 深度冻结一个对象,被冻结后的对象及其包含的对象都将不允许修改 + * + * @param v 指定要冻结的对象 + * + * + * + */ + export function deepFreeze(v: any): void; + /** * * @brief 将一个或者多个对象的键值扩展到指定对象 @@ -674,7 +685,7 @@ declare module "util" { * * */ - export function pick(v: any, ...objs: any[]): Object; + export function pick(v: any, ...objs: any[]): object; /** * @@ -687,7 +698,7 @@ declare module "util" { * * */ - export function omit(v: any, ...keys: any[]): Object; + export function omit(v: any, ...keys: any[]): object; /** * @@ -937,22 +948,25 @@ declare module "util" { * * ```JavaScript * { - * "fibjs": "0.1.0", - * "svn": 1753, - * "build": "Dec 10 2013 21:44:17", + * "fibjs": "0.25.0", + * "clang": "9.1", + * "date": "Jun 12 2018 07:22:40", * "vender": { - * "ev": "4.11", - * "exif": "0.6.21", - * "gd": "2.1.0-alpha", + * "ev": "4.24", + * "expat": "2.2.5", + * "gd": "2.2.4", * "jpeg": "8.3", - * "log4cpp": "1.0", + * "leveldb": "1.17", * "mongo": "0.7", * "pcre": "8.21", * "png": "1.5.4", - * "sqlite": "3.8.1", + * "mbedtls": "2.6.1", + * "snappy": "1.1.2", + * "sqlite": "3.23.0", * "tiff": "3.9.5", * "uuid": "1.6.2", - * "v8": "3.23.17 (candidate)", + * "v8": "6.7.288.20", + * "v8-snapshot": true, * "zlib": "1.2.7", * "zmq": "3.1" * } @@ -963,7 +977,7 @@ declare module "util" { * * */ - export function buildInfo(): Object; + export function buildInfo(): object; } /** end of `module util` */ export = util diff --git a/types/fibjs/declare/zlib.d.ts b/types/fibjs/declare/zlib.d.ts index 049d70f365..693dcf81bf 100644 --- a/types/fibjs/declare/zlib.d.ts +++ b/types/fibjs/declare/zlib.d.ts @@ -264,11 +264,12 @@ declare module "zlib" { * * @brief 创建一个 gunzip 流对象 * @param to 用于存储处理结果的流 + * @param maxSize 指定解压缩尺寸限制,缺省为 -1,不限制 * @return 返回封装过的流对象 * * */ - export function createGunzip(to: Class_Stream): Class_Stream; + export function createGunzip(to: Class_Stream, maxSize?: number/** = -1*/): Class_Stream; /** * @@ -284,21 +285,23 @@ declare module "zlib" { * * @brief 创建一个 inflate 流对象 * @param to 用于存储处理结果的流 + * @param maxSize 指定解压缩尺寸限制,缺省为 -1,不限制 * @return 返回封装过的流对象 * * */ - export function createInflate(to: Class_Stream): Class_Stream; + export function createInflate(to: Class_Stream, maxSize?: number/** = -1*/): Class_Stream; /** * * @brief 创建一个 inflateRaw 流对象 * @param to 用于存储处理结果的流 + * @param maxSize 指定解压缩尺寸限制,缺省为 -1,不限制 * @return 返回封装过的流对象 * * */ - export function createInflateRaw(to: Class_Stream): Class_Stream; + export function createInflateRaw(to: Class_Stream, maxSize?: number/** = -1*/): Class_Stream; /** * @@ -340,34 +343,37 @@ declare module "zlib" { * * @brief 解压缩 deflate 算法压缩的数据(zlib格式) * @param data 给定压缩后的数据 + * @param maxSize 指定解压缩尺寸限制,缺省为 -1,不限制 * @return 返回解压缩后的二进制数据 * * * @async */ - export function inflate(data: Class_Buffer): Class_Buffer; + export function inflate(data: Class_Buffer, maxSize?: number/** = -1*/): Class_Buffer; /** * * @brief 解压缩 deflate 算法压缩的数据到流对象中(zlib格式) * @param data 给定要解压缩的数据 * @param stm 指定存储解压缩数据的流 + * @param maxSize 指定解压缩尺寸限制,缺省为 -1,不限制 * * * @async */ - export function inflateTo(data: Class_Buffer, stm: Class_Stream): void; + export function inflateTo(data: Class_Buffer, stm: Class_Stream, maxSize?: number/** = -1*/): void; /** * * @brief 解压缩源流中 deflate 算法压缩的数据到流对象中(zlib格式) * @param src 给定要解压缩的数据所在的流 * @param stm 指定存储解压缩数据的流 + * @param maxSize 指定解压缩尺寸限制,缺省为 -1,不限制 * * * @async */ - export function inflateTo(src: Class_Stream, stm: Class_Stream): void; + export function inflateTo(src: Class_Stream, stm: Class_Stream, maxSize?: number/** = -1*/): void; /** * @@ -406,34 +412,37 @@ declare module "zlib" { * * @brief 解压缩 gzip 算法压缩的数据 * @param data 给定压缩后的数据 + * @param maxSize 指定解压缩尺寸限制,缺省为 -1,不限制 * @return 返回解压缩后的二进制数据 * * * @async */ - export function gunzip(data: Class_Buffer): Class_Buffer; + export function gunzip(data: Class_Buffer, maxSize?: number/** = -1*/): Class_Buffer; /** * * @brief 解压缩 gzip 算法压缩的数据到流对象中 * @param data 给定要解压缩的数据 * @param stm 指定存储解压缩数据的流 + * @param maxSize 指定解压缩尺寸限制,缺省为 -1,不限制 * * * @async */ - export function gunzipTo(data: Class_Buffer, stm: Class_Stream): void; + export function gunzipTo(data: Class_Buffer, stm: Class_Stream, maxSize?: number/** = -1*/): void; /** * * @brief 解压缩源流中 gzip 算法压缩的数据到流对象中 * @param src 给定要解压缩的数据所在的流 * @param stm 指定存储解压缩数据的流 + * @param maxSize 指定解压缩尺寸限制,缺省为 -1,不限制 * * * @async */ - export function gunzipTo(src: Class_Stream, stm: Class_Stream): void; + export function gunzipTo(src: Class_Stream, stm: Class_Stream, maxSize?: number/** = -1*/): void; /** * @@ -475,34 +484,37 @@ declare module "zlib" { * * @brief 解压缩 deflate 算法压缩的数据(inflateRaw) * @param data 给定压缩后的数据 + * @param maxSize 指定解压缩尺寸限制,缺省为 -1,不限制 * @return 返回解压缩后的二进制数据 * * * @async */ - export function inflateRaw(data: Class_Buffer): Class_Buffer; + export function inflateRaw(data: Class_Buffer, maxSize?: number/** = -1*/): Class_Buffer; /** * * @brief 解压缩 deflate 算法压缩的数据到流对象中(inflateRaw) * @param data 给定要解压缩的数据 * @param stm 指定存储解压缩数据的流 + * @param maxSize 指定解压缩尺寸限制,缺省为 -1,不限制 * * * @async */ - export function inflateRawTo(data: Class_Buffer, stm: Class_Stream): void; + export function inflateRawTo(data: Class_Buffer, stm: Class_Stream, maxSize?: number/** = -1*/): void; /** * * @brief 解压缩源流中 deflate 算法压缩的数据到流对象中(inflateRaw) * @param src 给定要解压缩的数据所在的流 * @param stm 指定存储解压缩数据的流 + * @param maxSize 指定解压缩尺寸限制,缺省为 -1,不限制 * * * @async */ - export function inflateRawTo(src: Class_Stream, stm: Class_Stream): void; + export function inflateRawTo(src: Class_Stream, stm: Class_Stream, maxSize?: number/** = -1*/): void; } /** end of `module zlib` */ export = zlib diff --git a/types/fibjs/index.d.ts b/types/fibjs/index.d.ts index 0b4ef29975..02201fd904 100644 --- a/types/fibjs/index.d.ts +++ b/types/fibjs/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for fibjs 0.25 +// Type definitions for fibjs 0.26 // Project: https://github.com/fibjs/fibjs // Definitions by: richardo2016 // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped diff --git a/types/fscreen/index.d.ts b/types/fscreen/index.d.ts index dfe2f6117f..b818f2dd2f 100644 --- a/types/fscreen/index.d.ts +++ b/types/fscreen/index.d.ts @@ -1,9 +1,13 @@ // Type definitions for fscreen 1.0 // Project: https://github.com/rafrex/fscreen#readme // Definitions by: Joscha Feth +// Terry Mun // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 -type Handler = () => void; +type Handler = (e?: Event) => void; +type RequestFullScreenFunction = (element: Element) => void; +type EventName = 'fullscreenEnabled' | 'fullscreenElement' | 'requestFullscreen' | 'exitFullscreen' | 'fullscreenchange' | 'fullscreenerror'; declare class Fscreen { readonly fullscreenElement: Element | undefined; @@ -12,10 +16,10 @@ declare class Fscreen { onfullscreenchange: Handler; onfullscreenerror: Handler; - addEventListener(type: string, handler: Handler, useCapture?: boolean): void; - removeEventListener(type: string, handler: Handler): void; + addEventListener(type: EventName, handler: Handler, options?: boolean | AddEventListenerOptions): void; + removeEventListener(type: EventName, handler: Handler, options?: boolean | AddEventListenerOptions): void; requestFullscreen(element: Element): void; - requestFullscreenFunction(element: Element): void; + requestFullscreenFunction(element: Element): RequestFullScreenFunction; } declare const fscreen: Fscreen; diff --git a/types/gc-stats/gc-stats-tests.ts b/types/gc-stats/gc-stats-tests.ts new file mode 100644 index 0000000000..bf44e20175 --- /dev/null +++ b/types/gc-stats/gc-stats-tests.ts @@ -0,0 +1,11 @@ +import GCStats = require("gc-stats"); +import { GCStatistics } from "gc-stats"; + +const gcStats = GCStats(); + +gcStats.on("stats", (stats: GCStatistics) => { + const { gctype: gcType, startTime, endTime, before, after, diff } = stats; + const beforeMallocedMemory = before.mallocedMemory; + const afterMallocedMemory = after.mallocedMemory; + const diffMallocedMemory = diff.mallocedMemory; +}); diff --git a/types/gc-stats/index.d.ts b/types/gc-stats/index.d.ts new file mode 100644 index 0000000000..917aedf5b9 --- /dev/null +++ b/types/gc-stats/index.d.ts @@ -0,0 +1,34 @@ +// Type definitions for gc-stats 1.2 +// Project: https://github.com/dainis/node-gcstats#readme +// Definitions by: Vitor Fernandes +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +import { EventEmitter } from "events"; + +declare namespace GCStats { + interface MemoryStatistics { + totalHeapSize: number; + totalHeapExecutableSize: number; + usedHeapSize: number; + heapSizeLimit: number; + totalPhysicalSize: number; + totalAvailableSize: number; + mallocedMemory: number; + peakMallocedMemory: number; + } + + interface GCStatistics { + startTime: number; + endTime: number; + pause: number; + pauseMS: number; + gctype: 1 | 2 | 4 | 8 | 15; + before: MemoryStatistics; + after: MemoryStatistics; + diff: MemoryStatistics; + } +} + +declare function GCStats(): EventEmitter; + +export = GCStats; diff --git a/types/gc-stats/tsconfig.json b/types/gc-stats/tsconfig.json new file mode 100644 index 0000000000..67fda0ff67 --- /dev/null +++ b/types/gc-stats/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "gc-stats-tests.ts" + ] +} diff --git a/types/gc-stats/tslint.json b/types/gc-stats/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/gc-stats/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/googlemaps/googlemaps-tests.ts b/types/googlemaps/googlemaps-tests.ts index 77a2900b7b..e161e8068e 100644 --- a/types/googlemaps/googlemaps-tests.ts +++ b/types/googlemaps/googlemaps-tests.ts @@ -418,7 +418,8 @@ let service = new google.maps.places.PlacesService(new HTMLDivElement()); service.getDetails({ placeId: '-a1', - fields: ['name'] + fields: ['name'], + sessionToken: new google.maps.places.AutocompleteSessionToken() }, (result, status) => { if (status === google.maps.places.PlacesServiceStatus.NOT_FOUND) { return; diff --git a/types/googlemaps/index.d.ts b/types/googlemaps/index.d.ts index 501dd4c1f8..dba5a5a5a1 100644 --- a/types/googlemaps/index.d.ts +++ b/types/googlemaps/index.d.ts @@ -1,14 +1,15 @@ // Type definitions for Google Maps JavaScript API 3.30 // Project: https://developers.google.com/maps/ -// Definitions by: Folia A/S , -// Chris Wrench , -// Kiarash Ghiaseddin , -// Grant Hutchins , -// Denis Atyasov , -// Michael McMullin , -// Martin Costello , +// Definitions by: Folia A/S , +// Chris Wrench , +// Kiarash Ghiaseddin , +// Grant Hutchins , +// Denis Atyasov , +// Michael McMullin , +// Martin Costello , // Sven Kreiss // Umar Bolatov +// Michael Gauthier // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /* @@ -2542,6 +2543,10 @@ declare namespace google.maps { getQueryPredictions(request: QueryAutocompletionRequest, callback: (result: QueryAutocompletePrediction[], status: PlacesServiceStatus) => void): void; } + export class AutocompleteSessionToken { + constructor(); + } + export interface AutocompletionRequest { bounds?: LatLngBounds|LatLngBoundsLiteral; componentRestrictions?: ComponentRestrictions; @@ -2549,6 +2554,7 @@ declare namespace google.maps { location?: LatLng; offset?: number; radius?: number; + sessionToken?: AutocompleteSessionToken; types?: string[]; } @@ -2566,6 +2572,7 @@ declare namespace google.maps { export interface PlaceDetailsRequest { placeId: string; fields?: string[]; + sessionToken?: AutocompleteSessionToken; } export interface PlaceGeometry { diff --git a/types/gulp-jsonmin/gulp-jsonmin-tests.ts b/types/gulp-jsonmin/gulp-jsonmin-tests.ts index 5c0cf66cc3..e13ec2c69f 100644 --- a/types/gulp-jsonmin/gulp-jsonmin-tests.ts +++ b/types/gulp-jsonmin/gulp-jsonmin-tests.ts @@ -1,5 +1,14 @@ -import * as GulpJsonmin from 'gulp-jsonmin'; +import gulp = require('gulp'); +import gulpJsonmin = require('gulp-jsonmin'); -GulpJsonmin(); -GulpJsonmin({}); -GulpJsonmin({ verbose: true }); +gulp.task('build', () => { + return gulp.src('*.json') + .pipe(gulpJsonmin()) + .pipe(gulp.dest('dist')); +}); + +gulp.task('build', () => { + return gulp.src('*.json') + .pipe(gulpJsonmin({ verbose: true })) + .pipe(gulp.dest('dist')); +}); diff --git a/types/gulp-jsonmin/index.d.ts b/types/gulp-jsonmin/index.d.ts index 16a4347dd2..d5faa2b969 100644 --- a/types/gulp-jsonmin/index.d.ts +++ b/types/gulp-jsonmin/index.d.ts @@ -7,12 +7,12 @@ import { Transform } from 'stream'; -declare function jsonmin(options?: jsonmin.Options): Transform; +declare function gulpJsonmin(options?: gulpJsonmin.Options): Transform; -declare namespace jsonmin { +declare namespace gulpJsonmin { interface Options { verbose?: boolean; } } -export = jsonmin; +export = gulpJsonmin; diff --git a/types/gulp-pug-i18n/gulp-pug-i18n-tests.ts b/types/gulp-pug-i18n/gulp-pug-i18n-tests.ts new file mode 100644 index 0000000000..98e83afcff --- /dev/null +++ b/types/gulp-pug-i18n/gulp-pug-i18n-tests.ts @@ -0,0 +1,10 @@ +import gulp = require('gulp'); +import gulpPugI18n = require('gulp-pug-i18n'); + +gulp.task('build', () => { + return gulp.src('*.pug') + .pipe(gulpPugI18n({ + i18n: { locales: 'locales/*.json' } + })) + .pipe(gulp.dest('dist')); +}); diff --git a/types/gulp-pug-i18n/index.d.ts b/types/gulp-pug-i18n/index.d.ts new file mode 100644 index 0000000000..7f4c50deda --- /dev/null +++ b/types/gulp-pug-i18n/index.d.ts @@ -0,0 +1,25 @@ +// Type definitions for gulp-pug-i18n 1.0 +// Project: https://github.com/dogancelik/gulp-pug-i18n +// Definitions by: Romain Faust +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +import { Options as PugOptions } from 'pug'; +import { Transform } from 'stream'; + +declare function gulpPugI18n(options: gulpPugI18n.Options): Transform; + +declare namespace gulpPugI18n { + interface Options extends PugOptions { + data?: any; + i18n: { + default?: string; + filename?: string; + locales: string | ReadonlyArray; + namespace?: string | null; + }; + } +} + +export = gulpPugI18n; diff --git a/types/gulp-pug-i18n/tsconfig.json b/types/gulp-pug-i18n/tsconfig.json new file mode 100644 index 0000000000..afd4c6ea4c --- /dev/null +++ b/types/gulp-pug-i18n/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "gulp-pug-i18n-tests.ts" + ] +} diff --git a/types/gulp-pug-i18n/tslint.json b/types/gulp-pug-i18n/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/gulp-pug-i18n/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/hash-sum/hash-sum-tests.ts b/types/hash-sum/hash-sum-tests.ts new file mode 100644 index 0000000000..2da5ff9566 --- /dev/null +++ b/types/hash-sum/hash-sum-tests.ts @@ -0,0 +1,9 @@ +import sum = require("hash-sum"); + +sum(undefined); +sum(null); +sum({}); +sum({ hello: "world" }); +sum(100); +sum(""); +sum(true); diff --git a/types/hash-sum/index.d.ts b/types/hash-sum/index.d.ts new file mode 100644 index 0000000000..e999437abe --- /dev/null +++ b/types/hash-sum/index.d.ts @@ -0,0 +1,8 @@ +// Type definitions for hash-sum 1.0 +// Project: https://github.com/bevacqua/hash-sum +// Definitions by: Daniel Rosenwasser +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export = hash_sum; + +declare function hash_sum(value: any): string; diff --git a/types/hash-sum/tsconfig.json b/types/hash-sum/tsconfig.json new file mode 100644 index 0000000000..be8178d410 --- /dev/null +++ b/types/hash-sum/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "hash-sum-tests.ts" + ] +} diff --git a/types/hash-sum/tslint.json b/types/hash-sum/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/hash-sum/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/helmet/helmet-tests.ts b/types/helmet/helmet-tests.ts index 38fa53828f..53fba8e948 100644 --- a/types/helmet/helmet-tests.ts +++ b/types/helmet/helmet-tests.ts @@ -206,3 +206,12 @@ function xssFilterTest() { app.use(helmet.xssFilter({ setOnOldIE: false })); app.use(helmet.xssFilter({ setOnOldIE: true })); } + +/** + * @summary Test for {@see helmet#permittedCrossDomainPolicies} function. + */ +function permittedCrossDomainPoliciesTest() { + app.use(helmet.permittedCrossDomainPolicies()); + app.use(helmet.permittedCrossDomainPolicies({})); + app.use(helmet.permittedCrossDomainPolicies({ permittedPolicies: 'none' })); +} diff --git a/types/helmet/index.d.ts b/types/helmet/index.d.ts index 0162912d99..1abe99c20f 100644 --- a/types/helmet/index.d.ts +++ b/types/helmet/index.d.ts @@ -11,18 +11,23 @@ export = helmet; declare namespace helmet { export interface IHelmetConfiguration { - contentSecurityPolicy?: boolean | IHelmetContentSecurityPolicyConfiguration, - dnsPrefetchControl?: boolean | IHelmetDnsPrefetchControlConfiguration, - frameguard?: boolean | IHelmetFrameguardConfiguration, - hidePoweredBy?: boolean | IHelmetHidePoweredByConfiguration, - hpkp?: boolean | IHelmetHpkpConfiguration, - hsts?: boolean | IHelmetHstsConfiguration, - ieNoOpen?: boolean, - noCache?: boolean, - noSniff?: boolean, - referrerPolicy?: boolean | IHelmetReferrerPolicyConfiguration, - xssFilter?: boolean | IHelmetXssFilterConfiguration, - expectCt?: boolean | IHelmetExpectCtConfiguration, + contentSecurityPolicy?: boolean | IHelmetContentSecurityPolicyConfiguration; + dnsPrefetchControl?: boolean | IHelmetDnsPrefetchControlConfiguration; + frameguard?: boolean | IHelmetFrameguardConfiguration; + hidePoweredBy?: boolean | IHelmetHidePoweredByConfiguration; + hpkp?: boolean | IHelmetHpkpConfiguration; + hsts?: boolean | IHelmetHstsConfiguration; + ieNoOpen?: boolean; + noCache?: boolean; + noSniff?: boolean; + referrerPolicy?: boolean | IHelmetReferrerPolicyConfiguration; + xssFilter?: boolean | IHelmetXssFilterConfiguration; + expectCt?: boolean | IHelmetExpectCtConfiguration; + permittedCrossDomainPolicies?: boolean | IHelmetPermittedCrossDomainPoliciesConfiguration; + } + + export interface IHelmetPermittedCrossDomainPoliciesConfiguration { + permittedPolicies?: string; } export interface IHelmetContentSecurityPolicyDirectiveFunction { @@ -31,22 +36,22 @@ declare namespace helmet { export type HelmetCspDirectiveValue = string | IHelmetContentSecurityPolicyDirectiveFunction; export interface IHelmetContentSecurityPolicyDirectives { - baseUri?: HelmetCspDirectiveValue[], - childSrc?: HelmetCspDirectiveValue[], - connectSrc?: HelmetCspDirectiveValue[], - defaultSrc?: HelmetCspDirectiveValue[], - fontSrc?: HelmetCspDirectiveValue[], - formAction?: HelmetCspDirectiveValue[], - frameAncestors?: HelmetCspDirectiveValue[], - frameSrc?: HelmetCspDirectiveValue[], - imgSrc?: HelmetCspDirectiveValue[], - mediaSrc?: HelmetCspDirectiveValue[], - objectSrc?: HelmetCspDirectiveValue[], - pluginTypes?: HelmetCspDirectiveValue[], - reportUri?: string, - sandbox?: HelmetCspDirectiveValue[], - scriptSrc?: HelmetCspDirectiveValue[], - styleSrc?: HelmetCspDirectiveValue[] + baseUri?: HelmetCspDirectiveValue[]; + childSrc?: HelmetCspDirectiveValue[]; + connectSrc?: HelmetCspDirectiveValue[]; + defaultSrc?: HelmetCspDirectiveValue[]; + fontSrc?: HelmetCspDirectiveValue[]; + formAction?: HelmetCspDirectiveValue[]; + frameAncestors?: HelmetCspDirectiveValue[]; + frameSrc?: HelmetCspDirectiveValue[]; + imgSrc?: HelmetCspDirectiveValue[]; + mediaSrc?: HelmetCspDirectiveValue[]; + objectSrc?: HelmetCspDirectiveValue[]; + pluginTypes?: HelmetCspDirectiveValue[]; + reportUri?: string; + sandbox?: HelmetCspDirectiveValue[]; + scriptSrc?: HelmetCspDirectiveValue[]; + styleSrc?: HelmetCspDirectiveValue[]; } export interface IHelmetContentSecurityPolicyConfiguration { @@ -54,7 +59,7 @@ declare namespace helmet { setAllHeaders?: boolean; disableAndroid?: boolean; browserSniff?: boolean; - directives?: IHelmetContentSecurityPolicyDirectives + directives?: IHelmetContentSecurityPolicyDirectives; } export interface IHelmetDnsPrefetchControlConfiguration { @@ -62,12 +67,12 @@ declare namespace helmet { } export interface IHelmetFrameguardConfiguration { - action?: string, - domain?: string + action?: string; + domain?: string; } export interface IHelmetHidePoweredByConfiguration { - setTo?: string + setTo?: string; } export interface IHelmetSetIfFunction { @@ -80,14 +85,14 @@ declare namespace helmet { includeSubdomains?: boolean; reportUri?: string; reportOnly?: boolean; - setIf?: IHelmetSetIfFunction + setIf?: IHelmetSetIfFunction; } export interface IHelmetHstsConfiguration { maxAge?: number; includeSubdomains?: boolean; preload?: boolean; - setIf?: IHelmetSetIfFunction, + setIf?: IHelmetSetIfFunction; force?: boolean; } @@ -195,5 +200,12 @@ declare namespace helmet { * @returns {e.RequestHandler} */ expectCt(options?: IHelmetExpectCtConfiguration): express.RequestHandler; + + /** + * @summary Adds the "X-Permitted-Cross-Domain-Policies" header. + * @param {helmet.IHelmetPermittedCrossDomainPoliciesConfiguration} options + * @returns {express.RequestHandler} + */ + permittedCrossDomainPolicies(options?: IHelmetPermittedCrossDomainPoliciesConfiguration): express.RequestHandler; } } diff --git a/types/ignite-ui/index.d.ts b/types/ignite-ui/index.d.ts index 1fa6cf1168..29d809964a 100644 --- a/types/ignite-ui/index.d.ts +++ b/types/ignite-ui/index.d.ts @@ -1044,6 +1044,7 @@ class TypeParser { * @param obj */ toDate(obj: Object): void; + toTime(obj: Object): void; toNumber(obj: Object): void; toBool(obj: Object): void; isNullOrUndefined(obj: Object): void; @@ -1063,8 +1064,12 @@ interface DataSchemaSchemaFields { * number * bool * date + * time * object * + * + * Valid values: + * "time" */ type?: string|number|boolean|Date|Object; @@ -10903,6 +10908,13 @@ interface IgCategoryChart { */ tooltipTemplates?: any; + /** + * Gets or sets the scaling value used to affect the pixel density of the control. + * A higher scaling ratio will produce crisper visuals at the expense of memory. Lower values will cause the control + * to appear blurry. + */ + pixelScalingRatio?: number; + /** * Gets or sets the left margin of chart title */ @@ -11139,6 +11151,11 @@ interface IgCategoryChart { */ markerMaxCount?: number; + /** + * Gets or sets whether the series animations should be allowed when a range change has been detected on an axis. + */ + animateSeriesWhenAxisRangeChanges?: boolean; + /** * Gets or sets the palette of brushes to used for coloring trend lines in this chart. * The value provided should be an array of CSS color strings or JavaScript objects defining gradients. Optionally the first element can be a string reading "RGB" or "HSV" to specify the interpolation mode of the collection @@ -11728,11 +11745,6 @@ interface IgCategoryChart { */ negativeOutlines?: any; - /** - * Gets or sets whether the series animations should be allowed when a range change has been detected on an axis. - */ - animateSeriesWhenAxisRangeChanges?: boolean; - /** * Gets or sets whether the large numbers on the Y-axis labels are abbreviated. */ @@ -12020,6 +12032,22 @@ interface JQuery { */ igCategoryChart(optionLiteral: 'option', optionName: "tooltipTemplates", optionValue: any): void; + /** + * Gets the scaling value used to affect the pixel density of the control. + * A higher scaling ratio will produce crisper visuals at the expense of memory. Lower values will cause the control + * to appear blurry. + */ + igCategoryChart(optionLiteral: 'option', optionName: "pixelScalingRatio"): number; + + /** + * Sets the scaling value used to affect the pixel density of the control. + * A higher scaling ratio will produce crisper visuals at the expense of memory. Lower values will cause the control + * to appear blurry. + * + * @optionValue New value to be set. + */ + igCategoryChart(optionLiteral: 'option', optionName: "pixelScalingRatio", optionValue: number): void; + /** * Gets the left margin of chart title */ @@ -12546,6 +12574,18 @@ interface JQuery { */ igCategoryChart(optionLiteral: 'option', optionName: "markerMaxCount", optionValue: number): void; + /** + * Gets whether the series animations should be allowed when a range change has been detected on an axis. + */ + igCategoryChart(optionLiteral: 'option', optionName: "animateSeriesWhenAxisRangeChanges"): boolean; + + /** + * Sets whether the series animations should be allowed when a range change has been detected on an axis. + * + * @optionValue New value to be set. + */ + igCategoryChart(optionLiteral: 'option', optionName: "animateSeriesWhenAxisRangeChanges", optionValue: boolean): void; + /** * Gets the palette of brushes to used for coloring trend lines in this chart. * The value provided should be an array of CSS color strings or JavaScript objects defining gradients. Optionally the first element can be a string reading "RGB" or "HSV" to specify the interpolation mode of the collection @@ -13706,18 +13746,6 @@ interface JQuery { */ igCategoryChart(optionLiteral: 'option', optionName: "negativeOutlines", optionValue: any): void; - /** - * Gets whether the series animations should be allowed when a range change has been detected on an axis. - */ - igCategoryChart(optionLiteral: 'option', optionName: "animateSeriesWhenAxisRangeChanges"): boolean; - - /** - * Sets whether the series animations should be allowed when a range change has been detected on an axis. - * - * @optionValue New value to be set. - */ - igCategoryChart(optionLiteral: 'option', optionName: "animateSeriesWhenAxisRangeChanges", optionValue: boolean): void; - /** * Gets whether the large numbers on the Y-axis labels are abbreviated. */ @@ -39305,6 +39333,13 @@ interface IgFinancialChart { */ tooltipTemplates?: any; + /** + * Gets or sets the scaling value used to affect the pixel density of the control. + * A higher scaling ratio will produce crisper visuals at the expense of memory. Lower values will cause the control + * to appear blurry. + */ + pixelScalingRatio?: number; + /** * Gets or sets the left margin of chart title */ @@ -39541,6 +39576,11 @@ interface IgFinancialChart { */ markerMaxCount?: number; + /** + * Gets or sets whether the series animations should be allowed when a range change has been detected on an axis. + */ + animateSeriesWhenAxisRangeChanges?: boolean; + /** * Gets or sets the palette of brushes to used for coloring trend lines in this chart. * The value provided should be an array of CSS color strings or JavaScript objects defining gradients. Optionally the first element can be a string reading "RGB" or "HSV" to specify the interpolation mode of the collection @@ -40093,6 +40133,7 @@ interface IgFinancialChart { * * Valid values: * "none" Do not display the zoom slider pane. + * "auto" * "bar" Display financial bar series in the zoom slider pane. * "candle" Display candle series in the zoom slider pane. * "column" Display column series in the zoom slider pane. @@ -40215,6 +40256,8 @@ interface IgFinancialChart { * When CustomIndicatorNames is set, the ApplyCustomIndicators event will be raised for each custom indicator name. */ customIndicatorNames?: any; + zoomSliderXAxisMajorStroke?: any; + zoomSliderXAxisMajorStrokeThickness?: number; /** * The width of the chart. @@ -40504,6 +40547,22 @@ interface JQuery { */ igFinancialChart(optionLiteral: 'option', optionName: "tooltipTemplates", optionValue: any): void; + /** + * Gets the scaling value used to affect the pixel density of the control. + * A higher scaling ratio will produce crisper visuals at the expense of memory. Lower values will cause the control + * to appear blurry. + */ + igFinancialChart(optionLiteral: 'option', optionName: "pixelScalingRatio"): number; + + /** + * Sets the scaling value used to affect the pixel density of the control. + * A higher scaling ratio will produce crisper visuals at the expense of memory. Lower values will cause the control + * to appear blurry. + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "pixelScalingRatio", optionValue: number): void; + /** * Gets the left margin of chart title */ @@ -41030,6 +41089,18 @@ interface JQuery { */ igFinancialChart(optionLiteral: 'option', optionName: "markerMaxCount", optionValue: number): void; + /** + * Gets whether the series animations should be allowed when a range change has been detected on an axis. + */ + igFinancialChart(optionLiteral: 'option', optionName: "animateSeriesWhenAxisRangeChanges"): boolean; + + /** + * Sets whether the series animations should be allowed when a range change has been detected on an axis. + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "animateSeriesWhenAxisRangeChanges", optionValue: boolean): void; + /** * Gets the palette of brushes to used for coloring trend lines in this chart. * The value provided should be an array of CSS color strings or JavaScript objects defining gradients. Optionally the first element can be a string reading "RGB" or "HSV" to specify the interpolation mode of the collection @@ -42431,6 +42502,10 @@ interface JQuery { * @optionValue New value to be set. */ igFinancialChart(optionLiteral: 'option', optionName: "customIndicatorNames", optionValue: any): void; + igFinancialChart(optionLiteral: 'option', optionName: "zoomSliderXAxisMajorStroke"): any; + igFinancialChart(optionLiteral: 'option', optionName: "zoomSliderXAxisMajorStroke", optionValue: any): void; + igFinancialChart(optionLiteral: 'option', optionName: "zoomSliderXAxisMajorStrokeThickness"): number; + igFinancialChart(optionLiteral: 'option', optionName: "zoomSliderXAxisMajorStrokeThickness", optionValue: number): void; /** * The width of the chart. @@ -44382,6 +44457,22 @@ interface IgGridCellMerging { */ mergeStrategy?: string|Function; + /** + * Defines the rules merging is based on. + * + * + * Valid values: + * "duplicate" Duplicate values in the column will be merged together. + * "null" Merging will be applied for each subsequent null value after a non-null value. + */ + rowMergeStrategy?: string|Function; + + /** + * Defines the whether the rows will be merged or not. + * + */ + mergeRows?: any; + /** * A list of column settings that specifies hiding options on a per column basis. * @@ -44452,6 +44543,8 @@ interface IgGridCellMergingMethods { * @param column The column index or column key to get the state for. */ isMerged(column: Object): boolean; + mergeRow(id: Object, fireEvents: Object): void; + unmergeRow(id: Object, index: Object): void; /** * Changes the all locales contained into a specified container to the language specified in [options.language](ui.igwidget#options:language) @@ -44472,6 +44565,8 @@ interface JQuery { igGridCellMerging(methodName: "mergeColumn", column: Object, raiseEvents: boolean): string; igGridCellMerging(methodName: "unmergeColumn", column: Object): string; igGridCellMerging(methodName: "isMerged", column: Object): boolean; + igGridCellMerging(methodName: "mergeRow", id: Object, fireEvents: Object): void; + igGridCellMerging(methodName: "unmergeRow", id: Object, index: Object): void; igGridCellMerging(methodName: "changeLocale", $container: Object): void; /** @@ -44522,6 +44617,36 @@ interface JQuery { igGridCellMerging(optionLiteral: 'option', optionName: "mergeStrategy", optionValue: string|Function): void; + /** + * Defines the rules merging is based on. + * + */ + + igGridCellMerging(optionLiteral: 'option', optionName: "rowMergeStrategy"): string|Function; + + /** + * Defines the rules merging is based on. + * + * + * @optionValue New value to be set. + */ + + igGridCellMerging(optionLiteral: 'option', optionName: "rowMergeStrategy", optionValue: string|Function): void; + + /** + * Defines the whether the rows will be merged or not. + * + */ + igGridCellMerging(optionLiteral: 'option', optionName: "mergeRows"): any; + + /** + * Defines the whether the rows will be merged or not. + * + * + * @optionValue New value to be set. + */ + igGridCellMerging(optionLiteral: 'option', optionName: "mergeRows", optionValue: any): void; + /** * A list of column settings that specifies hiding options on a per column basis. * @@ -65610,6 +65735,11 @@ interface EditRowStartingEvent { } interface EditRowStartingEventUIParam { + /** + * Gets a reference to GridUpdating. + */ + owner?: any; + /** * Gets the row's PK value. */ @@ -65626,6 +65756,11 @@ interface EditRowStartedEvent { } interface EditRowStartedEventUIParam { + /** + * Gets a reference to GridUpdating. + */ + owner?: any; + /** * Gets the row's PK value. */ @@ -65642,6 +65777,11 @@ interface EditRowEndingEvent { } interface EditRowEndingEventUIParam { + /** + * Gets a reference to GridUpdating. + */ + owner?: any; + /** * Check if any of the values is changed which will cause update in the data source. Can be manually set to false to prevent this update. */ @@ -65668,6 +65808,11 @@ interface EditRowEndedEvent { } interface EditRowEndedEventUIParam { + /** + * Gets a reference to GridUpdating. + */ + owner?: any; + /** * Gets the row's PK value. */ @@ -65699,6 +65844,11 @@ interface EditCellStartingEvent { } interface EditCellStartingEventUIParam { + /** + * Gets a reference to GridUpdating. + */ + owner?: any; + /** * Gets the row's PK value. */ @@ -65717,7 +65867,7 @@ interface EditCellStartingEventUIParam { /** * Gets a reference to the editor used for editing the column. */ - editor?: string; + editor?: any; /** * Gets or set the value of the editor. @@ -65735,6 +65885,11 @@ interface EditCellStartedEvent { } interface EditCellStartedEventUIParam { + /** + * Gets a reference to GridUpdating. + */ + owner?: any; + /** * Gets the row's PK value. */ @@ -65753,7 +65908,7 @@ interface EditCellStartedEventUIParam { /** * Gets a reference to the editor used for editing the column. */ - editor?: string; + editor?: any; /** * Gets or set the value of the editor. @@ -65771,6 +65926,11 @@ interface EditCellEndingEvent { } interface EditCellEndingEventUIParam { + /** + * Gets a reference to GridUpdating. + */ + owner?: any; + /** * Gets the row's PK value. */ @@ -65789,7 +65949,7 @@ interface EditCellEndingEventUIParam { /** * Gets a reference to the editor used for editing the column. */ - editor?: string; + editor?: any; /** * Gets or set the value of the editor. @@ -65817,6 +65977,11 @@ interface EditCellEndedEvent { } interface EditCellEndedEventUIParam { + /** + * Gets a reference to GridUpdating. + */ + owner?: any; + /** * Gets the row's PK value. */ @@ -65835,7 +66000,7 @@ interface EditCellEndedEventUIParam { /** * Gets a reference to the editor used for editing the column. */ - editor?: string; + editor?: any; /** * Gets the new value. @@ -65863,6 +66028,11 @@ interface RowAddingEvent { } interface RowAddingEventUIParam { + /** + * Gets a reference to GridUpdating. + */ + owner?: any; + /** * Gets the value for the column with the specified key. */ @@ -65879,6 +66049,11 @@ interface RowAddedEvent { } interface RowAddedEventUIParam { + /** + * Gets a reference to GridUpdating. + */ + owner?: any; + /** * Gets the value for the column with the specified key. */ @@ -65895,10 +66070,15 @@ interface RowDeletingEvent { } interface RowDeletingEventUIParam { + /** + * Gets a reference to GridUpdating. + */ + owner?: any; + /** * Gets a jQuery object containing the TR element of the row to delete. */ - element?: string; + element?: any; /** * Gets the row's PK value. @@ -65911,10 +66091,15 @@ interface RowDeletedEvent { } interface RowDeletedEventUIParam { + /** + * Gets a reference to GridUpdating. + */ + owner?: any; + /** * Gets a jQuery object containing the TR element of the deleted row. */ - element?: string; + element?: any; /** * Gets the row's PK value. @@ -65926,13 +66111,23 @@ interface DataDirtyEvent { (event: Event, ui: DataDirtyEventUIParam): void; } -interface DataDirtyEventUIParam {} +interface DataDirtyEventUIParam { + /** + * Gets a reference to GridUpdating. + */ + owner?: any; +} interface GeneratePrimaryKeyValueEvent { (event: Event, ui: GeneratePrimaryKeyValueEventUIParam): void; } interface GeneratePrimaryKeyValueEventUIParam { + /** + * Gets a reference to GridUpdating. + */ + owner?: any; + /** * Gets the auto-generated primary key (the number of records in the data source + 1) or set a custom unique primary key for the new row. */ @@ -65944,10 +66139,15 @@ interface RowEditDialogBeforeOpenEvent { } interface RowEditDialogBeforeOpenEventUIParam { + /** + * Gets a reference to GridUpdating. + */ + owner?: any; + /** * Gets a reference to row edit dialog DOM element. */ - dialogElement?: string; + dialogElement?: any; } interface RowEditDialogAfterOpenEvent { @@ -65955,10 +66155,15 @@ interface RowEditDialogAfterOpenEvent { } interface RowEditDialogAfterOpenEventUIParam { + /** + * Gets a reference to GridUpdating. + */ + owner?: any; + /** * Gets a reference to row edit dialog DOM element. */ - dialogElement?: string; + dialogElement?: any; } interface RowEditDialogBeforeCloseEvent { @@ -65966,10 +66171,15 @@ interface RowEditDialogBeforeCloseEvent { } interface RowEditDialogBeforeCloseEventUIParam { + /** + * Gets a reference to GridUpdating. + */ + owner?: any; + /** * Gets a reference to row edit dialog DOM element. */ - dialogElement?: string; + dialogElement?: any; } interface RowEditDialogAfterCloseEvent { @@ -65977,10 +66187,15 @@ interface RowEditDialogAfterCloseEvent { } interface RowEditDialogAfterCloseEventUIParam { + /** + * Gets a reference to GridUpdating. + */ + owner?: any; + /** * Gets a reference to row edit dialog DOM element. */ - dialogElement?: string; + dialogElement?: any; } interface RowEditDialogContentsRenderedEvent { @@ -65988,10 +66203,15 @@ interface RowEditDialogContentsRenderedEvent { } interface RowEditDialogContentsRenderedEventUIParam { + /** + * Gets a reference to GridUpdating. + */ + owner?: any; + /** * Gets a reference to row edit dialog DOM element. */ - dialogElement?: string; + dialogElement?: any; } interface IgGridUpdating { @@ -84620,6 +84840,13 @@ interface IgShapeChart { */ tooltipTemplates?: any; + /** + * Gets or sets the scaling value used to affect the pixel density of the control. + * A higher scaling ratio will produce crisper visuals at the expense of memory. Lower values will cause the control + * to appear blurry. + */ + pixelScalingRatio?: number; + /** * Gets or sets the left margin of chart title */ @@ -84856,6 +85083,11 @@ interface IgShapeChart { */ markerMaxCount?: number; + /** + * Gets or sets whether the series animations should be allowed when a range change has been detected on an axis. + */ + animateSeriesWhenAxisRangeChanges?: boolean; + /** * Gets or sets the palette of brushes to used for coloring trend lines in this chart. * The value provided should be an array of CSS color strings or JavaScript objects defining gradients. Optionally the first element can be a string reading "RGB" or "HSV" to specify the interpolation mode of the collection @@ -85719,6 +85951,22 @@ interface JQuery { */ igShapeChart(optionLiteral: 'option', optionName: "tooltipTemplates", optionValue: any): void; + /** + * Gets the scaling value used to affect the pixel density of the control. + * A higher scaling ratio will produce crisper visuals at the expense of memory. Lower values will cause the control + * to appear blurry. + */ + igShapeChart(optionLiteral: 'option', optionName: "pixelScalingRatio"): number; + + /** + * Sets the scaling value used to affect the pixel density of the control. + * A higher scaling ratio will produce crisper visuals at the expense of memory. Lower values will cause the control + * to appear blurry. + * + * @optionValue New value to be set. + */ + igShapeChart(optionLiteral: 'option', optionName: "pixelScalingRatio", optionValue: number): void; + /** * Gets the left margin of chart title */ @@ -86245,6 +86493,18 @@ interface JQuery { */ igShapeChart(optionLiteral: 'option', optionName: "markerMaxCount", optionValue: number): void; + /** + * Gets whether the series animations should be allowed when a range change has been detected on an axis. + */ + igShapeChart(optionLiteral: 'option', optionName: "animateSeriesWhenAxisRangeChanges"): boolean; + + /** + * Sets whether the series animations should be allowed when a range change has been detected on an axis. + * + * @optionValue New value to be set. + */ + igShapeChart(optionLiteral: 'option', optionName: "animateSeriesWhenAxisRangeChanges", optionValue: boolean): void; + /** * Gets the palette of brushes to used for coloring trend lines in this chart. * The value provided should be an array of CSS color strings or JavaScript objects defining gradients. Optionally the first element can be a string reading "RGB" or "HSV" to specify the interpolation mode of the collection @@ -99597,7 +99857,7 @@ interface IgTreeGrid { /** * This option is inherited from a parent widget and it's not applicable for the igTreeGrid. */ - avgRowHeight?: any; + avgRowHeight?: number; /** * This option is inherited from a parent widget and it's not applicable for the igTreeGrid. @@ -100879,14 +101139,14 @@ interface JQuery { /** * This option is inherited from a parent widget and it's not applicable for the igTreeGrid. */ - igTreeGrid(optionLiteral: 'option', optionName: "avgRowHeight"): any; + igTreeGrid(optionLiteral: 'option', optionName: "avgRowHeight"): number; /** * This option is inherited from a parent widget and it's not applicable for the igTreeGrid. * * @optionValue New value to be set. */ - igTreeGrid(optionLiteral: 'option', optionName: "avgRowHeight", optionValue: any): void; + igTreeGrid(optionLiteral: 'option', optionName: "avgRowHeight", optionValue: number): void; /** * This option is inherited from a parent widget and it's not applicable for the igTreeGrid. diff --git a/types/imagemin-gifsicle/imagemin-gifsicle-tests.ts b/types/imagemin-gifsicle/imagemin-gifsicle-tests.ts new file mode 100644 index 0000000000..0156322cd7 --- /dev/null +++ b/types/imagemin-gifsicle/imagemin-gifsicle-tests.ts @@ -0,0 +1,9 @@ +import imagemin = require('imagemin'); +import imageminGifsicle = require('imagemin-gifsicle'); + +imagemin(['*.gif'], { + plugins: [ + imageminGifsicle(), + imageminGifsicle({ colors: 255 }) + ] +}); diff --git a/types/imagemin-gifsicle/index.d.ts b/types/imagemin-gifsicle/index.d.ts new file mode 100644 index 0000000000..80bc128286 --- /dev/null +++ b/types/imagemin-gifsicle/index.d.ts @@ -0,0 +1,18 @@ +// Type definitions for imagemin-gifsicle 5.2 +// Project: https://github.com/imagemin/imagemin-gifsicle#readme +// Definitions by: Romain Faust +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +import { Plugin } from 'imagemin'; + +declare function imageminGifsicle(options?: imageminGifsicle.Options): Plugin; + +declare namespace imageminGifsicle { + interface Options { + colors?: number; + interlaced?: boolean; + optimizationLevel?: number; + } +} + +export = imageminGifsicle; diff --git a/types/imagemin-gifsicle/tsconfig.json b/types/imagemin-gifsicle/tsconfig.json new file mode 100644 index 0000000000..8efb698e59 --- /dev/null +++ b/types/imagemin-gifsicle/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "imagemin-gifsicle-tests.ts" + ] +} diff --git a/types/imagemin-gifsicle/tslint.json b/types/imagemin-gifsicle/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/imagemin-gifsicle/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/imagemin-jpegtran/imagemin-jpegtran-tests.ts b/types/imagemin-jpegtran/imagemin-jpegtran-tests.ts new file mode 100644 index 0000000000..82a8ea927f --- /dev/null +++ b/types/imagemin-jpegtran/imagemin-jpegtran-tests.ts @@ -0,0 +1,9 @@ +import imagemin = require('imagemin'); +import imageminJpegtran = require('imagemin-jpegtran'); + +imagemin(['*.jpg'], { + plugins: [ + imageminJpegtran(), + imageminJpegtran({ progressive: true }) + ] +}); diff --git a/types/imagemin-jpegtran/index.d.ts b/types/imagemin-jpegtran/index.d.ts new file mode 100644 index 0000000000..2ec98c3c17 --- /dev/null +++ b/types/imagemin-jpegtran/index.d.ts @@ -0,0 +1,17 @@ +// Type definitions for imagemin-jpegtran 5.0 +// Project: https://github.com/imagemin/imagemin-jpegtran#readme +// Definitions by: Romain Faust +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +import { Plugin } from 'imagemin'; + +declare function imageminJpegtran(options?: imageminJpegtran.Options): Plugin; + +declare namespace imageminJpegtran { + interface Options { + arithmetic?: boolean; + progressive?: boolean; + } +} + +export = imageminJpegtran; diff --git a/types/imagemin-jpegtran/tsconfig.json b/types/imagemin-jpegtran/tsconfig.json new file mode 100644 index 0000000000..e26dc49c0e --- /dev/null +++ b/types/imagemin-jpegtran/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "imagemin-jpegtran-tests.ts" + ] +} diff --git a/types/imagemin-jpegtran/tslint.json b/types/imagemin-jpegtran/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/imagemin-jpegtran/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/imagemin-optipng/imagemin-optipng-tests.ts b/types/imagemin-optipng/imagemin-optipng-tests.ts new file mode 100644 index 0000000000..ce0eb272ee --- /dev/null +++ b/types/imagemin-optipng/imagemin-optipng-tests.ts @@ -0,0 +1,9 @@ +import imagemin = require('imagemin'); +import imageminOptipng = require('imagemin-optipng'); + +imagemin(['*.png'], { + plugins: [ + imageminOptipng(), + imageminOptipng({ optimizationLevel: 2 }) + ] +}); diff --git a/types/imagemin-optipng/index.d.ts b/types/imagemin-optipng/index.d.ts new file mode 100644 index 0000000000..9ab9506205 --- /dev/null +++ b/types/imagemin-optipng/index.d.ts @@ -0,0 +1,19 @@ +// Type definitions for imagemin-optipng 5.2 +// Project: https://github.com/imagemin/imagemin-optipng#readme +// Definitions by: Romain Faust +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +import { Plugin } from 'imagemin'; + +declare function imageminOptipng(options?: imageminOptipng.Options): Plugin; + +declare namespace imageminOptipng { + interface Options { + bitDepthReduction?: boolean; + colorTypeReduction?: boolean; + optimizationLevel?: number; + paletteReduction?: boolean; + } +} + +export = imageminOptipng; diff --git a/types/imagemin-optipng/tsconfig.json b/types/imagemin-optipng/tsconfig.json new file mode 100644 index 0000000000..586e747281 --- /dev/null +++ b/types/imagemin-optipng/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "imagemin-optipng-tests.ts" + ] +} diff --git a/types/imagemin-optipng/tslint.json b/types/imagemin-optipng/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/imagemin-optipng/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/imagemin-svgo/imagemin-svgo-tests.ts b/types/imagemin-svgo/imagemin-svgo-tests.ts new file mode 100644 index 0000000000..23895afcd6 --- /dev/null +++ b/types/imagemin-svgo/imagemin-svgo-tests.ts @@ -0,0 +1,9 @@ +import imagemin = require('imagemin'); +import imageminSvgo = require('imagemin-svgo'); + +imagemin(['*.svg'], { + plugins: [ + imageminSvgo(), + imageminSvgo({ floatPrecision: 2 }) + ] +}); diff --git a/types/imagemin-svgo/index.d.ts b/types/imagemin-svgo/index.d.ts new file mode 100644 index 0000000000..24d3b73ca9 --- /dev/null +++ b/types/imagemin-svgo/index.d.ts @@ -0,0 +1,16 @@ +// Type definitions for imagemin-svgo 7.0 +// Project: https://github.com/imagemin/imagemin-svgo#readme +// Definitions by: Romain Faust +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +import { Plugin } from 'imagemin'; +import { Options as SvgoOptions } from 'svgo'; + +declare function imageminSvgo(options?: imageminSvgo.Options): Plugin; + +declare namespace imageminSvgo { + type Options = SvgoOptions; +} + +export = imageminSvgo; diff --git a/types/imagemin-svgo/tsconfig.json b/types/imagemin-svgo/tsconfig.json new file mode 100644 index 0000000000..6b4f221e13 --- /dev/null +++ b/types/imagemin-svgo/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "imagemin-svgo-tests.ts" + ] +} diff --git a/types/imagemin-svgo/tslint.json b/types/imagemin-svgo/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/imagemin-svgo/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/imagemin/imagemin-tests.ts b/types/imagemin/imagemin-tests.ts new file mode 100644 index 0000000000..88a91980d6 --- /dev/null +++ b/types/imagemin/imagemin-tests.ts @@ -0,0 +1,9 @@ +import imagemin = require('imagemin'); + +imagemin(['*.png']).then((results: imagemin.Result[]) => { /* ... */ }); +imagemin(['*.png'], 'dist').then((results: imagemin.Result[]) => { /* ... */ }); +imagemin(['*.png'], { plugins: [] }).then((results: imagemin.Result[]) => { /* ... */ }); +imagemin(['*.png'], 'dist', { plugins: [] }).then((results: imagemin.Result[]) => { /* ... */ }); + +imagemin.buffer(Buffer.from([/* ... */])).then((result: Buffer) => { /* ... */ }); +imagemin.buffer(Buffer.from([/* ... */]), { plugins: [] }).then((result: Buffer) => { /* ... */ }); diff --git a/types/imagemin/index.d.ts b/types/imagemin/index.d.ts new file mode 100644 index 0000000000..c848818f31 --- /dev/null +++ b/types/imagemin/index.d.ts @@ -0,0 +1,26 @@ +// Type definitions for imagemin 6.0 +// Project: https://github.com/imagemin/imagemin#readme +// Definitions by: Romain Faust +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare function imagemin(input: ReadonlyArray, outputOrOptions?: string | imagemin.Options): Promise; +declare function imagemin(input: ReadonlyArray, output?: string, options?: imagemin.Options): Promise; + +declare namespace imagemin { + type Plugin = (input: Buffer) => Promise; + + interface Options { + plugins: ReadonlyArray; + } + + interface Result { + data: Buffer; + path: string; + } + + function buffer(buffer: Buffer, options?: Options): Promise; +} + +export = imagemin; diff --git a/types/imagemin/tsconfig.json b/types/imagemin/tsconfig.json new file mode 100644 index 0000000000..849754b4d0 --- /dev/null +++ b/types/imagemin/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "imagemin-tests.ts" + ] +} diff --git a/types/imagemin/tslint.json b/types/imagemin/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/imagemin/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/intl-relativeformat/index.d.ts b/types/intl-relativeformat/index.d.ts new file mode 100644 index 0000000000..7c2fc0e57c --- /dev/null +++ b/types/intl-relativeformat/index.d.ts @@ -0,0 +1,94 @@ +// Type definitions for intl-relativeformat 2.1 +// Project: https://github.com/yahoo/intl-relativeformat +// Definitions by: Mohsen Azimi +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 + +/** + * This package aims to provide a way to format different variations of relative time. + * You can use this package in the browser and on the server via Node.js. + * + * This implementation is very similar to moment.js, in concept, although it provides + * only formatting features based on the Unicode CLDR locale data, an industry + * standard that supports more than 200 languages. + * + * @see https://github.com/yahoo/intl-relativeformat + */ +export default class IntlRelativeFormat { + /** + * To format a date to relative time, use the IntlRelativeFormat constructor. + * The constructor takes two parameters: + * + * @param locales A string with a BCP 47 language tag, or an array of + * such strings. If you do not provide a locale, the default locale will be used. + * When an array of locales is provided, each item and its ancestor locales are checked + * and the first one with registered locale data is returned. See: Locale Resolution + * for more details. + * @see https://github.com/yahoo/intl-relativeformat#locale-resolution + * + * @param optionas object with user defined options for format styles. + * See: Custom Options for more details. + * @see https://github.com/yahoo/intl-relativeformat#custom-options + * Note: The rf instance should be enough for your entire application, + * unless you want to use custom options. + */ + constructor( + locales: string | string[], + options?: Intl.DateTimeFormatOptions & { + /** + * By default, the relative time is computed to the best fit unit, + * but you can explicitly call it to force units to be displayed in + * "second", "second-short", "minute", "minute-short", "hour", + * "hour-short", "day", "day-short", "month", "month-short", + * "year" or "year-short": + */ + units?: + | "second" + | "second-short" + | "minute" + | "minute-short" + | "hour" + | "hour-short" + | "day" + | "day-short" + | "month" + | "month-short" + | "year" + | "year-short"; + + /** + * By default, the relative time is computed as "best fit", + * which means that instead of "1 day ago", it will display "yesterday", + * or "in 1 year" will be "next year", etc. But you can force to always + * use the "numeric" alternative: + */ + style?: "best fit" | "numeric"; + } + ); + + /** + * This method returns an object with the options values that were resolved + * during instance creation. It currently only contains a locale property + * + * var rf = new IntlRelativeFormat('en-us'); + * console.log(rf.resolvedOptions().locale); // => "en-US" + * + * Notice how the specified locale was the all lower-case value: "en-us", + * but it was resolved and normalized to: "en-US". + */ + resolvedOptions(): { locale: string }; + + /** + * The format method (which takes a JavaScript date or timestamp) and optional + * options arguments will compare the date with "now" (or options.now), + * and returns the formatted string; e.g., "3 hours ago" in the corresponding + * locale passed into the constructor. + * + * var output = rf.format(new Date()); + * console.log(output); // => "now" + * + * If you wish to specify a "now" value, it can be provided via options.now and + * will be used instead of querying Date.now() to get the current "now" value. + */ + format(date: Date, options?: { now?: Date }): string; +} diff --git a/types/intl-relativeformat/intl-relativeformat-tests.ts b/types/intl-relativeformat/intl-relativeformat-tests.ts new file mode 100644 index 0000000000..ca3d8280ca --- /dev/null +++ b/types/intl-relativeformat/intl-relativeformat-tests.ts @@ -0,0 +1,16 @@ +import IntlRelativeFormat from "intl-relativeformat"; + +let dateFormatter = new IntlRelativeFormat("en-US"); + +dateFormatter = new IntlRelativeFormat("en-US", { + units: "day" +}); +dateFormatter = new IntlRelativeFormat("en-US", { + units: "day", + style: "numeric" +}); + +console.log(dateFormatter.resolvedOptions().locale); + +dateFormatter.format(new Date()); +dateFormatter.format(new Date(), { now: new Date() }); diff --git a/types/intl-relativeformat/tsconfig.json b/types/intl-relativeformat/tsconfig.json new file mode 100644 index 0000000000..bfd9297169 --- /dev/null +++ b/types/intl-relativeformat/tsconfig.json @@ -0,0 +1,16 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": ["es6", "dom"], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": ["../"], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": ["index.d.ts", "intl-relativeformat-tests.ts"] +} diff --git a/types/intl-relativeformat/tslint.json b/types/intl-relativeformat/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/intl-relativeformat/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/ioredis/index.d.ts b/types/ioredis/index.d.ts index e593f4dcc3..3bd04944db 100644 --- a/types/ioredis/index.d.ts +++ b/types/ioredis/index.d.ts @@ -45,6 +45,8 @@ declare class Commander { } declare namespace IORedis { + type KeyType = string | Buffer; + interface Command { setArgumentTransformer(name: string, fn: (args: any[]) => any[]): void; setReplyTransformer(name: string, fn: (result: any) => any): void; @@ -59,257 +61,257 @@ declare namespace IORedis { send_command(command: string, ...args: any[]): any; - bitcount(key: string, callback: (err: Error, res: number) => void): void; - bitcount(key: string, start: number, end: number, callback: (err: Error, res: number) => void): void; - bitcount(key: string): Promise; - bitcount(key: string, start: number, end: number): Promise; + bitcount(key: KeyType, callback: (err: Error, res: number) => void): void; + bitcount(key: KeyType, start: number, end: number, callback: (err: Error, res: number) => void): void; + bitcount(key: KeyType): Promise; + bitcount(key: KeyType, start: number, end: number): Promise; - get(key: string, callback: (err: Error, res: string) => void): void; - get(key: string): Promise; + get(key: KeyType, callback: (err: Error, res: string) => void): void; + get(key: KeyType): Promise; - getBuffer(key: string, callback: (err: Error, res: Buffer) => void): void; - getBuffer(key: string): Promise; + getBuffer(key: KeyType, callback: (err: Error, res: Buffer) => void): void; + getBuffer(key: KeyType): Promise; - set(key: string, value: any, expiryMode?: string | any[], time?: number | string, setMode?: number | string): Promise; + set(key: KeyType, value: any, expiryMode?: string | any[], time?: number | string, setMode?: number | string): Promise; - set(key: string, value: any, callback: (err: Error, res: string) => void): void; - set(key: string, value: any, setMode: string | any[], callback: (err: Error, res: string) => void): void; - set(key: string, value: any, expiryMode: string, time: number | string, callback: (err: Error, res: string) => void): void; - set(key: string, value: any, expiryMode: string, time: number | string, setMode: number | string, callback: (err: Error, res: string) => void): void; + set(key: KeyType, value: any, callback: (err: Error, res: string) => void): void; + set(key: KeyType, value: any, setMode: string | any[], callback: (err: Error, res: string) => void): void; + set(key: KeyType, value: any, expiryMode: string, time: number | string, callback: (err: Error, res: string) => void): void; + set(key: KeyType, value: any, expiryMode: string, time: number | string, setMode: number | string, callback: (err: Error, res: string) => void): void; - setBuffer(key: string, value: any, expiryMode?: string | any[], time?: number | string, setMode?: number | string): Promise; + setBuffer(key: KeyType, value: any, expiryMode?: string | any[], time?: number | string, setMode?: number | string): Promise; - setBuffer(key: string, value: any, callback: (err: Error, res: Buffer) => void): void; - setBuffer(key: string, value: any, setMode: string, callback: (err: Error, res: Buffer) => void): void; - setBuffer(key: string, value: any, expiryMode: string, time: number, callback: (err: Error, res: Buffer) => void): void; - setBuffer(key: string, value: any, expiryMode: string, time: number | string, setMode: number | string, callback: (err: Error, res: Buffer) => void): void; + setBuffer(key: KeyType, value: any, callback: (err: Error, res: Buffer) => void): void; + setBuffer(key: KeyType, value: any, setMode: string, callback: (err: Error, res: Buffer) => void): void; + setBuffer(key: KeyType, value: any, expiryMode: string, time: number, callback: (err: Error, res: Buffer) => void): void; + setBuffer(key: KeyType, value: any, expiryMode: string, time: number | string, setMode: number | string, callback: (err: Error, res: Buffer) => void): void; - setnx(key: string, value: any, callback: (err: Error, res: any) => void): void; - setnx(key: string, value: any): Promise; + setnx(key: KeyType, value: any, callback: (err: Error, res: any) => void): void; + setnx(key: KeyType, value: any): Promise; - setex(key: string, seconds: number, value: any, callback: (err: Error, res: any) => void): void; - setex(key: string, seconds: number, value: any): Promise; + setex(key: KeyType, seconds: number, value: any, callback: (err: Error, res: any) => void): void; + setex(key: KeyType, seconds: number, value: any): Promise; - psetex(key: string, milliseconds: number, value: any, callback: (err: Error, res: any) => void): void; - psetex(key: string, milliseconds: number, value: any): Promise; + psetex(key: KeyType, milliseconds: number, value: any, callback: (err: Error, res: any) => void): void; + psetex(key: KeyType, milliseconds: number, value: any): Promise; - append(key: string, value: any, callback: (err: Error, res: number) => void): void; - append(key: string, value: any): Promise; + append(key: KeyType, value: any, callback: (err: Error, res: number) => void): void; + append(key: KeyType, value: any): Promise; - strlen(key: string, callback: (err: Error, res: number) => void): void; - strlen(key: string): Promise; + strlen(key: KeyType, callback: (err: Error, res: number) => void): void; + strlen(key: KeyType): Promise; - del(...keys: string[]): any; + del(...keys: KeyType[]): any; - exists(...keys: string[]): any; + exists(...keys: KeyType[]): any; - setbit(key: string, offset: number, value: any, callback: (err: Error, res: number) => void): void; - setbit(key: string, offset: number, value: any): Promise; + setbit(key: KeyType, offset: number, value: any, callback: (err: Error, res: number) => void): void; + setbit(key: KeyType, offset: number, value: any): Promise; - getbit(key: string, offset: number, callback: (err: Error, res: number) => void): void; - getbit(key: string, offset: number): Promise; + getbit(key: KeyType, offset: number, callback: (err: Error, res: number) => void): void; + getbit(key: KeyType, offset: number): Promise; - setrange(key: string, offset: number, value: any, callback: (err: Error, res: number) => void): void; - setrange(key: string, offset: number, value: any): Promise; + setrange(key: KeyType, offset: number, value: any, callback: (err: Error, res: number) => void): void; + setrange(key: KeyType, offset: number, value: any): Promise; - getrange(key: string, start: number, end: number, callback: (err: Error, res: string) => void): void; - getrange(key: string, start: number, end: number): Promise; + getrange(key: KeyType, start: number, end: number, callback: (err: Error, res: string) => void): void; + getrange(key: KeyType, start: number, end: number): Promise; - substr(key: string, start: number, end: number, callback: (err: Error, res: string) => void): void; - substr(key: string, start: number, end: number): Promise; + substr(key: KeyType, start: number, end: number, callback: (err: Error, res: string) => void): void; + substr(key: KeyType, start: number, end: number): Promise; - incr(key: string, callback: (err: Error, res: number) => void): void; - incr(key: string): Promise; + incr(key: KeyType, callback: (err: Error, res: number) => void): void; + incr(key: KeyType): Promise; - decr(key: string, callback: (err: Error, res: number) => void): void; - decr(key: string): Promise; + decr(key: KeyType, callback: (err: Error, res: number) => void): void; + decr(key: KeyType): Promise; - mget(...keys: string[]): any; + mget(...keys: KeyType[]): any; - rpush(key: string, ...values: any[]): any; + rpush(key: KeyType, ...values: any[]): any; - lpush(key: string, ...values: any[]): any; + lpush(key: KeyType, ...values: any[]): any; - rpushx(key: string, value: any, callback: (err: Error, res: number) => void): void; - rpushx(key: string, value: any): Promise; + rpushx(key: KeyType, value: any, callback: (err: Error, res: number) => void): void; + rpushx(key: KeyType, value: any): Promise; - lpushx(key: string, value: any, callback: (err: Error, res: number) => void): void; - lpushx(key: string, value: any): Promise; + lpushx(key: KeyType, value: any, callback: (err: Error, res: number) => void): void; + lpushx(key: KeyType, value: any): Promise; - linsert(key: string, direction: "BEFORE" | "AFTER", pivot: string, value: any, callback: (err: Error, res: number) => void): void; - linsert(key: string, direction: "BEFORE" | "AFTER", pivot: string, value: any): Promise; + linsert(key: KeyType, direction: "BEFORE" | "AFTER", pivot: string, value: any, callback: (err: Error, res: number) => void): void; + linsert(key: KeyType, direction: "BEFORE" | "AFTER", pivot: string, value: any): Promise; - rpop(key: string, callback: (err: Error, res: string) => void): void; - rpop(key: string): Promise; + rpop(key: KeyType, callback: (err: Error, res: string) => void): void; + rpop(key: KeyType): Promise; - lpop(key: string, callback: (err: Error, res: string) => void): void; - lpop(key: string): Promise; + lpop(key: KeyType, callback: (err: Error, res: string) => void): void; + lpop(key: KeyType): Promise; - brpop(...keys: string[]): any; + brpop(...keys: KeyType[]): any; - blpop(...keys: string[]): any; + blpop(...keys: KeyType[]): any; brpoplpush(source: string, destination: string, timeout: number, callback: (err: Error, res: any) => void): void; brpoplpush(source: string, destination: string, timeout: number): Promise; - llen(key: string, callback: (err: Error, res: number) => void): void; - llen(key: string): Promise; + llen(key: KeyType, callback: (err: Error, res: number) => void): void; + llen(key: KeyType): Promise; - lindex(key: string, index: number, callback: (err: Error, res: string) => void): void; - lindex(key: string, index: number): Promise; + lindex(key: KeyType, index: number, callback: (err: Error, res: string) => void): void; + lindex(key: KeyType, index: number): Promise; - lset(key: string, index: number, value: any, callback: (err: Error, res: any) => void): void; - lset(key: string, index: number, value: any): Promise; + lset(key: KeyType, index: number, value: any, callback: (err: Error, res: any) => void): void; + lset(key: KeyType, index: number, value: any): Promise; - lrange(key: string, start: number, stop: number, callback: (err: Error, res: any) => void): void; - lrange(key: string, start: number, stop: number): Promise; + lrange(key: KeyType, start: number, stop: number, callback: (err: Error, res: any) => void): void; + lrange(key: KeyType, start: number, stop: number): Promise; - ltrim(key: string, start: number, stop: number, callback: (err: Error, res: any) => void): void; - ltrim(key: string, start: number, stop: number): Promise; + ltrim(key: KeyType, start: number, stop: number, callback: (err: Error, res: any) => void): void; + ltrim(key: KeyType, start: number, stop: number): Promise; - lrem(key: string, count: number, value: any, callback: (err: Error, res: number) => void): void; - lrem(key: string, count: number, value: any): Promise; + lrem(key: KeyType, count: number, value: any, callback: (err: Error, res: number) => void): void; + lrem(key: KeyType, count: number, value: any): Promise; rpoplpush(source: string, destination: string, callback: (err: Error, res: string) => void): void; rpoplpush(source: string, destination: string): Promise; - sadd(key: string, ...members: any[]): any; + sadd(key: KeyType, ...members: any[]): any; - srem(key: string, ...members: any[]): any; + srem(key: KeyType, ...members: any[]): any; smove(source: string, destination: string, member: string, callback: (err: Error, res: string) => void): void; smove(source: string, destination: string, member: string): Promise; - sismember(key: string, member: string, callback: (err: Error, res: 1 | 0) => void): void; - sismember(key: string, member: string): Promise<1 | 0>; + sismember(key: KeyType, member: string, callback: (err: Error, res: 1 | 0) => void): void; + sismember(key: KeyType, member: string): Promise<1 | 0>; - scard(key: string, callback: (err: Error, res: number) => void): void; - scard(key: string): Promise; + scard(key: KeyType, callback: (err: Error, res: number) => void): void; + scard(key: KeyType): Promise; - spop(key: string, callback: (err: Error, res: any) => void): void; - spop(key: string, count: number, callback: (err: Error, res: any) => void): void; - spop(key: string, count?: number): Promise; + spop(key: KeyType, callback: (err: Error, res: any) => void): void; + spop(key: KeyType, count: number, callback: (err: Error, res: any) => void): void; + spop(key: KeyType, count?: number): Promise; - srandmember(key: string, callback: (err: Error, res: any) => void): void; - srandmember(key: string, count: number, callback: (err: Error, res: any) => void): void; - srandmember(key: string, count?: number): Promise; + srandmember(key: KeyType, callback: (err: Error, res: any) => void): void; + srandmember(key: KeyType, count: number, callback: (err: Error, res: any) => void): void; + srandmember(key: KeyType, count?: number): Promise; - sinter(...keys: string[]): any; + sinter(...keys: KeyType[]): any; - sinterstore(destination: string, ...keys: string[]): any; + sinterstore(destination: string, ...keys: KeyType[]): any; - sunion(...keys: string[]): any; + sunion(...keys: KeyType[]): any; - sunionstore(destination: string, ...keys: string[]): any; + sunionstore(destination: string, ...keys: KeyType[]): any; - sdiff(...keys: string[]): any; + sdiff(...keys: KeyType[]): any; - sdiffstore(destination: string, ...keys: string[]): any; + sdiffstore(destination: string, ...keys: KeyType[]): any; - smembers(key: string, callback: (err: Error, res: any) => void): void; - smembers(key: string): Promise; + smembers(key: KeyType, callback: (err: Error, res: any) => void): void; + smembers(key: KeyType): Promise; - zadd(key: string, ...args: string[]): any; + zadd(key: KeyType, ...args: string[]): any; - zincrby(key: string, increment: number, member: string, callback: (err: Error, res: any) => void): void; - zincrby(key: string, increment: number, member: string): Promise; + zincrby(key: KeyType, increment: number, member: string, callback: (err: Error, res: any) => void): void; + zincrby(key: KeyType, increment: number, member: string): Promise; - zrem(key: string, ...members: any[]): any; + zrem(key: KeyType, ...members: any[]): any; - zremrangebyscore(key: string, min: number | string, max: number | string, callback: (err: Error, res: any) => void): void; - zremrangebyscore(key: string, min: number | string, max: number | string): Promise; + zremrangebyscore(key: KeyType, min: number | string, max: number | string, callback: (err: Error, res: any) => void): void; + zremrangebyscore(key: KeyType, min: number | string, max: number | string): Promise; - zremrangebyrank(key: string, start: number, stop: number, callback: (err: Error, res: any) => void): void; - zremrangebyrank(key: string, start: number, stop: number): Promise; + zremrangebyrank(key: KeyType, start: number, stop: number, callback: (err: Error, res: any) => void): void; + zremrangebyrank(key: KeyType, start: number, stop: number): Promise; - zunionstore(destination: string, numkeys: number, key: string, ...args: string[]): any; + zunionstore(destination: string, numkeys: number, key: KeyType, ...args: string[]): any; - zinterstore(destination: string, numkeys: number, key: string, ...args: string[]): any; + zinterstore(destination: string, numkeys: number, key: KeyType, ...args: string[]): any; - zrange(key: string, start: number, stop: number, callback: (err: Error, res: any) => void): void; - zrange(key: string, start: number, stop: number, withScores: "WITHSCORES", callback: (err: Error, res: any) => void): void; - zrange(key: string, start: number, stop: number, withScores?: "WITHSCORES"): Promise; + zrange(key: KeyType, start: number, stop: number, callback: (err: Error, res: any) => void): void; + zrange(key: KeyType, start: number, stop: number, withScores: "WITHSCORES", callback: (err: Error, res: any) => void): void; + zrange(key: KeyType, start: number, stop: number, withScores?: "WITHSCORES"): Promise; - zrevrange(key: string, start: number, stop: number, callback: (err: Error, res: any) => void): void; - zrevrange(key: string, start: number, stop: number, withScores: "WITHSCORES", callback: (err: Error, res: any) => void): void; - zrevrange(key: string, start: number, stop: number, withScores?: "WITHSCORES"): Promise; + zrevrange(key: KeyType, start: number, stop: number, callback: (err: Error, res: any) => void): void; + zrevrange(key: KeyType, start: number, stop: number, withScores: "WITHSCORES", callback: (err: Error, res: any) => void): void; + zrevrange(key: KeyType, start: number, stop: number, withScores?: "WITHSCORES"): Promise; - zrangebyscore(key: string, min: number | string, max: number | string, ...args: string[]): any; + zrangebyscore(key: KeyType, min: number | string, max: number | string, ...args: string[]): any; - zrevrangebyscore(key: string, max: number | string, min: number | string, ...args: string[]): any; + zrevrangebyscore(key: KeyType, max: number | string, min: number | string, ...args: string[]): any; - zcount(key: string, min: number | string, max: number | string, callback: (err: Error, res: number) => void): void; - zcount(key: string, min: number | string, max: number | string): Promise; + zcount(key: KeyType, min: number | string, max: number | string, callback: (err: Error, res: number) => void): void; + zcount(key: KeyType, min: number | string, max: number | string): Promise; - zcard(key: string, callback: (err: Error, res: number) => void): void; - zcard(key: string): Promise; + zcard(key: KeyType, callback: (err: Error, res: number) => void): void; + zcard(key: KeyType): Promise; - zscore(key: string, member: string, callback: (err: Error, res: string) => void): void; - zscore(key: string, member: string): Promise; + zscore(key: KeyType, member: string, callback: (err: Error, res: string) => void): void; + zscore(key: KeyType, member: string): Promise; - zrank(key: string, member: string, callback: (err: Error, res: number) => void): void; - zrank(key: string, member: string): Promise; + zrank(key: KeyType, member: string, callback: (err: Error, res: number) => void): void; + zrank(key: KeyType, member: string): Promise; - zrevrank(key: string, member: string, callback: (err: Error, res: number) => void): void; - zrevrank(key: string, member: string): Promise; + zrevrank(key: KeyType, member: string, callback: (err: Error, res: number) => void): void; + zrevrank(key: KeyType, member: string): Promise; - hset(key: string, field: string, value: any, callback: (err: Error, res: 0 | 1) => void): void; - hset(key: string, field: string, value: any): Promise<0 | 1>; - hsetBuffer(key: string, field: string, value: any, callback: (err: Error, res: 0 | 1) => void): void; - hsetBuffer(key: string, field: string, value: any): Promise; + hset(key: KeyType, field: string, value: any, callback: (err: Error, res: 0 | 1) => void): void; + hset(key: KeyType, field: string, value: any): Promise<0 | 1>; + hsetBuffer(key: KeyType, field: string, value: any, callback: (err: Error, res: 0 | 1) => void): void; + hsetBuffer(key: KeyType, field: string, value: any): Promise; - hsetnx(key: string, field: string, value: any, callback: (err: Error, res: 0 | 1) => void): void; - hsetnx(key: string, field: string, value: any): Promise<0 | 1>; + hsetnx(key: KeyType, field: string, value: any, callback: (err: Error, res: 0 | 1) => void): void; + hsetnx(key: KeyType, field: string, value: any): Promise<0 | 1>; - hget(key: string, field: string, callback: (err: Error, res: string) => void): void; - hget(key: string, field: string): Promise; - hgetBuffer(key: string, field: string, callback: (err: Error, res: Buffer) => void): void; - hgetBuffer(key: string, field: string): Promise; + hget(key: KeyType, field: string, callback: (err: Error, res: string) => void): void; + hget(key: KeyType, field: string): Promise; + hgetBuffer(key: KeyType, field: string, callback: (err: Error, res: Buffer) => void): void; + hgetBuffer(key: KeyType, field: string): Promise; - hmset(key: string, field: string, value: any, ...args: string[]): Promise<0 | 1>; - hmset(key: string, data: any, callback: (err: Error, res: 0 | 1) => void): void; - hmset(key: string, data: any): Promise<0 | 1>; + hmset(key: KeyType, field: string, value: any, ...args: string[]): Promise<0 | 1>; + hmset(key: KeyType, data: any, callback: (err: Error, res: 0 | 1) => void): void; + hmset(key: KeyType, data: any): Promise<0 | 1>; - hmget(key: string, ...fields: string[]): any; + hmget(key: KeyType, ...fields: string[]): any; - hincrby(key: string, field: string, increment: number, callback: (err: Error, res: number) => void): void; - hincrby(key: string, field: string, increment: number): Promise; + hincrby(key: KeyType, field: string, increment: number, callback: (err: Error, res: number) => void): void; + hincrby(key: KeyType, field: string, increment: number): Promise; - hincrbyfloat(key: string, field: string, increment: number, callback: (err: Error, res: number) => void): void; - hincrbyfloat(key: string, field: string, increment: number): Promise; + hincrbyfloat(key: KeyType, field: string, increment: number, callback: (err: Error, res: number) => void): void; + hincrbyfloat(key: KeyType, field: string, increment: number): Promise; - hdel(key: string, ...fields: string[]): any; + hdel(key: KeyType, ...fields: string[]): any; - hlen(key: string, callback: (err: Error, res: number) => void): void; - hlen(key: string): Promise; + hlen(key: KeyType, callback: (err: Error, res: number) => void): void; + hlen(key: KeyType): Promise; - hkeys(key: string, callback: (err: Error, res: any) => void): void; - hkeys(key: string): Promise; + hkeys(key: KeyType, callback: (err: Error, res: any) => void): void; + hkeys(key: KeyType): Promise; - hvals(key: string, callback: (err: Error, res: any) => void): void; - hvals(key: string): Promise; + hvals(key: KeyType, callback: (err: Error, res: any) => void): void; + hvals(key: KeyType): Promise; - hgetall(key: string, callback: (err: Error, res: any) => void): void; - hgetall(key: string): Promise; + hgetall(key: KeyType, callback: (err: Error, res: any) => void): void; + hgetall(key: KeyType): Promise; - hexists(key: string, field: string, callback: (err: Error, res: 0 | 1) => void): void; - hexists(key: string, field: string): Promise<0 | 1>; + hexists(key: KeyType, field: string, callback: (err: Error, res: 0 | 1) => void): void; + hexists(key: KeyType, field: string): Promise<0 | 1>; - incrby(key: string, increment: number, callback: (err: Error, res: number) => void): void; - incrby(key: string, increment: number): Promise; + incrby(key: KeyType, increment: number, callback: (err: Error, res: number) => void): void; + incrby(key: KeyType, increment: number): Promise; - incrbyfloat(key: string, increment: number, callback: (err: Error, res: number) => void): void; - incrbyfloat(key: string, increment: number): Promise; + incrbyfloat(key: KeyType, increment: number, callback: (err: Error, res: number) => void): void; + incrbyfloat(key: KeyType, increment: number): Promise; - decrby(key: string, decrement: number, callback: (err: Error, res: number) => void): void; - decrby(key: string, decrement: number): Promise; + decrby(key: KeyType, decrement: number, callback: (err: Error, res: number) => void): void; + decrby(key: KeyType, decrement: number): Promise; - getset(key: string, value: any, callback: (err: Error, res: string) => void): void; - getset(key: string, value: any): Promise; + getset(key: KeyType, value: any, callback: (err: Error, res: string) => void): void; + getset(key: KeyType, value: any): Promise; - mset(key: string, value: any, ...args: string[]): any; + mset(key: KeyType, value: any, ...args: string[]): any; - msetnx(key: string, value: any, ...args: string[]): any; + msetnx(key: KeyType, value: any, ...args: string[]): any; randomkey(callback: (err: Error, res: string) => void): void; randomkey(): Promise; @@ -317,26 +319,26 @@ declare namespace IORedis { select(index: number, callback: (err: Error, res: string) => void): void; select(index: number): Promise; - move(key: string, db: string, callback: (err: Error, res: 0 | 1) => void): void; - move(key: string, db: string): Promise<0 | 1>; + move(key: KeyType, db: string, callback: (err: Error, res: 0 | 1) => void): void; + move(key: KeyType, db: string): Promise<0 | 1>; - rename(key: string, newkey: string, callback: (err: Error, res: string) => void): void; - rename(key: string, newkey: string): Promise; + rename(key: KeyType, newkey: KeyType, callback: (err: Error, res: string) => void): void; + rename(key: KeyType, newkey: KeyType): Promise; - renamenx(key: string, newkey: string, callback: (err: Error, res: 0 | 1) => void): void; - renamenx(key: string, newkey: string): Promise<0 | 1>; + renamenx(key: KeyType, newkey: KeyType, callback: (err: Error, res: 0 | 1) => void): void; + renamenx(key: KeyType, newkey: KeyType): Promise<0 | 1>; - expire(key: string, seconds: number, callback: (err: Error, res: 0 | 1) => void): void; - expire(key: string, seconds: number): Promise<0 | 1>; + expire(key: KeyType, seconds: number, callback: (err: Error, res: 0 | 1) => void): void; + expire(key: KeyType, seconds: number): Promise<0 | 1>; - pexpire(key: string, milliseconds: number, callback: (err: Error, res: 0 | 1) => void): void; - pexpire(key: string, milliseconds: number): Promise<0 | 1>; + pexpire(key: KeyType, milliseconds: number, callback: (err: Error, res: 0 | 1) => void): void; + pexpire(key: KeyType, milliseconds: number): Promise<0 | 1>; - expireat(key: string, timestamp: number, callback: (err: Error, res: 0 | 1) => void): void; - expireat(key: string, timestamp: number): Promise<0 | 1>; + expireat(key: KeyType, timestamp: number, callback: (err: Error, res: 0 | 1) => void): void; + expireat(key: KeyType, timestamp: number): Promise<0 | 1>; - pexpireat(key: string, millisecondsTimestamp: number, callback: (err: Error, res: 0 | 1) => void): void; - pexpireat(key: string, millisecondsTimestamp: number): Promise<0 | 1>; + pexpireat(key: KeyType, millisecondsTimestamp: number, callback: (err: Error, res: 0 | 1) => void): void; + pexpireat(key: KeyType, millisecondsTimestamp: number): Promise<0 | 1>; keys(pattern: string, callback: (err: Error, res: string[]) => void): void; keys(pattern: string): Promise; @@ -369,8 +371,8 @@ declare namespace IORedis { lastsave(callback: (err: Error, res: number) => void): void; lastsave(): Promise; - type(key: string, callback: (err: Error, res: string) => void): void; - type(key: string): Promise; + type(key: KeyType, callback: (err: Error, res: string) => void): void; + type(key: KeyType): Promise; multi(commands?: string[][], options?: MultiOptions): Pipeline; multi(options: { pipeline: false }): Promise; @@ -390,7 +392,7 @@ declare namespace IORedis { flushall(callback: (err: Error, res: string) => void): void; flushall(): Promise; - sort(key: string, ...args: string[]): any; + sort(key: KeyType, ...args: string[]): any; info(callback: (err: Error, res: any) => void): void; info(section: string, callback: (err: Error, res: any) => void): void; @@ -402,11 +404,11 @@ declare namespace IORedis { monitor(callback: (err: Error, res: NodeJS.EventEmitter) => void): void; monitor(): Promise; - ttl(key: string, callback: (err: Error, res: number) => void): void; - ttl(key: string): Promise; + ttl(key: KeyType, callback: (err: Error, res: number) => void): void; + ttl(key: KeyType): Promise; - persist(key: string, callback: (err: Error, res: 0 | 1) => void): void; - persist(key: string): Promise<0 | 1>; + persist(key: KeyType, callback: (err: Error, res: 0 | 1) => void): void; + persist(key: KeyType): Promise<0 | 1>; slaveof(host: string, port: number, callback: (err: Error, res: string) => void): void; slaveof(host: string, port: number): Promise; @@ -426,7 +428,7 @@ declare namespace IORedis { publish(channel: string, message: string, callback: (err: Error, res: number) => void): void; publish(channel: string, message: string): Promise; - watch(...keys: string[]): any; + watch(...keys: KeyType[]): any; unwatch(callback: (err: Error, res: string) => void): void; unwatch(): Promise; @@ -437,8 +439,8 @@ declare namespace IORedis { migrate(...args: any[]): any; - dump(key: string, callback: (err: Error, res: string) => void): void; - dump(key: string): Promise; + dump(key: KeyType, callback: (err: Error, res: string) => void): void; + dump(key: KeyType): Promise; object(subcommand: string, ...args: any[]): any; @@ -455,24 +457,24 @@ declare namespace IORedis { scan(cursor: number, ...args: any[]): any; - sscan(key: string, cursor: number, ...args: any[]): any; + sscan(key: KeyType, cursor: number, ...args: any[]): any; - hscan(key: string, cursor: number, ...args: any[]): any; + hscan(key: KeyType, cursor: number, ...args: any[]): any; - zscan(key: string, cursor: number, ...args: any[]): any; + zscan(key: KeyType, cursor: number, ...args: any[]): any; - pfmerge(destkey: string, ...sourcekeys: string[]): any; + pfmerge(destkey: KeyType, ...sourcekeys: KeyType[]): any; - pfadd(key: string, ...elements: string[]): any; + pfadd(key: KeyType, ...elements: string[]): any; - pfcount(...keys: string[]): any; + pfcount(...keys: KeyType[]): any; pipeline(commands?: string[][]): Pipeline; scanStream(options?: ScanStreamOption): NodeJS.EventEmitter; - sscanStream(key: string, options?: ScanStreamOption): NodeJS.EventEmitter; - hscanStream(key: string, options?: ScanStreamOption): NodeJS.EventEmitter; - zscanStream(key: string, options?: ScanStreamOption): NodeJS.EventEmitter; + sscanStream(key: KeyType, options?: ScanStreamOption): NodeJS.EventEmitter; + hscanStream(key: KeyType, options?: ScanStreamOption): NodeJS.EventEmitter; + zscanStream(key: KeyType, options?: ScanStreamOption): NodeJS.EventEmitter; } interface Pipeline { @@ -483,208 +485,208 @@ declare namespace IORedis { _result: any[]; _transactions: number; _shaToScript: {}; - bitcount(key: string, callback?: (err: Error, res: number) => void): Pipeline; - bitcount(key: string, start: number, end: number, callback?: (err: Error, res: number) => void): Pipeline; + bitcount(key: KeyType, callback?: (err: Error, res: number) => void): Pipeline; + bitcount(key: KeyType, start: number, end: number, callback?: (err: Error, res: number) => void): Pipeline; - get(key: string, callback?: (err: Error, res: string) => void): Pipeline; - getBuffer(key: string, callback?: (err: Error, res: Buffer) => void): Pipeline; + get(key: KeyType, callback?: (err: Error, res: string) => void): Pipeline; + getBuffer(key: KeyType, callback?: (err: Error, res: Buffer) => void): Pipeline; - set(key: string, value: any, callback?: (err: Error, res: string) => void): Pipeline; - set(key: string, value: any, setMode: string, callback?: (err: Error, res: string) => void): Pipeline; - set(key: string, value: any, expiryMode: string, time: number, callback?: (err: Error, res: string) => void): Pipeline; - set(key: string, value: any, expiryMode: string, time: number, setMode: string, callback?: (err: Error, res: string) => void): Pipeline; + set(key: KeyType, value: any, callback?: (err: Error, res: string) => void): Pipeline; + set(key: KeyType, value: any, setMode: string, callback?: (err: Error, res: string) => void): Pipeline; + set(key: KeyType, value: any, expiryMode: string, time: number, callback?: (err: Error, res: string) => void): Pipeline; + set(key: KeyType, value: any, expiryMode: string, time: number, setMode: string, callback?: (err: Error, res: string) => void): Pipeline; - setBuffer(key: string, value: any, callback?: (err: Error, res: Buffer) => void): Pipeline; - setBuffer(key: string, value: any, setMode: string, callback?: (err: Error, res: Buffer) => void): Pipeline; - setBuffer(key: string, value: any, expiryMode: string, time: number, callback?: (err: Error, res: Buffer) => void): Pipeline; - setBuffer(key: string, value: any, expiryMode: string, time: number, setMode: string, callback?: (err: Error, res: Buffer) => void): Pipeline; + setBuffer(key: KeyType, value: any, callback?: (err: Error, res: Buffer) => void): Pipeline; + setBuffer(key: KeyType, value: any, setMode: string, callback?: (err: Error, res: Buffer) => void): Pipeline; + setBuffer(key: KeyType, value: any, expiryMode: string, time: number, callback?: (err: Error, res: Buffer) => void): Pipeline; + setBuffer(key: KeyType, value: any, expiryMode: string, time: number, setMode: string, callback?: (err: Error, res: Buffer) => void): Pipeline; - setnx(key: string, value: any, callback?: (err: Error, res: any) => void): Pipeline; + setnx(key: KeyType, value: any, callback?: (err: Error, res: any) => void): Pipeline; - setex(key: string, seconds: number, value: any, callback?: (err: Error, res: any) => void): Pipeline; + setex(key: KeyType, seconds: number, value: any, callback?: (err: Error, res: any) => void): Pipeline; - psetex(key: string, milliseconds: number, value: any, callback?: (err: Error, res: any) => void): Pipeline; + psetex(key: KeyType, milliseconds: number, value: any, callback?: (err: Error, res: any) => void): Pipeline; - append(key: string, value: any, callback?: (err: Error, res: number) => void): Pipeline; + append(key: KeyType, value: any, callback?: (err: Error, res: number) => void): Pipeline; - strlen(key: string, callback?: (err: Error, res: number) => void): Pipeline; + strlen(key: KeyType, callback?: (err: Error, res: number) => void): Pipeline; - del(...keys: string[]): Pipeline; + del(...keys: KeyType[]): Pipeline; - exists(...keys: string[]): Pipeline; + exists(...keys: KeyType[]): Pipeline; - setbit(key: string, offset: number, value: any, callback?: (err: Error, res: number) => void): Pipeline; + setbit(key: KeyType, offset: number, value: any, callback?: (err: Error, res: number) => void): Pipeline; - getbit(key: string, offset: number, callback?: (err: Error, res: number) => void): Pipeline; + getbit(key: KeyType, offset: number, callback?: (err: Error, res: number) => void): Pipeline; - setrange(key: string, offset: number, value: any, callback?: (err: Error, res: number) => void): Pipeline; + setrange(key: KeyType, offset: number, value: any, callback?: (err: Error, res: number) => void): Pipeline; - getrange(key: string, start: number, end: number, callback?: (err: Error, res: string) => void): Pipeline; + getrange(key: KeyType, start: number, end: number, callback?: (err: Error, res: string) => void): Pipeline; - substr(key: string, start: number, end: number, callback?: (err: Error, res: string) => void): Pipeline; + substr(key: KeyType, start: number, end: number, callback?: (err: Error, res: string) => void): Pipeline; - incr(key: string, callback?: (err: Error, res: number) => void): Pipeline; + incr(key: KeyType, callback?: (err: Error, res: number) => void): Pipeline; - decr(key: string, callback?: (err: Error, res: number) => void): Pipeline; + decr(key: KeyType, callback?: (err: Error, res: number) => void): Pipeline; - mget(...keys: string[]): Pipeline; + mget(...keys: KeyType[]): Pipeline; - rpush(key: string, ...values: any[]): Pipeline; + rpush(key: KeyType, ...values: any[]): Pipeline; - lpush(key: string, ...values: any[]): Pipeline; + lpush(key: KeyType, ...values: any[]): Pipeline; - rpushx(key: string, value: any, callback?: (err: Error, res: number) => void): Pipeline; + rpushx(key: KeyType, value: any, callback?: (err: Error, res: number) => void): Pipeline; - lpushx(key: string, value: any, callback?: (err: Error, res: number) => void): Pipeline; + lpushx(key: KeyType, value: any, callback?: (err: Error, res: number) => void): Pipeline; - linsert(key: string, direction: "BEFORE" | "AFTER", pivot: string, value: any, callback?: (err: Error, res: number) => void): Pipeline; + linsert(key: KeyType, direction: "BEFORE" | "AFTER", pivot: string, value: any, callback?: (err: Error, res: number) => void): Pipeline; - rpop(key: string, callback?: (err: Error, res: string) => void): Pipeline; + rpop(key: KeyType, callback?: (err: Error, res: string) => void): Pipeline; - lpop(key: string, callback?: (err: Error, res: string) => void): Pipeline; + lpop(key: KeyType, callback?: (err: Error, res: string) => void): Pipeline; - brpop(...keys: string[]): Pipeline; + brpop(...keys: KeyType[]): Pipeline; - blpop(...keys: string[]): Pipeline; + blpop(...keys: KeyType[]): Pipeline; brpoplpush(source: string, destination: string, timeout: number, callback?: (err: Error, res: any) => void): Pipeline; - llen(key: string, callback?: (err: Error, res: number) => void): Pipeline; + llen(key: KeyType, callback?: (err: Error, res: number) => void): Pipeline; - lindex(key: string, index: number, callback?: (err: Error, res: string) => void): Pipeline; + lindex(key: KeyType, index: number, callback?: (err: Error, res: string) => void): Pipeline; - lset(key: string, index: number, value: any, callback?: (err: Error, res: any) => void): Pipeline; + lset(key: KeyType, index: number, value: any, callback?: (err: Error, res: any) => void): Pipeline; - lrange(key: string, start: number, stop: number, callback?: (err: Error, res: any) => void): Pipeline; + lrange(key: KeyType, start: number, stop: number, callback?: (err: Error, res: any) => void): Pipeline; - ltrim(key: string, start: number, stop: number, callback?: (err: Error, res: any) => void): Pipeline; + ltrim(key: KeyType, start: number, stop: number, callback?: (err: Error, res: any) => void): Pipeline; - lrem(key: string, count: number, value: any, callback?: (err: Error, res: number) => void): Pipeline; + lrem(key: KeyType, count: number, value: any, callback?: (err: Error, res: number) => void): Pipeline; rpoplpush(source: string, destination: string, callback?: (err: Error, res: string) => void): Pipeline; - sadd(key: string, ...members: any[]): Pipeline; + sadd(key: KeyType, ...members: any[]): Pipeline; - srem(key: string, ...members: any[]): Pipeline; + srem(key: KeyType, ...members: any[]): Pipeline; smove(source: string, destination: string, member: string, callback?: (err: Error, res: string) => void): Pipeline; - sismember(key: string, member: string, callback?: (err: Error, res: 1 | 0) => void): Pipeline; + sismember(key: KeyType, member: string, callback?: (err: Error, res: 1 | 0) => void): Pipeline; - scard(key: string, callback?: (err: Error, res: number) => void): Pipeline; + scard(key: KeyType, callback?: (err: Error, res: number) => void): Pipeline; - spop(key: string, callback?: (err: Error, res: any) => void): Pipeline; - spop(key: string, count: number, callback?: (err: Error, res: any) => void): Pipeline; + spop(key: KeyType, callback?: (err: Error, res: any) => void): Pipeline; + spop(key: KeyType, count: number, callback?: (err: Error, res: any) => void): Pipeline; - srandmember(key: string, callback?: (err: Error, res: any) => void): Pipeline; - srandmember(key: string, count: number, callback?: (err: Error, res: any) => void): Pipeline; + srandmember(key: KeyType, callback?: (err: Error, res: any) => void): Pipeline; + srandmember(key: KeyType, count: number, callback?: (err: Error, res: any) => void): Pipeline; - sinter(...keys: string[]): Pipeline; + sinter(...keys: KeyType[]): Pipeline; - sinterstore(destination: string, ...keys: string[]): Pipeline; + sinterstore(destination: string, ...keys: KeyType[]): Pipeline; - sunion(...keys: string[]): Pipeline; + sunion(...keys: KeyType[]): Pipeline; - sunionstore(destination: string, ...keys: string[]): Pipeline; + sunionstore(destination: string, ...keys: KeyType[]): Pipeline; - sdiff(...keys: string[]): Pipeline; + sdiff(...keys: KeyType[]): Pipeline; - sdiffstore(destination: string, ...keys: string[]): Pipeline; + sdiffstore(destination: string, ...keys: KeyType[]): Pipeline; - smembers(key: string, callback?: (err: Error, res: any) => void): Pipeline; + smembers(key: KeyType, callback?: (err: Error, res: any) => void): Pipeline; - zadd(key: string, ...args: string[]): Pipeline; + zadd(key: KeyType, ...args: string[]): Pipeline; - zincrby(key: string, increment: number, member: string, callback?: (err: Error, res: any) => void): Pipeline; + zincrby(key: KeyType, increment: number, member: string, callback?: (err: Error, res: any) => void): Pipeline; - zrem(key: string, ...members: any[]): Pipeline; + zrem(key: KeyType, ...members: any[]): Pipeline; - zremrangebyscore(key: string, min: number | string, max: number | string, callback?: (err: Error, res: any) => void): Pipeline; + zremrangebyscore(key: KeyType, min: number | string, max: number | string, callback?: (err: Error, res: any) => void): Pipeline; - zremrangebyrank(key: string, start: number, stop: number, callback?: (err: Error, res: any) => void): Pipeline; + zremrangebyrank(key: KeyType, start: number, stop: number, callback?: (err: Error, res: any) => void): Pipeline; - zunionstore(destination: string, numkeys: number, key: string, ...args: string[]): Pipeline; + zunionstore(destination: string, numkeys: number, key: KeyType, ...args: string[]): Pipeline; - zinterstore(destination: string, numkeys: number, key: string, ...args: string[]): Pipeline; + zinterstore(destination: string, numkeys: number, key: KeyType, ...args: string[]): Pipeline; - zrange(key: string, start: number, stop: number, callback?: (err: Error, res: any) => void): Pipeline; - zrange(key: string, start: number, stop: number, withScores: "WITHSCORES", callback?: (err: Error, res: any) => void): Pipeline; + zrange(key: KeyType, start: number, stop: number, callback?: (err: Error, res: any) => void): Pipeline; + zrange(key: KeyType, start: number, stop: number, withScores: "WITHSCORES", callback?: (err: Error, res: any) => void): Pipeline; - zrevrange(key: string, start: number, stop: number, callback?: (err: Error, res: any) => void): Pipeline; - zrevrange(key: string, start: number, stop: number, withScores: "WITHSCORES", callback?: (err: Error, res: any) => void): Pipeline; + zrevrange(key: KeyType, start: number, stop: number, callback?: (err: Error, res: any) => void): Pipeline; + zrevrange(key: KeyType, start: number, stop: number, withScores: "WITHSCORES", callback?: (err: Error, res: any) => void): Pipeline; - zrangebyscore(key: string, min: number | string, max: number | string, ...args: string[]): Pipeline; + zrangebyscore(key: KeyType, min: number | string, max: number | string, ...args: string[]): Pipeline; - zrevrangebyscore(key: string, max: number | string, min: number | string, ...args: string[]): Pipeline; + zrevrangebyscore(key: KeyType, max: number | string, min: number | string, ...args: string[]): Pipeline; - zcount(key: string, min: number | string, max: number | string, callback?: (err: Error, res: number) => void): Pipeline; + zcount(key: KeyType, min: number | string, max: number | string, callback?: (err: Error, res: number) => void): Pipeline; - zcard(key: string, callback?: (err: Error, res: number) => void): Pipeline; + zcard(key: KeyType, callback?: (err: Error, res: number) => void): Pipeline; - zscore(key: string, member: string, callback?: (err: Error, res: number) => void): Pipeline; + zscore(key: KeyType, member: string, callback?: (err: Error, res: number) => void): Pipeline; - zrank(key: string, member: string, callback?: (err: Error, res: number) => void): Pipeline; + zrank(key: KeyType, member: string, callback?: (err: Error, res: number) => void): Pipeline; - zrevrank(key: string, member: string, callback?: (err: Error, res: number) => void): Pipeline; + zrevrank(key: KeyType, member: string, callback?: (err: Error, res: number) => void): Pipeline; - hset(key: string, field: string, value: any, callback?: (err: Error, res: 0 | 1) => void): Pipeline; - hsetBuffer(key: string, field: string, value: any, callback?: (err: Error, res: Buffer) => void): Pipeline; + hset(key: KeyType, field: string, value: any, callback?: (err: Error, res: 0 | 1) => void): Pipeline; + hsetBuffer(key: KeyType, field: string, value: any, callback?: (err: Error, res: Buffer) => void): Pipeline; - hsetnx(key: string, field: string, value: any, callback?: (err: Error, res: 0 | 1) => void): Pipeline; + hsetnx(key: KeyType, field: string, value: any, callback?: (err: Error, res: 0 | 1) => void): Pipeline; - hget(key: string, field: string, callback?: (err: Error, res: string) => void): Pipeline; - hgetBuffer(key: string, field: string, callback?: (err: Error, res: Buffer) => void): Pipeline; + hget(key: KeyType, field: string, callback?: (err: Error, res: string) => void): Pipeline; + hgetBuffer(key: KeyType, field: string, callback?: (err: Error, res: Buffer) => void): Pipeline; - hmset(key: string, field: string, value: any, ...args: string[]): Pipeline; - hmset(key: string, data: any, callback?: (err: Error, res: 0 | 1) => void): Pipeline; + hmset(key: KeyType, field: string, value: any, ...args: string[]): Pipeline; + hmset(key: KeyType, data: any, callback?: (err: Error, res: 0 | 1) => void): Pipeline; - hmget(key: string, ...fields: string[]): Pipeline; + hmget(key: KeyType, ...fields: string[]): Pipeline; - hincrby(key: string, field: string, increment: number, callback?: (err: Error, res: number) => void): Pipeline; + hincrby(key: KeyType, field: string, increment: number, callback?: (err: Error, res: number) => void): Pipeline; - hincrbyfloat(key: string, field: string, increment: number, callback?: (err: Error, res: number) => void): Pipeline; + hincrbyfloat(key: KeyType, field: string, increment: number, callback?: (err: Error, res: number) => void): Pipeline; - hdel(key: string, ...fields: string[]): Pipeline; + hdel(key: KeyType, ...fields: string[]): Pipeline; - hlen(key: string, callback?: (err: Error, res: number) => void): Pipeline; + hlen(key: KeyType, callback?: (err: Error, res: number) => void): Pipeline; - hkeys(key: string, callback?: (err: Error, res: any) => void): Pipeline; + hkeys(key: KeyType, callback?: (err: Error, res: any) => void): Pipeline; - hvals(key: string, callback?: (err: Error, res: any) => void): Pipeline; + hvals(key: KeyType, callback?: (err: Error, res: any) => void): Pipeline; - hgetall(key: string, callback?: (err: Error, res: any) => void): Pipeline; + hgetall(key: KeyType, callback?: (err: Error, res: any) => void): Pipeline; - hexists(key: string, field: string, callback?: (err: Error, res: 0 | 1) => void): Pipeline; + hexists(key: KeyType, field: string, callback?: (err: Error, res: 0 | 1) => void): Pipeline; - incrby(key: string, increment: number, callback?: (err: Error, res: number) => void): Pipeline; + incrby(key: KeyType, increment: number, callback?: (err: Error, res: number) => void): Pipeline; - incrbyfloat(key: string, increment: number, callback?: (err: Error, res: number) => void): Pipeline; + incrbyfloat(key: KeyType, increment: number, callback?: (err: Error, res: number) => void): Pipeline; - decrby(key: string, decrement: number, callback?: (err: Error, res: number) => void): Pipeline; + decrby(key: KeyType, decrement: number, callback?: (err: Error, res: number) => void): Pipeline; - getset(key: string, value: any, callback?: (err: Error, res: string) => void): Pipeline; + getset(key: KeyType, value: any, callback?: (err: Error, res: string) => void): Pipeline; - mset(key: string, value: any, ...args: string[]): Pipeline; + mset(key: KeyType, value: any, ...args: string[]): Pipeline; - msetnx(key: string, value: any, ...args: string[]): Pipeline; + msetnx(key: KeyType, value: any, ...args: string[]): Pipeline; randomkey(callback?: (err: Error, res: string) => void): Pipeline; select(index: number, callback?: (err: Error, res: string) => void): Pipeline; - move(key: string, db: string, callback?: (err: Error, res: 0 | 1) => void): Pipeline; + move(key: KeyType, db: string, callback?: (err: Error, res: 0 | 1) => void): Pipeline; - rename(key: string, newkey: string, callback?: (err: Error, res: string) => void): Pipeline; + rename(key: KeyType, newkey: KeyType, callback?: (err: Error, res: string) => void): Pipeline; - renamenx(key: string, newkey: string, callback?: (err: Error, res: 0 | 1) => void): Pipeline; + renamenx(key: KeyType, newkey: KeyType, callback?: (err: Error, res: 0 | 1) => void): Pipeline; - expire(key: string, seconds: number, callback?: (err: Error, res: 0 | 1) => void): Pipeline; + expire(key: KeyType, seconds: number, callback?: (err: Error, res: 0 | 1) => void): Pipeline; - pexpire(key: string, milliseconds: number, callback?: (err: Error, res: 0 | 1) => void): Pipeline; + pexpire(key: KeyType, milliseconds: number, callback?: (err: Error, res: 0 | 1) => void): Pipeline; - expireat(key: string, timestamp: number, callback?: (err: Error, res: 0 | 1) => void): Pipeline; + expireat(key: KeyType, timestamp: number, callback?: (err: Error, res: 0 | 1) => void): Pipeline; - pexpireat(key: string, millisecondsTimestamp: number, callback?: (err: Error, res: 0 | 1) => void): Pipeline; + pexpireat(key: KeyType, millisecondsTimestamp: number, callback?: (err: Error, res: 0 | 1) => void): Pipeline; keys(pattern: string, callback?: (err: Error, res: string[]) => void): Pipeline; @@ -707,7 +709,7 @@ declare namespace IORedis { lastsave(callback?: (err: Error, res: number) => void): Pipeline; - type(key: string, callback?: (err: Error, res: string) => void): Pipeline; + type(key: KeyType, callback?: (err: Error, res: string) => void): Pipeline; multi(callback?: (err: Error, res: string) => void): Pipeline; @@ -721,7 +723,7 @@ declare namespace IORedis { flushall(callback?: (err: Error, res: string) => void): Pipeline; - sort(key: string, ...args: string[]): Pipeline; + sort(key: KeyType, ...args: string[]): Pipeline; info(callback?: (err: Error, res: any) => void): Pipeline; info(section: string, callback?: (err: Error, res: any) => void): Pipeline; @@ -730,9 +732,9 @@ declare namespace IORedis { monitor(callback?: (err: Error, res: NodeJS.EventEmitter) => void): Pipeline; - ttl(key: string, callback?: (err: Error, res: number) => void): Pipeline; + ttl(key: KeyType, callback?: (err: Error, res: number) => void): Pipeline; - persist(key: string, callback?: (err: Error, res: 0 | 1) => void): Pipeline; + persist(key: KeyType, callback?: (err: Error, res: 0 | 1) => void): Pipeline; slaveof(host: string, port: number, callback?: (err: Error, res: string) => void): Pipeline; @@ -750,7 +752,7 @@ declare namespace IORedis { publish(channel: string, message: string, callback?: (err: Error, res: number) => void): Pipeline; - watch(...keys: string[]): Pipeline; + watch(...keys: KeyType[]): Pipeline; unwatch(callback?: (err: Error, res: string) => void): Pipeline; @@ -760,7 +762,7 @@ declare namespace IORedis { migrate(...args: any[]): Pipeline; - dump(key: string, callback?: (err: Error, res: string) => void): Pipeline; + dump(key: KeyType, callback?: (err: Error, res: string) => void): Pipeline; object(subcommand: string, ...args: any[]): Pipeline; @@ -776,17 +778,17 @@ declare namespace IORedis { scan(cursor: number, ...args: any[]): Pipeline; - sscan(key: string, cursor: number, ...args: any[]): Pipeline; + sscan(key: KeyType, cursor: number, ...args: any[]): Pipeline; - hscan(key: string, cursor: number, ...args: any[]): Pipeline; + hscan(key: KeyType, cursor: number, ...args: any[]): Pipeline; - zscan(key: string, cursor: number, ...args: any[]): Pipeline; + zscan(key: KeyType, cursor: number, ...args: any[]): Pipeline; - pfmerge(destkey: string, ...sourcekeys: string[]): Pipeline; + pfmerge(destkey: KeyType, ...sourcekeys: KeyType[]): Pipeline; - pfadd(key: string, ...elements: string[]): Pipeline; + pfadd(key: KeyType, ...elements: string[]): Pipeline; - pfcount(...keys: string[]): Pipeline; + pfcount(...keys: KeyType[]): Pipeline; } interface NodeConfiguration { diff --git a/types/ioredis/ioredis-tests.ts b/types/ioredis/ioredis-tests.ts index 32ae5c24d5..106a50210b 100644 --- a/types/ioredis/ioredis-tests.ts +++ b/types/ioredis/ioredis-tests.ts @@ -31,6 +31,10 @@ redis.set('key', '100', 'EX', 10, 'NX', (err, data) => {}); redis.set('key', '100', ['EX', 10, 'NX'], (err, data) => {}); redis.setBuffer('key', '100', 'NX', 'EX', 10, (err, data) => {}); +// Should support usage of Buffer +redis.set(Buffer.from('key'), '100'); +redis.setBuffer(Buffer.from('key'), '100', 'NX', 'EX', 10); + new Redis(); // Connect to 127.0.0.1:6379 new Redis(6380); // 127.0.0.1:6380 new Redis(6379, '192.168.1.1'); // 192.168.1.1:6379 diff --git a/types/joi/index.d.ts b/types/joi/index.d.ts index 256e35a8c7..5af6969665 100644 --- a/types/joi/index.d.ts +++ b/types/joi/index.d.ts @@ -137,6 +137,14 @@ export interface UriOptions { * Can be an Array or String (strings are automatically escaped for use in a Regular Expression). */ scheme?: string | RegExp | Array; + /** + * Allow relative URIs. Defaults to `false`. + */ + allowRelative?: boolean; + /** + * Restrict only relative URIs. Defaults to `false`. + */ + relativeOnly?: boolean; } export interface Base64Options { diff --git a/types/jquery-toast-plugin/index.d.ts b/types/jquery-toast-plugin/index.d.ts index 48bff9ff44..db95a9961c 100644 --- a/types/jquery-toast-plugin/index.d.ts +++ b/types/jquery-toast-plugin/index.d.ts @@ -1,6 +1,7 @@ // Type definitions for jquery-toast-plugin 1.3 // Project: https://github.com/kamranahmedse/jquery-toast-plugin // Definitions by: Viqas Hussain +// Andrew Stegmaier // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 @@ -13,19 +14,26 @@ interface JQueryStatic { interface toastOptions { text: string; heading?: string; - showHideTransition?: string; + showHideTransition?: 'fade' | 'slide' | 'plain'; allowToastClose?: boolean; - hideAfter?: number; + hideAfter?: number | false; loader?: boolean; loaderBg?: string; - stack?: number; - position?: string; - bgColor?: boolean; - textColor?: boolean; - textAlign?: string; - icon?: boolean; + stack?: number | false; + position?: 'bottom-left' | 'bottom-right' | 'bottom-center' | 'top-right' | 'top-left' | 'top-center' | 'mid-center' | CustomPosition; + bgColor?: string; + textColor?: string; + textAlign?: 'left' | 'right' | 'center'; + icon?: 'info' | 'warning' | 'error' | 'success'; beforeShow?: () => any; afterShown?: () => any; beforeHide?: () => any; afterHidden?: () => any; } + +interface CustomPosition { + left: number | 'auto'; + right: number | 'auto'; + top: number | 'auto'; + bottom: number | 'auto'; +} diff --git a/types/jquery-toast-plugin/jquery-toast-plugin-tests.ts b/types/jquery-toast-plugin/jquery-toast-plugin-tests.ts index d9a2889c9b..d8f21dd200 100644 --- a/types/jquery-toast-plugin/jquery-toast-plugin-tests.ts +++ b/types/jquery-toast-plugin/jquery-toast-plugin-tests.ts @@ -1 +1,52 @@ $.toast({ text: "test" }); + +$.toast({ text: "test", heading: "Test Heading" }); + +$.toast({ text: "test", showHideTransition: "fade" }); +$.toast({ text: "test", showHideTransition: "slide" }); +$.toast({ text: "test", showHideTransition: "plain" }); + +$.toast({ text: "test", allowToastClose: false }); +$.toast({ text: "test", allowToastClose: true }); + +$.toast({ text: "test", hideAfter: 5}); +$.toast({ text: "test", hideAfter: false}); + +$.toast({ text: "test", loader: true }); +$.toast({ text: "test", loader: false }); + +$.toast({ text: "test", loaderBg: "#9EC600" }); + +$.toast({ text: "test", stack: 5}); +$.toast({ text: "test", stack: false}); + +$.toast({ text: "test", position: "bottom-left" }); +$.toast({ text: "test", position: "bottom-right" }); +$.toast({ text: "test", position: "bottom-center" }); +$.toast({ text: "test", position: "top-right" }); +$.toast({ text: "test", position: "top-left" }); +$.toast({ text: "test", position: "top-center" }); +$.toast({ text: "test", position: "mid-center" }); +$.toast({ text: "test", position: { left : "auto", right : 20, top : 20, bottom : "auto" } }); +$.toast({ text: "test", position: { left : 20, right : "auto", top : "auto", bottom : 20 } }); + +$.toast({ text: "test", bgColor: "#9EC600" }); + +$.toast({ text: "test", textColor: "#9EC600" }); + +$.toast({ text: "test", textAlign: "left" }); +$.toast({ text: "test", textAlign: "right" }); +$.toast({ text: "test", textAlign: "center" }); + +$.toast({ text: "test", icon: "info" }); +$.toast({ text: "test", icon: "warning" }); +$.toast({ text: "test", icon: "error" }); +$.toast({ text: "test", icon: "success" }); + +$.toast({ + text: 'Triggers the events', + beforeShow: () => {}, + afterShown: () => {}, + beforeHide: () => {}, + afterHidden: () => {} +}); diff --git a/types/jqueryui/index.d.ts b/types/jqueryui/index.d.ts index a979c65c7a..7dca429ce4 100644 --- a/types/jqueryui/index.d.ts +++ b/types/jqueryui/index.d.ts @@ -1071,6 +1071,17 @@ declare namespace JQueryUI { show?: any; } + interface WidgetCommonProperties { + element: JQuery; + defaultElement : string; + document: Document; + namespace: string; + uuid: string; + widgetEventPrefix: string; + widgetFullName: string; + window: Window; + } + interface Widget { (methodName: string): JQuery; (options: WidgetOptions): JQuery; @@ -1079,8 +1090,8 @@ declare namespace JQueryUI { (optionLiteral: string, options: WidgetOptions): any; (optionLiteral: string, optionName: string, optionValue: any): JQuery; - (name: string, prototype: any): JQuery; - (name: string, base: Function, prototype: any): JQuery; + (name: string, prototype: T & ThisType): JQuery; + (name: string, base: Function, prototype: T & ThisType ): JQuery; } //////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/types/jsforce/describe-result.d.ts b/types/jsforce/describe-result.d.ts index 17da9f5917..f59df9ff59 100644 --- a/types/jsforce/describe-result.d.ts +++ b/types/jsforce/describe-result.d.ts @@ -70,7 +70,7 @@ export interface Field { caseSensitive: boolean; compoundFieldName?: maybe; controllerName?: maybe; - creatable: boolean; + createable: boolean; custom: boolean; defaultValue?: maybe; defaultValueFormula?: maybe; diff --git a/types/jsforce/salesforce-id.d.ts b/types/jsforce/salesforce-id.d.ts index 87d086880f..5e79506ed6 100644 --- a/types/jsforce/salesforce-id.d.ts +++ b/types/jsforce/salesforce-id.d.ts @@ -1,2 +1 @@ -export class SalesforceId extends String { -} +export type SalesforceId = string diff --git a/types/json5/index.d.ts b/types/json5/index.d.ts index a8fc723b60..9c0cb6cde6 100644 --- a/types/json5/index.d.ts +++ b/types/json5/index.d.ts @@ -1,6 +1,7 @@ // Type definitions for JSON5 // Project: http://json5.org/ // Definitions by: Jason Swearingen +// Kacper Wiszczuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -40,5 +41,18 @@ Comments Both inline (single-line) and block (multi-line) comments are allowed. */ -declare var json5: JSON; + +type JSONReplacer = (key: string, value: any) => any | (number | string)[] | null; + +interface JSON5 { + // Old JSON methods + parse(text: string, reviver?: (key: any, value: any) => any): any; + stringify(value: any, replacer?: (key: string, value: any) => any, space?: string | number): string; + stringify(value: any, replacer?: (number | string)[] | null, space?: string | number): string; + + // New JSON5 stringify function + stringify(value: any, options?: { space?: number | string, quote?: string, replacer?: JSONReplacer }): string; +} + +declare var json5: JSON5; export = json5; diff --git a/types/json5/json5-tests.ts b/types/json5/json5-tests.ts index f1be5b1038..94820866f8 100644 --- a/types/json5/json5-tests.ts +++ b/types/json5/json5-tests.ts @@ -1,7 +1,21 @@ import JSON5 = require('json5'); -var obj = JSON5.parse("{ key:'val', 'key2':[0,1,2,] } //comment "); -var str = JSON5.stringify(obj, null, "\t"); -console.log(str); +const STR = "{ key:'val', 'key2':[0,1,2,] } //comment "; +const OBJ = { key: 'value', key2: [0, 1, 2] }; +function reviverFunction(key: any, value: any): any { + return { [key]: value }; +} + +function replacerFunction(key: string, value: any) { + return { [key]: value }; +} + +const str1: string = JSON5.stringify(OBJ); +const str2: string = JSON5.stringify(OBJ, null, 4); +const str3: string = JSON5.stringify(OBJ, undefined, '2'); +const str4: string = JSON5.stringify(OBJ, replacerFunction, 2); + +JSON.parse(STR); +JSON.parse(STR, reviverFunction); diff --git a/types/jui-core/index.d.ts b/types/jui-core/index.d.ts index 5a607f5721..5bc39848d0 100644 --- a/types/jui-core/index.d.ts +++ b/types/jui-core/index.d.ts @@ -53,7 +53,7 @@ export interface UtilBase { /** * use QuickSort */ - sort(array: any[]): UtilQuickSort; + sort(array: any[]): (array: number[], isClone: boolean) => this; /** * caculate callback runtime @@ -577,5 +577,3 @@ export interface UtilScaleOrdinal extends Function { rangeBands(interval: number, padding?: number, outerPadding?: number): () => void; invert(x: number): number; } - -export type UtilQuickSort = (array: number[], isClone: boolean) => this; diff --git a/types/knuddels-userapps-api/index.d.ts b/types/knuddels-userapps-api/index.d.ts index baff7689f8..1985c305a2 100644 --- a/types/knuddels-userapps-api/index.d.ts +++ b/types/knuddels-userapps-api/index.d.ts @@ -1,25 +1,35 @@ -// Type definitions for Knuddels UserApps API 1.00108823 +// Type definitions for Knuddels UserApps API 1.00109481 // Project: https://developer.knuddels.de // Definitions by: Knuddels GmbH & Co. KG // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// JSON definition -export interface Json { - [x: string]: string | number | boolean | Date | Json | JsonArray; -} -export interface JsonArray extends Array { } - -// serializable objects (for persistence) +// helper types +export type JsonData = string | number | boolean | Date | Json | JsonArray; +export type KnuddelsJsonData = string | number | boolean | Date | KnuddelsJson | KnuddelsJsonArray | KnuddelsSerializable; export type KnuddelsSerializable = string | number | boolean | User | BotUser; -export interface KnuddelsJson { - [x: string]: string | number | boolean | Date | KnuddelsJson | KnuddelsJsonArray | KnuddelsSerializable; -} -export interface KnuddelsJsonArray extends Array { } - -// "data" that may be send between apps and between server and client export type KnuddelsEvent = string | Json | KnuddelsEventArray; -export interface KnuddelsEventArray extends Array { } +// helper interfaces +declare global { + interface Json { + [x: string]: JsonData; + } + + interface KnuddelsJson { + [x: string]: KnuddelsJsonData; + } + + interface JsonArray extends Array { + } + + interface KnuddelsJsonArray extends Array { + } + + interface KnuddelsEventArray extends Array { + } +} + +// Apps API declare global { /** * @see https://developer.knuddels.de/docs/classes/App.html @@ -254,6 +264,13 @@ declare global { width: number, height: number ): AppContent; + /** + * @see https://developer.knuddels.de/docs/classes/AppContent.html#method_headerbarContent + */ + static headerbarContent( + htmlFile: HTMLFile, + height: number + ): AppContent; /** * @see https://developer.knuddels.de/docs/classes/AppContent.html#method_sendEvent */ @@ -426,6 +443,14 @@ declare global { * @see https://developer.knuddels.de/docs/classes/AppPersistence.html */ class AppPersistence extends Persistence { + /** + * @see https://developer.knuddels.de/docs/classes/AppPersistence.html#method_getDatabaseFileSize + */ + getDatabaseFileSize(): number; + /** + * @see https://developer.knuddels.de/docs/classes/AppPersistence.html#method_getDatabaseFileSizeLimit + */ + getDatabaseFileSizeLimit(): number; } /** @@ -493,6 +518,10 @@ declare global { * @see https://developer.knuddels.de/docs/classes/AppViewMode.html#property_Popup */ static readonly Popup: AppViewMode; + /** + * @see https://developer.knuddels.de/docs/classes/AppViewMode.html#property_Headerbar + */ + static readonly Headerbar: AppViewMode; } /** @@ -1597,6 +1626,18 @@ declare global { * @see https://developer.knuddels.de/docs/classes/KnuddelsServer.html */ class KnuddelsServer { + /** + * @see https://developer.knuddels.de/docs/classes/KnuddelsServer.html#method_execute + */ + static execute( + fileName: string + ): void; + /** + * @see https://developer.knuddels.de/docs/classes/KnuddelsServer.html#method_listFiles + */ + static listFiles( + path: string + ): string[]; /** * @see https://developer.knuddels.de/docs/classes/KnuddelsServer.html#method_getDefaultBotUser */ @@ -2269,6 +2310,7 @@ declare global { parameters?: { labelMapping?: { [minValue: string]: string }; ascending?: boolean; + sortIndex?: number; } ): Toplist; } diff --git a/types/koa-cors/index.d.ts b/types/koa-cors/index.d.ts new file mode 100644 index 0000000000..4b996b7b07 --- /dev/null +++ b/types/koa-cors/index.d.ts @@ -0,0 +1,22 @@ +// Type definitions for koa-cors 0.0 +// Project: https://github.com/evert0n/koa-cors +// Definitions by: Romain Faust +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +import { Middleware, Request } from 'koa'; + +declare function koaCors(options?: koaCors.Options): Middleware; + +declare namespace koaCors { + interface Options { + credentials?: true; + expose?: string | ReadonlyArray; + headers?: string | ReadonlyArray; + maxAge?: number; + methods?: string | ReadonlyArray; + origin?: boolean | string | ((request: Request) => string); + } +} + +export = koaCors; diff --git a/types/koa-cors/koa-cors-tests.ts b/types/koa-cors/koa-cors-tests.ts new file mode 100644 index 0000000000..943e11ae5f --- /dev/null +++ b/types/koa-cors/koa-cors-tests.ts @@ -0,0 +1,6 @@ +import Koa = require('koa'); +import koaCors = require('koa-cors'); + +const app = new Koa(); +app.use(koaCors()); +app.use(koaCors({ origin: '*' })); diff --git a/types/koa-cors/tsconfig.json b/types/koa-cors/tsconfig.json new file mode 100644 index 0000000000..69cf8667e4 --- /dev/null +++ b/types/koa-cors/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "koa-cors-tests.ts" + ] +} diff --git a/types/koa-cors/tslint.json b/types/koa-cors/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/koa-cors/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/koa-html-minifier/index.d.ts b/types/koa-html-minifier/index.d.ts index 5343257116..6c0c58db12 100644 --- a/types/koa-html-minifier/index.d.ts +++ b/types/koa-html-minifier/index.d.ts @@ -4,11 +4,13 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 +import { Options as HtmlMinifierOptions } from 'html-minifier'; import { Middleware } from 'koa'; -import { Options } from 'html-minifier'; -declare function minifier(options?: Options): Middleware; +declare function koaHtmlMinifier(options?: koaHtmlMinifier.Options): Middleware; -declare namespace minifier {} +declare namespace koaHtmlMinifier { + type Options = HtmlMinifierOptions; +} -export = minifier; +export = koaHtmlMinifier; diff --git a/types/koa-html-minifier/koa-html-minifier-tests.ts b/types/koa-html-minifier/koa-html-minifier-tests.ts index c068d303af..e84c6d81d1 100644 --- a/types/koa-html-minifier/koa-html-minifier-tests.ts +++ b/types/koa-html-minifier/koa-html-minifier-tests.ts @@ -1,8 +1,6 @@ -import * as Koa from 'koa'; -import * as KoaHtmlMinifier from 'koa-html-minifier'; +import Koa = require('koa'); +import koaHtmlMinifier = require('koa-html-minifier'); -const app = new Koa() - .use(KoaHtmlMinifier()) - .use(KoaHtmlMinifier({ - collapseWhitespace: true - })); +const app = new Koa(); +app.use(koaHtmlMinifier()); +app.use(koaHtmlMinifier({ collapseWhitespace: true })); diff --git a/types/leaflet/index.d.ts b/types/leaflet/index.d.ts index 89c9cbd9b9..0822dea605 100644 --- a/types/leaflet/index.d.ts +++ b/types/leaflet/index.d.ts @@ -612,10 +612,10 @@ export interface PolylineOptions extends PathOptions { } export class Polyline extends Path { - constructor(latlngs: LatLngExpression[], options?: PolylineOptions); + constructor(latlngs: LatLngExpression[] | LatLngExpression[][], options?: PolylineOptions); toGeoJSON(): geojson.Feature; getLatLngs(): LatLng[] | LatLng[][] | LatLng[][][]; - setLatLngs(latlngs: LatLngExpression[]): this; + setLatLngs(latlngs: LatLngExpression[] | LatLngExpression[][] | LatLngExpression[][][]): this; isEmpty(): boolean; getCenter(): LatLng; getBounds(): LatLngBounds; @@ -625,13 +625,13 @@ export class Polyline extends Polyline { - constructor(latlngs: LatLngExpression[] | LatLngExpression[][], options?: PolylineOptions); + constructor(latlngs: LatLngExpression[] | LatLngExpression[][] | LatLngExpression[][][], options?: PolylineOptions); } -export function polygon(latlngs: LatLngExpression[] | LatLngExpression[][], options?: PolylineOptions): Polygon; +export function polygon(latlngs: LatLngExpression[] | LatLngExpression[][] | LatLngExpression[][][], options?: PolylineOptions): Polygon; export class Rectangle

extends Polygon

{ constructor(latLngBounds: LatLngBoundsExpression, options?: PolylineOptions); diff --git a/types/leaflet/leaflet-tests.ts b/types/leaflet/leaflet-tests.ts index 1f6671cc8c..66f12fd0ed 100644 --- a/types/leaflet/leaflet-tests.ts +++ b/types/leaflet/leaflet-tests.ts @@ -473,15 +473,58 @@ L.marker([1, 2], { className: 'my-div-icon' })); -const latLngs = [ - {lat: 0, lng: 0}, - {lat: 1, lng: 1} -]; -const polygon = new L.Polygon(latLngs); -const polygonExclusion = new L.Polygon([latLngs, latLngs]); +let polygon: L.Polygon; -L.polygon(latLngs).addTo(map); -L.polygon([latLngs, latLngs]).addTo(map); +// simple polygon +const simplePolygonLatLngs: L.LatLngExpression[] = [[37, -109.05], [41, -109.03], [41, -102.05], [37, -102.04]]; +polygon = L.polygon(simplePolygonLatLngs); +polygon = new L.Polygon(simplePolygonLatLngs); +polygon.setLatLngs(simplePolygonLatLngs); +const simplePolygonLatLngs2: L.LatLng[] = polygon.getLatLngs() as L.LatLng[]; + +// complex polygon (polygon with holes) +const complexPolygonLatLngs: L.LatLngExpression[][] = [ + [[37, -109.05], [41, -109.03], [41, -102.05], [37, -102.04]], // outer ring + [[37.29, -108.58], [40.71, -108.58], [40.71, -102.50], [37.29, -102.50]] // hole +]; +polygon = L.polygon(complexPolygonLatLngs); +polygon = new L.Polygon(complexPolygonLatLngs); +polygon.setLatLngs(complexPolygonLatLngs); +const complexPolygonLatLngs2: L.LatLng[][] = polygon.getLatLngs() as L.LatLng[][]; + +// multi polygon +const multiPolygonLatLngs: L.LatLngExpression[][][] = [ + [ // first polygon + [[37, -109.05], [41, -109.03], [41, -102.05], [37, -102.04]], // outer ring + [[37.29, -108.58], [40.71, -108.58], [40.71, -102.50], [37.29, -102.50]] // hole + ], + [ // second polygon + [[41, -111.03], [45, -111.04], [45, -104.05], [41, -104.05]] + ] +]; +polygon = L.polygon(multiPolygonLatLngs); +polygon = new L.Polygon(multiPolygonLatLngs); +polygon.setLatLngs(multiPolygonLatLngs); +const multiPolygonLatLngs2: L.LatLng[][][] = polygon.getLatLngs() as L.LatLng[][][]; + +let polyline: L.Polyline; + +// simple polyline +const simplePolylineLatLngs: L.LatLngExpression[] = [[45.51, -122.68], [37.77, -122.43], [34.04, -118.2]]; +polyline = L.polyline(simplePolylineLatLngs); +polyline = new L.Polyline(simplePolylineLatLngs); +polyline.setLatLngs(simplePolylineLatLngs); +const simplePolylineLatLngs2: L.LatLng[] = polyline.getLatLngs() as L.LatLng[]; + +// multi polyline +const multiPolylineLatLngs: L.LatLngExpression[][] = [ + [[45.51, -122.68], [37.77, -122.43], [34.04, -118.2]], + [[40.78, -73.91], [41.83, -87.62], [32.76, -96.72]] +]; +polyline = L.polyline(multiPolylineLatLngs); +polyline = new L.Polyline(multiPolylineLatLngs); +polyline.setLatLngs(multiPolylineLatLngs); +const multiPolylineLatLngs2: L.LatLng[][] = polyline.getLatLngs() as L.LatLng[][]; L.Util.extend({}); L.Util.create({}); @@ -512,7 +555,7 @@ interface MyProperties { testProperty: string; } -(L.polygon(latLngs) as L.Polygon).feature.properties.testProperty = "test"; +(L.polygon(simplePolygonLatLngs) as L.Polygon).feature.properties.testProperty = "test"; (L.marker([1, 2], { icon: L.icon({ diff --git a/types/mapbox-gl/index.d.ts b/types/mapbox-gl/index.d.ts index 78ce94cb56..27b5d66dc9 100644 --- a/types/mapbox-gl/index.d.ts +++ b/types/mapbox-gl/index.d.ts @@ -1053,7 +1053,7 @@ declare namespace mapboxgl { base?: number; type?: 'identity' | 'exponential' | 'interval' | 'categorical'; default?: any; - 'colorSpace'?: 'rgb' | 'lab' | 'interval'; + 'colorSpace'?: 'rgb' | 'lab' | 'hcl'; } export interface BackgroundLayout { diff --git a/types/mapbox__polyline/index.d.ts b/types/mapbox__polyline/index.d.ts new file mode 100644 index 0000000000..84845edb35 --- /dev/null +++ b/types/mapbox__polyline/index.d.ts @@ -0,0 +1,15 @@ +// Type definitions for mapbox__polyline 1.0 +// Project: https://github.com/mapbox/polyline +// Definitions by: Arseniy Maximov +// Marko Klopets +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +/// + +export function decode(string: string, precision?: number): number[][]; +export function encode(coordinates: number[][], precision?: number): string; +export function fromGeoJSON(geojson: GeoJSON.LineString | GeoJSON.Feature, precision?: number): string; +export function toGeoJSON(string: string, precision?: number): GeoJSON.LineString; + +export as namespace polyline; diff --git a/types/mapbox__polyline/mapbox__polyline-tests.ts b/types/mapbox__polyline/mapbox__polyline-tests.ts new file mode 100644 index 0000000000..d1cf46553f --- /dev/null +++ b/types/mapbox__polyline/mapbox__polyline-tests.ts @@ -0,0 +1,25 @@ +const decodedString: number[][] = polyline.decode('_p~iF~ps|U_ulLnnqC_mqNvxq`@'); +const decodedStringWithPrecision: number[][] = polyline.decode('_p~iF~ps|U_ulLnnqC_mqNvxq`@', 2); + +const encoded: string = polyline.encode([[38.5, -120.2], [40.7, -120.95], [43.252, -126.453]]); +const encodedWithPrecision: string = polyline.encode([[38.5, -120.2], [40.7, -120.95], [43.252, -126.453]], 2); + +const fromGeoJSON: string = polyline.fromGeoJSON({ + type: 'Feature', + geometry: { + type: 'LineString', + coordinates: [[-120.2, 38.5], [-120.95, 40.7], [-126.453, 43.252]] + }, + properties: {} +}); +const fromGeoJSONWithPrecision: string = polyline.fromGeoJSON({ + type: 'Feature', + geometry: { + type: 'LineString', + coordinates: [[-120.2, 38.5], [-120.95, 40.7], [-126.453, 43.252]] + }, + properties: {} +}, 3); + +const toGeoJSON: GeoJSON.LineString = polyline.toGeoJSON('_p~iF~ps|U_ulLnnqC_mqNvxq`@'); +const toGeoJSONWithPrecision: GeoJSON.LineString = polyline.toGeoJSON('_p~iF~ps|U_ulLnnqC_mqNvxq`@', 6); diff --git a/types/mapbox__polyline/tsconfig.json b/types/mapbox__polyline/tsconfig.json new file mode 100644 index 0000000000..2d044d5adc --- /dev/null +++ b/types/mapbox__polyline/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "mapbox__polyline-tests.ts" + ] +} diff --git a/types/mapbox__polyline/tslint.json b/types/mapbox__polyline/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/mapbox__polyline/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/marked/index.d.ts b/types/marked/index.d.ts index 034c0cca18..c99f38aa6c 100644 --- a/types/marked/index.d.ts +++ b/types/marked/index.d.ts @@ -1,5 +1,5 @@ // Type definitions for Marked 0.4 -// Project: https://github.com/chjj/marked +// Project: https://github.com/markedjs/marked // Definitions by: William Orr // BendingBender // CrossR diff --git a/types/mongoose/index.d.ts b/types/mongoose/index.d.ts index 90bb04747f..316887ac9c 100644 --- a/types/mongoose/index.d.ts +++ b/types/mongoose/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Mongoose 5.2.2 +// Type definitions for Mongoose 5.2.3 // Project: http://mongoosejs.com/ // Definitions by: horiuchi // sindrenm @@ -2409,6 +2409,13 @@ declare module "mongoose" { */ read(pref: string, tags?: any[]): this; + /** + * Appends a new $replaceRoot operator to this aggregate pipeline. + * Note that the $replaceRoot operator requires field strings to start with '$'. If you are passing in a string Mongoose will prepend '$' if the specified field doesn't start '$'. If you are passing in an object the strings in your expression will not be altered. + * @param newRoot field or document which will become the new root document + */ + replaceRoot(newRoot: string | object): this; + /** * Appends new custom $sample operator(s) to this aggregate pipeline. * @param size number of random documents to pick diff --git a/types/mongoose/mongoose-tests.ts b/types/mongoose/mongoose-tests.ts index 02227c681d..da5aa792d8 100644 --- a/types/mongoose/mongoose-tests.ts +++ b/types/mongoose/mongoose-tests.ts @@ -1264,6 +1264,8 @@ aggregate.project({ }) aggregate.project({ salary_k: { $divide: [ "$salary", 1000 ]}}); aggregate.read('primaryPreferred').read('pp'); +aggregate.replaceRoot("user"); +aggregate.replaceRoot({x: {$concat: ['$this', '$that']}}); aggregate.sample(3).sample(3); aggregate.skip(10).skip(10); aggregate.sort({ field: 'asc', test: -1 }); diff --git a/types/next/app.d.ts b/types/next/app.d.ts index e086af0ca8..d077c0e95a 100644 --- a/types/next/app.d.ts +++ b/types/next/app.d.ts @@ -1,19 +1,19 @@ import * as React from "react"; import { NextContext } from "."; -import { RouterProps } from "./router"; +import { RouterProps, DefaultQuery } from "./router"; -export interface AppComponentProps { +export interface AppComponentProps { Component: React.ComponentType; - router: RouterProps; + router: RouterProps; pageProps: any; } -export interface AppComponentContext { +export interface AppComponentContext { Component: React.ComponentType; - router: RouterProps; - ctx: NextContext; + router: RouterProps; + ctx: NextContext; } -export class Container extends React.Component {} +export class Container extends React.Component { } -export default class App extends React.Component {} +export default class App extends React.Component> { } diff --git a/types/next/index.d.ts b/types/next/index.d.ts index 2d87121d61..399963cbd8 100644 --- a/types/next/index.d.ts +++ b/types/next/index.d.ts @@ -16,19 +16,22 @@ import * as url from "url"; import { Response as NodeResponse } from "node-fetch"; +import { SingletonRouter } from './router'; + declare namespace next { /** Map object used in query strings. */ type QueryStringMapObject = Record; /** * Context object used in methods like `getInitialProps()` - * <> + * https://github.com/zeit/next.js/blob/6.1.1/server/render.js#L77 + * https://github.com/zeit/next.js/blob/6.1.1/readme.md#fetching-data-and-component-lifecycle */ - interface NextContext { + interface NextContext { /** path section of URL */ pathname: string; /** query string section of URL parsed as an object */ - query: QueryStringMapObject; + query: Q; /** String of the actual path (including the query) shows in the browser */ asPath: string; /** HTTP request object (server only) */ @@ -39,20 +42,21 @@ declare namespace next { jsonPageRes?: NodeResponse; /** Error object if any error is encountered during the rendering */ err?: Error; - /** Whether we're running on the server environment or not. */ - isServer?: boolean; } - type NextSFC = NextStatelessComponent; - interface NextStatelessComponent + type NextSFC = NextStatelessComponent; + interface NextStatelessComponent extends React.StatelessComponent { - getInitialProps?: (ctx: NextContext) => Promise; + getInitialProps?: (ctx: NextContext) => Promise; } type UrlLike = url.UrlObject | url.Url; + /** + * Next.js config schema. + * https://github.com/zeit/next.js/blob/6.1.1/server/config.js#L10 + */ interface ServerConfig { - // known keys webpack?: any; webpackDevMiddleware?: any; poweredByHeader?: boolean; @@ -60,11 +64,20 @@ declare namespace next { assetPrefix?: string; configOrigin?: string; useFileSystemPublicRoutes?: boolean; + generateBuildId?: () => string; + generateEtags?: boolean; + pageExtensions?: string[]; + publicRuntimeConfig?: object; + serverRuntimeConfig?: object; - // and since this is a config, it can take anything else, too. + // Plugin can define their own keys. [key: string]: any; } + /** + * Options passed to the Server constructor in Node.js. + * https://github.com/zeit/next.js/blob/6.1.1/server/index.js#L30 + */ interface ServerOptions { dir?: string; dev?: boolean; @@ -73,8 +86,36 @@ declare namespace next { conf?: ServerConfig; } + /** + * Next.js server instance API. + */ interface Server { - setAssetPrefix: (cdnUrl: string) => void; + // From constructor + // https://github.com/zeit/next.js/blob/6.1.1/server/index.js#L30 + dir: string; + dev: boolean; + quiet: boolean; + router: SingletonRouter; + http: null | http.Server; + nextConfig: ServerConfig; + distDir: string; + buildId: string; + hotReloader: any; + renderOpts: { + dev: string; + staticMarkup: boolean; + distDir: string; + hotReloader: any; + buildId: string; + availableChunks: object; + generateETags: boolean; + runtimeConfig?: object; + }; + + getHotReloader( + dir: string, + options: { quiet: boolean; config: ServerConfig; buildId: string } + ): any; handleRequest( req: http.IncomingMessage, res: http.ServerResponse, @@ -85,6 +126,8 @@ declare namespace next { res: http.ServerResponse, parsedUrl?: UrlLike ) => Promise; + setAssetPrefix(prefix: string): void; + prepare(): Promise; close(): Promise; defineRoutes(): Promise; @@ -102,6 +145,12 @@ declare namespace next { query?: QueryStringMapObject, parsedUrl?: UrlLike ): Promise; + renderToHTML( + req: http.IncomingMessage, + res: http.ServerResponse, + pathname: string, + query?: QueryStringMapObject + ): Promise; renderError( err: any, req: http.IncomingMessage, @@ -109,17 +158,6 @@ declare namespace next { pathname: string, query?: QueryStringMapObject ): Promise; - render404( - req: http.IncomingMessage, - res: http.ServerResponse, - parsedUrl: UrlLike - ): Promise; - renderToHTML( - req: http.IncomingMessage, - res: http.ServerResponse, - pathname: string, - query?: QueryStringMapObject - ): Promise; renderErrorToHTML( err: any, req: http.IncomingMessage, @@ -127,6 +165,11 @@ declare namespace next { pathname: string, query?: QueryStringMapObject ): Promise; + render404( + req: http.IncomingMessage, + res: http.ServerResponse, + parsedUrl?: UrlLike + ): Promise; serveStatic( req: http.IncomingMessage, @@ -134,19 +177,9 @@ declare namespace next { path: string ): Promise; isServeableUrl(path: string): boolean; - isInternalUrl(req: http.IncomingMessage): boolean; readBuildId(): string; handleBuildId(buildId: string, res: http.ServerResponse): boolean; - getCompilationError( - page: string, - req: http.IncomingMessage, - res: http.ServerResponse - ): Promise; - handleBuildHash( - filename: string, - hash: string, - res: http.ServerResponse - ): void; + getCompilationError(): Promise; send404(res: http.ServerResponse): void; } } diff --git a/types/next/router.d.ts b/types/next/router.d.ts index fe3563d473..be3665e3d5 100644 --- a/types/next/router.d.ts +++ b/types/next/router.d.ts @@ -26,20 +26,22 @@ export type PopStateCallback = (state: any) => boolean | undefined; export type RouterCallback = () => void; -export interface RouterProps { +export interface DefaultQuery { + [key: string]: + | boolean + | boolean[] + | number + | number[] + | string + | string[]; +} + +export interface RouterProps { // url property fields readonly pathname: string; readonly route: string; readonly asPath?: string; - readonly query?: { - [key: string]: - | boolean - | boolean[] - | number - | number[] - | string - | string[]; - }; + readonly query?: Q; // property fields readonly components: { @@ -78,18 +80,22 @@ export interface RouterProps { }; } -export interface SingletonRouter extends RouterProps { - router: RouterProps | null; +export interface SingletonRouter extends RouterProps { + router: RouterProps | null; readyCallbacks: RouterCallback[]; ready(cb: RouterCallback): void; } -export interface WithRouterProps { - router: SingletonRouter; +export interface WithRouterProps { + router: SingletonRouter; } -export function withRouter( - Component: React.ComponentType, +// Manually disabling the no-unnecessary-generics rule so users can +// retain type inference if they warp their component in withRouter +// without defining props explicitly +export function withRouter( + // tslint:disable-next-line:no-unnecessary-generics + Component: React.ComponentType>, ): React.ComponentType; declare const Router: SingletonRouter; diff --git a/types/next/test/next-router-tests.tsx b/types/next/test/next-router-tests.tsx index fdcf1de3ff..04fa50b912 100644 --- a/types/next/test/next-router-tests.tsx +++ b/types/next/test/next-router-tests.tsx @@ -96,3 +96,13 @@ class TestComponent extends React.Component { } + +const TestSFC: React.SFC = ({ router }) => { + return

{router.query && router.query.test}
; +}; diff --git a/types/next/test/next-tests.ts b/types/next/test/next-tests.ts index ddbc51ee33..2e717f6698 100644 --- a/types/next/test/next-tests.ts +++ b/types/next/test/next-tests.ts @@ -10,13 +10,22 @@ const server = createServer({ distDir: "./dist", useFileSystemPublicRoutes: false, anotherProperty: { - key: true, - }, - }, + key: true + } + } }); -const voidFunc = () => {}; -const stringFunc = (x: string) => x.split("\n"); +const { + dir, + dev, + quiet, + router, + nextConfig, + distDir, + buildId + } = server; + const { assetPrefix } = nextConfig; + const voidFunc = () => {}; server.prepare().then(voidFunc); server.close().then(voidFunc); @@ -68,11 +77,9 @@ function handle(req: http.IncomingMessage, res: http.ServerResponse) { let b: boolean; b = server.isServeableUrl("/path/to/thing"); - b = server.isInternalUrl(req); b = server.handleBuildId("{buildId}", res); const s: string = server.readBuildId(); - server.getCompilationError("page", req, res).then(err => err.thisIsAnAny); - server.handleBuildHash("filename", "hash", res); + server.getCompilationError().then(err => err.thisIsAnAny); server.send404(res); } diff --git a/types/node-telegram-bot-api/index.d.ts b/types/node-telegram-bot-api/index.d.ts index 32f4ae8d85..934daa3fe3 100644 --- a/types/node-telegram-bot-api/index.d.ts +++ b/types/node-telegram-bot-api/index.d.ts @@ -904,96 +904,96 @@ declare class TelegramBot extends EventEmitter { hasOpenWebHook(): boolean; - getMe(): Promise; + getMe(): Promise; setWebHook(url: string, options?: TelegramBot.SetWebHookOptions): Promise; - deleteWebHook(): Promise; + deleteWebHook(): Promise; - getWebHookInfo(): Promise; + getWebHookInfo(): Promise; - getUpdates(options?: TelegramBot.GetUpdatesOptions): Promise; + getUpdates(options?: TelegramBot.GetUpdatesOptions): Promise; processUpdate(update: TelegramBot.Update): void; - sendMessage(chatId: number | string, text: string, options?: TelegramBot.SendMessageOptions): Promise; + sendMessage(chatId: number | string, text: string, options?: TelegramBot.SendMessageOptions): Promise; - answerInlineQuery(inlineQueryId: string, results: ReadonlyArray, options?: TelegramBot.AnswerInlineQueryOptions): Promise; + answerInlineQuery(inlineQueryId: string, results: ReadonlyArray, options?: TelegramBot.AnswerInlineQueryOptions): Promise; - forwardMessage(chatId: number | string, fromChatId: number | string, messageId: number | string, options?: TelegramBot.ForwardMessageOptions): Promise; + forwardMessage(chatId: number | string, fromChatId: number | string, messageId: number | string, options?: TelegramBot.ForwardMessageOptions): Promise; - sendPhoto(chatId: number | string, photo: string | Stream | Buffer, options?: TelegramBot.SendPhotoOptions): Promise; + sendPhoto(chatId: number | string, photo: string | Stream | Buffer, options?: TelegramBot.SendPhotoOptions): Promise; - sendAudio(chatId: number | string, audio: string | Stream | Buffer, options?: TelegramBot.SendAudioOptions): Promise; + sendAudio(chatId: number | string, audio: string | Stream | Buffer, options?: TelegramBot.SendAudioOptions): Promise; - sendDocument(chatId: number | string, doc: string | Stream | Buffer, options?: TelegramBot.SendDocumentOptions, fileOpts?: any): Promise; + sendDocument(chatId: number | string, doc: string | Stream | Buffer, options?: TelegramBot.SendDocumentOptions, fileOpts?: any): Promise; - sendMediaGroup(chatId: number | string, media: ReadonlyArray, options?: TelegramBot.SendMediaGroupOptions): Promise; + sendMediaGroup(chatId: number | string, media: ReadonlyArray, options?: TelegramBot.SendMediaGroupOptions): Promise; - sendSticker(chatId: number | string, sticker: string | Stream | Buffer, options?: TelegramBot.SendStickerOptions): Promise; + sendSticker(chatId: number | string, sticker: string | Stream | Buffer, options?: TelegramBot.SendStickerOptions): Promise; - sendVideo(chatId: number | string, video: string | Stream | Buffer, options?: TelegramBot.SendVideoOptions): Promise; + sendVideo(chatId: number | string, video: string | Stream | Buffer, options?: TelegramBot.SendVideoOptions): Promise; - sendVideoNote(chatId: number | string, videoNote: string | Stream | Buffer, options?: TelegramBot.SendVideoNoteOptions): Promise; + sendVideoNote(chatId: number | string, videoNote: string | Stream | Buffer, options?: TelegramBot.SendVideoNoteOptions): Promise; - sendVoice(chatId: number | string, voice: string | Stream | Buffer, options?: TelegramBot.SendVoiceOptions): Promise; + sendVoice(chatId: number | string, voice: string | Stream | Buffer, options?: TelegramBot.SendVoiceOptions): Promise; - sendChatAction(chatId: number | string, action: TelegramBot.ChatAction): Promise; + sendChatAction(chatId: number | string, action: TelegramBot.ChatAction): Promise; - kickChatMember(chatId: number | string, userId: string): Promise; + kickChatMember(chatId: number | string, userId: string): Promise; - unbanChatMember(chatId: number | string, userId: string): Promise; + unbanChatMember(chatId: number | string, userId: string): Promise; - restrictChatMember(chatId: number | string, userId: string, options?: TelegramBot.RestrictChatMemberOptions): Promise; + restrictChatMember(chatId: number | string, userId: string, options?: TelegramBot.RestrictChatMemberOptions): Promise; - promoteChatMember(chatId: number | string, userId: string, options?: TelegramBot.PromoteChatMemberOptions): Promise; + promoteChatMember(chatId: number | string, userId: string, options?: TelegramBot.PromoteChatMemberOptions): Promise; - exportChatInviteLink(chatId: number | string): Promise; + exportChatInviteLink(chatId: number | string): Promise; - setChatPhoto(chatId: number | string, photo: string | Stream | Buffer): Promise; + setChatPhoto(chatId: number | string, photo: string | Stream | Buffer): Promise; - deleteChatPhoto(chatId: number | string): Promise; + deleteChatPhoto(chatId: number | string): Promise; - setChatTitle(chatId: number | string, title: string): Promise; + setChatTitle(chatId: number | string, title: string): Promise; - setChatDescription(chatId: number | string, description: string): Promise; + setChatDescription(chatId: number | string, description: string): Promise; - pinChatMessage(chatId: number | string, messageId: string): Promise; + pinChatMessage(chatId: number | string, messageId: string): Promise; - unpinChatMessage(chatId: number | string): Promise; + unpinChatMessage(chatId: number | string): Promise; - answerCallbackQuery(callbackQueryId: string, options?: Partial): Promise; + answerCallbackQuery(callbackQueryId: string, options?: Partial): Promise; /** * @deprecated since version 0.30.0 */ - answerCallbackQuery(options?: TelegramBot.AnswerCallbackQueryOptions): Promise; + answerCallbackQuery(options?: TelegramBot.AnswerCallbackQueryOptions): Promise; - editMessageText(text: string, options?: TelegramBot.EditMessageTextOptions): Promise; + editMessageText(text: string, options?: TelegramBot.EditMessageTextOptions): Promise; - editMessageCaption(caption: string, options?: TelegramBot.EditMessageCaptionOptions): Promise; + editMessageCaption(caption: string, options?: TelegramBot.EditMessageCaptionOptions): Promise; - editMessageReplyMarkup(replyMarkup: TelegramBot.InlineKeyboardMarkup, options?: TelegramBot.EditMessageReplyMarkupOptions): Promise; + editMessageReplyMarkup(replyMarkup: TelegramBot.InlineKeyboardMarkup, options?: TelegramBot.EditMessageReplyMarkupOptions): Promise; - getUserProfilePhotos(userId: number | string, options?: TelegramBot.GetUserProfilePhotosOptions): Promise; + getUserProfilePhotos(userId: number | string, options?: TelegramBot.GetUserProfilePhotosOptions): Promise; - sendLocation(chatId: number | string, latitude: number, longitude: number, options?: TelegramBot.SendLocationOptions): Promise; + sendLocation(chatId: number | string, latitude: number, longitude: number, options?: TelegramBot.SendLocationOptions): Promise; - editMessageLiveLocation(latitude: number, longitude: number, options?: TelegramBot.EditMessageLiveLocationOptions): Promise; + editMessageLiveLocation(latitude: number, longitude: number, options?: TelegramBot.EditMessageLiveLocationOptions): Promise; - stopMessageLiveLocation(options?: TelegramBot.StopMessageLiveLocationOptions): Promise; + stopMessageLiveLocation(options?: TelegramBot.StopMessageLiveLocationOptions): Promise; - sendVenue(chatId: number | string, latitude: number, longitude: number, title: string, address: string, options?: TelegramBot.SendVenueOptions): Promise; + sendVenue(chatId: number | string, latitude: number, longitude: number, title: string, address: string, options?: TelegramBot.SendVenueOptions): Promise; - sendContact(chatId: number | string, phoneNumber: string, firstName: string, options?: TelegramBot.SendContactOptions): Promise; + sendContact(chatId: number | string, phoneNumber: string, firstName: string, options?: TelegramBot.SendContactOptions): Promise; - getFile(fileId: string): Promise; + getFile(fileId: string): Promise; - getFileLink(fileId: string): Promise; + getFileLink(fileId: string): Promise; getFileStream(fileId: string): Readable; - downloadFile(fileId: string, downloadDir: string): Promise; + downloadFile(fileId: string, downloadDir: string): Promise; onText(regexp: RegExp, callback: ((msg: TelegramBot.Message, match: RegExpExecArray | null) => void)): void; @@ -1003,34 +1003,34 @@ declare class TelegramBot extends EventEmitter { removeReplyListener(replyListenerId: number): TelegramBot.ReplyListener; - getChat(chatId: number | string): Promise; + getChat(chatId: number | string): Promise; - getChatAdministrators(chatId: number | string): Promise; + getChatAdministrators(chatId: number | string): Promise; - getChatMembersCount(chatId: number | string): Promise; + getChatMembersCount(chatId: number | string): Promise; - getChatMember(chatId: number | string, userId: string): Promise; + getChatMember(chatId: number | string, userId: string): Promise; - leaveChat(chatId: number | string): Promise; + leaveChat(chatId: number | string): Promise; - setChatStickerSet(chatId: number | string, stickerSetName: string): Promise; + setChatStickerSet(chatId: number | string, stickerSetName: string): Promise; - deleteChatStickerSet(chatId: number | string): Promise; + deleteChatStickerSet(chatId: number | string): Promise; - sendGame(chatId: number | string, gameShortName: string, options?: TelegramBot.SendGameOptions): Promise; + sendGame(chatId: number | string, gameShortName: string, options?: TelegramBot.SendGameOptions): Promise; - setGameScore(userId: string, score: number, options?: TelegramBot.SetGameScoreOptions): Promise; + setGameScore(userId: string, score: number, options?: TelegramBot.SetGameScoreOptions): Promise; - getGameHighScores(userId: string, options?: TelegramBot.GetGameHighScoresOptions): Promise; + getGameHighScores(userId: string, options?: TelegramBot.GetGameHighScoresOptions): Promise; - deleteMessage(chatId: number | string, messageId: string, options?: any): Promise; + deleteMessage(chatId: number | string, messageId: string, options?: any): Promise; sendInvoice(chatId: number | string, title: string, description: string, payload: string, providerToken: string, startParameter: string, currency: string, - prices: ReadonlyArray, options?: TelegramBot.SendInvoiceOptions): Promise; + prices: ReadonlyArray, options?: TelegramBot.SendInvoiceOptions): Promise; - answerShippingQuery(shippingQueryId: string, ok: boolean, options?: TelegramBot.AnswerShippingQueryOptions): Promise; + answerShippingQuery(shippingQueryId: string, ok: boolean, options?: TelegramBot.AnswerShippingQueryOptions): Promise; - answerPreCheckoutQuery(preCheckoutQueryId: string, ok: boolean, options?: TelegramBot.AnswerPreCheckoutQueryOptions): Promise; + answerPreCheckoutQuery(preCheckoutQueryId: string, ok: boolean, options?: TelegramBot.AnswerPreCheckoutQueryOptions): Promise; } export = TelegramBot; diff --git a/types/node-telegram-bot-api/node-telegram-bot-api-tests.ts b/types/node-telegram-bot-api/node-telegram-bot-api-tests.ts index b4b09485cb..49368e74ec 100644 --- a/types/node-telegram-bot-api/node-telegram-bot-api-tests.ts +++ b/types/node-telegram-bot-api/node-telegram-bot-api-tests.ts @@ -9,6 +9,9 @@ MyTelegramBot.openWebHook(); MyTelegramBot.closeWebHook(); MyTelegramBot.hasOpenWebHook(); MyTelegramBot.getMe(); +MyTelegramBot.getMe().then((value: TelegramBot.User) => { + const username = value.username; +}); MyTelegramBot.setWebHook('http://typescriptlang.org', {max_connections: 100}); MyTelegramBot.deleteWebHook(); MyTelegramBot.getWebHookInfo(); diff --git a/types/node/index.d.ts b/types/node/index.d.ts index 63b06965f6..2ce2d7299e 100644 --- a/types/node/index.d.ts +++ b/types/node/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Node.js 10.7.x +// Type definitions for Node.js 10.9.x // Project: http://nodejs.org/ // Definitions by: Microsoft TypeScript // DefinitelyTyped @@ -186,11 +186,11 @@ interface String { trimRight(): string; } -/************************************************ -* * -* GLOBAL * -* * -************************************************/ +/*-----------------------------------------------* + * * + * GLOBAL * + * * + ------------------------------------------------*/ declare var process: NodeJS.Process; declare var global: NodeJS.Global; declare var console: Console; @@ -468,11 +468,11 @@ declare var Buffer: { poolSize: number; }; -/************************************************ +/*----------------------------------------------* * * * GLOBAL INTERFACES * * * -************************************************/ +*-----------------------------------------------*/ declare namespace NodeJS { export interface InspectOptions { showHidden?: boolean; @@ -988,11 +988,11 @@ declare namespace NodeJS { interface IterableIterator { } -/************************************************ +/*----------------------------------------------* * * * MODULES * * * -************************************************/ +*-----------------------------------------------*/ declare module "buffer" { export var INSPECT_MAX_BYTES: number; var BuffType: typeof Buffer; @@ -1289,7 +1289,9 @@ declare module "http" { // create interface RequestOptions would make the naming more clear to developers export interface RequestOptions extends ClientRequestArgs { } export function request(options: RequestOptions | string | URL, callback?: (res: IncomingMessage) => void): ClientRequest; + export function request(url: string | URL, options: RequestOptions, callback?: (res: IncomingMessage) => void): ClientRequest; export function get(options: RequestOptions | string | URL, callback?: (res: IncomingMessage) => void): ClientRequest; + export function get(url: string | URL, options: RequestOptions, callback?: (res: IncomingMessage) => void): ClientRequest; export var globalAgent: Agent; } @@ -1708,6 +1710,7 @@ declare module "os" { netmask: string; mac: string; internal: boolean; + cidr: string | null; } export interface NetworkInterfaceInfoIPv4 extends NetworkInterfaceBase { @@ -1891,7 +1894,9 @@ declare module "https" { export function createServer(options: ServerOptions, requestListener?: (req: http.IncomingMessage, res: http.ServerResponse) => void): Server; export function request(options: RequestOptions | string | URL, callback?: (res: http.IncomingMessage) => void): http.ClientRequest; + export function request(url: string | URL, options: RequestOptions, callback?: (res: http.IncomingMessage) => void): http.ClientRequest; export function get(options: RequestOptions | string | URL, callback?: (res: http.IncomingMessage) => void): http.ClientRequest; + export function get(url: string | URL, options: RequestOptions, callback?: (res: http.IncomingMessage) => void): http.ClientRequest; export var globalAgent: Agent; } @@ -2198,7 +2203,7 @@ declare module "child_process" { keepOpen?: boolean; } - export type StdioOptions = "pipe" | "ignore" | "inherit" | Array<("pipe" | "ipc" | "ignore" | stream.Stream | number | null | undefined)>; + export type StdioOptions = "pipe" | "ignore" | "inherit" | Array<("pipe" | "ipc" | "ignore" | "inherit" | stream.Stream | number | null | undefined)>; export interface SpawnOptions { cwd?: string; @@ -5899,13 +5904,15 @@ declare module "crypto" { authTagLength?: number; } /** @deprecated since v10.0.0 use createCipheriv() */ - export function createCipher(algorithm: string, password: string | Buffer | NodeJS.TypedArray | DataView, options?: stream.TransformOptions): Cipher; export function createCipher(algorithm: CipherCCMTypes, password: string | Buffer | NodeJS.TypedArray | DataView, options: CipherCCMOptions): CipherCCM; - export function createCipher(algorithm: CipherGCMTypes, password: string | Buffer | NodeJS.TypedArray | DataView, options: CipherGCMOptions): CipherGCM; + /** @deprecated since v10.0.0 use createCipheriv() */ + export function createCipher(algorithm: CipherGCMTypes, password: string | Buffer | NodeJS.TypedArray | DataView, options?: CipherGCMOptions): CipherGCM; + /** @deprecated since v10.0.0 use createCipheriv() */ + export function createCipher(algorithm: string, password: string | Buffer | NodeJS.TypedArray | DataView, options?: stream.TransformOptions): Cipher; + export function createCipheriv(algorithm: CipherCCMTypes, key: string | Buffer | NodeJS.TypedArray | DataView, iv: string | Buffer | NodeJS.TypedArray | DataView, options: CipherCCMOptions): CipherCCM; + export function createCipheriv(algorithm: CipherGCMTypes, key: string | Buffer | NodeJS.TypedArray | DataView, iv: string | Buffer | NodeJS.TypedArray | DataView, options?: CipherGCMOptions): CipherGCM; export function createCipheriv(algorithm: string, key: string | Buffer | NodeJS.TypedArray | DataView, iv: string | Buffer | NodeJS.TypedArray | DataView, options?: stream.TransformOptions): Cipher; - export function createCipheriv(algorithm: CipherGCMTypes, key: string | Buffer | NodeJS.TypedArray | DataView, iv: string | Buffer | NodeJS.TypedArray | DataView, options: CipherCCMOptions): CipherCCM; - export function createCipheriv(algorithm: CipherGCMTypes, key: string | Buffer | NodeJS.TypedArray | DataView, iv: string | Buffer | NodeJS.TypedArray | DataView, options: CipherGCMOptions): CipherGCM; export interface Cipher extends NodeJS.ReadWriteStream { update(data: string | Buffer | NodeJS.TypedArray | DataView): Buffer; @@ -5921,21 +5928,23 @@ declare module "crypto" { // setAAD(buffer: Buffer): this; // docs only say buffer } export interface CipherCCM extends Cipher { - setAAD(buffer: Buffer, options: { plainTextLength: number }): this; + setAAD(buffer: Buffer, options: { plaintextLength: number }): this; getAuthTag(): Buffer; } export interface CipherGCM extends Cipher { - setAAD(buffer: Buffer, options?: { plainTextLength: number }): this; + setAAD(buffer: Buffer, options?: { plaintextLength: number }): this; getAuthTag(): Buffer; } /** @deprecated since v10.0.0 use createCipheriv() */ - export function createDecipher(algorithm: string, password: string | Buffer | NodeJS.TypedArray | DataView, options?: stream.TransformOptions): Decipher; export function createDecipher(algorithm: CipherCCMTypes, password: string | Buffer | NodeJS.TypedArray | DataView, options: CipherCCMOptions): DecipherCCM; - export function createDecipher(algorithm: CipherGCMTypes, password: string | Buffer | NodeJS.TypedArray | DataView, options: CipherGCMOptions): DecipherGCM; + /** @deprecated since v10.0.0 use createCipheriv() */ + export function createDecipher(algorithm: CipherGCMTypes, password: string | Buffer | NodeJS.TypedArray | DataView, options?: CipherGCMOptions): DecipherGCM; + /** @deprecated since v10.0.0 use createCipheriv() */ + export function createDecipher(algorithm: string, password: string | Buffer | NodeJS.TypedArray | DataView, options?: stream.TransformOptions): Decipher; - export function createDecipheriv(algorithm: string, key: string | Buffer | NodeJS.TypedArray | DataView, iv: string | Buffer | NodeJS.TypedArray | DataView, options?: stream.TransformOptions): Decipher; export function createDecipheriv(algorithm: CipherCCMTypes, key: string | Buffer | NodeJS.TypedArray | DataView, iv: string | Buffer | NodeJS.TypedArray | DataView, options: CipherCCMOptions): DecipherCCM; - export function createDecipheriv(algorithm: CipherGCMTypes, key: string | Buffer | NodeJS.TypedArray | DataView, iv: string | Buffer | NodeJS.TypedArray | DataView, options: CipherGCMOptions): DecipherGCM; + export function createDecipheriv(algorithm: CipherGCMTypes, key: string | Buffer | NodeJS.TypedArray | DataView, iv: string | Buffer | NodeJS.TypedArray | DataView, options?: CipherGCMOptions): DecipherGCM; + export function createDecipheriv(algorithm: string, key: string | Buffer | NodeJS.TypedArray | DataView, iv: string | Buffer | NodeJS.TypedArray | DataView, options?: stream.TransformOptions): Decipher; export interface Decipher extends NodeJS.ReadWriteStream { update(data: Buffer | NodeJS.TypedArray | DataView): Buffer; @@ -5950,12 +5959,12 @@ declare module "crypto" { // setAAD(buffer: Buffer | NodeJS.TypedArray | DataView): this; } export interface DecipherCCM extends Decipher { - setAuthTag(buffer: Buffer | NodeJS.TypedArray | DataView, options: { plainTextLength: number }): this; - setAAD(buffer: Buffer | NodeJS.TypedArray | DataView): this; + setAuthTag(buffer: Buffer | NodeJS.TypedArray | DataView): this; + setAAD(buffer: Buffer | NodeJS.TypedArray | DataView, options: { plaintextLength: number }): this; } export interface DecipherGCM extends Decipher { - setAuthTag(buffer: Buffer | NodeJS.TypedArray | DataView, options?: { plainTextLength: number }): this; - setAAD(buffer: Buffer | NodeJS.TypedArray | DataView): this; + setAuthTag(buffer: Buffer | NodeJS.TypedArray | DataView): this; + setAAD(buffer: Buffer | NodeJS.TypedArray | DataView, options?: { plaintextLength: number }): this; } export function createSign(algorithm: string, options?: stream.WritableOptions): Signer; @@ -6327,6 +6336,7 @@ declare module "stream" { declare module "util" { export interface InspectOptions extends NodeJS.InspectOptions { } export function format(format: any, ...param: any[]): string; + export function formatWithOptions(inspectOptions: InspectOptions, format: string, ...param: any[]): string; /** @deprecated since v0.11.3 - use `console.error()` instead. */ export function debug(string: string): void; /** @deprecated since v0.11.3 - use `console.error()` instead. */ @@ -6405,17 +6415,17 @@ declare module "util" { export function promisify(fn: CustomPromisify): TCustom; export function promisify(fn: (callback: (err: Error | null, result: TResult) => void) => void): () => Promise; - export function promisify(fn: (callback: (err: Error | null) => void) => void): () => Promise; + export function promisify(fn: (callback: (err?: Error | null) => void) => void): () => Promise; export function promisify(fn: (arg1: T1, callback: (err: Error | null, result: TResult) => void) => void): (arg1: T1) => Promise; - export function promisify(fn: (arg1: T1, callback: (err: Error | null) => void) => void): (arg1: T1) => Promise; + export function promisify(fn: (arg1: T1, callback: (err?: Error | null) => void) => void): (arg1: T1) => Promise; export function promisify(fn: (arg1: T1, arg2: T2, callback: (err: Error | null, result: TResult) => void) => void): (arg1: T1, arg2: T2) => Promise; - export function promisify(fn: (arg1: T1, arg2: T2, callback: (err: Error | null) => void) => void): (arg1: T1, arg2: T2) => Promise; + export function promisify(fn: (arg1: T1, arg2: T2, callback: (err?: Error | null) => void) => void): (arg1: T1, arg2: T2) => Promise; export function promisify(fn: (arg1: T1, arg2: T2, arg3: T3, callback: (err: Error | null, result: TResult) => void) => void): (arg1: T1, arg2: T2, arg3: T3) => Promise; - export function promisify(fn: (arg1: T1, arg2: T2, arg3: T3, callback: (err: Error | null) => void) => void): (arg1: T1, arg2: T2, arg3: T3) => Promise; + export function promisify(fn: (arg1: T1, arg2: T2, arg3: T3, callback: (err?: Error | null) => void) => void): (arg1: T1, arg2: T2, arg3: T3) => Promise; export function promisify(fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, callback: (err: Error | null, result: TResult) => void) => void): (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Promise; - export function promisify(fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, callback: (err: Error | null) => void) => void): (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Promise; + export function promisify(fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, callback: (err?: Error | null) => void) => void): (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Promise; export function promisify(fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, callback: (err: Error | null, result: TResult) => void) => void): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => Promise; - export function promisify(fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, callback: (err: Error | null) => void) => void): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => Promise; + export function promisify(fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, callback: (err?: Error | null) => void) => void): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => Promise; export function promisify(fn: Function): Function; export namespace promisify { const custom: symbol; diff --git a/types/node/inspector.d.ts b/types/node/inspector.d.ts index 955239b486..474c481d5a 100644 --- a/types/node/inspector.d.ts +++ b/types/node/inspector.d.ts @@ -15,26 +15,1075 @@ declare module "inspector" { params: T; } - export namespace Schema { + export namespace Console { /** - * Description of the protocol domain. + * Console message. */ - export interface Domain { + export interface ConsoleMessage { /** - * Domain name. + * Message source. */ - name: string; + source: string; /** - * Domain version. + * Message severity. */ - version: string; + level: string; + /** + * Message text. + */ + text: string; + /** + * URL of the message origin. + */ + url?: string; + /** + * Line number in the resource that generated this message (1-based). + */ + line?: number; + /** + * Column number in the resource that generated this message (1-based). + */ + column?: number; } - export interface GetDomainsReturnType { + export interface MessageAddedEventDataType { /** - * List of supported domains. + * Console message that has been added. */ - domains: Schema.Domain[]; + message: Console.ConsoleMessage; + } + } + + export namespace Debugger { + /** + * Breakpoint identifier. + */ + export type BreakpointId = string; + + /** + * Call frame identifier. + */ + export type CallFrameId = string; + + /** + * Location in the source code. + */ + export interface Location { + /** + * Script identifier as reported in the `Debugger.scriptParsed`. + */ + scriptId: Runtime.ScriptId; + /** + * Line number in the script (0-based). + */ + lineNumber: number; + /** + * Column number in the script (0-based). + */ + columnNumber?: number; + } + + /** + * Location in the source code. + * @experimental + */ + export interface ScriptPosition { + lineNumber: number; + columnNumber: number; + } + + /** + * JavaScript call frame. Array of call frames form the call stack. + */ + export interface CallFrame { + /** + * Call frame identifier. This identifier is only valid while the virtual machine is paused. + */ + callFrameId: Debugger.CallFrameId; + /** + * Name of the JavaScript function called on this call frame. + */ + functionName: string; + /** + * Location in the source code. + */ + functionLocation?: Debugger.Location; + /** + * Location in the source code. + */ + location: Debugger.Location; + /** + * JavaScript script name or url. + */ + url: string; + /** + * Scope chain for this call frame. + */ + scopeChain: Debugger.Scope[]; + /** + * `this` object for this call frame. + */ + this: Runtime.RemoteObject; + /** + * The value being returned, if the function is at return point. + */ + returnValue?: Runtime.RemoteObject; + } + + /** + * Scope description. + */ + export interface Scope { + /** + * Scope type. + */ + type: string; + /** + * Object representing the scope. For `global` and `with` scopes it represents the actual +object; for the rest of the scopes, it is artificial transient object enumerating scope +variables as its properties. + */ + object: Runtime.RemoteObject; + name?: string; + /** + * Location in the source code where scope starts + */ + startLocation?: Debugger.Location; + /** + * Location in the source code where scope ends + */ + endLocation?: Debugger.Location; + } + + /** + * Search match for resource. + */ + export interface SearchMatch { + /** + * Line number in resource content. + */ + lineNumber: number; + /** + * Line with match content. + */ + lineContent: string; + } + + export interface BreakLocation { + /** + * Script identifier as reported in the `Debugger.scriptParsed`. + */ + scriptId: Runtime.ScriptId; + /** + * Line number in the script (0-based). + */ + lineNumber: number; + /** + * Column number in the script (0-based). + */ + columnNumber?: number; + type?: string; + } + + export interface ContinueToLocationParameterType { + /** + * Location to continue to. + */ + location: Debugger.Location; + targetCallFrames?: string; + } + + export interface EvaluateOnCallFrameParameterType { + /** + * Call frame identifier to evaluate on. + */ + callFrameId: Debugger.CallFrameId; + /** + * Expression to evaluate. + */ + expression: string; + /** + * String object group name to put result into (allows rapid releasing resulting object handles +using `releaseObjectGroup`). + */ + objectGroup?: string; + /** + * Specifies whether command line API should be available to the evaluated expression, defaults +to false. + */ + includeCommandLineAPI?: boolean; + /** + * In silent mode exceptions thrown during evaluation are not reported and do not pause +execution. Overrides `setPauseOnException` state. + */ + silent?: boolean; + /** + * Whether the result is expected to be a JSON object that should be sent by value. + */ + returnByValue?: boolean; + /** + * Whether preview should be generated for the result. + * @experimental + */ + generatePreview?: boolean; + /** + * Whether to throw an exception if side effect cannot be ruled out during evaluation. + */ + throwOnSideEffect?: boolean; + } + + export interface GetPossibleBreakpointsParameterType { + /** + * Start of range to search possible breakpoint locations in. + */ + start: Debugger.Location; + /** + * End of range to search possible breakpoint locations in (excluding). When not specified, end +of scripts is used as end of range. + */ + end?: Debugger.Location; + /** + * Only consider locations which are in the same (non-nested) function as start. + */ + restrictToFunction?: boolean; + } + + export interface GetScriptSourceParameterType { + /** + * Id of the script to get source for. + */ + scriptId: Runtime.ScriptId; + } + + export interface GetStackTraceParameterType { + stackTraceId: Runtime.StackTraceId; + } + + export interface PauseOnAsyncCallParameterType { + /** + * Debugger will pause when async call with given stack trace is started. + */ + parentStackTraceId: Runtime.StackTraceId; + } + + export interface RemoveBreakpointParameterType { + breakpointId: Debugger.BreakpointId; + } + + export interface RestartFrameParameterType { + /** + * Call frame identifier to evaluate on. + */ + callFrameId: Debugger.CallFrameId; + } + + export interface SearchInContentParameterType { + /** + * Id of the script to search in. + */ + scriptId: Runtime.ScriptId; + /** + * String to search for. + */ + query: string; + /** + * If true, search is case sensitive. + */ + caseSensitive?: boolean; + /** + * If true, treats string parameter as regex. + */ + isRegex?: boolean; + } + + export interface SetAsyncCallStackDepthParameterType { + /** + * Maximum depth of async call stacks. Setting to `0` will effectively disable collecting async +call stacks (default). + */ + maxDepth: number; + } + + export interface SetBlackboxPatternsParameterType { + /** + * Array of regexps that will be used to check script url for blackbox state. + */ + patterns: string[]; + } + + export interface SetBlackboxedRangesParameterType { + /** + * Id of the script. + */ + scriptId: Runtime.ScriptId; + positions: Debugger.ScriptPosition[]; + } + + export interface SetBreakpointParameterType { + /** + * Location to set breakpoint in. + */ + location: Debugger.Location; + /** + * Expression to use as a breakpoint condition. When specified, debugger will only stop on the +breakpoint if this expression evaluates to true. + */ + condition?: string; + } + + export interface SetBreakpointByUrlParameterType { + /** + * Line number to set breakpoint at. + */ + lineNumber: number; + /** + * URL of the resources to set breakpoint on. + */ + url?: string; + /** + * Regex pattern for the URLs of the resources to set breakpoints on. Either `url` or +`urlRegex` must be specified. + */ + urlRegex?: string; + /** + * Script hash of the resources to set breakpoint on. + */ + scriptHash?: string; + /** + * Offset in the line to set breakpoint at. + */ + columnNumber?: number; + /** + * Expression to use as a breakpoint condition. When specified, debugger will only stop on the +breakpoint if this expression evaluates to true. + */ + condition?: string; + } + + export interface SetBreakpointsActiveParameterType { + /** + * New value for breakpoints active state. + */ + active: boolean; + } + + export interface SetPauseOnExceptionsParameterType { + /** + * Pause on exceptions mode. + */ + state: string; + } + + export interface SetReturnValueParameterType { + /** + * New return value. + */ + newValue: Runtime.CallArgument; + } + + export interface SetScriptSourceParameterType { + /** + * Id of the script to edit. + */ + scriptId: Runtime.ScriptId; + /** + * New content of the script. + */ + scriptSource: string; + /** + * If true the change will not actually be applied. Dry run may be used to get result +description without actually modifying the code. + */ + dryRun?: boolean; + } + + export interface SetSkipAllPausesParameterType { + /** + * New value for skip pauses state. + */ + skip: boolean; + } + + export interface SetVariableValueParameterType { + /** + * 0-based number of scope as was listed in scope chain. Only 'local', 'closure' and 'catch' +scope types are allowed. Other scopes could be manipulated manually. + */ + scopeNumber: number; + /** + * Variable name. + */ + variableName: string; + /** + * New variable value. + */ + newValue: Runtime.CallArgument; + /** + * Id of callframe that holds variable. + */ + callFrameId: Debugger.CallFrameId; + } + + export interface StepIntoParameterType { + /** + * Debugger will issue additional Debugger.paused notification if any async task is scheduled +before next pause. + * @experimental + */ + breakOnAsyncCall?: boolean; + } + + export interface EnableReturnType { + /** + * Unique identifier of the debugger. + * @experimental + */ + debuggerId: Runtime.UniqueDebuggerId; + } + + export interface EvaluateOnCallFrameReturnType { + /** + * Object wrapper for the evaluation result. + */ + result: Runtime.RemoteObject; + /** + * Exception details. + */ + exceptionDetails?: Runtime.ExceptionDetails; + } + + export interface GetPossibleBreakpointsReturnType { + /** + * List of the possible breakpoint locations. + */ + locations: Debugger.BreakLocation[]; + } + + export interface GetScriptSourceReturnType { + /** + * Script source. + */ + scriptSource: string; + } + + export interface GetStackTraceReturnType { + stackTrace: Runtime.StackTrace; + } + + export interface RestartFrameReturnType { + /** + * New stack trace. + */ + callFrames: Debugger.CallFrame[]; + /** + * Async stack trace, if any. + */ + asyncStackTrace?: Runtime.StackTrace; + /** + * Async stack trace, if any. + * @experimental + */ + asyncStackTraceId?: Runtime.StackTraceId; + } + + export interface SearchInContentReturnType { + /** + * List of search matches. + */ + result: Debugger.SearchMatch[]; + } + + export interface SetBreakpointReturnType { + /** + * Id of the created breakpoint for further reference. + */ + breakpointId: Debugger.BreakpointId; + /** + * Location this breakpoint resolved into. + */ + actualLocation: Debugger.Location; + } + + export interface SetBreakpointByUrlReturnType { + /** + * Id of the created breakpoint for further reference. + */ + breakpointId: Debugger.BreakpointId; + /** + * List of the locations this breakpoint resolved into upon addition. + */ + locations: Debugger.Location[]; + } + + export interface SetScriptSourceReturnType { + /** + * New stack trace in case editing has happened while VM was stopped. + */ + callFrames?: Debugger.CallFrame[]; + /** + * Whether current call stack was modified after applying the changes. + */ + stackChanged?: boolean; + /** + * Async stack trace, if any. + */ + asyncStackTrace?: Runtime.StackTrace; + /** + * Async stack trace, if any. + * @experimental + */ + asyncStackTraceId?: Runtime.StackTraceId; + /** + * Exception details if any. + */ + exceptionDetails?: Runtime.ExceptionDetails; + } + + export interface BreakpointResolvedEventDataType { + /** + * Breakpoint unique identifier. + */ + breakpointId: Debugger.BreakpointId; + /** + * Actual breakpoint location. + */ + location: Debugger.Location; + } + + export interface PausedEventDataType { + /** + * Call stack the virtual machine stopped on. + */ + callFrames: Debugger.CallFrame[]; + /** + * Pause reason. + */ + reason: string; + /** + * Object containing break-specific auxiliary properties. + */ + data?: {}; + /** + * Hit breakpoints IDs + */ + hitBreakpoints?: string[]; + /** + * Async stack trace, if any. + */ + asyncStackTrace?: Runtime.StackTrace; + /** + * Async stack trace, if any. + * @experimental + */ + asyncStackTraceId?: Runtime.StackTraceId; + /** + * Just scheduled async call will have this stack trace as parent stack during async execution. +This field is available only after `Debugger.stepInto` call with `breakOnAsynCall` flag. + * @experimental + */ + asyncCallStackTraceId?: Runtime.StackTraceId; + } + + export interface ScriptFailedToParseEventDataType { + /** + * Identifier of the script parsed. + */ + scriptId: Runtime.ScriptId; + /** + * URL or name of the script parsed (if any). + */ + url: string; + /** + * Line offset of the script within the resource with given URL (for script tags). + */ + startLine: number; + /** + * Column offset of the script within the resource with given URL. + */ + startColumn: number; + /** + * Last line of the script. + */ + endLine: number; + /** + * Length of the last line of the script. + */ + endColumn: number; + /** + * Specifies script creation context. + */ + executionContextId: Runtime.ExecutionContextId; + /** + * Content hash of the script. + */ + hash: string; + /** + * Embedder-specific auxiliary data. + */ + executionContextAuxData?: {}; + /** + * URL of source map associated with script (if any). + */ + sourceMapURL?: string; + /** + * True, if this script has sourceURL. + */ + hasSourceURL?: boolean; + /** + * True, if this script is ES6 module. + */ + isModule?: boolean; + /** + * This script length. + */ + length?: number; + /** + * JavaScript top stack frame of where the script parsed event was triggered if available. + * @experimental + */ + stackTrace?: Runtime.StackTrace; + } + + export interface ScriptParsedEventDataType { + /** + * Identifier of the script parsed. + */ + scriptId: Runtime.ScriptId; + /** + * URL or name of the script parsed (if any). + */ + url: string; + /** + * Line offset of the script within the resource with given URL (for script tags). + */ + startLine: number; + /** + * Column offset of the script within the resource with given URL. + */ + startColumn: number; + /** + * Last line of the script. + */ + endLine: number; + /** + * Length of the last line of the script. + */ + endColumn: number; + /** + * Specifies script creation context. + */ + executionContextId: Runtime.ExecutionContextId; + /** + * Content hash of the script. + */ + hash: string; + /** + * Embedder-specific auxiliary data. + */ + executionContextAuxData?: {}; + /** + * True, if this script is generated as a result of the live edit operation. + * @experimental + */ + isLiveEdit?: boolean; + /** + * URL of source map associated with script (if any). + */ + sourceMapURL?: string; + /** + * True, if this script has sourceURL. + */ + hasSourceURL?: boolean; + /** + * True, if this script is ES6 module. + */ + isModule?: boolean; + /** + * This script length. + */ + length?: number; + /** + * JavaScript top stack frame of where the script parsed event was triggered if available. + * @experimental + */ + stackTrace?: Runtime.StackTrace; + } + } + + export namespace HeapProfiler { + /** + * Heap snapshot object id. + */ + export type HeapSnapshotObjectId = string; + + /** + * Sampling Heap Profile node. Holds callsite information, allocation statistics and child nodes. + */ + export interface SamplingHeapProfileNode { + /** + * Function location. + */ + callFrame: Runtime.CallFrame; + /** + * Allocations size in bytes for the node excluding children. + */ + selfSize: number; + /** + * Child nodes. + */ + children: HeapProfiler.SamplingHeapProfileNode[]; + } + + /** + * Profile. + */ + export interface SamplingHeapProfile { + head: HeapProfiler.SamplingHeapProfileNode; + } + + export interface AddInspectedHeapObjectParameterType { + /** + * Heap snapshot object id to be accessible by means of $x command line API. + */ + heapObjectId: HeapProfiler.HeapSnapshotObjectId; + } + + export interface GetHeapObjectIdParameterType { + /** + * Identifier of the object to get heap object id for. + */ + objectId: Runtime.RemoteObjectId; + } + + export interface GetObjectByHeapObjectIdParameterType { + objectId: HeapProfiler.HeapSnapshotObjectId; + /** + * Symbolic group name that can be used to release multiple objects. + */ + objectGroup?: string; + } + + export interface StartSamplingParameterType { + /** + * Average sample interval in bytes. Poisson distribution is used for the intervals. The +default value is 32768 bytes. + */ + samplingInterval?: number; + } + + export interface StartTrackingHeapObjectsParameterType { + trackAllocations?: boolean; + } + + export interface StopTrackingHeapObjectsParameterType { + /** + * If true 'reportHeapSnapshotProgress' events will be generated while snapshot is being taken +when the tracking is stopped. + */ + reportProgress?: boolean; + } + + export interface TakeHeapSnapshotParameterType { + /** + * If true 'reportHeapSnapshotProgress' events will be generated while snapshot is being taken. + */ + reportProgress?: boolean; + } + + export interface GetHeapObjectIdReturnType { + /** + * Id of the heap snapshot object corresponding to the passed remote object id. + */ + heapSnapshotObjectId: HeapProfiler.HeapSnapshotObjectId; + } + + export interface GetObjectByHeapObjectIdReturnType { + /** + * Evaluation result. + */ + result: Runtime.RemoteObject; + } + + export interface GetSamplingProfileReturnType { + /** + * Return the sampling profile being collected. + */ + profile: HeapProfiler.SamplingHeapProfile; + } + + export interface StopSamplingReturnType { + /** + * Recorded sampling heap profile. + */ + profile: HeapProfiler.SamplingHeapProfile; + } + + export interface AddHeapSnapshotChunkEventDataType { + chunk: string; + } + + export interface HeapStatsUpdateEventDataType { + /** + * An array of triplets. Each triplet describes a fragment. The first integer is the fragment +index, the second integer is a total count of objects for the fragment, the third integer is +a total size of the objects for the fragment. + */ + statsUpdate: number[]; + } + + export interface LastSeenObjectIdEventDataType { + lastSeenObjectId: number; + timestamp: number; + } + + export interface ReportHeapSnapshotProgressEventDataType { + done: number; + total: number; + finished?: boolean; + } + } + + export namespace Profiler { + /** + * Profile node. Holds callsite information, execution statistics and child nodes. + */ + export interface ProfileNode { + /** + * Unique id of the node. + */ + id: number; + /** + * Function location. + */ + callFrame: Runtime.CallFrame; + /** + * Number of samples where this node was on top of the call stack. + */ + hitCount?: number; + /** + * Child node ids. + */ + children?: number[]; + /** + * The reason of being not optimized. The function may be deoptimized or marked as don't +optimize. + */ + deoptReason?: string; + /** + * An array of source position ticks. + */ + positionTicks?: Profiler.PositionTickInfo[]; + } + + /** + * Profile. + */ + export interface Profile { + /** + * The list of profile nodes. First item is the root node. + */ + nodes: Profiler.ProfileNode[]; + /** + * Profiling start timestamp in microseconds. + */ + startTime: number; + /** + * Profiling end timestamp in microseconds. + */ + endTime: number; + /** + * Ids of samples top nodes. + */ + samples?: number[]; + /** + * Time intervals between adjacent samples in microseconds. The first delta is relative to the +profile startTime. + */ + timeDeltas?: number[]; + } + + /** + * Specifies a number of samples attributed to a certain source position. + */ + export interface PositionTickInfo { + /** + * Source line number (1-based). + */ + line: number; + /** + * Number of samples attributed to the source line. + */ + ticks: number; + } + + /** + * Coverage data for a source range. + */ + export interface CoverageRange { + /** + * JavaScript script source offset for the range start. + */ + startOffset: number; + /** + * JavaScript script source offset for the range end. + */ + endOffset: number; + /** + * Collected execution count of the source range. + */ + count: number; + } + + /** + * Coverage data for a JavaScript function. + */ + export interface FunctionCoverage { + /** + * JavaScript function name. + */ + functionName: string; + /** + * Source ranges inside the function with coverage data. + */ + ranges: Profiler.CoverageRange[]; + /** + * Whether coverage data for this function has block granularity. + */ + isBlockCoverage: boolean; + } + + /** + * Coverage data for a JavaScript script. + */ + export interface ScriptCoverage { + /** + * JavaScript script id. + */ + scriptId: Runtime.ScriptId; + /** + * JavaScript script name or url. + */ + url: string; + /** + * Functions contained in the script that has coverage data. + */ + functions: Profiler.FunctionCoverage[]; + } + + /** + * Describes a type collected during runtime. + * @experimental + */ + export interface TypeObject { + /** + * Name of a type collected with type profiling. + */ + name: string; + } + + /** + * Source offset and types for a parameter or return value. + * @experimental + */ + export interface TypeProfileEntry { + /** + * Source offset of the parameter or end of function for return values. + */ + offset: number; + /** + * The types for this parameter or return value. + */ + types: Profiler.TypeObject[]; + } + + /** + * Type profile data collected during runtime for a JavaScript script. + * @experimental + */ + export interface ScriptTypeProfile { + /** + * JavaScript script id. + */ + scriptId: Runtime.ScriptId; + /** + * JavaScript script name or url. + */ + url: string; + /** + * Type profile entries for parameters and return values of the functions in the script. + */ + entries: Profiler.TypeProfileEntry[]; + } + + export interface SetSamplingIntervalParameterType { + /** + * New sampling interval in microseconds. + */ + interval: number; + } + + export interface StartPreciseCoverageParameterType { + /** + * Collect accurate call counts beyond simple 'covered' or 'not covered'. + */ + callCount?: boolean; + /** + * Collect block-based coverage. + */ + detailed?: boolean; + } + + export interface GetBestEffortCoverageReturnType { + /** + * Coverage data for the current isolate. + */ + result: Profiler.ScriptCoverage[]; + } + + export interface StopReturnType { + /** + * Recorded profile. + */ + profile: Profiler.Profile; + } + + export interface TakePreciseCoverageReturnType { + /** + * Coverage data for the current isolate. + */ + result: Profiler.ScriptCoverage[]; + } + + export interface TakeTypeProfileReturnType { + /** + * Type profile for all scripts since startTypeProfile() was turned on. + */ + result: Profiler.ScriptTypeProfile[]; + } + + export interface ConsoleProfileFinishedEventDataType { + id: string; + /** + * Location of console.profileEnd(). + */ + location: Debugger.Location; + profile: Profiler.Profile; + /** + * Profile title passed as an argument to console.profile(). + */ + title?: string; + } + + export interface ConsoleProfileStartedEventDataType { + id: string; + /** + * Location of console.profile(). + */ + location: Debugger.Location; + /** + * Profile title passed as an argument to console.profile(). + */ + title?: string; } } @@ -50,7 +1099,8 @@ declare module "inspector" { export type RemoteObjectId = string; /** - * Primitive value which cannot be JSON-stringified. + * Primitive value which cannot be JSON-stringified. Includes values `-0`, `NaN`, `Infinity`, +`-Infinity`, and bigint literals. */ export type UnserializableValue = string; @@ -63,11 +1113,11 @@ declare module "inspector" { */ type: string; /** - * Object subtype hint. Specified for object type values only. + * Object subtype hint. Specified for `object` type values only. */ subtype?: string; /** - * Object class (constructor) name. Specified for object type values only. + * Object class (constructor) name. Specified for `object` type values only. */ className?: string; /** @@ -75,7 +1125,8 @@ declare module "inspector" { */ value?: any; /** - * Primitive value which can not be JSON-stringified does not have value, but gets this property. + * Primitive value which can not be JSON-stringified does not have `value`, but gets this +property. */ unserializableValue?: Runtime.UnserializableValue; /** @@ -87,7 +1138,7 @@ declare module "inspector" { */ objectId?: Runtime.RemoteObjectId; /** - * Preview containing abbreviated property values. Specified for object type values only. + * Preview containing abbreviated property values. Specified for `object` type values only. * @experimental */ preview?: Runtime.ObjectPreview; @@ -118,7 +1169,7 @@ declare module "inspector" { */ type: string; /** - * Object subtype hint. Specified for object type values only. + * Object subtype hint. Specified for `object` type values only. */ subtype?: string; /** @@ -134,7 +1185,7 @@ declare module "inspector" { */ properties: Runtime.PropertyPreview[]; /** - * List of the entries. Specified for map and set subtype values only. + * List of the entries. Specified for `map` and `set` subtype values only. */ entries?: Runtime.EntryPreview[]; } @@ -160,7 +1211,7 @@ declare module "inspector" { */ valuePreview?: Runtime.ObjectPreview; /** - * Object subtype hint. Specified for object type values only. + * Object subtype hint. Specified for `object` type values only. */ subtype?: string; } @@ -196,19 +1247,23 @@ declare module "inspector" { */ writable?: boolean; /** - * A function which serves as a getter for the property, or undefined if there is no getter (accessor descriptors only). + * A function which serves as a getter for the property, or `undefined` if there is no getter +(accessor descriptors only). */ get?: Runtime.RemoteObject; /** - * A function which serves as a setter for the property, or undefined if there is no setter (accessor descriptors only). + * A function which serves as a setter for the property, or `undefined` if there is no setter +(accessor descriptors only). */ set?: Runtime.RemoteObject; /** - * True if the type of this property descriptor may be changed and if the property may be deleted from the corresponding object. + * True if the type of this property descriptor may be changed and if the property may be +deleted from the corresponding object. */ configurable: boolean; /** - * True if this property shows up during enumeration of the properties on the corresponding object. + * True if this property shows up during enumeration of the properties on the corresponding +object. */ enumerable: boolean; /** @@ -220,7 +1275,7 @@ declare module "inspector" { */ isOwn?: boolean; /** - * Property symbol object, if the property is of the symbol type. + * Property symbol object, if the property is of the `symbol` type. */ symbol?: Runtime.RemoteObject; } @@ -240,11 +1295,12 @@ declare module "inspector" { } /** - * Represents function call argument. Either remote object id objectId, primitive value, unserializable primitive value or neither of (for undefined) them should be specified. + * Represents function call argument. Either remote object id `objectId`, primitive `value`, +unserializable primitive value or neither of (for undefined) them should be specified. */ export interface CallArgument { /** - * Primitive value. + * Primitive value or serializable javascript object. */ value?: any; /** @@ -267,7 +1323,8 @@ declare module "inspector" { */ export interface ExecutionContextDescription { /** - * Unique id of the execution context. It can be used to specify in which execution context script evaluation should be performed. + * Unique id of the execution context. It can be used to specify in which execution context +script evaluation should be performed. */ id: Runtime.ExecutionContextId; /** @@ -285,7 +1342,8 @@ declare module "inspector" { } /** - * Detailed information about exception (or error) that was thrown during script compilation or execution. + * Detailed information about exception (or error) that was thrown during script compilation or +execution. */ export interface ExceptionDetails { /** @@ -362,7 +1420,8 @@ declare module "inspector" { */ export interface StackTrace { /** - * String label of this stack trace. For async traces this may be a name of the function that initiated the async call. + * String label of this stack trace. For async traces this may be a name of the function that +initiated the async call. */ description?: string; /** @@ -374,51 +1433,26 @@ declare module "inspector" { */ parent?: Runtime.StackTrace; /** - * Creation frame of the Promise which produced the next synchronous trace when resolved, if available. + * Asynchronous JavaScript stack trace that preceded this stack, if available. * @experimental */ - promiseCreationFrame?: Runtime.CallFrame; + parentId?: Runtime.StackTraceId; } - export interface EvaluateParameterType { - /** - * Expression to evaluate. - */ - expression: string; - /** - * Symbolic group name that can be used to release multiple objects. - */ - objectGroup?: string; - /** - * Determines whether Command Line API should be available during the evaluation. - */ - includeCommandLineAPI?: boolean; - /** - * In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides setPauseOnException state. - */ - silent?: boolean; - /** - * Specifies in which execution context to perform evaluation. If the parameter is omitted the evaluation will be performed in the context of the inspected page. - */ - contextId?: Runtime.ExecutionContextId; - /** - * Whether the result is expected to be a JSON object that should be sent by value. - */ - returnByValue?: boolean; - /** - * Whether preview should be generated for the result. - * @experimental - */ - generatePreview?: boolean; - /** - * Whether execution should be treated as initiated by user in the UI. - * @experimental - */ - userGesture?: boolean; - /** - * Whether execution should wait for promise to be resolved. If the result of evaluation is not a Promise, it's considered to be an error. - */ - awaitPromise?: boolean; + /** + * Unique identifier of current debugger. + * @experimental + */ + export type UniqueDebuggerId = string; + + /** + * If `debuggerId` is set stack trace comes from another debugger and can be resolved there. This +allows to track cross-debugger calls. See `Runtime.StackTrace` and `Debugger.paused` for usages. + * @experimental + */ + export interface StackTraceId { + id: string; + debuggerId?: Runtime.UniqueDebuggerId; } export interface AwaitPromiseParameterType { @@ -437,20 +1471,23 @@ declare module "inspector" { } export interface CallFunctionOnParameterType { - /** - * Identifier of the object to call function on. - */ - objectId: Runtime.RemoteObjectId; /** * Declaration of the function to call. */ functionDeclaration: string; /** - * Call arguments. All call arguments must belong to the same JavaScript world as the target object. + * Identifier of the object to call function on. Either objectId or executionContextId should +be specified. + */ + objectId?: Runtime.RemoteObjectId; + /** + * Call arguments. All call arguments must belong to the same JavaScript world as the target +object. */ arguments?: Runtime.CallArgument[]; /** - * In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides setPauseOnException state. + * In silent mode exceptions thrown during evaluation are not reported and do not pause +execution. Overrides `setPauseOnException` state. */ silent?: boolean; /** @@ -464,52 +1501,23 @@ declare module "inspector" { generatePreview?: boolean; /** * Whether execution should be treated as initiated by user in the UI. - * @experimental */ userGesture?: boolean; /** - * Whether execution should wait for promise to be resolved. If the result of evaluation is not a Promise, it's considered to be an error. + * Whether execution should `await` for resulting value and return once awaited promise is +resolved. */ awaitPromise?: boolean; - } - - export interface GetPropertiesParameterType { /** - * Identifier of the object to return properties for. + * Specifies execution context which global object will be used to call function on. Either +executionContextId or objectId should be specified. */ - objectId: Runtime.RemoteObjectId; + executionContextId?: Runtime.ExecutionContextId; /** - * If true, returns properties belonging only to the element itself, not to its prototype chain. + * Symbolic group name that can be used to release multiple objects. If objectGroup is not +specified and objectId is, objectGroup will be inherited from object. */ - ownProperties?: boolean; - /** - * If true, returns accessor properties (with getter/setter) only; internal properties are not returned either. - * @experimental - */ - accessorPropertiesOnly?: boolean; - /** - * Whether preview should be generated for the results. - * @experimental - */ - generatePreview?: boolean; - } - - export interface ReleaseObjectParameterType { - /** - * Identifier of the object to release. - */ - objectId: Runtime.RemoteObjectId; - } - - export interface ReleaseObjectGroupParameterType { - /** - * Symbolic object group name. - */ - objectGroup: string; - } - - export interface SetCustomObjectFormatterEnabledParameterType { - enabled: boolean; + objectGroup?: string; } export interface CompileScriptParameterType { @@ -526,18 +1534,123 @@ declare module "inspector" { */ persistScript: boolean; /** - * Specifies in which execution context to perform script run. If the parameter is omitted the evaluation will be performed in the context of the inspected page. + * Specifies in which execution context to perform script run. If the parameter is omitted the +evaluation will be performed in the context of the inspected page. */ executionContextId?: Runtime.ExecutionContextId; } + export interface EvaluateParameterType { + /** + * Expression to evaluate. + */ + expression: string; + /** + * Symbolic group name that can be used to release multiple objects. + */ + objectGroup?: string; + /** + * Determines whether Command Line API should be available during the evaluation. + */ + includeCommandLineAPI?: boolean; + /** + * In silent mode exceptions thrown during evaluation are not reported and do not pause +execution. Overrides `setPauseOnException` state. + */ + silent?: boolean; + /** + * Specifies in which execution context to perform evaluation. If the parameter is omitted the +evaluation will be performed in the context of the inspected page. + */ + contextId?: Runtime.ExecutionContextId; + /** + * Whether the result is expected to be a JSON object that should be sent by value. + */ + returnByValue?: boolean; + /** + * Whether preview should be generated for the result. + * @experimental + */ + generatePreview?: boolean; + /** + * Whether execution should be treated as initiated by user in the UI. + */ + userGesture?: boolean; + /** + * Whether execution should `await` for resulting value and return once awaited promise is +resolved. + */ + awaitPromise?: boolean; + /** + * Whether to throw an exception if side effect cannot be ruled out during evaluation. + * @experimental + */ + throwOnSideEffect?: boolean; + } + + export interface GetPropertiesParameterType { + /** + * Identifier of the object to return properties for. + */ + objectId: Runtime.RemoteObjectId; + /** + * If true, returns properties belonging only to the element itself, not to its prototype +chain. + */ + ownProperties?: boolean; + /** + * If true, returns accessor properties (with getter/setter) only; internal properties are not +returned either. + * @experimental + */ + accessorPropertiesOnly?: boolean; + /** + * Whether preview should be generated for the results. + * @experimental + */ + generatePreview?: boolean; + } + + export interface GlobalLexicalScopeNamesParameterType { + /** + * Specifies in which execution context to lookup global scope variables. + */ + executionContextId?: Runtime.ExecutionContextId; + } + + export interface QueryObjectsParameterType { + /** + * Identifier of the prototype to return objects for. + */ + prototypeObjectId: Runtime.RemoteObjectId; + /** + * Symbolic group name that can be used to release the results. + */ + objectGroup?: string; + } + + export interface ReleaseObjectParameterType { + /** + * Identifier of the object to release. + */ + objectId: Runtime.RemoteObjectId; + } + + export interface ReleaseObjectGroupParameterType { + /** + * Symbolic object group name. + */ + objectGroup: string; + } + export interface RunScriptParameterType { /** * Id of the script to run. */ scriptId: Runtime.ScriptId; /** - * Specifies in which execution context to perform script run. If the parameter is omitted the evaluation will be performed in the context of the inspected page. + * Specifies in which execution context to perform script run. If the parameter is omitted the +evaluation will be performed in the context of the inspected page. */ executionContextId?: Runtime.ExecutionContextId; /** @@ -545,7 +1658,8 @@ declare module "inspector" { */ objectGroup?: string; /** - * In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides setPauseOnException state. + * In silent mode exceptions thrown during evaluation are not reported and do not pause +execution. Overrides `setPauseOnException` state. */ silent?: boolean; /** @@ -561,20 +1675,14 @@ declare module "inspector" { */ generatePreview?: boolean; /** - * Whether execution should wait for promise to be resolved. If the result of evaluation is not a Promise, it's considered to be an error. + * Whether execution should `await` for resulting value and return once awaited promise is +resolved. */ awaitPromise?: boolean; } - export interface EvaluateReturnType { - /** - * Evaluation result. - */ - result: Runtime.RemoteObject; - /** - * Exception details. - */ - exceptionDetails?: Runtime.ExceptionDetails; + export interface SetCustomObjectFormatterEnabledParameterType { + enabled: boolean; } export interface AwaitPromiseReturnType { @@ -599,6 +1707,46 @@ declare module "inspector" { exceptionDetails?: Runtime.ExceptionDetails; } + export interface CompileScriptReturnType { + /** + * Id of the script. + */ + scriptId?: Runtime.ScriptId; + /** + * Exception details. + */ + exceptionDetails?: Runtime.ExceptionDetails; + } + + export interface EvaluateReturnType { + /** + * Evaluation result. + */ + result: Runtime.RemoteObject; + /** + * Exception details. + */ + exceptionDetails?: Runtime.ExceptionDetails; + } + + export interface GetIsolateIdReturnType { + /** + * The isolate id. + */ + id: string; + } + + export interface GetHeapUsageReturnType { + /** + * Used heap size in bytes. + */ + usedSize: number; + /** + * Allocated heap size in bytes. + */ + totalSize: number; + } + export interface GetPropertiesReturnType { /** * Object properties. @@ -614,15 +1762,15 @@ declare module "inspector" { exceptionDetails?: Runtime.ExceptionDetails; } - export interface CompileScriptReturnType { + export interface GlobalLexicalScopeNamesReturnType { + names: string[]; + } + + export interface QueryObjectsReturnType { /** - * Id of the script. + * Array with objects. */ - scriptId?: Runtime.ScriptId; - /** - * Exception details. - */ - exceptionDetails?: Runtime.ExceptionDetails; + objects: Runtime.RemoteObject; } export interface RunScriptReturnType { @@ -636,39 +1784,6 @@ declare module "inspector" { exceptionDetails?: Runtime.ExceptionDetails; } - export interface ExecutionContextCreatedEventDataType { - /** - * A newly created execution context. - */ - context: Runtime.ExecutionContextDescription; - } - - export interface ExecutionContextDestroyedEventDataType { - /** - * Id of the destroyed context - */ - executionContextId: Runtime.ExecutionContextId; - } - - export interface ExceptionThrownEventDataType { - /** - * Timestamp of the exception. - */ - timestamp: Runtime.Timestamp; - exceptionDetails: Runtime.ExceptionDetails; - } - - export interface ExceptionRevokedEventDataType { - /** - * Reason describing why exception was revoked. - */ - reason: string; - /** - * The id of revoked exception, as reported in exceptionUnhandled. - */ - exceptionId: number; - } - export interface ConsoleAPICalledEventDataType { /** * Type of the call. @@ -691,959 +1806,73 @@ declare module "inspector" { */ stackTrace?: Runtime.StackTrace; /** - * Console context descriptor for calls on non-default console context (not console.*): 'anonymous#unique-logger-id' for call on unnamed context, 'name#unique-logger-id' for call on named context. + * Console context descriptor for calls on non-default console context (not console.*): +'anonymous#unique-logger-id' for call on unnamed context, 'name#unique-logger-id' for call +on named context. * @experimental */ context?: string; } + export interface ExceptionRevokedEventDataType { + /** + * Reason describing why exception was revoked. + */ + reason: string; + /** + * The id of revoked exception, as reported in `exceptionThrown`. + */ + exceptionId: number; + } + + export interface ExceptionThrownEventDataType { + /** + * Timestamp of the exception. + */ + timestamp: Runtime.Timestamp; + exceptionDetails: Runtime.ExceptionDetails; + } + + export interface ExecutionContextCreatedEventDataType { + /** + * A newly created execution context. + */ + context: Runtime.ExecutionContextDescription; + } + + export interface ExecutionContextDestroyedEventDataType { + /** + * Id of the destroyed context + */ + executionContextId: Runtime.ExecutionContextId; + } + export interface InspectRequestedEventDataType { object: Runtime.RemoteObject; hints: {}; } } - export namespace Debugger { + export namespace Schema { /** - * Breakpoint identifier. + * Description of the protocol domain. */ - export type BreakpointId = string; - - /** - * Call frame identifier. - */ - export type CallFrameId = string; - - /** - * Location in the source code. - */ - export interface Location { - /** - * Script identifier as reported in the Debugger.scriptParsed. - */ - scriptId: Runtime.ScriptId; - /** - * Line number in the script (0-based). - */ - lineNumber: number; - /** - * Column number in the script (0-based). - */ - columnNumber?: number; - } - - /** - * Location in the source code. - * @experimental - */ - export interface ScriptPosition { - lineNumber: number; - columnNumber: number; - } - - /** - * JavaScript call frame. Array of call frames form the call stack. - */ - export interface CallFrame { - /** - * Call frame identifier. This identifier is only valid while the virtual machine is paused. - */ - callFrameId: Debugger.CallFrameId; - /** - * Name of the JavaScript function called on this call frame. - */ - functionName: string; - /** - * Location in the source code. - * @experimental - */ - functionLocation?: Debugger.Location; - /** - * Location in the source code. - */ - location: Debugger.Location; - /** - * Scope chain for this call frame. - */ - scopeChain: Debugger.Scope[]; - /** - * this object for this call frame. - */ - this: Runtime.RemoteObject; - /** - * The value being returned, if the function is at return point. - */ - returnValue?: Runtime.RemoteObject; - } - - /** - * Scope description. - */ - export interface Scope { - /** - * Scope type. - */ - type: string; - /** - * Object representing the scope. For global and with scopes it represents the actual object; for the rest of the scopes, it is artificial transient object enumerating scope variables as its properties. - */ - object: Runtime.RemoteObject; - name?: string; - /** - * Location in the source code where scope starts - */ - startLocation?: Debugger.Location; - /** - * Location in the source code where scope ends - */ - endLocation?: Debugger.Location; - } - - /** - * Search match for resource. - * @experimental - */ - export interface SearchMatch { - /** - * Line number in resource content. - */ - lineNumber: number; - /** - * Line with match content. - */ - lineContent: string; - } - - /** - * @experimental - */ - export interface BreakLocation { - /** - * Script identifier as reported in the Debugger.scriptParsed. - */ - scriptId: Runtime.ScriptId; - /** - * Line number in the script (0-based). - */ - lineNumber: number; - /** - * Column number in the script (0-based). - */ - columnNumber?: number; - type?: string; - } - - export interface SetBreakpointsActiveParameterType { - /** - * New value for breakpoints active state. - */ - active: boolean; - } - - export interface SetSkipAllPausesParameterType { + export interface Domain { /** - * New value for skip pauses state. + * Domain name. */ - skip: boolean; - } - - export interface SetBreakpointByUrlParameterType { - /** - * Line number to set breakpoint at. - */ - lineNumber: number; - /** - * URL of the resources to set breakpoint on. - */ - url?: string; - /** - * Regex pattern for the URLs of the resources to set breakpoints on. Either url or urlRegex must be specified. - */ - urlRegex?: string; - /** - * Offset in the line to set breakpoint at. - */ - columnNumber?: number; - /** - * Expression to use as a breakpoint condition. When specified, debugger will only stop on the breakpoint if this expression evaluates to true. - */ - condition?: string; - } - - export interface SetBreakpointParameterType { - /** - * Location to set breakpoint in. - */ - location: Debugger.Location; - /** - * Expression to use as a breakpoint condition. When specified, debugger will only stop on the breakpoint if this expression evaluates to true. - */ - condition?: string; - } - - export interface RemoveBreakpointParameterType { - breakpointId: Debugger.BreakpointId; - } - - export interface GetPossibleBreakpointsParameterType { - /** - * Start of range to search possible breakpoint locations in. - */ - start: Debugger.Location; - /** - * End of range to search possible breakpoint locations in (excluding). When not specified, end of scripts is used as end of range. - */ - end?: Debugger.Location; - /** - * Only consider locations which are in the same (non-nested) function as start. - */ - restrictToFunction?: boolean; - } - - export interface ContinueToLocationParameterType { - /** - * Location to continue to. - */ - location: Debugger.Location; - /** - * @experimental - */ - targetCallFrames?: string; - } - - export interface SearchInContentParameterType { - /** - * Id of the script to search in. - */ - scriptId: Runtime.ScriptId; - /** - * String to search for. - */ - query: string; - /** - * If true, search is case sensitive. - */ - caseSensitive?: boolean; + name: string; /** - * If true, treats string parameter as regex. + * Domain version. */ - isRegex?: boolean; - } - - export interface SetScriptSourceParameterType { - /** - * Id of the script to edit. - */ - scriptId: Runtime.ScriptId; - /** - * New content of the script. - */ - scriptSource: string; - /** - * If true the change will not actually be applied. Dry run may be used to get result description without actually modifying the code. - */ - dryRun?: boolean; - } - - export interface RestartFrameParameterType { - /** - * Call frame identifier to evaluate on. - */ - callFrameId: Debugger.CallFrameId; - } - - export interface GetScriptSourceParameterType { - /** - * Id of the script to get source for. - */ - scriptId: Runtime.ScriptId; - } - - export interface SetPauseOnExceptionsParameterType { - /** - * Pause on exceptions mode. - */ - state: string; - } - - export interface EvaluateOnCallFrameParameterType { - /** - * Call frame identifier to evaluate on. - */ - callFrameId: Debugger.CallFrameId; - /** - * Expression to evaluate. - */ - expression: string; - /** - * String object group name to put result into (allows rapid releasing resulting object handles using releaseObjectGroup). - */ - objectGroup?: string; - /** - * Specifies whether command line API should be available to the evaluated expression, defaults to false. - */ - includeCommandLineAPI?: boolean; - /** - * In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides setPauseOnException state. - */ - silent?: boolean; - /** - * Whether the result is expected to be a JSON object that should be sent by value. - */ - returnByValue?: boolean; - /** - * Whether preview should be generated for the result. - * @experimental - */ - generatePreview?: boolean; - /** - * Whether to throw an exception if side effect cannot be ruled out during evaluation. - * @experimental - */ - throwOnSideEffect?: boolean; - } - - export interface SetVariableValueParameterType { - /** - * 0-based number of scope as was listed in scope chain. Only 'local', 'closure' and 'catch' scope types are allowed. Other scopes could be manipulated manually. - */ - scopeNumber: number; - /** - * Variable name. - */ - variableName: string; - /** - * New variable value. - */ - newValue: Runtime.CallArgument; - /** - * Id of callframe that holds variable. - */ - callFrameId: Debugger.CallFrameId; - } - - export interface SetAsyncCallStackDepthParameterType { - /** - * Maximum depth of async call stacks. Setting to 0 will effectively disable collecting async call stacks (default). - */ - maxDepth: number; - } - - export interface SetBlackboxPatternsParameterType { - /** - * Array of regexps that will be used to check script url for blackbox state. - */ - patterns: string[]; - } - - export interface SetBlackboxedRangesParameterType { - /** - * Id of the script. - */ - scriptId: Runtime.ScriptId; - positions: Debugger.ScriptPosition[]; - } - - export interface SetBreakpointByUrlReturnType { - /** - * Id of the created breakpoint for further reference. - */ - breakpointId: Debugger.BreakpointId; - /** - * List of the locations this breakpoint resolved into upon addition. - */ - locations: Debugger.Location[]; - } - - export interface SetBreakpointReturnType { - /** - * Id of the created breakpoint for further reference. - */ - breakpointId: Debugger.BreakpointId; - /** - * Location this breakpoint resolved into. - */ - actualLocation: Debugger.Location; - } - - export interface GetPossibleBreakpointsReturnType { - /** - * List of the possible breakpoint locations. - */ - locations: Debugger.BreakLocation[]; - } - - export interface SearchInContentReturnType { - /** - * List of search matches. - */ - result: Debugger.SearchMatch[]; - } - - export interface SetScriptSourceReturnType { - /** - * New stack trace in case editing has happened while VM was stopped. - */ - callFrames?: Debugger.CallFrame[]; - /** - * Whether current call stack was modified after applying the changes. - */ - stackChanged?: boolean; - /** - * Async stack trace, if any. - */ - asyncStackTrace?: Runtime.StackTrace; - /** - * Exception details if any. - */ - exceptionDetails?: Runtime.ExceptionDetails; - } - - export interface RestartFrameReturnType { - /** - * New stack trace. - */ - callFrames: Debugger.CallFrame[]; - /** - * Async stack trace, if any. - */ - asyncStackTrace?: Runtime.StackTrace; - } - - export interface GetScriptSourceReturnType { - /** - * Script source. - */ - scriptSource: string; - } - - export interface EvaluateOnCallFrameReturnType { - /** - * Object wrapper for the evaluation result. - */ - result: Runtime.RemoteObject; - /** - * Exception details. - */ - exceptionDetails?: Runtime.ExceptionDetails; - } - - export interface ScriptParsedEventDataType { - /** - * Identifier of the script parsed. - */ - scriptId: Runtime.ScriptId; - /** - * URL or name of the script parsed (if any). - */ - url: string; - /** - * Line offset of the script within the resource with given URL (for script tags). - */ - startLine: number; - /** - * Column offset of the script within the resource with given URL. - */ - startColumn: number; - /** - * Last line of the script. - */ - endLine: number; - /** - * Length of the last line of the script. - */ - endColumn: number; - /** - * Specifies script creation context. - */ - executionContextId: Runtime.ExecutionContextId; - /** - * Content hash of the script. - */ - hash: string; - /** - * Embedder-specific auxiliary data. - */ - executionContextAuxData?: {}; - /** - * True, if this script is generated as a result of the live edit operation. - * @experimental - */ - isLiveEdit?: boolean; - /** - * URL of source map associated with script (if any). - */ - sourceMapURL?: string; - /** - * True, if this script has sourceURL. - * @experimental - */ - hasSourceURL?: boolean; - /** - * True, if this script is ES6 module. - * @experimental - */ - isModule?: boolean; - /** - * This script length. - * @experimental - */ - length?: number; - /** - * JavaScript top stack frame of where the script parsed event was triggered if available. - * @experimental - */ - stackTrace?: Runtime.StackTrace; - } - - export interface ScriptFailedToParseEventDataType { - /** - * Identifier of the script parsed. - */ - scriptId: Runtime.ScriptId; - /** - * URL or name of the script parsed (if any). - */ - url: string; - /** - * Line offset of the script within the resource with given URL (for script tags). - */ - startLine: number; - /** - * Column offset of the script within the resource with given URL. - */ - startColumn: number; - /** - * Last line of the script. - */ - endLine: number; - /** - * Length of the last line of the script. - */ - endColumn: number; - /** - * Specifies script creation context. - */ - executionContextId: Runtime.ExecutionContextId; - /** - * Content hash of the script. - */ - hash: string; - /** - * Embedder-specific auxiliary data. - */ - executionContextAuxData?: {}; - /** - * URL of source map associated with script (if any). - */ - sourceMapURL?: string; - /** - * True, if this script has sourceURL. - * @experimental - */ - hasSourceURL?: boolean; - /** - * True, if this script is ES6 module. - * @experimental - */ - isModule?: boolean; - /** - * This script length. - * @experimental - */ - length?: number; - /** - * JavaScript top stack frame of where the script parsed event was triggered if available. - * @experimental - */ - stackTrace?: Runtime.StackTrace; - } - - export interface BreakpointResolvedEventDataType { - /** - * Breakpoint unique identifier. - */ - breakpointId: Debugger.BreakpointId; - /** - * Actual breakpoint location. - */ - location: Debugger.Location; - } - - export interface PausedEventDataType { - /** - * Call stack the virtual machine stopped on. - */ - callFrames: Debugger.CallFrame[]; - /** - * Pause reason. - */ - reason: string; - /** - * Object containing break-specific auxiliary properties. - */ - data?: {}; - /** - * Hit breakpoints IDs - */ - hitBreakpoints?: string[]; - /** - * Async stack trace, if any. - */ - asyncStackTrace?: Runtime.StackTrace; - } - } - - export namespace Console { - /** - * Console message. - */ - export interface ConsoleMessage { - /** - * Message source. - */ - source: string; - /** - * Message severity. - */ - level: string; - /** - * Message text. - */ - text: string; - /** - * URL of the message origin. - */ - url?: string; - /** - * Line number in the resource that generated this message (1-based). - */ - line?: number; - /** - * Column number in the resource that generated this message (1-based). - */ - column?: number; - } - - export interface MessageAddedEventDataType { - /** - * Console message that has been added. - */ - message: Console.ConsoleMessage; - } - } - - export namespace Profiler { - /** - * Profile node. Holds callsite information, execution statistics and child nodes. - */ - export interface ProfileNode { - /** - * Unique id of the node. - */ - id: number; - /** - * Function location. - */ - callFrame: Runtime.CallFrame; - /** - * Number of samples where this node was on top of the call stack. - * @experimental - */ - hitCount?: number; - /** - * Child node ids. - */ - children?: number[]; - /** - * The reason of being not optimized. The function may be deoptimized or marked as don't optimize. - */ - deoptReason?: string; - /** - * An array of source position ticks. - * @experimental - */ - positionTicks?: Profiler.PositionTickInfo[]; - } - - /** - * Profile. - */ - export interface Profile { - /** - * The list of profile nodes. First item is the root node. - */ - nodes: Profiler.ProfileNode[]; - /** - * Profiling start timestamp in microseconds. - */ - startTime: number; - /** - * Profiling end timestamp in microseconds. - */ - endTime: number; - /** - * Ids of samples top nodes. - */ - samples?: number[]; - /** - * Time intervals between adjacent samples in microseconds. The first delta is relative to the profile startTime. - */ - timeDeltas?: number[]; - } - - /** - * Specifies a number of samples attributed to a certain source position. - * @experimental - */ - export interface PositionTickInfo { - /** - * Source line number (1-based). - */ - line: number; - /** - * Number of samples attributed to the source line. - */ - ticks: number; - } - - /** - * Coverage data for a source range. - * @experimental - */ - export interface CoverageRange { - /** - * JavaScript script source offset for the range start. - */ - startOffset: number; - /** - * JavaScript script source offset for the range end. - */ - endOffset: number; - /** - * Collected execution count of the source range. - */ - count: number; - } - - /** - * Coverage data for a JavaScript function. - * @experimental - */ - export interface FunctionCoverage { - /** - * JavaScript function name. - */ - functionName: string; - /** - * Source ranges inside the function with coverage data. - */ - ranges: Profiler.CoverageRange[]; - /** - * Whether coverage data for this function has block granularity. - */ - isBlockCoverage: boolean; - } - - /** - * Coverage data for a JavaScript script. - * @experimental - */ - export interface ScriptCoverage { - /** - * JavaScript script id. - */ - scriptId: Runtime.ScriptId; - /** - * JavaScript script name or url. - */ - url: string; - /** - * Functions contained in the script that has coverage data. - */ - functions: Profiler.FunctionCoverage[]; - } - - export interface SetSamplingIntervalParameterType { - /** - * New sampling interval in microseconds. - */ - interval: number; - } - - export interface StartPreciseCoverageParameterType { - /** - * Collect accurate call counts beyond simple 'covered' or 'not covered'. - */ - callCount?: boolean; - } - - export interface StopReturnType { - /** - * Recorded profile. - */ - profile: Profiler.Profile; - } - - export interface TakePreciseCoverageReturnType { - /** - * Coverage data for the current isolate. - */ - result: Profiler.ScriptCoverage[]; - } - - export interface GetBestEffortCoverageReturnType { - /** - * Coverage data for the current isolate. - */ - result: Profiler.ScriptCoverage[]; - } - - export interface ConsoleProfileStartedEventDataType { - id: string; - /** - * Location of console.profile(). - */ - location: Debugger.Location; - /** - * Profile title passed as an argument to console.profile(). - */ - title?: string; - } - - export interface ConsoleProfileFinishedEventDataType { - id: string; - /** - * Location of console.profileEnd(). - */ - location: Debugger.Location; - profile: Profiler.Profile; - /** - * Profile title passed as an argument to console.profile(). - */ - title?: string; - } - } - - export namespace HeapProfiler { - /** - * Heap snapshot object id. - */ - export type HeapSnapshotObjectId = string; - - /** - * Sampling Heap Profile node. Holds callsite information, allocation statistics and child nodes. - */ - export interface SamplingHeapProfileNode { - /** - * Function location. - */ - callFrame: Runtime.CallFrame; - /** - * Allocations size in bytes for the node excluding children. - */ - selfSize: number; - /** - * Child nodes. - */ - children: HeapProfiler.SamplingHeapProfileNode[]; - } - - /** - * Profile. - */ - export interface SamplingHeapProfile { - head: HeapProfiler.SamplingHeapProfileNode; - } - - export interface StartTrackingHeapObjectsParameterType { - trackAllocations?: boolean; - } - - export interface StopTrackingHeapObjectsParameterType { - /** - * If true 'reportHeapSnapshotProgress' events will be generated while snapshot is being taken when the tracking is stopped. - */ - reportProgress?: boolean; - } - - export interface TakeHeapSnapshotParameterType { - /** - * If true 'reportHeapSnapshotProgress' events will be generated while snapshot is being taken. - */ - reportProgress?: boolean; - } - - export interface GetObjectByHeapObjectIdParameterType { - objectId: HeapProfiler.HeapSnapshotObjectId; - /** - * Symbolic group name that can be used to release multiple objects. - */ - objectGroup?: string; - } - - export interface AddInspectedHeapObjectParameterType { - /** - * Heap snapshot object id to be accessible by means of $x command line API. - */ - heapObjectId: HeapProfiler.HeapSnapshotObjectId; - } - - export interface GetHeapObjectIdParameterType { - /** - * Identifier of the object to get heap object id for. - */ - objectId: Runtime.RemoteObjectId; - } - - export interface StartSamplingParameterType { - /** - * Average sample interval in bytes. Poisson distribution is used for the intervals. The default value is 32768 bytes. - */ - samplingInterval?: number; - } - - export interface GetObjectByHeapObjectIdReturnType { - /** - * Evaluation result. - */ - result: Runtime.RemoteObject; - } - - export interface GetHeapObjectIdReturnType { - /** - * Id of the heap snapshot object corresponding to the passed remote object id. - */ - heapSnapshotObjectId: HeapProfiler.HeapSnapshotObjectId; - } - - export interface StopSamplingReturnType { - /** - * Recorded sampling heap profile. - */ - profile: HeapProfiler.SamplingHeapProfile; - } - - export interface AddHeapSnapshotChunkEventDataType { - chunk: string; - } - - export interface ReportHeapSnapshotProgressEventDataType { - done: number; - total: number; - finished?: boolean; - } - - export interface LastSeenObjectIdEventDataType { - lastSeenObjectId: number; - timestamp: number; + version: string; } - export interface HeapStatsUpdateEventDataType { + export interface GetDomainsReturnType { /** - * An array of triplets. Each triplet describes a fragment. The first integer is the fragment index, the second integer is a total count of objects for the fragment, the third integer is a total size of the objects for the fragment. + * List of supported domains. */ - statsUpdate: number[]; + domains: Schema.Domain[]; } } @@ -1673,15 +1902,291 @@ declare module "inspector" { post(method: string, callback?: (err: Error | null, params?: {}) => void): void; /** - * Returns supported domains. + * Does nothing. */ - post(method: "Schema.getDomains", callback?: (err: Error | null, params: Schema.GetDomainsReturnType) => void): void; - /** - * Evaluates expression on global object. - */ - post(method: "Runtime.evaluate", params?: Runtime.EvaluateParameterType, callback?: (err: Error | null, params: Runtime.EvaluateReturnType) => void): void; - post(method: "Runtime.evaluate", callback?: (err: Error | null, params: Runtime.EvaluateReturnType) => void): void; + post(method: "Console.clearMessages", callback?: (err: Error | null) => void): void; + /** + * Disables console domain, prevents further console messages from being reported to the client. + */ + post(method: "Console.disable", callback?: (err: Error | null) => void): void; + + /** + * Enables console domain, sends the messages collected so far to the client by means of the +`messageAdded` notification. + */ + post(method: "Console.enable", callback?: (err: Error | null) => void): void; + /** + * Continues execution until specific location is reached. + */ + post(method: "Debugger.continueToLocation", params?: Debugger.ContinueToLocationParameterType, callback?: (err: Error | null) => void): void; + post(method: "Debugger.continueToLocation", callback?: (err: Error | null) => void): void; + + /** + * Disables debugger for given page. + */ + post(method: "Debugger.disable", callback?: (err: Error | null) => void): void; + + /** + * Enables debugger for the given page. Clients should not assume that the debugging has been +enabled until the result for this command is received. + */ + post(method: "Debugger.enable", callback?: (err: Error | null, params: Debugger.EnableReturnType) => void): void; + + /** + * Evaluates expression on a given call frame. + */ + post(method: "Debugger.evaluateOnCallFrame", params?: Debugger.EvaluateOnCallFrameParameterType, callback?: (err: Error | null, params: Debugger.EvaluateOnCallFrameReturnType) => void): void; + post(method: "Debugger.evaluateOnCallFrame", callback?: (err: Error | null, params: Debugger.EvaluateOnCallFrameReturnType) => void): void; + + /** + * Returns possible locations for breakpoint. scriptId in start and end range locations should be +the same. + */ + post(method: "Debugger.getPossibleBreakpoints", params?: Debugger.GetPossibleBreakpointsParameterType, callback?: (err: Error | null, params: Debugger.GetPossibleBreakpointsReturnType) => void): void; + post(method: "Debugger.getPossibleBreakpoints", callback?: (err: Error | null, params: Debugger.GetPossibleBreakpointsReturnType) => void): void; + + /** + * Returns source for the script with given id. + */ + post(method: "Debugger.getScriptSource", params?: Debugger.GetScriptSourceParameterType, callback?: (err: Error | null, params: Debugger.GetScriptSourceReturnType) => void): void; + post(method: "Debugger.getScriptSource", callback?: (err: Error | null, params: Debugger.GetScriptSourceReturnType) => void): void; + + /** + * Returns stack trace with given `stackTraceId`. + * @experimental + */ + post(method: "Debugger.getStackTrace", params?: Debugger.GetStackTraceParameterType, callback?: (err: Error | null, params: Debugger.GetStackTraceReturnType) => void): void; + post(method: "Debugger.getStackTrace", callback?: (err: Error | null, params: Debugger.GetStackTraceReturnType) => void): void; + + /** + * Stops on the next JavaScript statement. + */ + post(method: "Debugger.pause", callback?: (err: Error | null) => void): void; + + /** + * @experimental + */ + post(method: "Debugger.pauseOnAsyncCall", params?: Debugger.PauseOnAsyncCallParameterType, callback?: (err: Error | null) => void): void; + post(method: "Debugger.pauseOnAsyncCall", callback?: (err: Error | null) => void): void; + + /** + * Removes JavaScript breakpoint. + */ + post(method: "Debugger.removeBreakpoint", params?: Debugger.RemoveBreakpointParameterType, callback?: (err: Error | null) => void): void; + post(method: "Debugger.removeBreakpoint", callback?: (err: Error | null) => void): void; + + /** + * Restarts particular call frame from the beginning. + */ + post(method: "Debugger.restartFrame", params?: Debugger.RestartFrameParameterType, callback?: (err: Error | null, params: Debugger.RestartFrameReturnType) => void): void; + post(method: "Debugger.restartFrame", callback?: (err: Error | null, params: Debugger.RestartFrameReturnType) => void): void; + + /** + * Resumes JavaScript execution. + */ + post(method: "Debugger.resume", callback?: (err: Error | null) => void): void; + + /** + * This method is deprecated - use Debugger.stepInto with breakOnAsyncCall and +Debugger.pauseOnAsyncTask instead. Steps into next scheduled async task if any is scheduled +before next pause. Returns success when async task is actually scheduled, returns error if no +task were scheduled or another scheduleStepIntoAsync was called. + * @experimental + */ + post(method: "Debugger.scheduleStepIntoAsync", callback?: (err: Error | null) => void): void; + + /** + * Searches for given string in script content. + */ + post(method: "Debugger.searchInContent", params?: Debugger.SearchInContentParameterType, callback?: (err: Error | null, params: Debugger.SearchInContentReturnType) => void): void; + post(method: "Debugger.searchInContent", callback?: (err: Error | null, params: Debugger.SearchInContentReturnType) => void): void; + + /** + * Enables or disables async call stacks tracking. + */ + post(method: "Debugger.setAsyncCallStackDepth", params?: Debugger.SetAsyncCallStackDepthParameterType, callback?: (err: Error | null) => void): void; + post(method: "Debugger.setAsyncCallStackDepth", callback?: (err: Error | null) => void): void; + + /** + * Replace previous blackbox patterns with passed ones. Forces backend to skip stepping/pausing in +scripts with url matching one of the patterns. VM will try to leave blackboxed script by +performing 'step in' several times, finally resorting to 'step out' if unsuccessful. + * @experimental + */ + post(method: "Debugger.setBlackboxPatterns", params?: Debugger.SetBlackboxPatternsParameterType, callback?: (err: Error | null) => void): void; + post(method: "Debugger.setBlackboxPatterns", callback?: (err: Error | null) => void): void; + + /** + * Makes backend skip steps in the script in blackboxed ranges. VM will try leave blacklisted +scripts by performing 'step in' several times, finally resorting to 'step out' if unsuccessful. +Positions array contains positions where blackbox state is changed. First interval isn't +blackboxed. Array should be sorted. + * @experimental + */ + post(method: "Debugger.setBlackboxedRanges", params?: Debugger.SetBlackboxedRangesParameterType, callback?: (err: Error | null) => void): void; + post(method: "Debugger.setBlackboxedRanges", callback?: (err: Error | null) => void): void; + + /** + * Sets JavaScript breakpoint at a given location. + */ + post(method: "Debugger.setBreakpoint", params?: Debugger.SetBreakpointParameterType, callback?: (err: Error | null, params: Debugger.SetBreakpointReturnType) => void): void; + post(method: "Debugger.setBreakpoint", callback?: (err: Error | null, params: Debugger.SetBreakpointReturnType) => void): void; + + /** + * Sets JavaScript breakpoint at given location specified either by URL or URL regex. Once this +command is issued, all existing parsed scripts will have breakpoints resolved and returned in +`locations` property. Further matching script parsing will result in subsequent +`breakpointResolved` events issued. This logical breakpoint will survive page reloads. + */ + post(method: "Debugger.setBreakpointByUrl", params?: Debugger.SetBreakpointByUrlParameterType, callback?: (err: Error | null, params: Debugger.SetBreakpointByUrlReturnType) => void): void; + post(method: "Debugger.setBreakpointByUrl", callback?: (err: Error | null, params: Debugger.SetBreakpointByUrlReturnType) => void): void; + + /** + * Activates / deactivates all breakpoints on the page. + */ + post(method: "Debugger.setBreakpointsActive", params?: Debugger.SetBreakpointsActiveParameterType, callback?: (err: Error | null) => void): void; + post(method: "Debugger.setBreakpointsActive", callback?: (err: Error | null) => void): void; + + /** + * Defines pause on exceptions state. Can be set to stop on all exceptions, uncaught exceptions or +no exceptions. Initial pause on exceptions state is `none`. + */ + post(method: "Debugger.setPauseOnExceptions", params?: Debugger.SetPauseOnExceptionsParameterType, callback?: (err: Error | null) => void): void; + post(method: "Debugger.setPauseOnExceptions", callback?: (err: Error | null) => void): void; + + /** + * Changes return value in top frame. Available only at return break position. + * @experimental + */ + post(method: "Debugger.setReturnValue", params?: Debugger.SetReturnValueParameterType, callback?: (err: Error | null) => void): void; + post(method: "Debugger.setReturnValue", callback?: (err: Error | null) => void): void; + + /** + * Edits JavaScript source live. + */ + post(method: "Debugger.setScriptSource", params?: Debugger.SetScriptSourceParameterType, callback?: (err: Error | null, params: Debugger.SetScriptSourceReturnType) => void): void; + post(method: "Debugger.setScriptSource", callback?: (err: Error | null, params: Debugger.SetScriptSourceReturnType) => void): void; + + /** + * Makes page not interrupt on any pauses (breakpoint, exception, dom exception etc). + */ + post(method: "Debugger.setSkipAllPauses", params?: Debugger.SetSkipAllPausesParameterType, callback?: (err: Error | null) => void): void; + post(method: "Debugger.setSkipAllPauses", callback?: (err: Error | null) => void): void; + + /** + * Changes value of variable in a callframe. Object-based scopes are not supported and must be +mutated manually. + */ + post(method: "Debugger.setVariableValue", params?: Debugger.SetVariableValueParameterType, callback?: (err: Error | null) => void): void; + post(method: "Debugger.setVariableValue", callback?: (err: Error | null) => void): void; + + /** + * Steps into the function call. + */ + post(method: "Debugger.stepInto", params?: Debugger.StepIntoParameterType, callback?: (err: Error | null) => void): void; + post(method: "Debugger.stepInto", callback?: (err: Error | null) => void): void; + + /** + * Steps out of the function call. + */ + post(method: "Debugger.stepOut", callback?: (err: Error | null) => void): void; + + /** + * Steps over the statement. + */ + post(method: "Debugger.stepOver", callback?: (err: Error | null) => void): void; + /** + * Enables console to refer to the node with given id via $x (see Command Line API for more details +$x functions). + */ + post(method: "HeapProfiler.addInspectedHeapObject", params?: HeapProfiler.AddInspectedHeapObjectParameterType, callback?: (err: Error | null) => void): void; + post(method: "HeapProfiler.addInspectedHeapObject", callback?: (err: Error | null) => void): void; + + post(method: "HeapProfiler.collectGarbage", callback?: (err: Error | null) => void): void; + + post(method: "HeapProfiler.disable", callback?: (err: Error | null) => void): void; + + post(method: "HeapProfiler.enable", callback?: (err: Error | null) => void): void; + + post(method: "HeapProfiler.getHeapObjectId", params?: HeapProfiler.GetHeapObjectIdParameterType, callback?: (err: Error | null, params: HeapProfiler.GetHeapObjectIdReturnType) => void): void; + post(method: "HeapProfiler.getHeapObjectId", callback?: (err: Error | null, params: HeapProfiler.GetHeapObjectIdReturnType) => void): void; + + post(method: "HeapProfiler.getObjectByHeapObjectId", params?: HeapProfiler.GetObjectByHeapObjectIdParameterType, callback?: (err: Error | null, params: HeapProfiler.GetObjectByHeapObjectIdReturnType) => void): void; + post(method: "HeapProfiler.getObjectByHeapObjectId", callback?: (err: Error | null, params: HeapProfiler.GetObjectByHeapObjectIdReturnType) => void): void; + + post(method: "HeapProfiler.getSamplingProfile", callback?: (err: Error | null, params: HeapProfiler.GetSamplingProfileReturnType) => void): void; + + post(method: "HeapProfiler.startSampling", params?: HeapProfiler.StartSamplingParameterType, callback?: (err: Error | null) => void): void; + post(method: "HeapProfiler.startSampling", callback?: (err: Error | null) => void): void; + + post(method: "HeapProfiler.startTrackingHeapObjects", params?: HeapProfiler.StartTrackingHeapObjectsParameterType, callback?: (err: Error | null) => void): void; + post(method: "HeapProfiler.startTrackingHeapObjects", callback?: (err: Error | null) => void): void; + + post(method: "HeapProfiler.stopSampling", callback?: (err: Error | null, params: HeapProfiler.StopSamplingReturnType) => void): void; + + post(method: "HeapProfiler.stopTrackingHeapObjects", params?: HeapProfiler.StopTrackingHeapObjectsParameterType, callback?: (err: Error | null) => void): void; + post(method: "HeapProfiler.stopTrackingHeapObjects", callback?: (err: Error | null) => void): void; + + post(method: "HeapProfiler.takeHeapSnapshot", params?: HeapProfiler.TakeHeapSnapshotParameterType, callback?: (err: Error | null) => void): void; + post(method: "HeapProfiler.takeHeapSnapshot", callback?: (err: Error | null) => void): void; + post(method: "Profiler.disable", callback?: (err: Error | null) => void): void; + + post(method: "Profiler.enable", callback?: (err: Error | null) => void): void; + + /** + * Collect coverage data for the current isolate. The coverage data may be incomplete due to +garbage collection. + */ + post(method: "Profiler.getBestEffortCoverage", callback?: (err: Error | null, params: Profiler.GetBestEffortCoverageReturnType) => void): void; + + /** + * Changes CPU profiler sampling interval. Must be called before CPU profiles recording started. + */ + post(method: "Profiler.setSamplingInterval", params?: Profiler.SetSamplingIntervalParameterType, callback?: (err: Error | null) => void): void; + post(method: "Profiler.setSamplingInterval", callback?: (err: Error | null) => void): void; + + post(method: "Profiler.start", callback?: (err: Error | null) => void): void; + + /** + * Enable precise code coverage. Coverage data for JavaScript executed before enabling precise code +coverage may be incomplete. Enabling prevents running optimized code and resets execution +counters. + */ + post(method: "Profiler.startPreciseCoverage", params?: Profiler.StartPreciseCoverageParameterType, callback?: (err: Error | null) => void): void; + post(method: "Profiler.startPreciseCoverage", callback?: (err: Error | null) => void): void; + + /** + * Enable type profile. + * @experimental + */ + post(method: "Profiler.startTypeProfile", callback?: (err: Error | null) => void): void; + + post(method: "Profiler.stop", callback?: (err: Error | null, params: Profiler.StopReturnType) => void): void; + + /** + * Disable precise code coverage. Disabling releases unnecessary execution count records and allows +executing optimized code. + */ + post(method: "Profiler.stopPreciseCoverage", callback?: (err: Error | null) => void): void; + + /** + * Disable type profile. Disabling releases type profile data collected so far. + * @experimental + */ + post(method: "Profiler.stopTypeProfile", callback?: (err: Error | null) => void): void; + + /** + * Collect coverage data for the current isolate, and resets execution counters. Precise code +coverage needs to have started. + */ + post(method: "Profiler.takePreciseCoverage", callback?: (err: Error | null, params: Profiler.TakePreciseCoverageReturnType) => void): void; + + /** + * Collect type profile. + * @experimental + */ + post(method: "Profiler.takeTypeProfile", callback?: (err: Error | null, params: Profiler.TakeTypeProfileReturnType) => void): void; /** * Add handler to promise with given promise object id. */ @@ -1689,17 +2194,70 @@ declare module "inspector" { post(method: "Runtime.awaitPromise", callback?: (err: Error | null, params: Runtime.AwaitPromiseReturnType) => void): void; /** - * Calls function with given declaration on the given object. Object group of the result is inherited from the target object. + * Calls function with given declaration on the given object. Object group of the result is +inherited from the target object. */ post(method: "Runtime.callFunctionOn", params?: Runtime.CallFunctionOnParameterType, callback?: (err: Error | null, params: Runtime.CallFunctionOnReturnType) => void): void; post(method: "Runtime.callFunctionOn", callback?: (err: Error | null, params: Runtime.CallFunctionOnReturnType) => void): void; /** - * Returns properties of a given object. Object group of the result is inherited from the target object. + * Compiles expression. + */ + post(method: "Runtime.compileScript", params?: Runtime.CompileScriptParameterType, callback?: (err: Error | null, params: Runtime.CompileScriptReturnType) => void): void; + post(method: "Runtime.compileScript", callback?: (err: Error | null, params: Runtime.CompileScriptReturnType) => void): void; + + /** + * Disables reporting of execution contexts creation. + */ + post(method: "Runtime.disable", callback?: (err: Error | null) => void): void; + + /** + * Discards collected exceptions and console API calls. + */ + post(method: "Runtime.discardConsoleEntries", callback?: (err: Error | null) => void): void; + + /** + * Enables reporting of execution contexts creation by means of `executionContextCreated` event. +When the reporting gets enabled the event will be sent immediately for each existing execution +context. + */ + post(method: "Runtime.enable", callback?: (err: Error | null) => void): void; + + /** + * Evaluates expression on global object. + */ + post(method: "Runtime.evaluate", params?: Runtime.EvaluateParameterType, callback?: (err: Error | null, params: Runtime.EvaluateReturnType) => void): void; + post(method: "Runtime.evaluate", callback?: (err: Error | null, params: Runtime.EvaluateReturnType) => void): void; + + /** + * Returns the isolate id. + * @experimental + */ + post(method: "Runtime.getIsolateId", callback?: (err: Error | null, params: Runtime.GetIsolateIdReturnType) => void): void; + + /** + * Returns the JavaScript heap usage. +It is the total usage of the corresponding isolate not scoped to a particular Runtime. + * @experimental + */ + post(method: "Runtime.getHeapUsage", callback?: (err: Error | null, params: Runtime.GetHeapUsageReturnType) => void): void; + + /** + * Returns properties of a given object. Object group of the result is inherited from the target +object. */ post(method: "Runtime.getProperties", params?: Runtime.GetPropertiesParameterType, callback?: (err: Error | null, params: Runtime.GetPropertiesReturnType) => void): void; post(method: "Runtime.getProperties", callback?: (err: Error | null, params: Runtime.GetPropertiesReturnType) => void): void; + /** + * Returns all let, const and class variables from global scope. + */ + post(method: "Runtime.globalLexicalScopeNames", params?: Runtime.GlobalLexicalScopeNamesParameterType, callback?: (err: Error | null, params: Runtime.GlobalLexicalScopeNamesReturnType) => void): void; + post(method: "Runtime.globalLexicalScopeNames", callback?: (err: Error | null, params: Runtime.GlobalLexicalScopeNamesReturnType) => void): void; + + post(method: "Runtime.queryObjects", params?: Runtime.QueryObjectsParameterType, callback?: (err: Error | null, params: Runtime.QueryObjectsReturnType) => void): void; + post(method: "Runtime.queryObjects", callback?: (err: Error | null, params: Runtime.QueryObjectsReturnType) => void): void; + /** * Releases remote object with given id. */ @@ -1718,19 +2276,10 @@ declare module "inspector" { post(method: "Runtime.runIfWaitingForDebugger", callback?: (err: Error | null) => void): void; /** - * Enables reporting of execution contexts creation by means of executionContextCreated event. When the reporting gets enabled the event will be sent immediately for each existing execution context. + * Runs script with given id in a given context. */ - post(method: "Runtime.enable", callback?: (err: Error | null) => void): void; - - /** - * Disables reporting of execution contexts creation. - */ - post(method: "Runtime.disable", callback?: (err: Error | null) => void): void; - - /** - * Discards collected exceptions and console API calls. - */ - post(method: "Runtime.discardConsoleEntries", callback?: (err: Error | null) => void): void; + post(method: "Runtime.runScript", params?: Runtime.RunScriptParameterType, callback?: (err: Error | null, params: Runtime.RunScriptReturnType) => void): void; + post(method: "Runtime.runScript", callback?: (err: Error | null, params: Runtime.RunScriptReturnType) => void): void; /** * @experimental @@ -1739,245 +2288,15 @@ declare module "inspector" { post(method: "Runtime.setCustomObjectFormatterEnabled", callback?: (err: Error | null) => void): void; /** - * Compiles expression. - */ - post(method: "Runtime.compileScript", params?: Runtime.CompileScriptParameterType, callback?: (err: Error | null, params: Runtime.CompileScriptReturnType) => void): void; - post(method: "Runtime.compileScript", callback?: (err: Error | null, params: Runtime.CompileScriptReturnType) => void): void; - - /** - * Runs script with given id in a given context. - */ - post(method: "Runtime.runScript", params?: Runtime.RunScriptParameterType, callback?: (err: Error | null, params: Runtime.RunScriptReturnType) => void): void; - post(method: "Runtime.runScript", callback?: (err: Error | null, params: Runtime.RunScriptReturnType) => void): void; - /** - * Enables debugger for the given page. Clients should not assume that the debugging has been enabled until the result for this command is received. - */ - post(method: "Debugger.enable", callback?: (err: Error | null) => void): void; - - /** - * Disables debugger for given page. - */ - post(method: "Debugger.disable", callback?: (err: Error | null) => void): void; - - /** - * Activates / deactivates all breakpoints on the page. - */ - post(method: "Debugger.setBreakpointsActive", params?: Debugger.SetBreakpointsActiveParameterType, callback?: (err: Error | null) => void): void; - post(method: "Debugger.setBreakpointsActive", callback?: (err: Error | null) => void): void; - - /** - * Makes page not interrupt on any pauses (breakpoint, exception, dom exception etc). - */ - post(method: "Debugger.setSkipAllPauses", params?: Debugger.SetSkipAllPausesParameterType, callback?: (err: Error | null) => void): void; - post(method: "Debugger.setSkipAllPauses", callback?: (err: Error | null) => void): void; - - /** - * Sets JavaScript breakpoint at given location specified either by URL or URL regex. Once this command is issued, all existing parsed scripts will have breakpoints resolved and returned in locations property. Further matching script parsing will result in subsequent breakpointResolved events issued. This logical breakpoint will survive page reloads. - */ - post(method: "Debugger.setBreakpointByUrl", params?: Debugger.SetBreakpointByUrlParameterType, callback?: (err: Error | null, params: Debugger.SetBreakpointByUrlReturnType) => void): void; - post(method: "Debugger.setBreakpointByUrl", callback?: (err: Error | null, params: Debugger.SetBreakpointByUrlReturnType) => void): void; - - /** - * Sets JavaScript breakpoint at a given location. - */ - post(method: "Debugger.setBreakpoint", params?: Debugger.SetBreakpointParameterType, callback?: (err: Error | null, params: Debugger.SetBreakpointReturnType) => void): void; - post(method: "Debugger.setBreakpoint", callback?: (err: Error | null, params: Debugger.SetBreakpointReturnType) => void): void; - - /** - * Removes JavaScript breakpoint. - */ - post(method: "Debugger.removeBreakpoint", params?: Debugger.RemoveBreakpointParameterType, callback?: (err: Error | null) => void): void; - post(method: "Debugger.removeBreakpoint", callback?: (err: Error | null) => void): void; - - /** - * Returns possible locations for breakpoint. scriptId in start and end range locations should be the same. + * Terminate current or next JavaScript execution. +Will cancel the termination when the outer-most script execution ends. * @experimental */ - post(method: "Debugger.getPossibleBreakpoints", params?: Debugger.GetPossibleBreakpointsParameterType, callback?: (err: Error | null, params: Debugger.GetPossibleBreakpointsReturnType) => void): void; - post(method: "Debugger.getPossibleBreakpoints", callback?: (err: Error | null, params: Debugger.GetPossibleBreakpointsReturnType) => void): void; - + post(method: "Runtime.terminateExecution", callback?: (err: Error | null) => void): void; /** - * Continues execution until specific location is reached. + * Returns supported domains. */ - post(method: "Debugger.continueToLocation", params?: Debugger.ContinueToLocationParameterType, callback?: (err: Error | null) => void): void; - post(method: "Debugger.continueToLocation", callback?: (err: Error | null) => void): void; - - /** - * Steps over the statement. - */ - post(method: "Debugger.stepOver", callback?: (err: Error | null) => void): void; - - /** - * Steps into the function call. - */ - post(method: "Debugger.stepInto", callback?: (err: Error | null) => void): void; - - /** - * Steps out of the function call. - */ - post(method: "Debugger.stepOut", callback?: (err: Error | null) => void): void; - - /** - * Stops on the next JavaScript statement. - */ - post(method: "Debugger.pause", callback?: (err: Error | null) => void): void; - - /** - * Steps into next scheduled async task if any is scheduled before next pause. Returns success when async task is actually scheduled, returns error if no task were scheduled or another scheduleStepIntoAsync was called. - * @experimental - */ - post(method: "Debugger.scheduleStepIntoAsync", callback?: (err: Error | null) => void): void; - - /** - * Resumes JavaScript execution. - */ - post(method: "Debugger.resume", callback?: (err: Error | null) => void): void; - - /** - * Searches for given string in script content. - * @experimental - */ - post(method: "Debugger.searchInContent", params?: Debugger.SearchInContentParameterType, callback?: (err: Error | null, params: Debugger.SearchInContentReturnType) => void): void; - post(method: "Debugger.searchInContent", callback?: (err: Error | null, params: Debugger.SearchInContentReturnType) => void): void; - - /** - * Edits JavaScript source live. - */ - post(method: "Debugger.setScriptSource", params?: Debugger.SetScriptSourceParameterType, callback?: (err: Error | null, params: Debugger.SetScriptSourceReturnType) => void): void; - post(method: "Debugger.setScriptSource", callback?: (err: Error | null, params: Debugger.SetScriptSourceReturnType) => void): void; - - /** - * Restarts particular call frame from the beginning. - */ - post(method: "Debugger.restartFrame", params?: Debugger.RestartFrameParameterType, callback?: (err: Error | null, params: Debugger.RestartFrameReturnType) => void): void; - post(method: "Debugger.restartFrame", callback?: (err: Error | null, params: Debugger.RestartFrameReturnType) => void): void; - - /** - * Returns source for the script with given id. - */ - post(method: "Debugger.getScriptSource", params?: Debugger.GetScriptSourceParameterType, callback?: (err: Error | null, params: Debugger.GetScriptSourceReturnType) => void): void; - post(method: "Debugger.getScriptSource", callback?: (err: Error | null, params: Debugger.GetScriptSourceReturnType) => void): void; - - /** - * Defines pause on exceptions state. Can be set to stop on all exceptions, uncaught exceptions or no exceptions. Initial pause on exceptions state is none. - */ - post(method: "Debugger.setPauseOnExceptions", params?: Debugger.SetPauseOnExceptionsParameterType, callback?: (err: Error | null) => void): void; - post(method: "Debugger.setPauseOnExceptions", callback?: (err: Error | null) => void): void; - - /** - * Evaluates expression on a given call frame. - */ - post(method: "Debugger.evaluateOnCallFrame", params?: Debugger.EvaluateOnCallFrameParameterType, callback?: (err: Error | null, params: Debugger.EvaluateOnCallFrameReturnType) => void): void; - post(method: "Debugger.evaluateOnCallFrame", callback?: (err: Error | null, params: Debugger.EvaluateOnCallFrameReturnType) => void): void; - - /** - * Changes value of variable in a callframe. Object-based scopes are not supported and must be mutated manually. - */ - post(method: "Debugger.setVariableValue", params?: Debugger.SetVariableValueParameterType, callback?: (err: Error | null) => void): void; - post(method: "Debugger.setVariableValue", callback?: (err: Error | null) => void): void; - - /** - * Enables or disables async call stacks tracking. - */ - post(method: "Debugger.setAsyncCallStackDepth", params?: Debugger.SetAsyncCallStackDepthParameterType, callback?: (err: Error | null) => void): void; - post(method: "Debugger.setAsyncCallStackDepth", callback?: (err: Error | null) => void): void; - - /** - * Replace previous blackbox patterns with passed ones. Forces backend to skip stepping/pausing in scripts with url matching one of the patterns. VM will try to leave blackboxed script by performing 'step in' several times, finally resorting to 'step out' if unsuccessful. - * @experimental - */ - post(method: "Debugger.setBlackboxPatterns", params?: Debugger.SetBlackboxPatternsParameterType, callback?: (err: Error | null) => void): void; - post(method: "Debugger.setBlackboxPatterns", callback?: (err: Error | null) => void): void; - - /** - * Makes backend skip steps in the script in blackboxed ranges. VM will try leave blacklisted scripts by performing 'step in' several times, finally resorting to 'step out' if unsuccessful. Positions array contains positions where blackbox state is changed. First interval isn't blackboxed. Array should be sorted. - * @experimental - */ - post(method: "Debugger.setBlackboxedRanges", params?: Debugger.SetBlackboxedRangesParameterType, callback?: (err: Error | null) => void): void; - post(method: "Debugger.setBlackboxedRanges", callback?: (err: Error | null) => void): void; - /** - * Enables console domain, sends the messages collected so far to the client by means of the messageAdded notification. - */ - post(method: "Console.enable", callback?: (err: Error | null) => void): void; - - /** - * Disables console domain, prevents further console messages from being reported to the client. - */ - post(method: "Console.disable", callback?: (err: Error | null) => void): void; - - /** - * Does nothing. - */ - post(method: "Console.clearMessages", callback?: (err: Error | null) => void): void; - post(method: "Profiler.enable", callback?: (err: Error | null) => void): void; - - post(method: "Profiler.disable", callback?: (err: Error | null) => void): void; - - /** - * Changes CPU profiler sampling interval. Must be called before CPU profiles recording started. - */ - post(method: "Profiler.setSamplingInterval", params?: Profiler.SetSamplingIntervalParameterType, callback?: (err: Error | null) => void): void; - post(method: "Profiler.setSamplingInterval", callback?: (err: Error | null) => void): void; - - post(method: "Profiler.start", callback?: (err: Error | null) => void): void; - - post(method: "Profiler.stop", callback?: (err: Error | null, params: Profiler.StopReturnType) => void): void; - - /** - * Enable precise code coverage. Coverage data for JavaScript executed before enabling precise code coverage may be incomplete. Enabling prevents running optimized code and resets execution counters. - * @experimental - */ - post(method: "Profiler.startPreciseCoverage", params?: Profiler.StartPreciseCoverageParameterType, callback?: (err: Error | null) => void): void; - post(method: "Profiler.startPreciseCoverage", callback?: (err: Error | null) => void): void; - - /** - * Disable precise code coverage. Disabling releases unnecessary execution count records and allows executing optimized code. - * @experimental - */ - post(method: "Profiler.stopPreciseCoverage", callback?: (err: Error | null) => void): void; - - /** - * Collect coverage data for the current isolate, and resets execution counters. Precise code coverage needs to have started. - * @experimental - */ - post(method: "Profiler.takePreciseCoverage", callback?: (err: Error | null, params: Profiler.TakePreciseCoverageReturnType) => void): void; - - /** - * Collect coverage data for the current isolate. The coverage data may be incomplete due to garbage collection. - * @experimental - */ - post(method: "Profiler.getBestEffortCoverage", callback?: (err: Error | null, params: Profiler.GetBestEffortCoverageReturnType) => void): void; - post(method: "HeapProfiler.enable", callback?: (err: Error | null) => void): void; - - post(method: "HeapProfiler.disable", callback?: (err: Error | null) => void): void; - - post(method: "HeapProfiler.startTrackingHeapObjects", params?: HeapProfiler.StartTrackingHeapObjectsParameterType, callback?: (err: Error | null) => void): void; - post(method: "HeapProfiler.startTrackingHeapObjects", callback?: (err: Error | null) => void): void; - - post(method: "HeapProfiler.stopTrackingHeapObjects", params?: HeapProfiler.StopTrackingHeapObjectsParameterType, callback?: (err: Error | null) => void): void; - post(method: "HeapProfiler.stopTrackingHeapObjects", callback?: (err: Error | null) => void): void; - - post(method: "HeapProfiler.takeHeapSnapshot", params?: HeapProfiler.TakeHeapSnapshotParameterType, callback?: (err: Error | null) => void): void; - post(method: "HeapProfiler.takeHeapSnapshot", callback?: (err: Error | null) => void): void; - - post(method: "HeapProfiler.collectGarbage", callback?: (err: Error | null) => void): void; - - post(method: "HeapProfiler.getObjectByHeapObjectId", params?: HeapProfiler.GetObjectByHeapObjectIdParameterType, callback?: (err: Error | null, params: HeapProfiler.GetObjectByHeapObjectIdReturnType) => void): void; - post(method: "HeapProfiler.getObjectByHeapObjectId", callback?: (err: Error | null, params: HeapProfiler.GetObjectByHeapObjectIdReturnType) => void): void; - - /** - * Enables console to refer to the node with given id via $x (see Command Line API for more details $x functions). - */ - post(method: "HeapProfiler.addInspectedHeapObject", params?: HeapProfiler.AddInspectedHeapObjectParameterType, callback?: (err: Error | null) => void): void; - post(method: "HeapProfiler.addInspectedHeapObject", callback?: (err: Error | null) => void): void; - - post(method: "HeapProfiler.getHeapObjectId", params?: HeapProfiler.GetHeapObjectIdParameterType, callback?: (err: Error | null, params: HeapProfiler.GetHeapObjectIdReturnType) => void): void; - post(method: "HeapProfiler.getHeapObjectId", callback?: (err: Error | null, params: HeapProfiler.GetHeapObjectIdReturnType) => void): void; - - post(method: "HeapProfiler.startSampling", params?: HeapProfiler.StartSamplingParameterType, callback?: (err: Error | null) => void): void; - post(method: "HeapProfiler.startSampling", callback?: (err: Error | null) => void): void; - - post(method: "HeapProfiler.stopSampling", callback?: (err: Error | null, params: HeapProfiler.StopSamplingReturnType) => void): void; + post(method: "Schema.getDomains", callback?: (err: Error | null, params: Schema.GetDomainsReturnType) => void): void; // Events @@ -1989,49 +2308,9 @@ declare module "inspector" { addListener(event: "inspectorNotification", listener: (message: InspectorNotification<{}>) => void): this; /** - * Issued when new execution context is created. + * Issued when new console message is added. */ - addListener(event: "Runtime.executionContextCreated", listener: (message: InspectorNotification) => void): this; - - /** - * Issued when execution context is destroyed. - */ - addListener(event: "Runtime.executionContextDestroyed", listener: (message: InspectorNotification) => void): this; - - /** - * Issued when all executionContexts were cleared in browser - */ - addListener(event: "Runtime.executionContextsCleared", listener: () => void): this; - - /** - * Issued when exception was thrown and unhandled. - */ - addListener(event: "Runtime.exceptionThrown", listener: (message: InspectorNotification) => void): this; - - /** - * Issued when unhandled exception was revoked. - */ - addListener(event: "Runtime.exceptionRevoked", listener: (message: InspectorNotification) => void): this; - - /** - * Issued when console API was called. - */ - addListener(event: "Runtime.consoleAPICalled", listener: (message: InspectorNotification) => void): this; - - /** - * Issued when object should be inspected (for example, as a result of inspect() command line API call). - */ - addListener(event: "Runtime.inspectRequested", listener: (message: InspectorNotification) => void): this; - - /** - * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger. - */ - addListener(event: "Debugger.scriptParsed", listener: (message: InspectorNotification) => void): this; - - /** - * Fired when virtual machine fails to parse the script. - */ - addListener(event: "Debugger.scriptFailedToParse", listener: (message: InspectorNotification) => void): this; + addListener(event: "Console.messageAdded", listener: (message: InspectorNotification) => void): this; /** * Fired when breakpoint is resolved to an actual script and location. @@ -2049,52 +2328,97 @@ declare module "inspector" { addListener(event: "Debugger.resumed", listener: () => void): this; /** - * Issued when new console message is added. + * Fired when virtual machine fails to parse the script. */ - addListener(event: "Console.messageAdded", listener: (message: InspectorNotification) => void): this; + addListener(event: "Debugger.scriptFailedToParse", listener: (message: InspectorNotification) => void): this; /** - * Sent when new profile recording is started using console.profile() call. + * Fired when virtual machine parses script. This event is also fired for all known and uncollected +scripts upon enabling debugger. */ - addListener(event: "Profiler.consoleProfileStarted", listener: (message: InspectorNotification) => void): this; + addListener(event: "Debugger.scriptParsed", listener: (message: InspectorNotification) => void): this; - addListener(event: "Profiler.consoleProfileFinished", listener: (message: InspectorNotification) => void): this; addListener(event: "HeapProfiler.addHeapSnapshotChunk", listener: (message: InspectorNotification) => void): this; - addListener(event: "HeapProfiler.resetProfiles", listener: () => void): this; - addListener(event: "HeapProfiler.reportHeapSnapshotProgress", listener: (message: InspectorNotification) => void): this; - - /** - * If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. - */ - addListener(event: "HeapProfiler.lastSeenObjectId", listener: (message: InspectorNotification) => void): this; /** * If heap objects tracking has been started then backend may send update for one or more fragments */ addListener(event: "HeapProfiler.heapStatsUpdate", listener: (message: InspectorNotification) => void): this; + /** + * If heap objects tracking has been started then backend regularly sends a current value for last +seen object id and corresponding timestamp. If the were changes in the heap since last event +then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. + */ + addListener(event: "HeapProfiler.lastSeenObjectId", listener: (message: InspectorNotification) => void): this; + + addListener(event: "HeapProfiler.reportHeapSnapshotProgress", listener: (message: InspectorNotification) => void): this; + addListener(event: "HeapProfiler.resetProfiles", listener: () => void): this; + addListener(event: "Profiler.consoleProfileFinished", listener: (message: InspectorNotification) => void): this; + + /** + * Sent when new profile recording is started using console.profile() call. + */ + addListener(event: "Profiler.consoleProfileStarted", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when console API was called. + */ + addListener(event: "Runtime.consoleAPICalled", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when unhandled exception was revoked. + */ + addListener(event: "Runtime.exceptionRevoked", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when exception was thrown and unhandled. + */ + addListener(event: "Runtime.exceptionThrown", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when new execution context is created. + */ + addListener(event: "Runtime.executionContextCreated", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when execution context is destroyed. + */ + addListener(event: "Runtime.executionContextDestroyed", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when all executionContexts were cleared in browser + */ + addListener(event: "Runtime.executionContextsCleared", listener: () => void): this; + + /** + * Issued when object should be inspected (for example, as a result of inspect() command line API +call). + */ + addListener(event: "Runtime.inspectRequested", listener: (message: InspectorNotification) => void): this; + emit(event: string | symbol, ...args: any[]): boolean; emit(event: "inspectorNotification", message: InspectorNotification<{}>): boolean; - emit(event: "Runtime.executionContextCreated", message: InspectorNotification): boolean; - emit(event: "Runtime.executionContextDestroyed", message: InspectorNotification): boolean; - emit(event: "Runtime.executionContextsCleared"): boolean; - emit(event: "Runtime.exceptionThrown", message: InspectorNotification): boolean; - emit(event: "Runtime.exceptionRevoked", message: InspectorNotification): boolean; - emit(event: "Runtime.consoleAPICalled", message: InspectorNotification): boolean; - emit(event: "Runtime.inspectRequested", message: InspectorNotification): boolean; - emit(event: "Debugger.scriptParsed", message: InspectorNotification): boolean; - emit(event: "Debugger.scriptFailedToParse", message: InspectorNotification): boolean; + emit(event: "Console.messageAdded", message: InspectorNotification): boolean; emit(event: "Debugger.breakpointResolved", message: InspectorNotification): boolean; emit(event: "Debugger.paused", message: InspectorNotification): boolean; emit(event: "Debugger.resumed"): boolean; - emit(event: "Console.messageAdded", message: InspectorNotification): boolean; - emit(event: "Profiler.consoleProfileStarted", message: InspectorNotification): boolean; - emit(event: "Profiler.consoleProfileFinished", message: InspectorNotification): boolean; + emit(event: "Debugger.scriptFailedToParse", message: InspectorNotification): boolean; + emit(event: "Debugger.scriptParsed", message: InspectorNotification): boolean; emit(event: "HeapProfiler.addHeapSnapshotChunk", message: InspectorNotification): boolean; - emit(event: "HeapProfiler.resetProfiles"): boolean; - emit(event: "HeapProfiler.reportHeapSnapshotProgress", message: InspectorNotification): boolean; - emit(event: "HeapProfiler.lastSeenObjectId", message: InspectorNotification): boolean; emit(event: "HeapProfiler.heapStatsUpdate", message: InspectorNotification): boolean; + emit(event: "HeapProfiler.lastSeenObjectId", message: InspectorNotification): boolean; + emit(event: "HeapProfiler.reportHeapSnapshotProgress", message: InspectorNotification): boolean; + emit(event: "HeapProfiler.resetProfiles"): boolean; + emit(event: "Profiler.consoleProfileFinished", message: InspectorNotification): boolean; + emit(event: "Profiler.consoleProfileStarted", message: InspectorNotification): boolean; + emit(event: "Runtime.consoleAPICalled", message: InspectorNotification): boolean; + emit(event: "Runtime.exceptionRevoked", message: InspectorNotification): boolean; + emit(event: "Runtime.exceptionThrown", message: InspectorNotification): boolean; + emit(event: "Runtime.executionContextCreated", message: InspectorNotification): boolean; + emit(event: "Runtime.executionContextDestroyed", message: InspectorNotification): boolean; + emit(event: "Runtime.executionContextsCleared"): boolean; + emit(event: "Runtime.inspectRequested", message: InspectorNotification): boolean; on(event: string, listener: (...args: any[]) => void): this; @@ -2104,49 +2428,9 @@ declare module "inspector" { on(event: "inspectorNotification", listener: (message: InspectorNotification<{}>) => void): this; /** - * Issued when new execution context is created. + * Issued when new console message is added. */ - on(event: "Runtime.executionContextCreated", listener: (message: InspectorNotification) => void): this; - - /** - * Issued when execution context is destroyed. - */ - on(event: "Runtime.executionContextDestroyed", listener: (message: InspectorNotification) => void): this; - - /** - * Issued when all executionContexts were cleared in browser - */ - on(event: "Runtime.executionContextsCleared", listener: () => void): this; - - /** - * Issued when exception was thrown and unhandled. - */ - on(event: "Runtime.exceptionThrown", listener: (message: InspectorNotification) => void): this; - - /** - * Issued when unhandled exception was revoked. - */ - on(event: "Runtime.exceptionRevoked", listener: (message: InspectorNotification) => void): this; - - /** - * Issued when console API was called. - */ - on(event: "Runtime.consoleAPICalled", listener: (message: InspectorNotification) => void): this; - - /** - * Issued when object should be inspected (for example, as a result of inspect() command line API call). - */ - on(event: "Runtime.inspectRequested", listener: (message: InspectorNotification) => void): this; - - /** - * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger. - */ - on(event: "Debugger.scriptParsed", listener: (message: InspectorNotification) => void): this; - - /** - * Fired when virtual machine fails to parse the script. - */ - on(event: "Debugger.scriptFailedToParse", listener: (message: InspectorNotification) => void): this; + on(event: "Console.messageAdded", listener: (message: InspectorNotification) => void): this; /** * Fired when breakpoint is resolved to an actual script and location. @@ -2164,29 +2448,74 @@ declare module "inspector" { on(event: "Debugger.resumed", listener: () => void): this; /** - * Issued when new console message is added. + * Fired when virtual machine fails to parse the script. */ - on(event: "Console.messageAdded", listener: (message: InspectorNotification) => void): this; + on(event: "Debugger.scriptFailedToParse", listener: (message: InspectorNotification) => void): this; + + /** + * Fired when virtual machine parses script. This event is also fired for all known and uncollected +scripts upon enabling debugger. + */ + on(event: "Debugger.scriptParsed", listener: (message: InspectorNotification) => void): this; + + on(event: "HeapProfiler.addHeapSnapshotChunk", listener: (message: InspectorNotification) => void): this; + + /** + * If heap objects tracking has been started then backend may send update for one or more fragments + */ + on(event: "HeapProfiler.heapStatsUpdate", listener: (message: InspectorNotification) => void): this; + + /** + * If heap objects tracking has been started then backend regularly sends a current value for last +seen object id and corresponding timestamp. If the were changes in the heap since last event +then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. + */ + on(event: "HeapProfiler.lastSeenObjectId", listener: (message: InspectorNotification) => void): this; + + on(event: "HeapProfiler.reportHeapSnapshotProgress", listener: (message: InspectorNotification) => void): this; + on(event: "HeapProfiler.resetProfiles", listener: () => void): this; + on(event: "Profiler.consoleProfileFinished", listener: (message: InspectorNotification) => void): this; /** * Sent when new profile recording is started using console.profile() call. */ on(event: "Profiler.consoleProfileStarted", listener: (message: InspectorNotification) => void): this; - on(event: "Profiler.consoleProfileFinished", listener: (message: InspectorNotification) => void): this; - on(event: "HeapProfiler.addHeapSnapshotChunk", listener: (message: InspectorNotification) => void): this; - on(event: "HeapProfiler.resetProfiles", listener: () => void): this; - on(event: "HeapProfiler.reportHeapSnapshotProgress", listener: (message: InspectorNotification) => void): this; + /** + * Issued when console API was called. + */ + on(event: "Runtime.consoleAPICalled", listener: (message: InspectorNotification) => void): this; /** - * If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. + * Issued when unhandled exception was revoked. */ - on(event: "HeapProfiler.lastSeenObjectId", listener: (message: InspectorNotification) => void): this; + on(event: "Runtime.exceptionRevoked", listener: (message: InspectorNotification) => void): this; /** - * If heap objects tracking has been started then backend may send update for one or more fragments + * Issued when exception was thrown and unhandled. */ - on(event: "HeapProfiler.heapStatsUpdate", listener: (message: InspectorNotification) => void): this; + on(event: "Runtime.exceptionThrown", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when new execution context is created. + */ + on(event: "Runtime.executionContextCreated", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when execution context is destroyed. + */ + on(event: "Runtime.executionContextDestroyed", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when all executionContexts were cleared in browser + */ + on(event: "Runtime.executionContextsCleared", listener: () => void): this; + + /** + * Issued when object should be inspected (for example, as a result of inspect() command line API +call). + */ + on(event: "Runtime.inspectRequested", listener: (message: InspectorNotification) => void): this; once(event: string, listener: (...args: any[]) => void): this; @@ -2196,49 +2525,9 @@ declare module "inspector" { once(event: "inspectorNotification", listener: (message: InspectorNotification<{}>) => void): this; /** - * Issued when new execution context is created. + * Issued when new console message is added. */ - once(event: "Runtime.executionContextCreated", listener: (message: InspectorNotification) => void): this; - - /** - * Issued when execution context is destroyed. - */ - once(event: "Runtime.executionContextDestroyed", listener: (message: InspectorNotification) => void): this; - - /** - * Issued when all executionContexts were cleared in browser - */ - once(event: "Runtime.executionContextsCleared", listener: () => void): this; - - /** - * Issued when exception was thrown and unhandled. - */ - once(event: "Runtime.exceptionThrown", listener: (message: InspectorNotification) => void): this; - - /** - * Issued when unhandled exception was revoked. - */ - once(event: "Runtime.exceptionRevoked", listener: (message: InspectorNotification) => void): this; - - /** - * Issued when console API was called. - */ - once(event: "Runtime.consoleAPICalled", listener: (message: InspectorNotification) => void): this; - - /** - * Issued when object should be inspected (for example, as a result of inspect() command line API call). - */ - once(event: "Runtime.inspectRequested", listener: (message: InspectorNotification) => void): this; - - /** - * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger. - */ - once(event: "Debugger.scriptParsed", listener: (message: InspectorNotification) => void): this; - - /** - * Fired when virtual machine fails to parse the script. - */ - once(event: "Debugger.scriptFailedToParse", listener: (message: InspectorNotification) => void): this; + once(event: "Console.messageAdded", listener: (message: InspectorNotification) => void): this; /** * Fired when breakpoint is resolved to an actual script and location. @@ -2256,29 +2545,74 @@ declare module "inspector" { once(event: "Debugger.resumed", listener: () => void): this; /** - * Issued when new console message is added. + * Fired when virtual machine fails to parse the script. */ - once(event: "Console.messageAdded", listener: (message: InspectorNotification) => void): this; + once(event: "Debugger.scriptFailedToParse", listener: (message: InspectorNotification) => void): this; + + /** + * Fired when virtual machine parses script. This event is also fired for all known and uncollected +scripts upon enabling debugger. + */ + once(event: "Debugger.scriptParsed", listener: (message: InspectorNotification) => void): this; + + once(event: "HeapProfiler.addHeapSnapshotChunk", listener: (message: InspectorNotification) => void): this; + + /** + * If heap objects tracking has been started then backend may send update for one or more fragments + */ + once(event: "HeapProfiler.heapStatsUpdate", listener: (message: InspectorNotification) => void): this; + + /** + * If heap objects tracking has been started then backend regularly sends a current value for last +seen object id and corresponding timestamp. If the were changes in the heap since last event +then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. + */ + once(event: "HeapProfiler.lastSeenObjectId", listener: (message: InspectorNotification) => void): this; + + once(event: "HeapProfiler.reportHeapSnapshotProgress", listener: (message: InspectorNotification) => void): this; + once(event: "HeapProfiler.resetProfiles", listener: () => void): this; + once(event: "Profiler.consoleProfileFinished", listener: (message: InspectorNotification) => void): this; /** * Sent when new profile recording is started using console.profile() call. */ once(event: "Profiler.consoleProfileStarted", listener: (message: InspectorNotification) => void): this; - once(event: "Profiler.consoleProfileFinished", listener: (message: InspectorNotification) => void): this; - once(event: "HeapProfiler.addHeapSnapshotChunk", listener: (message: InspectorNotification) => void): this; - once(event: "HeapProfiler.resetProfiles", listener: () => void): this; - once(event: "HeapProfiler.reportHeapSnapshotProgress", listener: (message: InspectorNotification) => void): this; + /** + * Issued when console API was called. + */ + once(event: "Runtime.consoleAPICalled", listener: (message: InspectorNotification) => void): this; /** - * If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. + * Issued when unhandled exception was revoked. */ - once(event: "HeapProfiler.lastSeenObjectId", listener: (message: InspectorNotification) => void): this; + once(event: "Runtime.exceptionRevoked", listener: (message: InspectorNotification) => void): this; /** - * If heap objects tracking has been started then backend may send update for one or more fragments + * Issued when exception was thrown and unhandled. */ - once(event: "HeapProfiler.heapStatsUpdate", listener: (message: InspectorNotification) => void): this; + once(event: "Runtime.exceptionThrown", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when new execution context is created. + */ + once(event: "Runtime.executionContextCreated", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when execution context is destroyed. + */ + once(event: "Runtime.executionContextDestroyed", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when all executionContexts were cleared in browser + */ + once(event: "Runtime.executionContextsCleared", listener: () => void): this; + + /** + * Issued when object should be inspected (for example, as a result of inspect() command line API +call). + */ + once(event: "Runtime.inspectRequested", listener: (message: InspectorNotification) => void): this; prependListener(event: string, listener: (...args: any[]) => void): this; @@ -2288,49 +2622,9 @@ declare module "inspector" { prependListener(event: "inspectorNotification", listener: (message: InspectorNotification<{}>) => void): this; /** - * Issued when new execution context is created. + * Issued when new console message is added. */ - prependListener(event: "Runtime.executionContextCreated", listener: (message: InspectorNotification) => void): this; - - /** - * Issued when execution context is destroyed. - */ - prependListener(event: "Runtime.executionContextDestroyed", listener: (message: InspectorNotification) => void): this; - - /** - * Issued when all executionContexts were cleared in browser - */ - prependListener(event: "Runtime.executionContextsCleared", listener: () => void): this; - - /** - * Issued when exception was thrown and unhandled. - */ - prependListener(event: "Runtime.exceptionThrown", listener: (message: InspectorNotification) => void): this; - - /** - * Issued when unhandled exception was revoked. - */ - prependListener(event: "Runtime.exceptionRevoked", listener: (message: InspectorNotification) => void): this; - - /** - * Issued when console API was called. - */ - prependListener(event: "Runtime.consoleAPICalled", listener: (message: InspectorNotification) => void): this; - - /** - * Issued when object should be inspected (for example, as a result of inspect() command line API call). - */ - prependListener(event: "Runtime.inspectRequested", listener: (message: InspectorNotification) => void): this; - - /** - * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger. - */ - prependListener(event: "Debugger.scriptParsed", listener: (message: InspectorNotification) => void): this; - - /** - * Fired when virtual machine fails to parse the script. - */ - prependListener(event: "Debugger.scriptFailedToParse", listener: (message: InspectorNotification) => void): this; + prependListener(event: "Console.messageAdded", listener: (message: InspectorNotification) => void): this; /** * Fired when breakpoint is resolved to an actual script and location. @@ -2348,29 +2642,74 @@ declare module "inspector" { prependListener(event: "Debugger.resumed", listener: () => void): this; /** - * Issued when new console message is added. + * Fired when virtual machine fails to parse the script. */ - prependListener(event: "Console.messageAdded", listener: (message: InspectorNotification) => void): this; + prependListener(event: "Debugger.scriptFailedToParse", listener: (message: InspectorNotification) => void): this; + + /** + * Fired when virtual machine parses script. This event is also fired for all known and uncollected +scripts upon enabling debugger. + */ + prependListener(event: "Debugger.scriptParsed", listener: (message: InspectorNotification) => void): this; + + prependListener(event: "HeapProfiler.addHeapSnapshotChunk", listener: (message: InspectorNotification) => void): this; + + /** + * If heap objects tracking has been started then backend may send update for one or more fragments + */ + prependListener(event: "HeapProfiler.heapStatsUpdate", listener: (message: InspectorNotification) => void): this; + + /** + * If heap objects tracking has been started then backend regularly sends a current value for last +seen object id and corresponding timestamp. If the were changes in the heap since last event +then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. + */ + prependListener(event: "HeapProfiler.lastSeenObjectId", listener: (message: InspectorNotification) => void): this; + + prependListener(event: "HeapProfiler.reportHeapSnapshotProgress", listener: (message: InspectorNotification) => void): this; + prependListener(event: "HeapProfiler.resetProfiles", listener: () => void): this; + prependListener(event: "Profiler.consoleProfileFinished", listener: (message: InspectorNotification) => void): this; /** * Sent when new profile recording is started using console.profile() call. */ prependListener(event: "Profiler.consoleProfileStarted", listener: (message: InspectorNotification) => void): this; - prependListener(event: "Profiler.consoleProfileFinished", listener: (message: InspectorNotification) => void): this; - prependListener(event: "HeapProfiler.addHeapSnapshotChunk", listener: (message: InspectorNotification) => void): this; - prependListener(event: "HeapProfiler.resetProfiles", listener: () => void): this; - prependListener(event: "HeapProfiler.reportHeapSnapshotProgress", listener: (message: InspectorNotification) => void): this; + /** + * Issued when console API was called. + */ + prependListener(event: "Runtime.consoleAPICalled", listener: (message: InspectorNotification) => void): this; /** - * If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. + * Issued when unhandled exception was revoked. */ - prependListener(event: "HeapProfiler.lastSeenObjectId", listener: (message: InspectorNotification) => void): this; + prependListener(event: "Runtime.exceptionRevoked", listener: (message: InspectorNotification) => void): this; /** - * If heap objects tracking has been started then backend may send update for one or more fragments + * Issued when exception was thrown and unhandled. */ - prependListener(event: "HeapProfiler.heapStatsUpdate", listener: (message: InspectorNotification) => void): this; + prependListener(event: "Runtime.exceptionThrown", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when new execution context is created. + */ + prependListener(event: "Runtime.executionContextCreated", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when execution context is destroyed. + */ + prependListener(event: "Runtime.executionContextDestroyed", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when all executionContexts were cleared in browser + */ + prependListener(event: "Runtime.executionContextsCleared", listener: () => void): this; + + /** + * Issued when object should be inspected (for example, as a result of inspect() command line API +call). + */ + prependListener(event: "Runtime.inspectRequested", listener: (message: InspectorNotification) => void): this; prependOnceListener(event: string, listener: (...args: any[]) => void): this; @@ -2380,49 +2719,9 @@ declare module "inspector" { prependOnceListener(event: "inspectorNotification", listener: (message: InspectorNotification<{}>) => void): this; /** - * Issued when new execution context is created. + * Issued when new console message is added. */ - prependOnceListener(event: "Runtime.executionContextCreated", listener: (message: InspectorNotification) => void): this; - - /** - * Issued when execution context is destroyed. - */ - prependOnceListener(event: "Runtime.executionContextDestroyed", listener: (message: InspectorNotification) => void): this; - - /** - * Issued when all executionContexts were cleared in browser - */ - prependOnceListener(event: "Runtime.executionContextsCleared", listener: () => void): this; - - /** - * Issued when exception was thrown and unhandled. - */ - prependOnceListener(event: "Runtime.exceptionThrown", listener: (message: InspectorNotification) => void): this; - - /** - * Issued when unhandled exception was revoked. - */ - prependOnceListener(event: "Runtime.exceptionRevoked", listener: (message: InspectorNotification) => void): this; - - /** - * Issued when console API was called. - */ - prependOnceListener(event: "Runtime.consoleAPICalled", listener: (message: InspectorNotification) => void): this; - - /** - * Issued when object should be inspected (for example, as a result of inspect() command line API call). - */ - prependOnceListener(event: "Runtime.inspectRequested", listener: (message: InspectorNotification) => void): this; - - /** - * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger. - */ - prependOnceListener(event: "Debugger.scriptParsed", listener: (message: InspectorNotification) => void): this; - - /** - * Fired when virtual machine fails to parse the script. - */ - prependOnceListener(event: "Debugger.scriptFailedToParse", listener: (message: InspectorNotification) => void): this; + prependOnceListener(event: "Console.messageAdded", listener: (message: InspectorNotification) => void): this; /** * Fired when breakpoint is resolved to an actual script and location. @@ -2440,29 +2739,74 @@ declare module "inspector" { prependOnceListener(event: "Debugger.resumed", listener: () => void): this; /** - * Issued when new console message is added. + * Fired when virtual machine fails to parse the script. */ - prependOnceListener(event: "Console.messageAdded", listener: (message: InspectorNotification) => void): this; + prependOnceListener(event: "Debugger.scriptFailedToParse", listener: (message: InspectorNotification) => void): this; + + /** + * Fired when virtual machine parses script. This event is also fired for all known and uncollected +scripts upon enabling debugger. + */ + prependOnceListener(event: "Debugger.scriptParsed", listener: (message: InspectorNotification) => void): this; + + prependOnceListener(event: "HeapProfiler.addHeapSnapshotChunk", listener: (message: InspectorNotification) => void): this; + + /** + * If heap objects tracking has been started then backend may send update for one or more fragments + */ + prependOnceListener(event: "HeapProfiler.heapStatsUpdate", listener: (message: InspectorNotification) => void): this; + + /** + * If heap objects tracking has been started then backend regularly sends a current value for last +seen object id and corresponding timestamp. If the were changes in the heap since last event +then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. + */ + prependOnceListener(event: "HeapProfiler.lastSeenObjectId", listener: (message: InspectorNotification) => void): this; + + prependOnceListener(event: "HeapProfiler.reportHeapSnapshotProgress", listener: (message: InspectorNotification) => void): this; + prependOnceListener(event: "HeapProfiler.resetProfiles", listener: () => void): this; + prependOnceListener(event: "Profiler.consoleProfileFinished", listener: (message: InspectorNotification) => void): this; /** * Sent when new profile recording is started using console.profile() call. */ prependOnceListener(event: "Profiler.consoleProfileStarted", listener: (message: InspectorNotification) => void): this; - prependOnceListener(event: "Profiler.consoleProfileFinished", listener: (message: InspectorNotification) => void): this; - prependOnceListener(event: "HeapProfiler.addHeapSnapshotChunk", listener: (message: InspectorNotification) => void): this; - prependOnceListener(event: "HeapProfiler.resetProfiles", listener: () => void): this; - prependOnceListener(event: "HeapProfiler.reportHeapSnapshotProgress", listener: (message: InspectorNotification) => void): this; + /** + * Issued when console API was called. + */ + prependOnceListener(event: "Runtime.consoleAPICalled", listener: (message: InspectorNotification) => void): this; /** - * If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. + * Issued when unhandled exception was revoked. */ - prependOnceListener(event: "HeapProfiler.lastSeenObjectId", listener: (message: InspectorNotification) => void): this; + prependOnceListener(event: "Runtime.exceptionRevoked", listener: (message: InspectorNotification) => void): this; /** - * If heap objects tracking has been started then backend may send update for one or more fragments + * Issued when exception was thrown and unhandled. */ - prependOnceListener(event: "HeapProfiler.heapStatsUpdate", listener: (message: InspectorNotification) => void): this; + prependOnceListener(event: "Runtime.exceptionThrown", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when new execution context is created. + */ + prependOnceListener(event: "Runtime.executionContextCreated", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when execution context is destroyed. + */ + prependOnceListener(event: "Runtime.executionContextDestroyed", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when all executionContexts were cleared in browser + */ + prependOnceListener(event: "Runtime.executionContextsCleared", listener: () => void): this; + + /** + * Issued when object should be inspected (for example, as a result of inspect() command line API +call). + */ + prependOnceListener(event: "Runtime.inspectRequested", listener: (message: InspectorNotification) => void): this; } // Top Level API diff --git a/types/node/node-tests.ts b/types/node/node-tests.ts index a7fcd4d44a..542e8111a2 100644 --- a/types/node/node-tests.ts +++ b/types/node/node-tests.ts @@ -782,6 +782,8 @@ namespace util_tests { }); assert(typeof util.inspect.custom === 'symbol'); + util.formatWithOptions({ colors: true }, 'See object %O', { foo: 42 }); + // util.callbackify // tslint:disable-next-line no-unnecessary-class class callbackifyTest { @@ -862,6 +864,7 @@ namespace util_tests { var arg0NoResult: () => Promise = util.promisify((cb: (err: Error) => void): void => { }); var arg1: (arg: string) => Promise = util.promisify((arg: string, cb: (err: Error, result: number) => void): void => { }); var arg1NoResult: (arg: string) => Promise = util.promisify((arg: string, cb: (err: Error) => void): void => { }); + var cbOptionalError: () => Promise = util.promisify((cb: (err?: Error | null) => void): void => { cb(); }); assert(typeof util.promisify.custom === 'symbol'); // util.deprecate const foo = () => {}; @@ -1205,8 +1208,7 @@ namespace crypto_tests { { // crypto_cipher_decipher_dataview_test let key: Buffer = new Buffer([1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 2, 3, 4, 5, 6, 7]); - let clearText: DataView = new DataView( - new Buffer([1, 2, 3, 4, 5, 6, 7, 8, 9, 8, 7, 6, 5, 4]).buffer); + let clearText: DataView = new DataView(new Buffer([1, 2, 3, 4, 5, 6, 7, 8, 9, 8, 7, 6, 5, 4]).buffer); let cipher: crypto.Cipher = crypto.createCipher("aes-128-ecb", key); let cipherBuffers: Buffer[] = []; cipherBuffers.push(cipher.update(clearText)); @@ -1224,6 +1226,56 @@ namespace crypto_tests { assert.deepEqual(clearText2, clearText); } + { + const key = 'keykeykeykeykeykeykeykey'; + const nonce = crypto.randomBytes(12); + const aad = Buffer.from('0123456789', 'hex'); + + const cipher = crypto.createCipheriv('aes-192-ccm', key, nonce, { + authTagLength: 16 + }); + const plaintext = 'Hello world'; + cipher.setAAD(aad, { + plaintextLength: Buffer.byteLength(plaintext) + }); + const ciphertext = cipher.update(plaintext, 'utf8'); + cipher.final(); + const tag = cipher.getAuthTag(); + + const decipher = crypto.createDecipheriv('aes-192-ccm', key, nonce, { + authTagLength: 16 + }); + decipher.setAuthTag(tag); + decipher.setAAD(aad, { + plaintextLength: ciphertext.length + }); + const receivedPlaintext: string = decipher.update(ciphertext, null, 'utf8'); + decipher.final(); + } + + { + const key = 'keykeykeykeykeykeykeykey'; + const nonce = crypto.randomBytes(12); + const aad = Buffer.from('0123456789', 'hex'); + + const cipher = crypto.createCipheriv('aes-192-gcm', key, nonce); + const plaintext = 'Hello world'; + cipher.setAAD(aad, { + plaintextLength: Buffer.byteLength(plaintext) + }); + const ciphertext = cipher.update(plaintext, 'utf8'); + cipher.final(); + const tag = cipher.getAuthTag(); + + const decipher = crypto.createDecipheriv('aes-192-gcm', key, nonce); + decipher.setAuthTag(tag); + decipher.setAAD(aad, { + plaintextLength: ciphertext.length + }); + const receivedPlaintext: string = decipher.update(ciphertext, null, 'utf8'); + decipher.final(); + } + { // crypto_timingsafeequal_buffer_test let buffer1: Buffer = new Buffer([1, 2, 3, 4, 5]); @@ -1708,7 +1760,25 @@ namespace http_tests { } { + http.get('http://www.example.com/xyz'); http.request('http://www.example.com/xyz'); + + http.get('http://www.example.com/xyz', (res: http.IncomingMessage): void => {}); + http.request('http://www.example.com/xyz', (res: http.IncomingMessage): void => {}); + + http.get(new url.URL('http://www.example.com/xyz')); + http.request(new url.URL('http://www.example.com/xyz')); + + http.get(new url.URL('http://www.example.com/xyz'), (res: http.IncomingMessage): void => {}); + http.request(new url.URL('http://www.example.com/xyz'), (res: http.IncomingMessage): void => {}); + + const opts: http.RequestOptions = { + path: '"/some/path' + }; + http.get(new url.URL('http://www.example.com'), opts); + http.request(new url.URL('http://www.example.com'), opts); + http.get(new url.URL('http://www.example.com/xyz'), opts, (res: http.IncomingMessage): void => {}); + http.request(new url.URL('http://www.example.com/xyz'), opts, (res: http.IncomingMessage): void => {}); } { @@ -1770,8 +1840,26 @@ namespace https_tests { agent: undefined }); + https.get('http://www.example.com/xyz'); https.request('http://www.example.com/xyz'); + https.get('http://www.example.com/xyz', (res: http.IncomingMessage): void => {}); + https.request('http://www.example.com/xyz', (res: http.IncomingMessage): void => {}); + + https.get(new url.URL('http://www.example.com/xyz')); + https.request(new url.URL('http://www.example.com/xyz')); + + https.get(new url.URL('http://www.example.com/xyz'), (res: http.IncomingMessage): void => {}); + https.request(new url.URL('http://www.example.com/xyz'), (res: http.IncomingMessage): void => {}); + + const opts: https.RequestOptions = { + path: '/some/path' + }; + https.get(new url.URL('http://www.example.com'), opts); + https.request(new url.URL('http://www.example.com'), opts); + https.get(new url.URL('http://www.example.com/xyz'), opts, (res: http.IncomingMessage): void => {}); + https.request(new url.URL('http://www.example.com/xyz'), opts, (res: http.IncomingMessage): void => {}); + https.globalAgent.options.ca = []; { @@ -2329,7 +2417,7 @@ namespace child_process_tests { childProcess.exec("echo test", { windowsHide: true }); childProcess.spawn("echo", ["test"], { windowsHide: true }); childProcess.spawn("echo", ["test"], { windowsHide: true, argv0: "echo-test" }); - childProcess.spawn("echo", ["test"], { stdio: [0xdeadbeef, undefined, "pipe"] }); + childProcess.spawn("echo", ["test"], { stdio: [0xdeadbeef, "inherit", undefined, "pipe"] }); childProcess.spawnSync("echo test"); childProcess.spawnSync("echo test", {windowsVerbatimArguments: false}); childProcess.spawnSync("echo test", {windowsVerbatimArguments: false, argv0: "echo-test"}); diff --git a/types/node/v8/index.d.ts b/types/node/v8/index.d.ts index dc44245c59..af15c21fda 100644 --- a/types/node/v8/index.d.ts +++ b/types/node/v8/index.d.ts @@ -1588,6 +1588,7 @@ declare module "os" { netmask: string; mac: string; internal: boolean; + cidr: string | null; } export interface NetworkInterfaceInfoIPv4 extends NetworkInterfaceBase { @@ -5688,17 +5689,17 @@ declare module "util" { export function promisify(fn: CustomPromisify): TCustom; export function promisify(fn: (callback: (err: Error | null, result: TResult) => void) => void): () => Promise; - export function promisify(fn: (callback: (err: Error | null) => void) => void): () => Promise; + export function promisify(fn: (callback: (err?: Error | null) => void) => void): () => Promise; export function promisify(fn: (arg1: T1, callback: (err: Error | null, result: TResult) => void) => void): (arg1: T1) => Promise; - export function promisify(fn: (arg1: T1, callback: (err: Error | null) => void) => void): (arg1: T1) => Promise; + export function promisify(fn: (arg1: T1, callback: (err?: Error | null) => void) => void): (arg1: T1) => Promise; export function promisify(fn: (arg1: T1, arg2: T2, callback: (err: Error | null, result: TResult) => void) => void): (arg1: T1, arg2: T2) => Promise; - export function promisify(fn: (arg1: T1, arg2: T2, callback: (err: Error | null) => void) => void): (arg1: T1, arg2: T2) => Promise; + export function promisify(fn: (arg1: T1, arg2: T2, callback: (err?: Error | null) => void) => void): (arg1: T1, arg2: T2) => Promise; export function promisify(fn: (arg1: T1, arg2: T2, arg3: T3, callback: (err: Error | null, result: TResult) => void) => void): (arg1: T1, arg2: T2, arg3: T3) => Promise; - export function promisify(fn: (arg1: T1, arg2: T2, arg3: T3, callback: (err: Error | null) => void) => void): (arg1: T1, arg2: T2, arg3: T3) => Promise; + export function promisify(fn: (arg1: T1, arg2: T2, arg3: T3, callback: (err?: Error | null) => void) => void): (arg1: T1, arg2: T2, arg3: T3) => Promise; export function promisify(fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, callback: (err: Error | null, result: TResult) => void) => void): (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Promise; - export function promisify(fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, callback: (err: Error | null) => void) => void): (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Promise; + export function promisify(fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, callback: (err?: Error | null) => void) => void): (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Promise; export function promisify(fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, callback: (err: Error | null, result: TResult) => void) => void): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => Promise; - export function promisify(fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, callback: (err: Error | null) => void) => void): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => Promise; + export function promisify(fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, callback: (err?: Error | null) => void) => void): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => Promise; export function promisify(fn: Function): Function; export namespace promisify { const custom: symbol; diff --git a/types/node/v8/inspector.d.ts b/types/node/v8/inspector.d.ts index 955239b486..19bba5af01 100644 --- a/types/node/v8/inspector.d.ts +++ b/types/node/v8/inspector.d.ts @@ -244,7 +244,7 @@ declare module "inspector" { */ export interface CallArgument { /** - * Primitive value. + * Primitive value or serializable javascript object. */ value?: any; /** @@ -416,7 +416,7 @@ declare module "inspector" { */ userGesture?: boolean; /** - * Whether execution should wait for promise to be resolved. If the result of evaluation is not a Promise, it's considered to be an error. + * Whether execution should await for resulting value and return once awaited promise is resolved. */ awaitPromise?: boolean; } @@ -468,7 +468,7 @@ declare module "inspector" { */ userGesture?: boolean; /** - * Whether execution should wait for promise to be resolved. If the result of evaluation is not a Promise, it's considered to be an error. + * Whether execution should await for resulting value and return once awaited promise is resolved. */ awaitPromise?: boolean; } @@ -561,11 +561,18 @@ declare module "inspector" { */ generatePreview?: boolean; /** - * Whether execution should wait for promise to be resolved. If the result of evaluation is not a Promise, it's considered to be an error. + * Whether execution should await for resulting value and return once awaited promise is resolved. */ awaitPromise?: boolean; } + export interface QueryObjectsParameterType { + /** + * Identifier of the prototype to return objects for. + */ + prototypeObjectId: Runtime.RemoteObjectId; + } + export interface EvaluateReturnType { /** * Evaluation result. @@ -636,6 +643,13 @@ declare module "inspector" { exceptionDetails?: Runtime.ExceptionDetails; } + export interface QueryObjectsReturnType { + /** + * Array with objects. + */ + objects: Runtime.RemoteObject; + } + export interface ExecutionContextCreatedEventDataType { /** * A newly created execution context. @@ -1476,6 +1490,10 @@ declare module "inspector" { * Collect accurate call counts beyond simple 'covered' or 'not covered'. */ callCount?: boolean; + /** + * Collect block-based coverage. + */ + detailed?: boolean; } export interface StopReturnType { @@ -1749,6 +1767,12 @@ declare module "inspector" { */ post(method: "Runtime.runScript", params?: Runtime.RunScriptParameterType, callback?: (err: Error | null, params: Runtime.RunScriptReturnType) => void): void; post(method: "Runtime.runScript", callback?: (err: Error | null, params: Runtime.RunScriptReturnType) => void): void; + + /** + * @experimental + */ + post(method: "Runtime.queryObjects", params?: Runtime.QueryObjectsParameterType, callback?: (err: Error | null, params: Runtime.QueryObjectsReturnType) => void): void; + post(method: "Runtime.queryObjects", callback?: (err: Error | null, params: Runtime.QueryObjectsReturnType) => void): void; /** * Enables debugger for the given page. Clients should not assume that the debugging has been enabled until the result for this command is received. */ diff --git a/types/node/v8/node-tests.ts b/types/node/v8/node-tests.ts index d89e6faacc..e1d14b9089 100644 --- a/types/node/v8/node-tests.ts +++ b/types/node/v8/node-tests.ts @@ -819,6 +819,8 @@ namespace util_tests { var arg0NoResult: () => Promise = util.promisify((cb: (err: Error) => void): void => { }); var arg1: (arg: string) => Promise = util.promisify((arg: string, cb: (err: Error, result: number) => void): void => { }); var arg1NoResult: (arg: string) => Promise = util.promisify((arg: string, cb: (err: Error) => void): void => { }); + // The following test requires typescript >= 2.4, but definitions currently tested with typescript@2.1 + // var cbOptionalError: () => Promise = util.promisify((cb: (err?: Error | null) => void): void => { cb(); }); assert(typeof util.promisify.custom === 'symbol'); // util.deprecate const foo = () => {}; diff --git a/types/node/v9/index.d.ts b/types/node/v9/index.d.ts index fd89e18e16..2a110b6c9b 100644 --- a/types/node/v9/index.d.ts +++ b/types/node/v9/index.d.ts @@ -1677,6 +1677,7 @@ declare module "os" { netmask: string; mac: string; internal: boolean; + cidr: string | null; } export interface NetworkInterfaceInfoIPv4 extends NetworkInterfaceBase { @@ -5772,17 +5773,17 @@ declare module "util" { export function promisify(fn: CustomPromisify): TCustom; export function promisify(fn: (callback: (err: Error | null, result: TResult) => void) => void): () => Promise; - export function promisify(fn: (callback: (err: Error | null) => void) => void): () => Promise; + export function promisify(fn: (callback: (err?: Error | null) => void) => void): () => Promise; export function promisify(fn: (arg1: T1, callback: (err: Error | null, result: TResult) => void) => void): (arg1: T1) => Promise; - export function promisify(fn: (arg1: T1, callback: (err: Error | null) => void) => void): (arg1: T1) => Promise; + export function promisify(fn: (arg1: T1, callback: (err?: Error | null) => void) => void): (arg1: T1) => Promise; export function promisify(fn: (arg1: T1, arg2: T2, callback: (err: Error | null, result: TResult) => void) => void): (arg1: T1, arg2: T2) => Promise; - export function promisify(fn: (arg1: T1, arg2: T2, callback: (err: Error | null) => void) => void): (arg1: T1, arg2: T2) => Promise; + export function promisify(fn: (arg1: T1, arg2: T2, callback: (err?: Error | null) => void) => void): (arg1: T1, arg2: T2) => Promise; export function promisify(fn: (arg1: T1, arg2: T2, arg3: T3, callback: (err: Error | null, result: TResult) => void) => void): (arg1: T1, arg2: T2, arg3: T3) => Promise; - export function promisify(fn: (arg1: T1, arg2: T2, arg3: T3, callback: (err: Error | null) => void) => void): (arg1: T1, arg2: T2, arg3: T3) => Promise; + export function promisify(fn: (arg1: T1, arg2: T2, arg3: T3, callback: (err?: Error | null) => void) => void): (arg1: T1, arg2: T2, arg3: T3) => Promise; export function promisify(fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, callback: (err: Error | null, result: TResult) => void) => void): (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Promise; - export function promisify(fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, callback: (err: Error | null) => void) => void): (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Promise; + export function promisify(fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, callback: (err?: Error | null) => void) => void): (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Promise; export function promisify(fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, callback: (err: Error | null, result: TResult) => void) => void): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => Promise; - export function promisify(fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, callback: (err: Error | null) => void) => void): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => Promise; + export function promisify(fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, callback: (err?: Error | null) => void) => void): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => Promise; export function promisify(fn: Function): Function; export namespace promisify { const custom: symbol; diff --git a/types/node/v9/inspector.d.ts b/types/node/v9/inspector.d.ts index 955239b486..7088455c8c 100644 --- a/types/node/v9/inspector.d.ts +++ b/types/node/v9/inspector.d.ts @@ -244,7 +244,7 @@ declare module "inspector" { */ export interface CallArgument { /** - * Primitive value. + * Primitive value or serializable javascript object. */ value?: any; /** @@ -416,7 +416,7 @@ declare module "inspector" { */ userGesture?: boolean; /** - * Whether execution should wait for promise to be resolved. If the result of evaluation is not a Promise, it's considered to be an error. + * Whether execution should await for resulting value and return once awaited promise is resolved. */ awaitPromise?: boolean; } @@ -468,7 +468,7 @@ declare module "inspector" { */ userGesture?: boolean; /** - * Whether execution should wait for promise to be resolved. If the result of evaluation is not a Promise, it's considered to be an error. + * Whether execution should await for resulting value and return once awaited promise is resolved. */ awaitPromise?: boolean; } @@ -561,11 +561,25 @@ declare module "inspector" { */ generatePreview?: boolean; /** - * Whether execution should wait for promise to be resolved. If the result of evaluation is not a Promise, it's considered to be an error. + * Whether execution should await for resulting value and return once awaited promise is resolved. */ awaitPromise?: boolean; } + export interface QueryObjectsParameterType { + /** + * Identifier of the prototype to return objects for. + */ + prototypeObjectId: Runtime.RemoteObjectId; + } + + export interface GlobalLexicalScopeNamesParameterType { + /** + * Specifies in which execution context to lookup global scope variables. + */ + executionContextId?: Runtime.ExecutionContextId; + } + export interface EvaluateReturnType { /** * Evaluation result. @@ -636,6 +650,17 @@ declare module "inspector" { exceptionDetails?: Runtime.ExceptionDetails; } + export interface QueryObjectsReturnType { + /** + * Array with objects. + */ + objects: Runtime.RemoteObject; + } + + export interface GlobalLexicalScopeNamesReturnType { + names: string[]; + } + export interface ExecutionContextCreatedEventDataType { /** * A newly created execution context. @@ -1476,6 +1501,10 @@ declare module "inspector" { * Collect accurate call counts beyond simple 'covered' or 'not covered'. */ callCount?: boolean; + /** + * Collect block-based coverage. + */ + detailed?: boolean; } export interface StopReturnType { @@ -1749,6 +1778,19 @@ declare module "inspector" { */ post(method: "Runtime.runScript", params?: Runtime.RunScriptParameterType, callback?: (err: Error | null, params: Runtime.RunScriptReturnType) => void): void; post(method: "Runtime.runScript", callback?: (err: Error | null, params: Runtime.RunScriptReturnType) => void): void; + + /** + * @experimental + */ + post(method: "Runtime.queryObjects", params?: Runtime.QueryObjectsParameterType, callback?: (err: Error | null, params: Runtime.QueryObjectsReturnType) => void): void; + post(method: "Runtime.queryObjects", callback?: (err: Error | null, params: Runtime.QueryObjectsReturnType) => void): void; + + /** + * Returns all let, const and class variables from global scope. + * @experimental + */ + post(method: "Runtime.globalLexicalScopeNames", params?: Runtime.GlobalLexicalScopeNamesParameterType, callback?: (err: Error | null, params: Runtime.GlobalLexicalScopeNamesReturnType) => void): void; + post(method: "Runtime.globalLexicalScopeNames", callback?: (err: Error | null, params: Runtime.GlobalLexicalScopeNamesReturnType) => void): void; /** * Enables debugger for the given page. Clients should not assume that the debugging has been enabled until the result for this command is received. */ diff --git a/types/node/v9/node-tests.ts b/types/node/v9/node-tests.ts index ace737fa3b..03f641e216 100644 --- a/types/node/v9/node-tests.ts +++ b/types/node/v9/node-tests.ts @@ -845,6 +845,7 @@ namespace util_tests { var arg0NoResult: () => Promise = util.promisify((cb: (err: Error) => void): void => { }); var arg1: (arg: string) => Promise = util.promisify((arg: string, cb: (err: Error, result: number) => void): void => { }); var arg1NoResult: (arg: string) => Promise = util.promisify((arg: string, cb: (err: Error) => void): void => { }); + var cbOptionalError: () => Promise = util.promisify((cb: (err?: Error | null) => void): void => { cb(); }); assert(typeof util.promisify.custom === 'symbol'); // util.deprecate const foo = () => {}; diff --git a/types/office-js/index.d.ts b/types/office-js/index.d.ts index c840c1b7ea..490063fb77 100644 --- a/types/office-js/index.d.ts +++ b/types/office-js/index.d.ts @@ -231,7 +231,7 @@ declare namespace Office { resolve(value: T | PromiseLike): Promise; /** - * Creates a new resolved promise . + * Creates a new resolved promise. * @returns A resolved promise. */ resolve(): Promise; @@ -244,9 +244,11 @@ declare namespace Office { * * **Support details** * - * A capital Y in the following matrix indicates that this property is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this enumeration. + * A capital Y in the following matrix indicates that this property is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this enumeration. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* * @@ -263,21 +265,26 @@ declare namespace Office { /** * Occurs when the runtime environment is loaded and the add-in is ready to start interacting with the application and hosted document. * - * The reason parameter of the initialize event listener function returns an `InitializationReason` enumeration value that specifies how initialization occurred. A task pane or content add-in can be initialized in two ways: + * The reason parameter of the initialize event listener function returns an `InitializationReason` enumeration value that specifies how + * initialization occurred. A task pane or content add-in can be initialized in two ways: * - * - The user just inserted it from Recently Used Add-ins section of the Add-in drop-down list on the Insert tab of the ribbon in the Office host application, or from Insert add-in dialog box. + * - The user just inserted it from Recently Used Add-ins section of the Add-in drop-down list on the Insert tab of the ribbon in the Office + * host application, or from Insert add-in dialog box. * * - The user opened a document that already contains the add-in. * - * *Note*: The reason parameter of the initialize event listener function only returns an `InitializationReason` enumeration value for task pane and content add-ins. It does not return a value for Outlook add-ins. + * *Note*: The reason parameter of the initialize event listener function only returns an `InitializationReason` enumeration value for task pane + * and content add-ins. It does not return a value for Outlook add-ins. * * @remarks * * **Support details** * - * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this method. + * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this method. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -294,9 +301,13 @@ declare namespace Office { */ function initialize(reason: InitializationReason): void; /** - * Ensures that the Office JavaScript APIs are ready to be called by the add-in. If the framework hasn't initialized yet, the callback or promise will wait until the Office host is ready to accept API calls. - * Note that though this API is intended to be used inside an Office add-in, it can also be used outside the add-in. In that case, once Office.js determines that it is running outside of an Office host application, it will call the callback and resolve the promise with "null" for both the host and platform. - * @param callback - An optional callback method, that will receive the host and platform info. Alternatively, rather than use a callback, an add-in may simply wait for the Promise returned by the function to resolve. + * Ensures that the Office JavaScript APIs are ready to be called by the add-in. If the framework hasn't initialized yet, the callback or promise + * will wait until the Office host is ready to accept API calls. Note that though this API is intended to be used inside an Office add-in, it can + * also be used outside the add-in. In that case, once Office.js determines that it is running outside of an Office host application, it will call + * the callback and resolve the promise with "null" for both the host and platform. + * + * @param callback - An optional callback method, that will receive the host and platform info. + * Alternatively, rather than use a callback, an add-in may simply wait for the Promise returned by the function to resolve. * @returns A Promise that contains the host and platform info, once initialization is completed. */ function onReady(callback?: (info: { host: HostType, platform: PlatformType }) => any): Promise<{ host: HostType, platform: PlatformType }>; @@ -307,9 +318,11 @@ declare namespace Office { * * **Support details** * - * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this method. + * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this method. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -335,9 +348,11 @@ declare namespace Office { * * **Support details** * - * A capital Y in the following matrix indicates that this enumeration is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this enumeration. + * A capital Y in the following matrix indicates that this enumeration is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this enumeration. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -367,9 +382,11 @@ declare namespace Office { * * **Support details** * - * A capital Y in the following matrix indicates that this enumeration is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this enumeration. + * A capital Y in the following matrix indicates that this enumeration is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this enumeration. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -396,9 +413,11 @@ declare namespace Office { * * **Support details** * - * A capital Y in the following matrix indicates that this enumeration is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this enumeration. + * A capital Y in the following matrix indicates that this enumeration is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this enumeration. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -449,9 +468,11 @@ declare namespace Office { * * **Support details** * - * A capital Y in the following matrix indicates that this enumeration is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this enumeration. + * A capital Y in the following matrix indicates that this enumeration is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this enumeration. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -498,19 +519,24 @@ declare namespace Office { * @remarks *
HostsAccess, Excel, Outlook, PowerPoint, Project, Word
* - * When the function you pass to the `callback` parameter of an "Async" method executes, it receives an AsyncResult object that you can access from the `callback` function's only parameter. + * When the function you pass to the `callback` parameter of an "Async" method executes, it receives an AsyncResult object that you can access + * from the `callback` function's only parameter. */ - interface AsyncResult { + interface AsyncResult { /** - * Gets the user-defined item passed to the optional `asyncContext` parameter of the invoked method in the same state as it was passed in. This returns the user-defined item (which can be of any JavaScript type: String, Number, Boolean, Object, Array, Null, or Undefined) passed to the optional `asyncContext` parameter of the invoked method. Returns Undefined, if you didn't pass anything to the asyncContext parameter. + * Gets the user-defined item passed to the optional `asyncContext` parameter of the invoked method in the same state as it was passed in. + * This returns the user-defined item (which can be of any JavaScript type: String, Number, Boolean, Object, Array, Null, or Undefined) passed + * to the optional `asyncContext` parameter of the invoked method. Returns Undefined, if you didn't pass anything to the asyncContext parameter. * * @remarks * * **Support details** * - * A capital Y in the following matrix indicates that this property is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this enumeration. + * A capital Y in the following matrix indicates that this property is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this enumeration. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* * @@ -531,9 +557,11 @@ declare namespace Office { * * **Support details** * - * A capital Y in the following matrix indicates that this property is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this enumeration. + * A capital Y in the following matrix indicates that this property is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this enumeration. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -554,9 +582,11 @@ declare namespace Office { * * **Support details** * - * A capital Y in the following matrix indicates that this property is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this enumeration. + * A capital Y in the following matrix indicates that this property is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this enumeration. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -574,16 +604,19 @@ declare namespace Office { * Gets the payload or content of this asynchronous operation, if any. * * @remarks - * You access the AsyncResult object in the function passed as the argument to the callback parameter of an "Async" method, such as the `getSelectedDataAsync` and `setSelectedDataAsync` methods of the {@link Office.Document | Document} object. + * You access the AsyncResult object in the function passed as the argument to the callback parameter of an "Async" method, such as the + * `getSelectedDataAsync` and `setSelectedDataAsync` methods of the {@link Office.Document | Document} object. * * Note: What the value property returns for a particular "Async" method varies depending on the purpose and context of that method. * To determine what is returned by the value property for an "Async" method, refer to the "Callback value" section of the method's topic. * * **Support details** * - * A capital Y in the following matrix indicates that this property is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this enumeration. + * A capital Y in the following matrix indicates that this property is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this enumeration. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -596,7 +629,7 @@ declare namespace Office { * *
Word Y Y Y
*/ - value: any; + value: T; } /** * Represents the runtime environment of the add-in and provides access to key objects of the API. @@ -614,13 +647,17 @@ declare namespace Office { * True, if the current platform allows the add-in to display a UI for selling or upgrading; otherwise returns False. * * @remarks - * The iOS App Store doesn't support apps with add-ins that provide links to additional payment systems. However, Office Add-ins running on the Windows desktop or for Office Online in the browser do allow such links. If you want the UI of your add-in to provide a link to an external payment system on platforms other than iOS, you can use the commerceAllowed property to control when that link is displayed. + * The iOS App Store doesn't support apps with add-ins that provide links to additional payment systems. However, Office Add-ins running on + * the Windows desktop or for Office Online in the browser do allow such links. If you want the UI of your add-in to provide a link to an + * external payment system on platforms other than iOS, you can use the commerceAllowed property to control when that link is displayed. * * **Support details** * - * A capital Y in the following matrix indicates that this property is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this enumeration. + * A capital Y in the following matrix indicates that this property is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this enumeration. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* * @@ -634,15 +671,18 @@ declare namespace Office { * Gets the locale (language) specified by the user for editing the document or item. * * @remarks - * The `contentLanguage` value reflects the **Editing Language** setting specified with **File > Options > Language** in the Office host application. + * The `contentLanguage` value reflects the **Editing Language** setting specified with **File > Options > Language** in the Office host + * application. * * In content add-ins for Access web apps, the `contentLanguage` property gets the add-in culture (e.g., "en-GB"). * * **Support details** * - * A capital Y in the following matrix indicates that this property is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this enumeration. + * A capital Y in the following matrix indicates that this property is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this enumeration. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -667,7 +707,8 @@ declare namespace Office { * * The returned value is a string in the RFC 1766 Language tag format, such as en-US. * - * The `displayLanguage` value reflects the current **Display Language** setting specified with **File > Options > Language** in the Office host application. + * The `displayLanguage` value reflects the current **Display Language** setting specified with **File > Options > Language** in the Office + * host application. * * In content add-ins for Access web apps, the `displayLanguage property` gets the add-in language (e.g., "en-US"). * @@ -675,9 +716,11 @@ declare namespace Office { * * **Support details** * - * A capital Y in the following matrix indicates that this property is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this enumeration. + * A capital Y in the following matrix indicates that this property is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this enumeration. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -698,9 +741,11 @@ declare namespace Office { * * **Support details** * - * A capital Y in the following matrix indicates that this property is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this enumeration. + * A capital Y in the following matrix indicates that this property is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this enumeration. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -755,7 +800,8 @@ declare namespace Office { /** * Gets an object that represents the custom settings or state of a mail add-in saved to a user's mailbox. * - * The RoamingSettings object lets you store and access data for a mail add-in that is stored in a user's mailbox, so that is available to that add-in when it is running from any host client application used to access that mailbox. + * The RoamingSettings object lets you store and access data for a mail add-in that is stored in a user's mailbox, so that is available to + * that add-in when it is running from any host client application used to access that mailbox. * * [Api set: Mailbox 1.0] * @@ -766,16 +812,20 @@ declare namespace Office { */ roamingSettings: Office.RoamingSettings; /** - * Specifies whether the platform and device allows touch interaction. True if the add-in is running on a touch device, such as an iPad; false otherwise. + * Specifies whether the platform and device allows touch interaction. + * True if the add-in is running on a touch device, such as an iPad; false otherwise. * * @remarks - * Use the touchEnabled property to determine when your add-in is running on a touch device and if necessary, adjust the kind of controls, and size and spacing of elements in your add-in's UI to accommodate touch interactions. + * Use the touchEnabled property to determine when your add-in is running on a touch device and if necessary, adjust the kind of controls, and + * size and spacing of elements in your add-in's UI to accommodate touch interactions. * * **Support details** * - * A capital Y in the following matrix indicates that this property is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this enumeration. + * A capital Y in the following matrix indicates that this property is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this enumeration. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -795,13 +845,16 @@ declare namespace Office { * Provides specific information about an error that occurred during an asynchronous data operation. * * @remarks - * The Error object is accessed from the AsyncResult object that is returned in the function passed as the callback argument of an asynchronous data operation, such as the setSelectedDataAsync method of the Document object. + * The Error object is accessed from the AsyncResult object that is returned in the function passed as the callback argument of an asynchronous + * data operation, such as the setSelectedDataAsync method of the Document object. * * **Support details** * - * A capital Y in the following matrix indicates that this interface is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this interface. + * A capital Y in the following matrix indicates that this interface is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this interface. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -830,7 +883,8 @@ declare namespace Office { } namespace AddinCommands { /** - * The event object is passed as a parameter to add-in functions invoked by UI-less command buttons. The object allows the add-in to identify which button was clicked and to signal the host that it has completed its processing. + * The event object is passed as a parameter to add-in functions invoked by UI-less command buttons. The object allows the add-in to identify + * which button was clicked and to signal the host that it has completed its processing. * * @remarks * @@ -847,9 +901,11 @@ declare namespace Office { * * **Support details** * - * A capital Y in the following matrix indicates that this property is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this property. + * A capital Y in the following matrix indicates that this property is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this property. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -861,7 +917,10 @@ declare namespace Office { /** * Indicates that the add-in has completed processing that was triggered by an add-in command button or event handler. * - * This method must be called at the end of a function which was invoked by an add-in command defined with an Action element with an xsi:type attribute set to ExecuteFunction. Calling this method signals the host client that the function is complete and that it can clean up any state involved with invoking the function. For example, if the user closes Outlook before this method is called, Outlook will warn that a function is still executing. + * This method must be called at the end of a function which was invoked by an add-in command defined with an Action element with an + * xsi:type attribute set to ExecuteFunction. Calling this method signals the host client that the function is complete and that it can + * clean up any state involved with invoking the function. For example, if the user closes Outlook before this method is called, Outlook + * will warn that a function is still executing. * * This method must be called in an event handler added via Office.context.mailbox.addHandlerAsync after completing processing of the event. * @@ -875,9 +934,11 @@ declare namespace Office { * * **Support details** * - * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this method. + * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this method. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -889,7 +950,9 @@ declare namespace Office { *
* * @param options Optional. An object literal that contains one or more of the following properties. - * allowEvent: A boolean value. When the completed method is used to signal completion of an event handler, this value indicates of the handled event should continue execution or be canceled. For example, an add-in that handles the ItemSend event can set allowEvent = false to cancel sending of the message. + * allowEvent: A boolean value. When the completed method is used to signal completion of an event handler, + * this value indicates of the handled event should continue execution or be canceled. + * For example, an add-in that handles the ItemSend event can set allowEvent = false to cancel sending of the message. */ completed(options?: any): void; } @@ -900,7 +963,8 @@ declare namespace Office { interface Source { /** - * The id of the control that triggered calling this function. The id comes from the manifest and is the unique ID of your Office Add-in as a GUID. + * The id of the control that triggered calling this function. The id comes from the manifest and is the unique ID of your Office Add-in + * as a GUID. */ id: string; } @@ -908,7 +972,8 @@ declare namespace Office { /** * Provides objects and methods that you can use to create and manipulate UI components, such as dialog boxes, in your Office Add-ins. * - * Visit "{@link https://docs.microsoft.com/office/dev/add-ins/develop/dialog-api-in-office-add-ins | Use the Dialog API in your Office Add-ins}" for more information. + * Visit "{@link https://docs.microsoft.com/office/dev/add-ins/develop/dialog-api-in-office-add-ins | Use the Dialog API in your Office Add-ins}" + * for more information. */ interface UI { /** @@ -919,10 +984,12 @@ declare namespace Office { * * Requirement setsDialogApi, Mailbox 1.4 * - * This method is available in the DialogApi requirement set for Word, Excel, or PowerPoint add-ins, and in the Mailbox requirement set 1.4 for Outlook. - * For more on how to specify a requirement set in your manifest, see {@link https://docs.microsoft.com/en-us/office/dev/add-ins/develop/specify-office-hosts-and-api-requirements | Specify Office hosts and API requirements}. + * This method is available in the DialogApi requirement set for Word, Excel, or PowerPoint add-ins, and in the Mailbox requirement set 1.4 + * for Outlook. For more on how to specify a requirement set in your manifest, see + * {@link https://docs.microsoft.com/en-us/office/dev/add-ins/develop/specify-office-hosts-and-api-requirements | Specify Office hosts and API requirements}. * - * The initial page must be on the same domain as the parent page (the startAddress parameter). After the initial page loads, you can go to other domains. + * The initial page must be on the same domain as the parent page (the startAddress parameter). After the initial page loads, you can go to + * other domains. * * Any page calling `office.context.ui.messageParent` must also be on the same domain as the parent page. * @@ -930,7 +997,8 @@ declare namespace Office { * * The following design considerations apply to dialog boxes: * - * - An Office Add-in task pane can have only one dialog box open at any time. Multiple dialogs can be open at the same time from Add-in Commands (custom ribbon buttons or menu items). + * - An Office Add-in task pane can have only one dialog box open at any time. Multiple dialogs can be open at the same time from Add-in + * Commands (custom ribbon buttons or menu items). * * - Every dialog box can be moved and resized by the user. * @@ -942,13 +1010,15 @@ declare namespace Office { * * - Display authentication pages to collect user credentials. * - * - Display an error/progress/input screen from a ShowTaspane or ExecuteAction command. + * - Display an error/progress/input screen from a ShowTaskpane or ExecuteAction command. * * - Temporarily increase the surface area that a user has available to complete a task. * * Do not use a dialog box to interact with a document. Use a task pane instead. * - * For a design pattern that you can use to create a dialog box, see {@link https://github.com/OfficeDev/Office-Add-in-UX-Design-Patterns/blob/master/Patterns/Client_Dialog.md | Client Dialog} in the Office Add-in UX Design Patterns repository on GitHub. + * For a design pattern that you can use to create a dialog box, see + * {@link https://github.com/OfficeDev/Office-Add-in-UX-Design-Patterns/blob/master/Patterns/Client_Dialog.md | Client Dialog} in the Office + * Add-in UX Design Patterns repository on GitHub. * * **displayDialogAsync Errors**: * @@ -971,7 +1041,8 @@ declare namespace Office { * * * - * In the callback function passed to the displayDialogAsync method, you can use the properties of the AsyncResult object to return the following information. + * In the callback function passed to the displayDialogAsync method, you can use the properties of the AsyncResult object to return the + * following information. * * * @@ -1000,7 +1071,7 @@ declare namespace Office { * @param options - Optional. Accepts an {@link Office.DialogOptions} object to define dialog display. * @param callback - Optional. Accepts a callback method to handle the dialog creation attempt. If successful, the AsyncResult.value is a Dialog object. */ - displayDialogAsync(startAddress: string, options?: DialogOptions, callback?: (result: AsyncResult) => void): void; + displayDialogAsync(startAddress: string, options?: DialogOptions, callback?: (result: AsyncResult) => void): void; /** * Delivers a message from the dialog box to its parent/opener page. The page calling this API must be on the same domain as the parent. * @param messageObject Accepts a message from the dialog to deliver to the add-in. @@ -1016,20 +1087,12 @@ declare namespace Office { * * - Called from a UI-less command button: No effect. Any dialog opened by displayDialogAsync will remain open. * - * - Called from a taskpane: The taskpane will close. Any dialog opened by displayDialogAsync will also close. If the taskpane supports pinning and was pinned by the user, it will be un-pinned. + * - Called from a taskpane: The taskpane will close. Any dialog opened by displayDialogAsync will also close. + * If the taskpane supports pinning and was pinned by the user, it will be un-pinned. * * - Called from a module extension: No effect. */ closeContainer(): void; - /** - * For internal Microsoft use only. Do not call from your code. Opens a browser window and loads the specified URL. - * - * @remarks - *
Requirement setsOpenBrowserWindowAPI 1.1
- * - * @param url The full URL to be opened including protocol (e.g., https), and port number, if any. - */ - openBrowserWindow(url: string): void; } /** @@ -1057,7 +1120,10 @@ declare namespace Office { */ width?: number, /** - * Determines whether the dialog box should be displayed within an IFrame. This setting is only applicable in Office Online clients, and is ignored by other platforms. If false (default), the dialog will be displayed as a new browser window (pop-up). Recommended for authentication pages that cannot be displayed in an IFrame. If true, the dialog will be displayed as a floating overlay with an IFrame. This is best for user experience and performance. + * Determines whether the dialog box should be displayed within an IFrame. This setting is only applicable in Office Online clients, and is + * ignored by other platforms. If false (default), the dialog will be displayed as a new browser window (pop-up). Recommended for + * authentication pages that cannot be displayed in an IFrame. If true, the dialog will be displayed as a floating overlay with an IFrame. + * This is best for user experience and performance. */ displayInIframe?: boolean /** @@ -1066,28 +1132,32 @@ declare namespace Office { asyncContext?: any } /** - * The Office Auth namespace, Office.context.auth, provides a method that allows the Office host to obtain and access the add-in token. Indirectly, enable the add-in to access the signed-in user's Microsoft Graph data without requiring the user to sign in a second time. + * The Office Auth namespace, Office.context.auth, provides a method that allows the Office host to obtain and access the add-in token. + * Indirectly, enable the add-in to access the signed-in user's Microsoft Graph data without requiring the user to sign in a second time. */ interface Auth { /** - * Calls the Azure Active Directory V 2.0 endpoint to get an access token to your add-in's web application. Allows add-ins to identify users. Server side code can use this token to access Microsoft Graph for the add-in's web application by using the {@link https://docs.microsoft.com/azure/active-directory/develop/active-directory-v2-protocols-oauth-on-behalf-of | "on behalf of" OAuth flow}. + * Calls the Azure Active Directory V 2.0 endpoint to get an access token to your add-in's web application. Allows add-ins to identify users. + * Server side code can use this token to access Microsoft Graph for the add-in's web application by using the + * {@link https://docs.microsoft.com/azure/active-directory/develop/active-directory-v2-protocols-oauth-on-behalf-of | "on behalf of" OAuth flow}. * * Important: In Outlook, this API is not supported if the add-in is loaded in an Outlook.com or Gmail mailbox. * * @remarks * * - *
HostsExcel, OneNote, Outlook, PowerPoint, Word
Requirement sets{@link https://docs.microsoft.com/office/dev/add-ins/develop/specify-office-hosts-and-api-requirements -| IdentityAPI}
+ * Requirement sets{@link https://docs.microsoft.com/office/dev/add-ins/develop/specify-office-hosts-and-api-requirements | IdentityAPI} * - * This API requires a single sign-on configuration that bridges the add-in to an Azure application. Office users sign-in with Organizational Accounts and Microsoft Accounts. Microsoft Azure returns tokens intended for both user account types to access resources in the Microsoft Graph. + * This API requires a single sign-on configuration that bridges the add-in to an Azure application. Office users sign-in with Organizational + * Accounts and Microsoft Accounts. Microsoft Azure returns tokens intended for both user account types to access resources in the Microsoft Graph. * * @param options - Optional. Accepts an AuthOptions object to define sign-on behaviors. - * @param callback - Optional. Accepts a callback method to handle the token acquisition attempt. If AsyncResult.status is "succeeded", then AsyncResult.value is the raw AAD v. 2.0-formatted access token. + * @param callback - Optional. Accepts a callback method to handle the token acquisition attempt. + * If AsyncResult.status is "succeeded", then AsyncResult.value is the raw AAD v. 2.0-formatted access token. * * @beta */ - getAccessTokenAsync(options?: AuthOptions, callback?: (result: AsyncResult) => void): void; + getAccessTokenAsync(options?: AuthOptions, callback?: (result: AsyncResult) => void): void; } /** @@ -1095,7 +1165,8 @@ declare namespace Office { */ interface AuthOptions { /** - * Causes Office to display the add-in consent experience. Useful if the add-in's Azure permissions have changed or if the user's consent has been revoked. + * Causes Office to display the add-in consent experience. Useful if the add-in's Azure permissions have changed or if the user's consent has + * been revoked. */ forceConsent?: boolean, /** @@ -1103,7 +1174,11 @@ declare namespace Office { */ forceAddAccount?: boolean, /** - * Causes Office to prompt the user to provide the additional factor when the tenancy being targeted by Microsoft Graph requires multifactor authentication. The string value identifies the type of additional factor that is required. In most cases, you won't know at development time whether the user's tenant requires an additional factor or what the string should be. So this option would be used in a "second try" call of getAccessTokenAsync after Microsoft Graph has sent an error requesting the additional factor and containing the string that should be used with the authChallenge option. + * Causes Office to prompt the user to provide the additional factor when the tenancy being targeted by Microsoft Graph requires multifactor + * authentication. The string value identifies the type of additional factor that is required. In most cases, you won't know at development + * time whether the user's tenant requires an additional factor or what the string should be. So this option would be used in a "second try" + * call of getAccessTokenAsync after Microsoft Graph has sent an error requesting the additional factor and containing the string that should + * be used with the authChallenge option. */ authChallenge?: string /** @@ -1149,7 +1224,8 @@ declare namespace Office { */ coercionType?: Office.CoercionType | string /** - * Specifies whether values, such as numbers and dates, are returned with their formatting applied. Use Office.ValueFormat or text value. Default: Unformatted data. + * Specifies whether values, such as numbers and dates, are returned with their formatting applied. Use Office.ValueFormat or text value. + * Default: Unformatted data. */ valueFormat?: Office.ValueFormat | string /** @@ -1169,7 +1245,8 @@ declare namespace Office { */ columnCount?: number /** - * Specify whether to get only the visible (filtered in) data or all the data (default is all). Useful when filtering data. Use Office.FilterType or text value. + * Specify whether to get only the visible (filtered in) data or all the data (default is all). Useful when filtering data. + * Use Office.FilterType or text value. */ filterType?: Office.FilterType | string /** @@ -1189,7 +1266,8 @@ declare namespace Office { */ interface SetBindingDataOptions { /** - * Use only with binding type table and when a TableData object is passed for the data parameter. An array of objects that specify a range of columns, rows, or cells and specify, as key-value pairs, the cell formatting to apply to that range. + * Use only with binding type table and when a TableData object is passed for the data parameter. An array of objects that specify a range of + * columns, rows, or cells and specify, as key-value pairs, the cell formatting to apply to that range. * * Example: `[{cells: Office.Table.Data, format: {fontColor: "yellow"}}, {cells: {row: 3, column: 4}, format: {borderColor: "white", fontStyle: "bold"}}]` */ @@ -1207,15 +1285,18 @@ declare namespace Office { */ rows?: string /** - * Specifies the zero-based starting row for a subset of the data in the binding. Only for table or matrix bindings. If omitted, data is set starting in the first row. + * Specifies the zero-based starting row for a subset of the data in the binding. Only for table or matrix bindings. If omitted, data is set + * starting in the first row. */ startRow?: number /** - * Specifies the zero-based starting column for a subset of the data. Only for table or matrix bindings. If omitted, data is set starting in the first column. + * Specifies the zero-based starting column for a subset of the data. Only for table or matrix bindings. If omitted, data is set starting in + * the first column. */ startColumn?: number /** - * For an inserted table, a list of key-value pairs that specify table formatting options, such as header row, total row, and banded rows. Example: `{bandedRows: true, filterButton: false}` + * For an inserted table, a list of key-value pairs that specify table formatting options, such as header row, total row, and banded rows. + * Example: `{bandedRows: true, filterButton: false}` */ tableOptions?: object /** @@ -1228,7 +1309,8 @@ declare namespace Office { */ interface RangeFormatConfiguration { /** - * Specifies the range. Example of using Office.Table enum: Office.Table.All. Example of using RangeCoordinates: {row: 3, column: 4} specifies the cell in the 3rd (zero-based) row in the 4th (zero-based) column. + * Specifies the range. Example of using Office.Table enum: Office.Table.All. Example of using RangeCoordinates: {row: 3, column: 4} specifies + * the cell in the 3rd (zero-based) row in the 4th (zero-based) column. */ cells: Office.Table | RangeCoordinates /** @@ -1237,7 +1319,8 @@ declare namespace Office { format: object } /** - * Specifies a cell, or row, or column, by its zero-based row and/or column number. Example: {row: 3, column: 4} specifies the cell in the 3rd (zero-based) row in the 4th (zero-based) column. + * Specifies a cell, or row, or column, by its zero-based row and/or column number. Example: {row: 3, column: 4} specifies the cell in the 3rd + * (zero-based) row in the 4th (zero-based) column. */ interface RangeCoordinates { /** @@ -1284,11 +1367,14 @@ declare namespace Office { */ id?: string /** - * Specifies the string to display in the prompt UI that tells the user what to select. Limited to 200 characters. If no promptText argument is passed, "Please make a selection" is displayed. + * Specifies the string to display in the prompt UI that tells the user what to select. Limited to 200 characters. + * If no promptText argument is passed, "Please make a selection" is displayed. */ promptText?: string /** - * Specifies a table of sample data displayed in the prompt UI as an example of the kinds of fields (columns) that can be bound by your add-in. The headers provided in the TableData object specify the labels used in the field selection UI. Note: This parameter is used only in add-ins for Access. It is ignored if provided when calling the method in an add-in for Excel. + * Specifies a table of sample data displayed in the prompt UI as an example of the kinds of fields (columns) that can be bound by your add-in. + * The headers provided in the TableData object specify the labels used in the field selection UI. + * Note: This parameter is used only in add-ins for Access. It is ignored if provided when calling the method in an add-in for Excel. */ sampleData?: Office.TableData /** @@ -1335,7 +1421,8 @@ declare namespace Office { */ valueFormat?: Office.ValueFormat | string /** - * Specify whether to get only the visible (that is, filtered-in) data or all the data. Useful when filtering data. Use {@link Office.FilterType} or string equivalent. This parameter is ignored in Word documents. + * Specify whether to get only the visible (that is, filtered-in) data or all the data. Useful when filtering data. + * Use {@link Office.FilterType} or string equivalent. This parameter is ignored in Word documents. */ filterType?: Office.FilterType | string /** @@ -1349,15 +1436,19 @@ declare namespace Office { * @remarks * The behavior caused by the {@link Office.SelectionMode | options.selectionMode} option varies by host: * - * In Excel: `Office.SelectionMode.Selected` selects all content in the binding, or named item. `Office.SelectionMode.None` for text bindings, selects the cell; for matrix bindings, table bindings, and named items, selects the first data cell (not first cell in header row for tables). + * In Excel: `Office.SelectionMode.Selected` selects all content in the binding, or named item. `Office.SelectionMode.None` for text bindings, + * selects the cell; for matrix bindings, table bindings, and named items, selects the first data cell (not first cell in header row for tables). * - * In PowerPoint: `Office.SelectionMode.Selected` selects the slide title or first textbox on the slide. `Office.SelectionMode.None` Doesn't select anything. + * In PowerPoint: `Office.SelectionMode.Selected` selects the slide title or first textbox on the slide. + * `Office.SelectionMode.None` doesn't select anything. * - * In Word: `Office.SelectionMode.Selected` selects all content in the binding. `Office.SelectionMode.None` for text bindings, moves the cursor to the beginning of the text; for matrix bindings and table bindings, selects the first data cell (not first cell in header row for tables). + * In Word: `Office.SelectionMode.Selected` selects all content in the binding. `Office.SelectionMode.None` for text bindings, moves the cursor to + * the beginning of the text; for matrix bindings and table bindings, selects the first data cell (not first cell in header row for tables). */ interface GoToByIdOptions { /** - * Specifies whether the location specified by the id parameter is selected (highlighted). Use {@link Office.SelectionMode} or string equivalent. See the Remarks for more information. + * Specifies whether the location specified by the id parameter is selected (highlighted). + * Use {@link Office.SelectionMode} or string equivalent. See the Remarks for more information. */ selectionMode?: Office.SelectionMode | string /** @@ -1370,7 +1461,8 @@ declare namespace Office { */ interface SetSelectedDataOptions { /** - * Use only with binding type table and when a TableData object is passed for the data parameter. An array of objects that specify a range of columns, rows, or cells and specify, as key-value pairs, the cell formatting to apply to that range. + * Use only with binding type table and when a TableData object is passed for the data parameter. An array of objects that specify a range of + * columns, rows, or cells and specify, as key-value pairs, the cell formatting to apply to that range. * * Example: `[{cells: Office.Table.Data, format: {fontColor: "yellow"}}, {cells: {row: 3, column: 4}, format: {borderColor: "white", fontStyle: "bold"}}]` */ @@ -1380,23 +1472,30 @@ declare namespace Office { */ coercionType?: Office.CoercionType | string /** - * For an inserted table, a list of key-value pairs that specify table formatting options, such as header row, total row, and banded rows. Example: `{bandedRows: true, filterButton: false}` + * For an inserted table, a list of key-value pairs that specify table formatting options, such as header row, total row, and banded rows. + * Example: `{bandedRows: true, filterButton: false}` */ tableOptions?: object /** - * This option is applicable for inserting images. Indicates the insert location in relation to the top of the slide for PowerPoint, and its relation to the currently selected cell in Excel. This value is ignored for Word. This value is in points. + * This option is applicable for inserting images. Indicates the insert location in relation to the top of the slide for PowerPoint, and its + * relation to the currently selected cell in Excel. This value is ignored for Word. This value is in points. */ imageTop?: number /** - * This option is applicable for inserting images. Indicates the image width. If this option is provided without the imageHeight, the image will scale to match the value of the image width. If both image width and image height are provided, the image will be resized accordingly. If neither the image height or width is provided, the default image size and aspect ratio will be used. This value is in points. + * This option is applicable for inserting images. Indicates the image width. If this option is provided without the imageHeight, the image + * will scale to match the value of the image width. If both image width and image height are provided, the image will be resized accordingly. + * If neither the image height or width is provided, the default image size and aspect ratio will be used. This value is in points. */ imageWidth?: number /** - * This option is applicable for inserting images. Indicates the insert location in relation to the left side of the slide for PowerPoint, and its relation to the currently selected cell in Excel. This value is ignored for Word. This value is in points. + * This option is applicable for inserting images. Indicates the insert location in relation to the left side of the slide for PowerPoint, and + * its relation to the currently selected cell in Excel. This value is ignored for Word. This value is in points. */ imageLeft?: number /** - * This option is applicable for inserting images. Indicates the image height. If this option is provided without the imageWidth, the image will scale to match the value of the image height. If both image width and image height are provided, the image will be resized accordingly. If neither the image height or width is provided, the default image size and aspect ratio will be used. This value is in points. + * This option is applicable for inserting images. Indicates the image height. If this option is provided without the imageWidth, the image + * will scale to match the value of the image height. If both image width and image height are provided, the image will be resized accordingly. + * If neither the image height or width is provided, the default image size and aspect ratio will be used. This value is in points. */ imageHeight?: number /** @@ -1420,15 +1519,19 @@ declare namespace Office { /** * Provides access to the properties for Office theme colors. * - * Using Office theme colors lets you coordinate the color scheme of your add-in with the current Office theme selected by the user with File > Office Account > Office Theme UI, which is applied across all Office host applications. Using Office theme colors is appropriate for mail and task pane add-ins. + * Using Office theme colors lets you coordinate the color scheme of your add-in with the current Office theme selected by the user with File > + * Office Account > Office Theme UI, which is applied across all Office host applications. Using Office theme colors is appropriate for mail and + * task pane add-ins. * * @remarks * * **Support details** * - * A capital Y in the following matrix indicates that these properties are supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this enumeration. + * A capital Y in the following matrix indicates that these properties are supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this enumeration. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* * @@ -1483,16 +1586,19 @@ declare namespace Office { declare namespace Office { /** * Returns a promise of an object described in the expression. Callback is invoked only if method fails. + * * @param expression The object to be retrieved. Example "bindings#BindingName", retrieves a binding promise for a binding named 'BindingName' - * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. * * @remarks * * **Support details** * - * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this method. + * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this method. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -1502,7 +1608,7 @@ declare namespace Office { * *
Word Y Y
*/ - function select(expression: string, callback?: (result: AsyncResult) => void): Binding; + function select(expression: string, callback?: (result: AsyncResult) => void): Binding; // Enumerations /** * Specifies the state of the active view of the document, for example, whether the user can edit the document. @@ -1510,9 +1616,11 @@ declare namespace Office { * * **Support details** * - * A capital Y in the following matrix indicates that this enumeration is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this enumeration. + * A capital Y in the following matrix indicates that this enumeration is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this enumeration. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* * @@ -1536,9 +1644,11 @@ declare namespace Office { * * **Support details** * - * A capital Y in the following matrix indicates that this enumeration is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this enumeration. + * A capital Y in the following matrix indicates that this enumeration is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this enumeration. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -1554,7 +1664,8 @@ declare namespace Office { */ Text, /** - * Tabular data without a header row. Data is returned as an array of arrays, for example in this form: [[row1column1, row1column2],[row2column1, row2column2]] + * Tabular data without a header row. Data is returned as an array of arrays, for example in this form: + * [[row1column1, row1column2],[row2column1, row2column2]] */ Matrix, /** @@ -1572,9 +1683,11 @@ declare namespace Office { * * **Support details** * - * A capital Y in the following matrix indicates that this enumeration is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this enumeration. + * A capital Y in the following matrix indicates that this enumeration is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this enumeration. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -1593,7 +1706,8 @@ declare namespace Office { */ Text, /** - * Return or set data as tabular data with no headers. Data is returned or set as an array of arrays containing one-dimensional runs of characters. For example, three rows of string values in two columns would be: [["R1C1", "R1C2"], ["R2C1", "R2C2"], ["R3C1", "R3C2"]]. + * Return or set data as tabular data with no headers. Data is returned or set as an array of arrays containing one-dimensional runs of + * characters. For example, three rows of string values in two columns would be: [["R1C1", "R1C2"], ["R2C1", "R2C2"], ["R3C1", "R3C2"]]. * * Note: Only applies to data in Excel and Word. */ @@ -1617,9 +1731,11 @@ declare namespace Office { */ Ooxml, /** - * Return a JSON object that contains an array of the ids, titles, and indexes of the selected slides. For example, `{"slides":[{"id":257,"title":"Slide 2","index":2},{"id":256,"title":"Slide 1","index":1}]}` for a selection of two slides. + * Return a JSON object that contains an array of the ids, titles, and indexes of the selected slides. For example, + * `{"slides":[{"id":257,"title":"Slide 2","index":2},{"id":256,"title":"Slide 1","index":1}]}` for a selection of two slides. * - * Note: Only applies to data in PowerPoint when calling the {@link Office.Document | Document}.getSelectedData method to get the current slide or selected range of slides. + * Note: Only applies to data in PowerPoint when calling the {@link Office.Document | Document}.getSelectedData method to get the current + * slide or selected range of slides. */ SlideRange, /** @@ -1637,9 +1753,11 @@ declare namespace Office { * * **Support details** * - * A capital Y in the following matrix indicates that this enumeration is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this enumeration. + * A capital Y in the following matrix indicates that this enumeration is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this enumeration. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -1668,9 +1786,11 @@ declare namespace Office { * * **Support details** * - * A capital Y in the following matrix indicates that this enumeration is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this enumeration. + * A capital Y in the following matrix indicates that this enumeration is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this enumeration. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -1711,7 +1831,8 @@ declare namespace Office { /** * Specifies the kind of event that was raised. Returned by the `type` property of an *EventArgs object. * - * Add-ins for Project support the `Office.EventType.ResourceSelectionChanged`, `Office.EventType.TaskSelectionChanged`, and `Office.EventType.ViewSelectionChanged` event types. + * Add-ins for Project support the `Office.EventType.ResourceSelectionChanged`, `Office.EventType.TaskSelectionChanged`, and + * `Office.EventType.ViewSelectionChanged` event types. * *
BindingDataChanged and BindingSelectionChanged hosts
Access, Excel, Word
* @@ -1719,9 +1840,11 @@ declare namespace Office { * * **Support details** * - * A capital Y in the following matrix indicates that this enumeration is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this enumeration. + * A capital Y in the following matrix indicates that this enumeration is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this enumeration. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* * @@ -1739,9 +1862,11 @@ declare namespace Office { * * **Support details** * - * A capital Y in the following matrix indicates that this enumeration is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this enumeration. + * A capital Y in the following matrix indicates that this enumeration is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this enumeration. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -1767,9 +1892,11 @@ declare namespace Office { * * **Support details** * - * A capital Y in the following matrix indicates that this enumeration is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this enumeration. + * A capital Y in the following matrix indicates that this enumeration is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this enumeration. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -1781,17 +1908,18 @@ declare namespace Office { */ BindingDataChanged, /** - * Occurs when the selection is changed within the binding. - * To add an event handler for the BindingSelectionChanged event of a binding, use the addHandlerAsync method of the Binding object. - * The event handler receives an argument of type {@link Office.BindingSelectionChangedEventArgs}. + * Occurs when the selection is changed within the binding. To add an event handler for the BindingSelectionChanged event of a binding, use + * the addHandlerAsync method of the Binding object. The event handler receives an argument of type {@link Office.BindingSelectionChangedEventArgs}. * * @remarks * * **Support details** * - * A capital Y in the following matrix indicates that this enumeration is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this enumeration. + * A capital Y in the following matrix indicates that this enumeration is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this enumeration. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -1815,9 +1943,11 @@ declare namespace Office { * * **Support details** * - * A capital Y in the following matrix indicates that this enumeration is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this enumeration. + * A capital Y in the following matrix indicates that this enumeration is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this enumeration. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -1870,9 +2000,11 @@ declare namespace Office { * * **Support details** * - * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this method. + * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this method. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -1901,9 +2033,11 @@ declare namespace Office { * * **Support details** * - * A capital Y in the following matrix indicates that this enumeration is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this enumeration. + * A capital Y in the following matrix indicates that this enumeration is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this enumeration. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -1934,9 +2068,11 @@ declare namespace Office { * * **Support details** * - * A capital Y in the following matrix indicates that this enumeration is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this enumeration. + * A capital Y in the following matrix indicates that this enumeration is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this enumeration. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -1963,9 +2099,11 @@ declare namespace Office { * * **Support details** * - * A capital Y in the following matrix indicates that this enumeration is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this enumeration. + * A capital Y in the following matrix indicates that this enumeration is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this enumeration. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -2009,9 +2147,11 @@ declare namespace Office { * * **Support details** * - * A capital Y in the following matrix indicates that this enumeration is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this enumeration. + * A capital Y in the following matrix indicates that this enumeration is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this enumeration. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -2044,9 +2184,11 @@ declare namespace Office { * * **Support details** * - * A capital Y in the following matrix indicates that this enumeration is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this enumeration. + * A capital Y in the following matrix indicates that this enumeration is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this enumeration. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -2071,14 +2213,17 @@ declare namespace Office { * Specifies whether values, such as numbers and dates, returned by the invoked method are returned with their formatting applied. * * @remarks - * For example, if the valueFormat parameter is specified as "formatted", a number formatted as currency, or a date formatted as mm/dd/yy in the host application will have its formatting preserved. - * If the valueFormat parameter is specified as "unformatted", a date will be returned in its underlying sequential serial number form. + * For example, if the valueFormat parameter is specified as "formatted", a number formatted as currency, or a date formatted as mm/dd/yy in the + * host application will have its formatting preserved. If the valueFormat parameter is specified as "unformatted", a date will be returned in its + * underlying sequential serial number form. * * **Support details** * - * A capital Y in the following matrix indicates that this enumeration is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this enumeration. + * A capital Y in the following matrix indicates that this enumeration is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this enumeration. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -2107,13 +2252,19 @@ declare namespace Office { * * The Binding object exposes the functionality possessed by all bindings regardless of type. * - * The Binding object is never called directly. It is the abstract parent class of the objects that represent each type of binding: {@link Office.MatrixBinding}, {@link Office.TableBinding}, or {@link Office.TextBinding}. All three of these objects inherit the getDataAsync and setDataAsync methods from the Binding object that enable to you interact with the data in the binding. They also inherit the id and type properties for querying those property values. Additionally, the MatrixBinding and TableBinding objects expose additional methods for matrix- and table-specific features, such as counting the number of rows and columns. + * The Binding object is never called directly. It is the abstract parent class of the objects that represent each type of binding: + * {@link Office.MatrixBinding}, {@link Office.TableBinding}, or {@link Office.TextBinding}. All three of these objects inherit the getDataAsync + * and setDataAsync methods from the Binding object that enable to you interact with the data in the binding. They also inherit the id and type + * properties for querying those property values. Additionally, the MatrixBinding and TableBinding objects expose additional methods for matrix- + * and table-specific features, such as counting the number of rows and columns. * * **Support details** * - * A capital Y in the following matrix indicates that this interface is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this interface. + * A capital Y in the following matrix indicates that this interface is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this interface. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -2139,7 +2290,8 @@ declare namespace Office { */ type: Office.BindingType; /** - * Adds an event handler to the object for the specified {@link Office.EventType}. Supported EventTypes are `Office.EventType.BindingDataChanged` and `Office.EventType.BindingSelectionChanged`. + * Adds an event handler to the object for the specified {@link Office.EventType}. Supported EventTypes are + * `Office.EventType.BindingDataChanged` and `Office.EventType.BindingSelectionChanged`. * * @remarks * You can add multiple event handlers for the specified eventType as long as the name of each event handler function is unique. @@ -2149,19 +2301,22 @@ declare namespace Office { * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. */ - addHandlerAsync(eventType: Office.EventType, handler: any, options?: Office.AsyncContextOptions, callback?: (result: Office.AsyncResult) => void): void; + addHandlerAsync(eventType: Office.EventType, handler: any, options?: Office.AsyncContextOptions, callback?: (result: Office.AsyncResult) => void): void; /** * Returns the data contained within the binding. * * @remarks *
Requirement SetsMatrixBindings, TableBindings, TextBindings
* - * When called from a MatrixBinding or TableBinding, the getDataAsync method will return a subset of the bound values if the optional startRow, startColumn, rowCount, and columnCount parameters are specified (and they specify a contiguous and valid range). + * When called from a MatrixBinding or TableBinding, the getDataAsync method will return a subset of the bound values if the optional startRow, + * startColumn, rowCount, and columnCount parameters are specified (and they specify a contiguous and valid range). * * @param options Provides options for how to get the data in a binding. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. + * The `value` property of the result is the values in the specified binding. + * If the `coercionType` parameter is specified (and the call is successful), the data is returned in the format described in the CoercionType enumeration topic. */ - getDataAsync(options?: GetBindingDataOptions, callback?: (result: AsyncResult) => void): void; + getDataAsync(options?: GetBindingDataOptions, callback?: (result: AsyncResult) => void): void; /** * Removes the specified handler from the binding for the specified event type. * @@ -2170,9 +2325,9 @@ declare namespace Office { * * @param eventType The event type. For bindings, it can be `Office.EventType.BindingDataChanged` or `Office.EventType.BindingSelectionChanged`. * @param options Provides options to determine which event handler or handlers are removed. - * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. */ - removeHandlerAsync(eventType: Office.EventType, options?: RemoveHandlerOptions, callback?: (result: AsyncResult) => void): void; + removeHandlerAsync(eventType: Office.EventType, options?: RemoveHandlerOptions, callback?: (result: AsyncResult) => void): void; /** * Writes data to the bound section of the document represented by the specified binding object. * @@ -2180,7 +2335,8 @@ declare namespace Office { * *
Requirement SetsMatrixBindings, TableBindings, TextBindings
* - * The value passed for data contains the data to be written in the binding. The kind of value passed determines what will be written as described in the following table. + * The value passed for data contains the data to be written in the binding. The kind of value passed determines what will be written as + * described in the following table. * * * @@ -2201,7 +2357,8 @@ declare namespace Office { * *
* - * Additionally, these application-specific actions apply when writing data to a binding. For Word, the specified data is written to the binding as follows: + * Additionally, these application-specific actions apply when writing data to a binding. For Word, the specified data is written to the + * binding as follows: * * * @@ -2251,13 +2408,16 @@ declare namespace Office { * * - The total number of cells in the value passed to the data parameter can't exceed 20,000 in a single call to this method. * - * - The number of formatting groups passed to the cellFormat parameter can't exceed 100. A single formatting group consists of a set of formatting applied to a specified range of cells. + * - The number of formatting groups passed to the cellFormat parameter can't exceed 100. + * A single formatting group consists of a set of formatting applied to a specified range of cells. * * In all other cases, an error is returned. * - * The setDataAsync method will write data in a subset of a table or matrix binding if the optional startRow and startColumn parameters are specified, and they specify a valid range. + * The setDataAsync method will write data in a subset of a table or matrix binding if the optional startRow and startColumn parameters are + * specified, and they specify a valid range. * - * In the callback function passed to the setDataAsync method, you can use the properties of the AsyncResult object to return the following information. + * In the callback function passed to the setDataAsync method, you can use the properties of the AsyncResult object to return the following + * information. * *
* @@ -2296,9 +2456,9 @@ declare namespace Office { * * @param options Provides options for how to set the data in a binding. * - * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. You can use the properties of the AsyncResult object to return the following information. + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. */ - setDataAsync(data: TableData | any, options?: SetBindingDataOptions, callback?: (result: AsyncResult) => void): void; + setDataAsync(data: TableData | any, options?: SetBindingDataOptions, callback?: (result: AsyncResult) => void): void; } /** @@ -2335,7 +2495,9 @@ declare namespace Office { * * If the user makes a non-contiguous selection, the count for the last contiguous selection within the binding is returned. * - * For Word, this property will work only for bindings of {@link Office.BindingType} "table". If the binding is of type "matrix", null is returned. Also, the call will fail if the table contains merged cells, because the structure of the table must be uniform for this property to work correctly. + * For Word, this property will work only for bindings of {@link Office.BindingType} "table". If the binding is of type "matrix", null is + * returned. Also, the call will fail if the table contains merged cells, because the structure of the table must be uniform for this property + * to work correctly. */ columnCount: number; /** @@ -2343,7 +2505,9 @@ declare namespace Office { * * If the user makes a non-contiguous selection, the count for the last contiguous selection within the binding is returned. * - * For Word, this property will work only for bindings of {@link Office.BindingType} "table". If the binding is of type "matrix", null is returned. Also, the call will fail if the table contains merged cells, because the structure of the table must be uniform for this property to work correctly. + * For Word, this property will work only for bindings of {@link Office.BindingType} "table". If the binding is of type "matrix", null is + * returned. Also, the call will fail if the table contains merged cells, because the structure of the table must be uniform for this property + * to work correctly. */ rowCount: number; /** @@ -2351,7 +2515,9 @@ declare namespace Office { * * If the user makes a non-contiguous selection, the coordinates for the last contiguous selection within the binding are returned. * - * For Word, this property will work only for bindings of {@link Office.BindingType} "table". If the binding is of type "matrix", null is returned. Also, the call will fail if the table contains merged cells, because the structure of the table must be uniform for this property to work correctly. + * For Word, this property will work only for bindings of {@link Office.BindingType} "table". If the binding is of type "matrix", null is + * returned. Also, the call will fail if the table contains merged cells, because the structure of the table must be uniform for this property + * to work correctly. */ startColumn: number; /** @@ -2359,7 +2525,9 @@ declare namespace Office { * * If the user makes a non-contiguous selection, the coordinates for the last contiguous selection within the binding are returned. * - * For Word, this property will work only for bindings of {@link Office.BindingType} "table". If the binding is of type "matrix", null is returned. Also, the call will fail if the table contains merged cells, because the structure of the table must be uniform for this property to work correctly. + * For Word, this property will work only for bindings of {@link Office.BindingType} "table". If the binding is of type "matrix", null is + * returned. Also, the call will fail if the table contains merged cells, because the structure of the table must be uniform for this property + * to work correctly. */ startRow: number; /** @@ -2379,9 +2547,11 @@ declare namespace Office { * * **Support details** * - * A capital Y in the following matrix indicates that this property is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this property. + * A capital Y in the following matrix indicates that this property is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this property. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -2400,21 +2570,29 @@ declare namespace Office { * * For Excel, the itemName parameter can refer to a named range or a table. * - * By default, adding a table in Excel assigns the name "Table1" for the first table you add, "Table2" for the second table you add, and so on. To assign a meaningful name for a table in the Excel UI, use the Table Name property on the Table Tools | Design tab of the ribbon. + * By default, adding a table in Excel assigns the name "Table1" for the first table you add, "Table2" for the second table you add, and so on. + * To assign a meaningful name for a table in the Excel UI, use the Table Name property on the Table Tools | Design tab of the ribbon. * - * Note: In Excel, when specifying a table as a named item, you must fully qualify the name to include the worksheet name in the name of the table in this format: "Sheet1!Table1" + * Note: In Excel, when specifying a table as a named item, you must fully qualify the name to include the worksheet name in the name of + * the table in this format: "Sheet1!Table1" * - * For Word, the itemName parameter refers to the Title property of a Rich Text content control. (You can't bind to content controls other than the Rich Text content control). + * For Word, the itemName parameter refers to the Title property of a Rich Text content control. (You can't bind to content controls other + * than the Rich Text content control). * - * By default, a content control has no Title value assigned. To assign a meaningful name in the Word UI, after inserting a Rich Text content control from the Controls group on the Developer tab of the ribbon, use the Properties command in the Controls group to display the Content Control Properties dialog box. Then set the Title property of the content control to the name you want to reference from your code. + * By default, a content control has no Title value assigned. To assign a meaningful name in the Word UI, after inserting a Rich Text content + * control from the Controls group on the Developer tab of the ribbon, use the Properties command in the Controls group to display the Content + * Control Properties dialog box. Then set the Title property of the content control to the name you want to reference from your code. * - * Note: In Word, if there are multiple Rich Text content controls with the same Title property value (name), and you try to bind to one these content controls with this method (by specifying its name as the itemName parameter), the operation will fail. + * Note: In Word, if there are multiple Rich Text content controls with the same Title property value (name), and you try to bind to one + * these content controls with this method (by specifying its name as the itemName parameter), the operation will fail. * * **Support details** * - * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this method. + * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this method. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -2426,22 +2604,26 @@ declare namespace Office { * @param itemName Name of the bindable object in the document. For Example 'MyExpenses' table in Excel." * @param bindingType The {@link Office.BindingType} for the data. The method returns null if the selected object cannot be coerced into the specified type. * @param options Provides options for configuring the binding that is created. - * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. + * The `value` property of the result is the Binding object that represents the specified named item. */ - addFromNamedItemAsync(itemName: string, bindingType: BindingType, options?: AddBindingFromNamedItemOptions, callback?: (result: AsyncResult) => void): void; + addFromNamedItemAsync(itemName: string, bindingType: BindingType, options?: AddBindingFromNamedItemOptions, callback?: (result: AsyncResult) => void): void; /** * Create a binding by prompting the user to make a selection on the document. * * @remarks *
Requirement SetsNot in a set
* - * Adds a binding object of the specified type to the Bindings collection, which will be identified with the supplied id. The method fails if the specified selection cannot be bound. + * Adds a binding object of the specified type to the Bindings collection, which will be identified with the supplied id. + * The method fails if the specified selection cannot be bound. * * **Support details** * - * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this method. + * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this method. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* * @@ -2450,11 +2632,13 @@ declare namespace Office { * *
Excel Y Y Y
* - * @param bindingType Specifies the type of the binding object to create. Required. Returns null if the selected object cannot be coerced into the specified type. + * @param bindingType Specifies the type of the binding object to create. Required. + * Returns null if the selected object cannot be coerced into the specified type. * @param options Provides options for configuring the prompt and identifying the binding that is created. - * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. + * The `value` property of the result is the Binding object that represents the selection specified by the user. */ - addFromPromptAsync(bindingType: BindingType, options?: AddBindingFromPromptOptions, callback?: (result: AsyncResult) => void): void; + addFromPromptAsync(bindingType: BindingType, options?: AddBindingFromPromptOptions, callback?: (result: AsyncResult) => void): void; /** * Create a binding based on the user's current selection. * @@ -2463,14 +2647,18 @@ declare namespace Office { * * Adds the specified type of binding object to the Bindings collection, which will be identified with the supplied id. * - * Note In Excel, if you call the addFromSelectionAsync method passing in the Binding.id of an existing binding, the Binding.type of that binding is used, and its type cannot be changed by specifying a different value for the bindingType parameter. - * If you need to use an existing id and change the bindingType, call the Bindings.releaseByIdAsync method first to release the binding, and then call the addFromSelectionAsync method to reestablish the binding with a new type. + * Note In Excel, if you call the addFromSelectionAsync method passing in the Binding.id of an existing binding, the Binding.type of that + * binding is used, and its type cannot be changed by specifying a different value for the bindingType parameter. + * If you need to use an existing id and change the bindingType, call the Bindings.releaseByIdAsync method first to release the binding, and + * then call the addFromSelectionAsync method to reestablish the binding with a new type. * * **Support details** * - * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this method. + * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this method. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* * @@ -2480,11 +2668,13 @@ declare namespace Office { * *
Word Y Y Y
* - * @param bindingType Specifies the type of the binding object to create. Required. Returns null if the selected object cannot be coerced into the specified type. + * @param bindingType Specifies the type of the binding object to create. Required. + * Returns null if the selected object cannot be coerced into the specified type. * @param options Provides options for configuring the prompt and identifying the binding that is created. - * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. + * The `value` property of the result is the Binding object that represents the selection specified by the user. */ - addFromSelectionAsync(bindingType: BindingType, options?: AddBindingFromSelectionOptions, callback?: (result: AsyncResult) => void): void; + addFromSelectionAsync(bindingType: BindingType, options?: AddBindingFromSelectionOptions, callback?: (result: AsyncResult) => void): void; /** * Gets all bindings that were previously created. * @@ -2493,9 +2683,11 @@ declare namespace Office { * * **Support details** * - * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this method. + * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this method. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* * @@ -2506,9 +2698,10 @@ declare namespace Office { *
* * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. - * @param callback A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. + * @param callback A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. + * The `value` property of the result is an array that contains each binding created for the referenced Bindings object. */ - getAllAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + getAllAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Retrieves a binding based on its Name * @@ -2519,9 +2712,11 @@ declare namespace Office { * * **Support details** * - * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this method. + * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this method. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* * @@ -2533,9 +2728,10 @@ declare namespace Office { * * @param id Specifies the unique name of the binding object. Required. * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. - * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. + * The `value` property of the result is the Binding object specified by the id in the call. */ - getByIdAsync(id: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + getByIdAsync(id: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Removes the binding from the document * @@ -2546,9 +2742,11 @@ declare namespace Office { * * **Support details** * - * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this method. + * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this method. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -2560,9 +2758,9 @@ declare namespace Office { * * @param id Specifies the unique name to be used to identify the binding object. Required. * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. - * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. */ - releaseByIdAsync(id: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + releaseByIdAsync(id: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; } /** * Represents an XML node in a tree in a document. @@ -2572,9 +2770,11 @@ declare namespace Office { * * **Support details** * - * A capital Y in the following matrix indicates that this interface is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this interface. + * A capital Y in the following matrix indicates that this interface is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this interface. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -2612,9 +2812,10 @@ declare namespace Office { * * @param xPath The XPath expression that specifies the nodes to get. Required. * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. - * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. + * The `value` property of the result is an array of CustomXmlNode objects that represent the nodes specified by the XPath expression passed to the `xPath` parameter. */ - getNodesAsync(xPath: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + getNodesAsync(xPath: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Gets the node value. * @@ -2622,9 +2823,10 @@ declare namespace Office { *
Requirement SetsCustomXmlParts
* * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. - * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. + * The `value` property of the result is a string that contains the value of the referenced node. */ - getNodeValueAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + getNodeValueAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Gets the text of an XML node in a custom XML part. * @@ -2632,9 +2834,10 @@ declare namespace Office { *
Requirement SetsCustomXmlParts
* * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. - * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. + * The `value` property of the result is a string that contains the inner text of the referenced nodes. */ - getTextAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + getTextAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Gets the node's XML. * @@ -2642,9 +2845,10 @@ declare namespace Office { *
Requirement SetsCustomXmlParts
* * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. - * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. + * The `value` property of the result is a string that contains the XML of the referenced node. */ - getXmlAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + getXmlAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Sets the node value. * @@ -2653,9 +2857,9 @@ declare namespace Office { * * @param value The value to be set on the node * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. - * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. */ - setNodeValueAsync(value: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + setNodeValueAsync(value: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Asynchronously sets the text of an XML node in a custom XML part. * @@ -2666,9 +2870,9 @@ declare namespace Office { * * @param text Required. The text value of the XML node. * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. - * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. */ - setTextAsync(text: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + setTextAsync(text: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Sets the node XML. * @@ -2677,9 +2881,9 @@ declare namespace Office { * * @param xml The XML to be set on the node * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. - * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. */ - setXmlAsync(xml: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + setXmlAsync(xml: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; } /** * Represents a single CustomXMLPart in an {@link Office.CustomXmlParts} collection. @@ -2689,9 +2893,11 @@ declare namespace Office { * * **Support details** * - * A capital Y in the following matrix indicates that this interface is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this interface. + * A capital Y in the following matrix indicates that this interface is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this interface. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* * @@ -2709,7 +2915,7 @@ declare namespace Office { */ id: string; /** - * Gets the set of namespace prefix mappings ({@link Office.CustomXmlPrefixMappings}) used against the current CustomXMLPart. + * Gets the set of namespace prefix mappings ({@link Office.CustomXmlPrefixMappings}) used against the current CustomXmlPart. */ namespaceManager: CustomXmlPrefixMappings; @@ -2720,21 +2926,23 @@ declare namespace Office { * * You can add multiple event handlers for the specified eventType as long as the name of each event handler function is unique. * - * @param eventType Specifies the type of event to add. For a CustomXmlPart object, the eventType parameter can be specified as `Office.EventType.NodeDeleted`, `Office.EventType.NodeInserted`, and `Office.EventType.NodeReplaced`. - * @param handler The event handler function to add, whose only parameter is of type {@link Office.NodeDeletedEventArgs}, {@link Office.NodeInsertedEventArgs}, or {@link Office.NodeReplacedEventArgs} + * @param eventType Specifies the type of event to add. For a CustomXmlPart object, the eventType parameter can be specified as + * `Office.EventType.NodeDeleted`, `Office.EventType.NodeInserted`, and `Office.EventType.NodeReplaced`. + * @param handler The event handler function to add, whose only parameter is of type {@link Office.NodeDeletedEventArgs}, + * {@link Office.NodeInsertedEventArgs}, or {@link Office.NodeReplacedEventArgs} * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. - * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. */ - addHandlerAsync(eventType: Office.EventType, handler: (result: any) => void, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + addHandlerAsync(eventType: Office.EventType, handler: (result: any) => void, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Deletes the Custom XML Part. * * @remarks * * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. - * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. */ - deleteAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + deleteAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Asynchronously gets any CustomXmlNodes in this custom XML part which match the specified XPath. * @@ -2742,29 +2950,32 @@ declare namespace Office { * * @param xPath An XPath expression that specifies the nodes you want returned. Required. * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. - * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. + * The `value` property of the result is an array of CustomXmlNode objects that represent the nodes specified by the XPath expression passed to the xPath parameter. */ - getNodesAsync(xPath: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + getNodesAsync(xPath: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Asynchronously gets the XML inside this custom XML part. * * @remarks * * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. - * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. + * The `value` property of the result is a string that contains the XML of the referenced CustomXmlPart object. */ - getXmlAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + getXmlAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Removes an event handler for the specified event type. * * @remarks * - * @param eventType Specifies the type of event to remove. For a CustomXmlPart object, the eventType parameter can be specified as `Office.EventType.NodeDeleted`, `Office.EventType.NodeInserted`, and `Office.EventType.NodeReplaced`. + * @param eventType Specifies the type of event to remove. For a CustomXmlPart object, the eventType parameter can be specified as + * `Office.EventType.NodeDeleted`, `Office.EventType.NodeInserted`, and `Office.EventType.NodeReplaced`. * @param handler The name of the handler to remove. * @param options Provides options to determine which event handler or handlers are removed. - * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. */ - removeHandlerAsync(eventType: Office.EventType, handler?: (result: any) => void, options?: RemoveHandlerOptions, callback?: (result: AsyncResult) => void): void; + removeHandlerAsync(eventType: Office.EventType, handler?: (result: any) => void, options?: RemoveHandlerOptions, callback?: (result: AsyncResult) => void): void; } /** @@ -2774,9 +2985,11 @@ declare namespace Office { * * **Support details** * - * A capital Y in the following matrix indicates that this interface is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this interface. + * A capital Y in the following matrix indicates that this interface is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this interface. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -2796,7 +3009,8 @@ declare namespace Office { /** * Gets the node which was just deleted from the {@link Office.CustomXmlPart} object. * - * Note that this node may have children, if a subtree is being removed from the document. Also, this node will be a "disconnected" node in that you can query down from the node, but you cannot query up the tree - the node appears to exist alone. + * Note that this node may have children, if a subtree is being removed from the document. Also, this node will be a "disconnected" node in + * that you can query down from the node, but you cannot query up the tree - the node appears to exist alone. */ oldNode: CustomXmlNode; } @@ -2808,9 +3022,11 @@ declare namespace Office { * * **Support details** * - * A capital Y in the following matrix indicates that this interface is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this interface. + * A capital Y in the following matrix indicates that this interface is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this interface. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -2837,9 +3053,11 @@ declare namespace Office { * @remarks * **Support details** * - * A capital Y in the following matrix indicates that this interface is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this interface. + * A capital Y in the following matrix indicates that this interface is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this interface. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -2861,7 +3079,8 @@ declare namespace Office { /** * Gets the node which was just deleted (replaced) from the CustomXmlPart object. * - * Note that this node may have children, if a subtree is being removed from the document. Also, this node will be a "disconnected" node in that you can query down from the node, but you cannot query up the tree - the node appears to exist alone. + * Note that this node may have children, if a subtree is being removed from the document. Also, this node will be a "disconnected" node in + * that you can query down from the node, but you cannot query up the tree - the node appears to exist alone. */ oldNode: CustomXmlNode; } @@ -2874,9 +3093,11 @@ declare namespace Office { * * **Support details** * - * A capital Y in the following matrix indicates that this interface is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this interface. + * A capital Y in the following matrix indicates that this interface is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this interface. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -2890,25 +3111,29 @@ declare namespace Office { * * @param xml The XML to add to the newly created custom XML part. * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. - * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. + * The `value` property of the result is the newly created CustomXmlPart object. */ - addAsync(xml: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + addAsync(xml: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Asynchronously gets the specified custom XML part by its id. * * @param id The GUID of the custom XML part, including opening and closing braces. * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. - * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. + * The `value` property of the result is a CustomXmlPart object that represents the specified custom XML part. + * If there is no custom XML part with the specified id, the method returns null. */ - getByIdAsync(id: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + getByIdAsync(id: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Asynchronously gets the specified custom XML part(s) by its namespace. * * @param ns The namespace URI. * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. - * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. + * The `value` property of the result is an array of CustomXmlPart objects that match the specified namespace. */ - getByNamespaceAsync(ns: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + getByNamespaceAsync(ns: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; } /** * Represents a collection of CustomXmlPart objects. @@ -2919,9 +3144,11 @@ declare namespace Office { * * **Support details** * - * A capital Y in the following matrix indicates that this interface is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this interface. + * A capital Y in the following matrix indicates that this interface is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this interface. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -2939,33 +3166,37 @@ declare namespace Office { * @param prefix Specifies the prefix to add to the prefix mapping list. Required. * @param ns Specifies the namespace URI to assign to the newly added prefix. Required. * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. - * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. */ - addNamespaceAsync(prefix: string, ns: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + addNamespaceAsync(prefix: string, ns: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Asynchronously gets the namespace mapped to the specified prefix. * * @remarks * - * If the prefix already exists in the namespace manager, this method will overwrite the mapping of that prefix except when the prefix is one added or used by the data store internally, in which case it will return an error. + * If the prefix already exists in the namespace manager, this method will overwrite the mapping of that prefix except when the prefix is one + * added or used by the data store internally, in which case it will return an error. * * @param prefix TSpecifies the prefix to get the namespace for. Required. * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. - * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. + * The `value` property of the result is a string that contains the namespace mapped to the specified prefix. */ - getNamespaceAsync(prefix: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + getNamespaceAsync(prefix: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Asynchronously gets the prefix for the specified namespace. * * @remarks * - * If no prefix is assigned to the requested namespace, the method returns an empty string (""). If there are multiple prefixes specified in the namespace manager, the method returns the first prefix that matches the supplied namespace. + * If no prefix is assigned to the requested namespace, the method returns an empty string (""). If there are multiple prefixes specified in + * the namespace manager, the method returns the first prefix that matches the supplied namespace. * * @param ns Specifies the namespace to get the prefix for. Required. * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. - * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. + * The `value` property of the result is a string that contains the prefix of the specified namespace. */ - getPrefixAsync(ns: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + getPrefixAsync(ns: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; } /** * An abstract class that represents the document the add-in is interacting with. @@ -2978,13 +3209,16 @@ declare namespace Office { * Gets an object that provides access to the bindings defined in the document. * * @remarks - * You don't instantiate the Document object directly in your script. To call members of the Document object to interact with the current document or worksheet, use `Office.context.document` in your script. + * You don't instantiate the Document object directly in your script. To call members of the Document object to interact with the current + * document or worksheet, use `Office.context.document` in your script. * * **Support details** * - * A capital Y in the following matrix indicates that this property is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this property. + * A capital Y in the following matrix indicates that this property is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this property. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -3002,9 +3236,11 @@ declare namespace Office { * * **Support details** * - * A capital Y in the following matrix indicates that this property is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this property. + * A capital Y in the following matrix indicates that this property is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this property. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -3020,9 +3256,11 @@ declare namespace Office { * * **Support details** * - * A capital Y in the following matrix indicates that this property is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this property. + * A capital Y in the following matrix indicates that this property is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this property. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -3041,9 +3279,11 @@ declare namespace Office { * * **Support details** * - * A capital Y in the following matrix indicates that this property is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this property. + * A capital Y in the following matrix indicates that this property is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this property. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -3062,9 +3302,11 @@ declare namespace Office { * * **Support details** * - * A capital Y in the following matrix indicates that this property is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this property. + * A capital Y in the following matrix indicates that this property is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this property. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -3086,9 +3328,11 @@ declare namespace Office { * * **Support details** * - * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this method. + * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this method. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -3099,12 +3343,13 @@ declare namespace Office { * *
Word Y Y Y
* - * @param eventType For a Document object event, the eventType parameter can be specified as `Office.EventType.Document.SelectionChanged` or `Office.EventType.Document.ActiveViewChanged`, or the corresponding text value of this enumeration. + * @param eventType For a Document object event, the eventType parameter can be specified as `Office.EventType.Document.SelectionChanged` or + * `Office.EventType.Document.ActiveViewChanged`, or the corresponding text value of this enumeration. * @param handler The event handler function to add, whose only parameter is of type {@link Office.DocumentSelectionChangedEventArgs}. Required. * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. - * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. */ - addHandlerAsync(eventType: Office.EventType, handler: any, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + addHandlerAsync(eventType: Office.EventType, handler: any, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Returns the state of the current view of the presentation (edit or read). * @@ -3115,9 +3360,11 @@ declare namespace Office { * * **Support details** * - * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this method. + * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this method. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* * @@ -3128,18 +3375,25 @@ declare namespace Office { *
* * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. - * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. + * The `value` property of the result is the state of the presentation's current view. + * The value returned can be either "edit" or "read". "edit" corresponds to any of the views in which you can edit slides, + * such as Normal or Outline View. "read" corresponds to either Slide Show or Reading View. */ - getActiveViewAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + getActiveViewAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult<"edit" | "read">) => void): void; /** - * Returns the entire document file in slices of up to 4194304 bytes (4 MB). For add-ins for iOS, file slice is supported up to 65536 (64 KB). Note that specifying file slice size of above permitted limit will result in an "Internal Error" failure. + * Returns the entire document file in slices of up to 4194304 bytes (4 MB). For add-ins for iOS, file slice is supported up to 65536 (64 KB). + * Note that specifying file slice size of above permitted limit will result in an "Internal Error" failure. * * @remarks *
Requirement SetsFile
* - * For add-ins running in Office host applications other than Office for iOS, the getFileAsync method supports getting files in slices of up to 4194304 bytes (4 MB). For add-ins running in Office for iOS apps, the getFileAsync method supports getting files in slices of up to 65536 (64 KB). + * For add-ins running in Office host applications other than Office for iOS, the getFileAsync method supports getting files in slices of up + * to 4194304 bytes (4 MB). For add-ins running in Office for iOS apps, the getFileAsync method supports getting files in slices of up to + * 65536 (64 KB). * - * The fileType parameter can be specified by using the {@link Office.FileType} enumeration or text values. But the possible values vary with the host: + * The fileType parameter can be specified by using the {@link Office.FileType} enumeration or text values. But the possible values vary with + * the host: * * Excel Online, Win32, Mac, and iOS: `Office.FileType.Compressed` * @@ -3151,9 +3405,11 @@ declare namespace Office { * * **Support details** * - * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this method. + * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this method. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* * @@ -3165,9 +3421,10 @@ declare namespace Office { * * @param fileType The format in which the file will be returned * @param options Provides options for setting the size of slices that the document will be divided into. - * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. + * The `value` property of the result is the File object. */ - getFileAsync(fileType: FileType, options?: GetFileOptions, callback?: (result: AsyncResult) => void): void; + getFileAsync(fileType: FileType, options?: GetFileOptions, callback?: (result: AsyncResult) => void): void; /** * Gets file properties of the current document. * @@ -3178,9 +3435,11 @@ declare namespace Office { * * **Support details** * - * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this method. + * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this method. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -3191,16 +3450,18 @@ declare namespace Office { *
* * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. - * @param callback A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. + * @param callback A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. + * The `value` property of the result is the file's properties (with the URL found at `asyncResult.value.url`). */ - getFilePropertiesAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + getFilePropertiesAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Reads the data contained in the current selection in the document. * * @remarks *
Requirement SetsSelection
* - * In the callback function that is passed to the getSelectedDataAsync method, you can use the properties of the AsyncResult object to return the following information. + * In the callback function that is passed to the getSelectedDataAsync method, you can use the properties of the AsyncResult object to return + * the following information. * * * @@ -3260,9 +3521,11 @@ declare namespace Office { * * **Support details** * - * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this method. + * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this method. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -3278,9 +3541,12 @@ declare namespace Office { * * @param options Provides options for customizing what data is returned and how it is formatted. * - * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. + * The `value` property of the result is the data in the current selection. + * This is returned in the data structure or format you specified with the coercionType parameter. + * (See Remarks for more information about data coercion.) */ - getSelectedDataAsync(coerciontype: Office.CoercionType, options?: GetSelectedDataOptions, callback?: (result: AsyncResult) => void): void; + getSelectedDataAsync(coerciontype: Office.CoercionType, options?: GetSelectedDataOptions, callback?: (result: AsyncResult) => void): void; /** * Goes to the specified object or location in the document. * @@ -3291,17 +3557,22 @@ declare namespace Office { * * The behavior caused by the selectionMode option varies by host: * - * In Excel: `Office.SelectionMode.Selected` selects all content in the binding, or named item. Office.SelectionMode.None for text bindings, selects the cell; for matrix bindings, table bindings, and named items, selects the first data cell (not first cell in header row for tables). + * In Excel: `Office.SelectionMode.Selected` selects all content in the binding, or named item. Office.SelectionMode.None for text bindings, + * selects the cell; for matrix bindings, table bindings, and named items, selects the first data cell (not first cell in header row for tables). * - * In PowerPoint: `Office.SelectionMode.Selected` selects the slide title or first textbox on the slide. `Office.SelectionMode.None` Doesn't select anything. + * In PowerPoint: `Office.SelectionMode.Selected` selects the slide title or first textbox on the slide. + * `Office.SelectionMode.None` doesn't select anything. * - * In Word: `Office.SelectionMode.Selected` selects all content in the binding. Office.SelectionMode.None for text bindings, moves the cursor to the beginning of the text; for matrix bindings and table bindings, selects the first data cell (not first cell in header row for tables). + * In Word: `Office.SelectionMode.Selected` selects all content in the binding. Office.SelectionMode.None for text bindings, moves the cursor + * to the beginning of the text; for matrix bindings and table bindings, selects the first data cell (not first cell in header row for tables). * * **Support details** * - * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this method. + * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this method. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -3314,9 +3585,10 @@ declare namespace Office { * @param id The identifier of the object or location to go to. * @param goToType The type of the location to go to. * @param options Provides options for whether to select the location that is navigated to. - * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. + * The `value` property of the result is the current view. */ - goToByIdAsync(id: string | number, goToType: GoToType, options?: GoToByIdOptions, callback?: (result: AsyncResult) => void): void; + goToByIdAsync(id: string | number, goToType: GoToType, options?: GoToByIdOptions, callback?: (result: AsyncResult) => void): void; /** * Removes an event handler for the specified event type. * @@ -3325,9 +3597,11 @@ declare namespace Office { * * **Support details** * - * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this method. + * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this method. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -3339,9 +3613,9 @@ declare namespace Office { * * @param eventType The event type. For document can be 'Document.SelectionChanged' or 'Document.ActiveViewChanged'. * @param options Provides options to determine which event handler or handlers are removed. - * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. */ - removeHandlerAsync(eventType: Office.EventType, options?: RemoveHandlerOptions, callback?: (result: AsyncResult) => void): void; + removeHandlerAsync(eventType: Office.EventType, options?: RemoveHandlerOptions, callback?: (result: AsyncResult) => void): void; /** * Writes the specified data into the current selection. * @@ -3410,9 +3684,11 @@ declare namespace Office { * * **Support details** * - * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this method. + * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this method. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -3428,32 +3704,47 @@ declare namespace Office { * If the value passed for `data` is: * * - A string: Plain text or anything that can be coerced to a string will be inserted. - * In Excel, you can also specify data as a valid formula to add that formula to the selected cell. For example, setting data to "=SUM(A1:A5)" will total the values in the specified range. However, when you set a formula on the bound cell, after doing so, you can't read the added formula (or any pre-existing formula) from the bound cell. If you call the Document.getSelectedDataAsync method on the selected cell to read its data, the method can return only the data displayed in the cell (the formula's result). + * In Excel, you can also specify data as a valid formula to add that formula to the selected cell. For example, setting data to "=SUM(A1:A5)" + * will total the values in the specified range. However, when you set a formula on the bound cell, after doing so, you can't read the added + * formula (or any pre-existing formula) from the bound cell. If you call the Document.getSelectedDataAsync method on the selected cell to + * read its data, the method can return only the data displayed in the cell (the formula's result). * - * - An array of arrays ("matrix"): Tabular data without headers will be inserted. For example, to write data to three rows in two columns, you can pass an array like this: [["R1C1", "R1C2"], ["R2C1", "R2C2"], ["R3C1", "R3C2"]]. To write a single column of three rows, pass an array like this: [["R1C1"], ["R2C1"], ["R3C1"]] - * In Excel, you can also specify data as an array of arrays that contains valid formulas to add them to the selected cells. For example if no other data will be overwritten, setting data to [["=SUM(A1:A5)","=AVERAGE(A1:A5)"]] will add those two formulas to the selection. Just as when setting a formula on a single cell as "text", you can't read the added formulas (or any pre-existing formulas) after they have been set - you can only read the formulas' results. + * - An array of arrays ("matrix"): Tabular data without headers will be inserted. For example, to write data to three rows in two columns, + * you can pass an array like this: [["R1C1", "R1C2"], ["R2C1", "R2C2"], ["R3C1", "R3C2"]]. To write a single column of three rows, pass an + * array like this: [["R1C1"], ["R2C1"], ["R3C1"]] + * + * In Excel, you can also specify data as an array of arrays that contains valid formulas to add them to the selected cells. For example if no + * other data will be overwritten, setting data to [["=SUM(A1:A5)","=AVERAGE(A1:A5)"]] will add those two formulas to the selection. Just as + * when setting a formula on a single cell as "text", you can't read the added formulas (or any pre-existing formulas) after they have been + * set - you can only read the formulas' results. * * - A TableData object: A table with headers will be inserted. - * In Excel, if you specify formulas in the TableData object you pass for the data parameter, you might not get the results you expect due to the "calculated columns" feature of Excel, which automatically duplicates formulas within a column. To work around this when you want to write `data` that contains formulas to a selected table, try specifying the data as an array of arrays (instead of a TableData object), and specify the coercionType as Microsoft.Office.Matrix or "matrix". + * In Excel, if you specify formulas in the TableData object you pass for the data parameter, you might not get the results you expect due to + * the "calculated columns" feature of Excel, which automatically duplicates formulas within a column. To work around this when you want to + * write `data` that contains formulas to a selected table, try specifying the data as an array of arrays (instead of a TableData object), and + * specify the coercionType as Microsoft.Office.Matrix or "matrix". * * @param options Provides options for how to insert data to the selection. - * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. - * The AsyncResult.value property always returns undefined because there is no object or data to retrieve. + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. + * The AsyncResult.value property always returns undefined because there is no object or data to retrieve. */ - setSelectedDataAsync(data: string | TableData | any[][], options?: SetSelectedDataOptions, callback?: (result: AsyncResult) => void): void; + setSelectedDataAsync(data: string | TableData | any[][], options?: SetSelectedDataOptions, callback?: (result: AsyncResult) => void): void; /** * Project documents only. Get Project field (Ex. ProjectWebAccessURL). * @param fieldId Project level fields. * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. - * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. + * The `value` property of the result contains the `fieldValue` property, which represents the value of the specified field. * * @remarks * * **Support details** * - * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this method. + * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this method. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -3461,21 +3752,24 @@ declare namespace Office { * *
Project Y
*/ - getProjectFieldAsync(fieldId: number, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + getProjectFieldAsync(fieldId: number, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Project documents only. Get resource field for provided resource Id. (Ex.ResourceName) * @param resourceId Either a string or value of the Resource Id. * @param fieldId Resource Fields. * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. - * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. + * The `value` property of the result is the GUID of the resource as a string. * * @remarks * * **Support details** * - * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this method. + * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this method. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* * @@ -3483,19 +3777,22 @@ declare namespace Office { * *
Project Y
*/ - getResourceFieldAsync(resourceId: string, fieldId: number, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + getResourceFieldAsync(resourceId: string, fieldId: number, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Project documents only. Get the current selected Resource's Id. * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. - * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. + * The `value` property of the result is the GUID of the resource as a string. * * @remarks * * **Support details** * - * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this method. + * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this method. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* * @@ -3503,19 +3800,22 @@ declare namespace Office { * *
Project Y
*/ - getSelectedResourceAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + getSelectedResourceAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Project documents only. Get the current selected Task's Id. * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. - * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. + * The `value` property of the result is the GUID of the resource as a string. * * @remarks * * **Support details** * - * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this method. + * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this method. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* * @@ -3523,19 +3823,24 @@ declare namespace Office { * *
Project Y
*/ - getSelectedTaskAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + getSelectedTaskAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Project documents only. Get the current selected View Type (Ex. Gantt) and View Name. * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. - * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. + * The `value` property of the result contains the following properties: + * `viewName` - The name of the view, as a ProjectViewTypes constant. + * `viewType` - The type of view, as the integer value of a ProjectViewTypes constant. * * @remarks * * **Support details** * - * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this method. + * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this method. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* * @@ -3543,20 +3848,26 @@ declare namespace Office { * *
Project Y
*/ - getSelectedViewAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + getSelectedViewAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Project documents only. Get the Task Name, WSS Task Id, and ResourceNames for given taskId. * @param taskId Either a string or value of the Task Id. * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. - * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. + * The `value` property of the result contains the following properties: + * `taskName` - The name of the task. + * `wssTaskId` - The ID of the task in the synchronized SharePoint task list. If the project is not synchronized with a SharePoint task list, the value is 0. + * `resourceNames` - The comma-separated list of the names of resources that are assigned to the task. * * @remarks * * **Support details** * - * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this method. + * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this method. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* * @@ -3564,21 +3875,24 @@ declare namespace Office { * *
Project Y
*/ - getTaskAsync(taskId: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + getTaskAsync(taskId: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Project documents only. Get task field for provided task Id. (Ex. StartDate). * @param taskId Either a string or value of the Task Id. * @param fieldId Task Fields. * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. - * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. + * The `value` property of the result contains the `fieldValue` property, which represents the value of the specified field. * * @remarks * * **Support details** * - * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this method. + * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this method. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* * @@ -3586,19 +3900,24 @@ declare namespace Office { * *
Project Y
*/ - getTaskFieldAsync(taskId: string, fieldId: number, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + getTaskFieldAsync(taskId: string, fieldId: number, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Project documents only. Get the WSS Url and list name for the Tasks List, the MPP is synced too. * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. - * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. + * The `value` property of the result contains the following properties: + * `listName` - the name of the synchronized SharePoint task list. + * `serverUrl` - the URL of the synchronized SharePoint task list. * * @remarks * * **Support details** * - * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this method. + * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this method. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* * @@ -3606,22 +3925,25 @@ declare namespace Office { * *
Project Y
*/ - getWSSUrlAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + getWSSUrlAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Project documents only. Get the maximum index of the collection of resources in the current project. * * Important: This API works only in Project 2016 on Windows desktop. * * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. - * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. + * The `value` property of the result is the highest index number in the current project's resource collection. * * @remarks * * **Support details** * - * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this method. + * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this method. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* * @@ -3629,22 +3951,25 @@ declare namespace Office { * *
Project Y
*/ - getMaxResourceIndexAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + getMaxResourceIndexAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Project documents only. Get the maximum index of the collection of tasks in the current project. * * Important: This API works only in Project 2016 on Windows desktop. * * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. - * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. + * The `value` property of the result is the highest index number in the current project's task collection. * * @remarks * * **Support details** * - * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this method. + * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this method. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* * @@ -3652,7 +3977,7 @@ declare namespace Office { * *
Project Y
*/ - getMaxTaskIndexAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + getMaxTaskIndexAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Project documents only. Get the GUID of the resource that has the specified index in the resource collection. * @@ -3660,15 +3985,18 @@ declare namespace Office { * * @param resourceIndex The index of the resource in the collection of resources for the project. * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. - * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. + * The `value` property of the result is the GUID of the resource as a string. * * @remarks * * **Support details** * - * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this method. + * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this method. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* * @@ -3676,7 +4004,7 @@ declare namespace Office { * *
Project Y
*/ - getResourceByIndexAsync(resourceIndex: number, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + getResourceByIndexAsync(resourceIndex: number, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Project documents only. Get the GUID of the task that has the specified index in the task collection. * @@ -3684,15 +4012,18 @@ declare namespace Office { * * @param taskIndex The index of the task in the collection of tasks for the project. * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. - * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. + * The `value` property of the result is the GUID of the task as a string. * * @remarks * * **Support details** * - * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this method. + * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this method. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* * @@ -3700,7 +4031,7 @@ declare namespace Office { * *
Project Y
*/ - getTaskByIndexAsync(taskIndex: number, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + getTaskByIndexAsync(taskIndex: number, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Project documents only. Set resource field for specified resource Id. * @@ -3710,15 +4041,17 @@ declare namespace Office { * @param fieldId Resource Fields. * @param fieldValue Value of the target field. * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. - * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. * * @remarks * * **Support details** * - * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this method. + * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this method. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* * @@ -3726,7 +4059,7 @@ declare namespace Office { * *
Project Y
*/ - setResourceFieldAsync(resourceId: string, fieldId: number, fieldValue: string | number | boolean | object, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + setResourceFieldAsync(resourceId: string, fieldId: number, fieldValue: string | number | boolean | object, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Project documents only. Set task field for specified task Id. * @@ -3736,15 +4069,17 @@ declare namespace Office { * @param fieldId Task Fields. * @param fieldValue Value of the target field. * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. - * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. * * @remarks * * **Support details** * - * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this method. + * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this method. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* * @@ -3752,7 +4087,7 @@ declare namespace Office { * *
Project Y
*/ - setTaskFieldAsync(taskId: string, fieldId: number, fieldValue: string | number | boolean | object, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + setTaskFieldAsync(taskId: string, fieldId: number, fieldValue: string | number | boolean | object, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; } /** * Provides information about the document that raised the SelectionChanged event. @@ -3775,9 +4110,11 @@ declare namespace Office { * * **Support details** * - * A capital Y in the following matrix indicates that this interface is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this interface. + * A capital Y in the following matrix indicates that this interface is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this interface. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* * @@ -3805,9 +4142,11 @@ declare namespace Office { * *
Requirement SetsFile
* - * No more than two documents are allowed to be in memory; otherwise the Document.getFileAsync operation will fail. Use the File.closeAsync method to close the file when you are finished working with it. + * No more than two documents are allowed to be in memory; otherwise the Document.getFileAsync operation will fail. Use the File.closeAsync + * method to close the file when you are finished working with it. * - * In the callback function passed to the closeAsync method, you can use the properties of the AsyncResult object to return the following information. + * In the callback function passed to the closeAsync method, you can use the properties of the AsyncResult object to return the following + * information. * * * @@ -3832,16 +4171,17 @@ declare namespace Office { * *
* - * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. When the function you passed to the callback parameter executes, it receives an AsyncResult object that you can access from the callback function's only parameter to return the following information. + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. */ - closeAsync(callback?: (result: AsyncResult) => void): void; + closeAsync(callback?: (result: AsyncResult) => void): void; /** * Returns the specified slice. * * @remarks *
Requirement SetsFile
* - * In the callback function passed to the getSliceAsync method, you can use the properties of the AsyncResult object to return the following information. + * In the callback function passed to the getSliceAsync method, you can use the properties of the AsyncResult object to return the following + * information. * * * @@ -3867,9 +4207,10 @@ declare namespace Office { *
* * @param sliceIndex Specifies the zero-based index of the slice to be retrieved. Required. - * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. When the function you passed to the callback parameter executes, it receives an AsyncResult object that you can access from the callback function's only parameter to return the following information. + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. + * The `value` property of the result is the {@link Office.Slice} object. */ - getSliceAsync(sliceIndex: number, callback?: (result: AsyncResult) => void): void; + getSliceAsync(sliceIndex: number, callback?: (result: AsyncResult) => void): void; } interface FileProperties { /** @@ -3887,9 +4228,11 @@ declare namespace Office { * * **Support details** * - * A capital Y in the following matrix indicates that this interface is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this interface. + * A capital Y in the following matrix indicates that this interface is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this interface. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* * @@ -3931,14 +4274,18 @@ declare namespace Office { * * The name of a setting is a string, while the value can be a string, number, boolean, null, object, or array. * - * The Settings object is automatically loaded as part of the Document object, and is available by calling the settings property of that object when the add-in is activated. + * The Settings object is automatically loaded as part of the Document object, and is available by calling the settings property of that object + * when the add-in is activated. + * * The developer is responsible for calling the saveAsync method after adding or deleting settings to save the settings in the document. */ interface Settings { /** * Adds an event handler for the settingsChanged event. * - * Important: Your add-in's code can register a handler for the settingsChanged event when the add-in is running with any Excel client, but the event will fire only when the add-in is loaded with a spreadsheet that is opened in Excel Online, and more than one user is editing the spreadsheet (co-authoring). Therefore, effectively the settingsChanged event is supported only in Excel Online in co-authoring scenarios. + * Important: Your add-in's code can register a handler for the settingsChanged event when the add-in is running with any Excel client, but + * the event will fire only when the add-in is loaded with a spreadsheet that is opened in Excel Online, and more than one user is editing the + * spreadsheet (co-authoring). Therefore, effectively the settingsChanged event is supported only in Excel Online in co-authoring scenarios. * * @remarks * @@ -3947,9 +4294,9 @@ declare namespace Office { * You can add multiple event handlers for the specified eventType as long as the name of each event handler function is unique. * * @param eventType Specifies the type of event to add. Required. - * @param handler The event handler function to add. Required. + * @param handler The event handler function to add, whose only parameter is of type {@link Office.SettingsChangedEventArgs}. Required. * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. - * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. When the function you passed to the callback parameter executes, it receives an AsyncResult object that you can access from the callback function's only parameter to return the following information. + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. * *
* @@ -3976,9 +4323,11 @@ declare namespace Office { * * **Support details** * - * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this method. + * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this method. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -3986,7 +4335,7 @@ declare namespace Office { * *
Excel Y
*/ - addHandlerAsync(eventType: Office.EventType, handler: any, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + addHandlerAsync(eventType: Office.EventType, handler: any, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Retrieves the specified setting. * @@ -3995,9 +4344,11 @@ declare namespace Office { * * **Support details** * - * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this method. + * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this method. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* * @@ -4019,12 +4370,14 @@ declare namespace Office { * *
Requirement SetsSettings
* - * This method is useful in Excel, Word, and PowerPoint coauthoring scenarios when multiple instances of the same add-in are working against the same document. - * Because each add-in is working against an in-memory copy of the settings loaded from the document at the time the user opened it, the settings values used by each user can get out of sync. - * This can happen whenever an instance of the add-in calls the Settings.saveAsync method to persist all of that user's settings to the document. - * Calling the refreshAsync method from the event handler for the settingsChanged event of the add-in will refresh the settings values for all users. + * This method is useful in Excel, Word, and PowerPoint coauthoring scenarios when multiple instances of the same add-in are working against + * the same document. Because each add-in is working against an in-memory copy of the settings loaded from the document at the time the user + * opened it, the settings values used by each user can get out of sync. This can happen whenever an instance of the add-in calls the + * Settings.saveAsync method to persist all of that user's settings to the document. Calling the refreshAsync method from the event handler + * for the settingsChanged event of the add-in will refresh the settings values for all users. * - * In the callback function passed to the refreshAsync method, you can use the properties of the AsyncResult object to return the following information. + * In the callback function passed to the refreshAsync method, you can use the properties of the AsyncResult object to return the following + * information. * * * @@ -4051,9 +4404,11 @@ declare namespace Office { * * **Support details** * - * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this method. + * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this method. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -4064,13 +4419,16 @@ declare namespace Office { * *
Word Y Y Y
* - * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. When the function you passed to the callback parameter executes, it receives an AsyncResult object that you can access from the callback function's only parameter. + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. + * The `value` property of the result is an {@link Office.Settings} object with the refreshed values. */ - refreshAsync(callback?: (result: AsyncResult) => void): void; + refreshAsync(callback?: (result: AsyncResult) => void): void; /** * Removes the specified setting. * - * Important: Be aware that the Settings.remove method affects only the in-memory copy of the settings property bag. To persist the removal of the specified setting in the document, at some point after calling the Settings.remove method and before the add-in is closed, you must call the Settings.saveAsync method. + * Important: Be aware that the Settings.remove method affects only the in-memory copy of the settings property bag. To persist the removal of + * the specified setting in the document, at some point after calling the Settings.remove method and before the add-in is closed, you must + * call the Settings.saveAsync method. * * @remarks *
Requirement SetsSettings
@@ -4079,9 +4437,11 @@ declare namespace Office { * * **Support details** * - * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this method. + * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this method. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* * @@ -4102,17 +4462,22 @@ declare namespace Office { * *
Requirement SetsSettings
* - * If the optional handler parameter is omitted when calling the removeHandlerAsync method, all event handlers for the specified eventType will be removed. + * If the optional handler parameter is omitted when calling the removeHandlerAsync method, all event handlers for the specified eventType + * will be removed. * - * When the function you passed to the callback parameter executes, it receives an AsyncResult object that you can access from the callback function's only parameter. + * When the function you passed to the callback parameter executes, it receives an AsyncResult object that you can access from the callback + * function's only parameter. * - * In the callback function passed to the removeHandlerAsync method, you can use the properties of the AsyncResult object to return the following information. + * In the callback function passed to the removeHandlerAsync method, you can use the properties of the AsyncResult object to return the + * following information. * * **Support details** * - * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this method. + * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this method. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* * @@ -4124,18 +4489,21 @@ declare namespace Office { * * @param eventType Specifies the type of event to remove. Required. * @param options Provides options to determine which event handler or handlers are removed. - * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. */ - removeHandlerAsync(eventType: Office.EventType, options?: RemoveHandlerOptions, callback?: (result: AsyncResult) => void): void; + removeHandlerAsync(eventType: Office.EventType, options?: RemoveHandlerOptions, callback?: (result: AsyncResult) => void): void; /** * Persists the in-memory copy of the settings property bag in the document. * * @remarks - * Any settings previously saved by an add-in are loaded when it is initialized, so during the lifetime of the session you can just use the set and get methods to work with the in-memory copy of the settings property bag. - * When you want to persist the settings so that they are available the next time the add-in is used, use the saveAsync method. + * Any settings previously saved by an add-in are loaded when it is initialized, so during the lifetime of the session you can just use the + * set and get methods to work with the in-memory copy of the settings property bag. When you want to persist the settings so that they are + * available the next time the add-in is used, use the saveAsync method. * - * Note: The saveAsync method persists the in-memory settings property bag into the document file. However, the changes to the document file itself are saved only when the user (or AutoRecover setting) saves the document to the file system. - * The refreshAsync method is only useful in coauthoring scenarios when other instances of the same add-in might change the settings and those changes should be made available to all instances. + * Note: The saveAsync method persists the in-memory settings property bag into the document file. However, the changes to the document file + * itself are saved only when the user (or AutoRecover setting) saves the document to the file system. The refreshAsync method is only useful + * in coauthoring scenarios when other instances of the same add-in might change the settings and those changes should be made available to + * all instances. * *
* @@ -4162,9 +4530,11 @@ declare namespace Office { * * **Support details** * - * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this method. + * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this method. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -4176,26 +4546,31 @@ declare namespace Office { *
* * @param options Provides options for saving settings. - * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. When the function you passed to the callback parameter executes, it receives an AsyncResult object that you can access from the callback function's only parameter to return the following information. + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. */ - saveAsync(options?: SaveSettingsOptions, callback?: (result: AsyncResult) => void): void; + saveAsync(options?: SaveSettingsOptions, callback?: (result: AsyncResult) => void): void; /** * Sets or creates the specified setting. * * Important: Be aware that the Settings.set method affects only the in-memory copy of the settings property bag. - * To make sure that additions or changes to settings will be available to your add-in the next time the document is opened, at some point after calling the Settings.set method and before the add-in is closed, you must call the Settings.saveAsync method to persist settings in the document. + * To make sure that additions or changes to settings will be available to your add-in the next time the document is opened, at some point + * after calling the Settings.set method and before the add-in is closed, you must call the Settings.saveAsync method to persist settings in + * the document. * * @remarks *
Requirement SetsSettings
* - * The set method creates a new setting of the specified name if it does not already exist, or sets an existing setting of the specified name in the in-memory copy of the settings property bag. - * After you call the Settings.saveAsync method, the value is stored in the document as the serialized JSON representation of its data type. A maximum of 2MB is available for the settings of each add-in. + * The set method creates a new setting of the specified name if it does not already exist, or sets an existing setting of the specified name + * in the in-memory copy of the settings property bag. After you call the Settings.saveAsync method, the value is stored in the document as + * the serialized JSON representation of its data type. A maximum of 2MB is available for the settings of each add-in. * * **Support details** * - * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this method. + * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this method. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* * @@ -4211,6 +4586,52 @@ declare namespace Office { */ set(name: string, value: any): void; } + /** + * Provides information about the settings that raised the settingsChanged event. + * + * @remarks + *
Requirement SetsSettings
+ * + * To add an event handler for the settingsChanged event, use the addHandlerAsync method of the + * {@link Office.Settings} object. + * + * The settingsChanged event fires only when your add-in's script calls the Settings.saveAsync method to persist + * the in-memory copy of the settings into the document file. The settingsChanged event is not triggered when the + * Settings.set or Settings.remove methods are called. + * + * The settingsChanged event was designed to let you to handle potential conflicts when two or more users are + * attempting to save settings at the same time when your add-in is used in a shared (co-authored) document. + * + * **Important:** Your add-in's code can register a handler for the settingsChanged event when the add-in + * is running with any Excel client, but the event will fire only when the add-in is loaded with a spreadsheet + * that is opened in Excel Online, and more than one user is editing the spreadsheet (co-authoring). + * Therefore, effectively the settingsChanged event is supported only in Excel Online in co-authoring scenarios. + * + * **Support details** + * + * A capital Y in the following matrix indicates that this interface is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this interface. + * + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * + * *Supported hosts, by platform* + * + * + * + * + *
Office for Windows desktop Office Online (in browser) Office for iPad
Excel Y
Word Y Y
+ */ + interface SettingsChangedEventArgs { + /** + * Gets an {@link Office.Settings} object that represents the settings that raised the settingsChanged event. + */ + settings: Settings; + /** + * Get an {@link Office.EventType} enumeration value that identifies the kind of event that was raised. + */ + type: EventType; + } /** * Represents a slice of a document file. * @@ -4221,9 +4642,11 @@ declare namespace Office { * * **Support details** * - * A capital Y in the following matrix indicates that this interface is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this interface. + * A capital Y in the following matrix indicates that this interface is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this interface. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* * @@ -4234,7 +4657,8 @@ declare namespace Office { */ interface Slice { /** - * Gets the raw data of the file slice in `Office.FileType.Text` ("text") or `Office.FileType.Compressed` ("compressed") format as specified by the fileType parameter of the call to the Document.getFileAsync method. + * Gets the raw data of the file slice in `Office.FileType.Text` ("text") or `Office.FileType.Compressed` ("compressed") format as specified + * by the fileType parameter of the call to the Document.getFileAsync method. * * @remarks * @@ -4256,9 +4680,11 @@ declare namespace Office { * @remarks *
Requirement SetsTableBindings
* - * The TableBinding object inherits the id property, type property, getDataAsync method, and setDataAsync method from the Binding object. + * The TableBinding object inherits the `id` property, `type` property, `getDataAsync` method, and `setDataAsync` method from the + * {@link Office.Binding} object. * - * For Excel, note that after you establish a table binding in Excel, each new row a user adds to the table is automatically included in the binding and rowCount increases. + * For Excel, note that after you establish a table binding, each new row a user adds to the table is automatically included in the binding and + * rowCount increases. */ interface TableBinding extends Binding { /** @@ -4268,9 +4694,11 @@ declare namespace Office { * * **Support details** * - * A capital Y in the following matrix indicates that this property is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this property. + * A capital Y in the following matrix indicates that this property is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this property. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* * @@ -4288,9 +4716,11 @@ declare namespace Office { * * **Support details** * - * A capital Y in the following matrix indicates that this property is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this property. + * A capital Y in the following matrix indicates that this property is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this property. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -4305,20 +4735,27 @@ declare namespace Office { * Gets the number of rows in the TableBinding, as an integer value. * * @remarks - * When you insert an empty table by selecting a single row in Excel 2013 and Excel Online (using Table on the Insert tab), both Office host applications create a single row of headers followed by a single blank row. However, if your add-in's script creates a binding for this newly inserted table (for example, by using the addFromSelectionAsync method), and then checks the value of the rowCount property, the value returned will differ depending whether the spreadsheet is open in Excel 2013 or Excel Online. + * When you insert an empty table by selecting a single row in Excel 2013 and Excel Online (using Table on the Insert tab), both Office host + * applications create a single row of headers followed by a single blank row. However, if your add-in's script creates a binding for this + * newly inserted table (for example, by using the {@link Office.Bindings}.addFromSelectionAsync method), and then checks the value of the + * rowCount property, the value returned will differ depending whether the spreadsheet is open in Excel 2013 or Excel Online. + * * - In Excel on the desktop, rowCount will return 0 (the blank row following the headers is not counted). * * - In Excel Online, rowCount will return 1 (the blank row following the headers is counted). * - * You can work around this difference in your script by checking if rowCount == 1, and if so, then checking if the row contains all empty strings. + * You can work around this difference in your script by checking if rowCount == 1, and if so, then checking if the row contains all empty + * strings. * * In content add-ins for Access, for performance reasons the rowCount property always returns -1. * * **Support details** * - * A capital Y in the following matrix indicates that this property is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this property. + * A capital Y in the following matrix indicates that this property is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this property. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -4334,23 +4771,30 @@ declare namespace Office { * * @remarks * - * To add one or more columns specifying the values of the data and headers, pass a TableData object as the data parameter. To add one or more columns specifying only the data, pass an array of arrays ("matrix") as the data parameter. + * To add one or more columns specifying the values of the data and headers, pass a TableData object as the data parameter. To add one or more + * columns specifying only the data, pass an array of arrays ("matrix") as the data parameter. * - * The success or failure of an addColumnsAsync operation is atomic. That is, the entire add columns operation must succeed, or it will be completely rolled back (and the AsyncResult.status property returned to the callback will report failure): + * The success or failure of an addColumnsAsync operation is atomic. That is, the entire add columns operation must succeed, or it will be + * completely rolled back (and the AsyncResult.status property returned to the callback will report failure): * - * - Each row in the array you pass as the data argument must have the same number of rows as the table being updated. If not, the entire operation will fail. + * - Each row in the array you pass as the data argument must have the same number of rows as the table being updated. If not, the entire + * operation will fail. * - * - Each row and cell in the array must successfully add that row or cell to the table in the newly added column(s). If any row or cell fails to be set for any reason, the entire operation will fail. + * - Each row and cell in the array must successfully add that row or cell to the table in the newly added column(s). If any row or cell + * fails to be set for any reason, the entire operation will fail. * * - If you pass a TableData object as the data argument, the number of header rows must match that of the table being updated. * - * Additional remark for Excel Online: The total number of cells in the TableData object passed to the data parameter can't exceed 20,000 in a single call to this method. + * Additional remark for Excel Online: The total number of cells in the TableData object passed to the data parameter can't exceed 20,000 in + * a single call to this method. * * **Support details** * - * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this method. + * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this method. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -4361,31 +4805,35 @@ declare namespace Office { * * @param tableData An array of arrays ("matrix") or a TableData object that contains one or more columns of data to add to the table. Required. * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. - * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. */ - addColumnsAsync(tableData: TableData | any[][], options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + addColumnsAsync(tableData: TableData | any[][], options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Adds the specified data to the table as additional rows. * * @remarks * - * To add one or more columns specifying the values of the data and headers, pass a TableData object as the data parameter. To add one or more columns specifying only the data, pass an array of arrays ("matrix") as the data parameter. + * The success or failure of an addRowsAsync operation is atomic. That is, the entire add columns operation must succeed, or it will be + * completely rolled back (and the AsyncResult.status property returned to the callback will report failure): * - * The success or failure of an addRowsAsync operation is atomic. That is, the entire add columns operation must succeed, or it will be completely rolled back (and the AsyncResult.status property returned to the callback will report failure): + * - Each row in the array you pass as the data argument must have the same number of columns as the table being updated. If not, the entire + * operation will fail. * - * - Each row in the array you pass as the data argument must have the same number of columns as the table being updated. If not, the entire operation will fail. - * - * - Each column and cell in the array must successfully add that column or cell to the table in the newly added rows(s). If any column or cell fails to be set for any reason, the entire operation will fail. + * - Each column and cell in the array must successfully add that column or cell to the table in the newly added rows(s). If any column or + * cell fails to be set for any reason, the entire operation will fail. * * - If you pass a TableData object as the data argument, the number of header rows must match that of the table being updated. * - * Additional remark for Excel Online: The total number of cells in the TableData object passed to the data parameter can't exceed 20,000 in a single call to this method. + * Additional remark for Excel Online: The total number of cells in the TableData object passed to the data parameter can't exceed 20,000 in + * a single call to this method. * * **Support details** * - * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this method. + * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this method. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -4397,9 +4845,9 @@ declare namespace Office { * * @param rows An array of arrays ("matrix") or a TableData object that contains one or more rows of data to add to the table. Required. * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. - * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. */ - addRowsAsync(rows: TableData | any[][], options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + addRowsAsync(rows: TableData | any[][], options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Deletes all non-header rows and their values in the table, shifting appropriately for the host application. * @@ -4409,9 +4857,11 @@ declare namespace Office { * * **Support details** * - * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this method. + * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this method. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -4422,9 +4872,9 @@ declare namespace Office { *
* * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. - * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. */ - deleteAllDataValuesAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + deleteAllDataValuesAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Clears formatting on the bound table. * @@ -4433,9 +4883,11 @@ declare namespace Office { * * **Support details** * - * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this method. + * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this method. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* * @@ -4444,28 +4896,17 @@ declare namespace Office { *
* * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. - * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. */ - clearFormatsAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + clearFormatsAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Gets the formatting on specified items in the table. - * @param cellReference An object literal containing name-value pairs that specify the range of cells to get formatting from. - * @param formats An array specifying the format properties to get. - * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. - * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. - */ - getFormatsAsync(cellReference?: any, formats?: any[], options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; - /** - * Sets formatting on specified items and data in the table. - * + * * @remarks * - * **Specifying the cellFormat parameter** + * **Returned format structure** * - * Use the cellFormat parameter to set or change cell formatting values, such as width, height, font, background, alignment, and so on. - * The value you pass as the cellFormat parameter is an array that contains a list of one or more JavaScript objects that specify which cells to target (`cells:`) and the formats (`format:`) to apply to them. - * - * Each JavaScript object in the cellFormat array has this form: `{cells:{ cell_range }, format:{ format_definition }}` + * Each JavaScript object in the return value array has this form: `{cells:{ cell_range }, format:{ format_definition }}` * * The `cells:` property specifies the range you want format using one of the following values: * @@ -4504,7 +4945,66 @@ declare namespace Office { * * The `format:` property specifies values that correspond to a subset of the settings available in the Format Cells dialog box in Excel (Right-click > Format Cells or Home > Format > Format Cells). * - * You specify the value of the `format:` property as a list of one or more property name - value pairs in a JavaScript object literal. The property name specifies the name of the formatting property to set, and value specifies the property value. + * @param cellReference An object literal containing name-value pairs that specify the range of cells to get formatting from. + * @param formats An array specifying the format properties to get. + * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. + * The `value` property of the result is an array containing one or more JavaScript objects specifying the formatting of their corresponding cells. + */ + getFormatsAsync(cellReference?: any, formats?: any[], options?: Office.AsyncContextOptions, callback?: (result: AsyncResult< ({ cells: any, format: any})[]>) => void): void; + /** + * Sets formatting on specified items and data in the table. + * + * @remarks + * + * **Specifying the cellFormat parameter** + * + * Use the cellFormat parameter to set or change cell formatting values, such as width, height, font, background, alignment, and so on. + * The value you pass as the cellFormat parameter is an array that contains a list of one or more JavaScript objects that specify which cells + * to target (`cells:`) and the formats (`format:`) to apply to them. + * + * Each JavaScript object in the cellFormat array has this form: `{cells:{ cell_range }, format:{ format_definition }}` + * + * The `cells:` property specifies the range you want format using one of the following values: + * + * **Supported ranges in cells property** + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
cells range settingsDescription
{row: n}Specifies the range that is the zero-based nth row of data in the table.
{column: n}Specifies the range that is the zero-based nth column of data in the table.
{row: i, column: j}Specifies the single cell that is the ith row and jth column of the table.
Office.Table.AllSpecifies the entire table, including column headers, data, and totals (if any).
Office.Table.DataSpecifies only the data in the table (no headers and totals).
Office.Table.HeadersSpecifies only the header row.
+ * + * The `format:` property specifies values that correspond to a subset of the settings available in the Format Cells dialog box in Excel + * (Right-click > Format Cells or Home > Format > Format Cells). + * + * You specify the value of the `format:` property as a list of one or more property name - value pairs in a JavaScript object literal. The + * property name specifies the name of the formatting property to set, and value specifies the property value. * You can specify multiple values for a given format, such as both a font's color and size. * * Here's three `format:` property value examples: @@ -4530,9 +5030,11 @@ declare namespace Office { * * For more detail, see how to {@link https://support.office.com/article/create-or-delete-a-custom-number-format-78f2a361-936b-4c03-8772-09fab54be7f4 | Create a custom number format}. * - * To set formatting on tables when writing data, use the tableOptions and cellFormat optional parameters of the `Document.setSelectedDataAsync` or `TableBinding.setDataAsync` methods. + * To set formatting on tables when writing data, use the tableOptions and cellFormat optional parameters of the + * `Document.setSelectedDataAsync` or `TableBinding.setDataAsync` methods. * - * Setting formatting with the optional parameters of the `Document.setSelectedDataAsync` and `TableBinding.setDataAsync` methods only works to set formatting when writing data the first time. + * Setting formatting with the optional parameters of the `Document.setSelectedDataAsync` and `TableBinding.setDataAsync` methods only works + * to set formatting when writing data the first time. * To make formatting changes after writing data, use the following methods: * * - To update cell formatting, such as font color and style, use the `TableBinding.setFormatsAsync` method (this method). @@ -4541,38 +5043,16 @@ declare namespace Office { * * - To clear formatting, use the `TableBinding.clearFormats` method. * - * For more details and examples, see {@link https://docs.microsoft.com/office/dev/add-ins/excel/excel-add-ins-tables#format-a-table | How to format tables in add-ins for Excel}. - * - * In the callback function passed to the goToByIdAsync method, you can use the properties of the AsyncResult object to return the following information. - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
PropertyUse to...
AsyncResult.valueAlways returns undefined because there is no data or object to retrieve when setting formats.
AsyncResult.statusDetermine the success or failure of the operation.
AsyncResult.errorAccess an Error object that provides error information if the operation failed.
AsyncResult.asyncContextA user-defined item of any type that is returned in the AsyncResult object without being altered.
+ * For more details and examples, see + * {@link https://docs.microsoft.com/office/dev/add-ins/excel/excel-add-ins-tables#format-a-table | How to format tables in add-ins for Excel}. * * **Support details** * - * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this method. + * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this method. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* * @@ -4582,9 +5062,9 @@ declare namespace Office { * * @param cellFormat An array that contains one or more JavaScript objects that specify which cells to target and the formatting to apply to them. * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. - * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. */ - setFormatsAsync(cellFormat?: any[], options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + setFormatsAsync(cellFormat: any[], options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Updates table formatting options on the bound table. * @@ -4620,9 +5100,11 @@ declare namespace Office { * * **Support details** * - * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this method. + * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this method. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -4632,11 +5114,10 @@ declare namespace Office { * * @param tableOptions An object literal containing a list of property name-value pairs that define the table options to apply. * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. - * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. You can use the properties of the AsyncResult object to return the following information. + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. * - */ - setTableOptionsAsync(tableOptions: any, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + setTableOptionsAsync(tableOptions: any, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; } /** * Represents the data in a table or a {@link Office.TableBinding}. @@ -4657,9 +5138,11 @@ declare namespace Office { * *
Requirement SetsTableBindings
* - * To specify headers, you must specify an array of arrays that corresponds to the structure of the table. For example, to specify headers for a two-column table you would set the header property to [['header1', 'header2']]. + * To specify headers, you must specify an array of arrays that corresponds to the structure of the table. For example, to specify headers + * for a two-column table you would set the header property to [['header1', 'header2']]. * - * If you specify null for the headers property (or leaving the property empty when you construct a TableData object), the following results occur when your code executes: + * If you specify null for the headers property (or leaving the property empty when you construct a TableData object), the following results + * occur when your code executes: * * - If you insert a new table, the default column headers for the table are created. * @@ -4667,16 +5150,19 @@ declare namespace Office { */ headers: any[]; /** - * Gets or sets the rows in the table. Returns an array of arrays that contains the data in the table. Returns an empty array ``, if there are no rows. + * Gets or sets the rows in the table. Returns an array of arrays that contains the data in the table. Returns an empty array ``, if there are + * no rows. * * @remarks * * *
HostsExcel, Word
Requirement SetsTableBindings
* - * To specify rows, you must specify an array of arrays that corresponds to the structure of the table. For example, to specify two rows of string values in a two-column table you would set the rows property to [['a', 'b'], ['c', 'd']]. + * To specify rows, you must specify an array of arrays that corresponds to the structure of the table. For example, to specify two rows of + * string values in a two-column table you would set the rows property to [['a', 'b'], ['c', 'd']]. * - * If you specify null for the rows property (or leave the property empty when you construct a TableData object), the following results occur when your code executes: + * If you specify null for the rows property (or leave the property empty when you construct a TableData object), the following results occur + * when your code executes: * * - If you insert a new table, a blank row will be inserted. * @@ -4685,15 +5171,18 @@ declare namespace Office { rows: any[][]; } /** - * Specifies enumerated values for the `cells` property in the cellFormat parameter of {@link https://docs.microsoft.com/en-us/office/dev/add-ins/excel/excel-add-ins-tables#format-a-table | table formatting methods}. + * Specifies enumerated values for the `cells` property in the cellFormat parameter of + * {@link https://docs.microsoft.com/en-us/office/dev/add-ins/excel/excel-add-ins-tables#format-a-table | table formatting methods}. * * @remarks * * **Support details** * - * A capital Y in the following matrix indicates that this enumeration is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this enumeration. + * A capital Y in the following matrix indicates that this enumeration is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this enumeration. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* * @@ -4721,13 +5210,16 @@ declare namespace Office { * @remarks *
Requirement SetsTextBindings
* - * The TextBinding object inherits the id property, type property, getDataAsync method, and setDataAsync method from the {@link Office.Binding} object. It does not implement any additional properties or methods of its own. + * The TextBinding object inherits the id property, type property, getDataAsync method, and setDataAsync method from the {@link Office.Binding} + * object. It does not implement any additional properties or methods of its own. * * **Support details** * - * A capital Y in the following matrix indicates that this interface is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this interface. + * A capital Y in the following matrix indicates that this interface is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this interface. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* * @@ -4746,9 +5238,11 @@ declare namespace Office { * * **Support details** * - * A capital Y in the following matrix indicates that this enumeration is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this enumeration. + * A capital Y in the following matrix indicates that this enumeration is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this enumeration. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -4766,7 +5260,8 @@ declare namespace Office { */ CurrencySymbol, /** - * The placement of the currency symbol: Not specified = -1; Before the value with no space ($0) = 0; After the value with no space (0$) = 1; Before the value with a space ($ 0) = 2; After the value with a space (0 $) = 3. + * The placement of the currency symbol: Not specified = -1; Before the value with no space ($0) = 0; After the value with no space (0$) = 1; + * Before the value with a space ($ 0) = 2; After the value with a space (0 $) = 3. */ CurrencySymbolPosition, DurationUnits, @@ -4813,13 +5308,17 @@ declare namespace Office { * @remarks * A ProjectResourceFields constant can be used as a parameter of the {@link Office.Document | Document}.getResourceFieldAsync method. * - * For more information about working with fields in Project, see {@link https://support.office.com/article/Available-fields-reference-615a4563-1cc3-40f4-b66f-1b17e793a460 | Available fields} reference. In Project Help, search for Available fields. + * For more information about working with fields in Project, see + * {@link https://support.office.com/article/Available-fields-reference-615a4563-1cc3-40f4-b66f-1b17e793a460 | Available fields} reference. In + * Project Help, search for Available fields. * * **Support details** * - * A capital Y in the following matrix indicates that this enumeration is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this enumeration. + * A capital Y in the following matrix indicates that this enumeration is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this enumeration. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -4829,7 +5328,8 @@ declare namespace Office { */ enum ProjectResourceFields { /** - * The accrual method that defines how a task accrues the cost of the resource: Accrues when the task starts = 1, accrues when the task ends = 2, accrues as the task progresses (prorated) = 3. + * The accrual method that defines how a task accrues the cost of the resource: Accrues when the task starts = 1, + * accrues when the task ends = 2, accrues as the task progresses (prorated) = 3. */ Accrual, /** @@ -5635,13 +6135,17 @@ declare namespace Office { * @remarks * A ProjectTaskFields constant can be used as a parameter of the {@link Office.Document | Document}.getTaskFieldAsync method. * - * For more information about working with fields in Project, see the {@link https://support.office.com/article/Available-fields-reference-615a4563-1cc3-40f4-b66f-1b17e793a460 | Available fields} reference. In Project Help, search for Available fields. + * For more information about working with fields in Project, see the + * {@link https://support.office.com/article/Available-fields-reference-615a4563-1cc3-40f4-b66f-1b17e793a460 | Available fields} reference. + * In Project Help, search for Available fields. * * **Support details** * - * A capital Y in the following matrix indicates that this enumeration is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this enumeration. + * A capital Y in the following matrix indicates that this enumeration is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this enumeration. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -5903,7 +6407,8 @@ declare namespace Office { */ Baseline10FixedCost, /** - * The accrual method that defines how the baseline task accrues fixed costs: Accrues when the task starts = 1, accrues when the task ends = 2, accrues as the task progresses (prorated) = 3. + * The accrual method that defines how the baseline task accrues fixed costs: Accrues when the task starts = 1, + * accrues when the task ends = 2, accrues as the task progresses (prorated) = 3. */ Baseline10FixedCostAccrual, /** @@ -5939,7 +6444,8 @@ declare namespace Office { */ Baseline1FixedCost, /** - * The accrual method that defines how the baseline task accrues fixed costs: Accrues when the task starts = 1, accrues when the task ends = 2, accrues as the task progresses (prorated) = 3. + * The accrual method that defines how the baseline task accrues fixed costs: Accrues when the task starts = 1, + * accrues when the task ends = 2, accrues as the task progresses (prorated) = 3. */ Baseline1FixedCostAccrual, /** @@ -5975,7 +6481,8 @@ declare namespace Office { */ Baseline2FixedCost, /** - * The accrual method that defines how the baseline task accrues fixed costs: Accrues when the task starts = 1, accrues when the task ends = 2, accrues as the task progresses (prorated) = 3. + * The accrual method that defines how the baseline task accrues fixed costs: Accrues when the task starts = 1, + * accrues when the task ends = 2, accrues as the task progresses (prorated) = 3. */ Baseline2FixedCostAccrual, /** @@ -6011,7 +6518,8 @@ declare namespace Office { */ Baseline3FixedCost, /** - * The accrual method that defines how the baseline task accrues fixed costs: Accrues when the task starts = 1, accrues when the task ends = 2, accrues as the task progresses (prorated) = 3. + * The accrual method that defines how the baseline task accrues fixed costs: Accrues when the task starts = 1, + * accrues when the task ends = 2, accrues as the task progresses (prorated) = 3. */ Baseline3FixedCostAccrual, /** @@ -6047,7 +6555,8 @@ declare namespace Office { */ Baseline4FixedCost, /** - * The accrual method that defines how the baseline task accrues fixed costs: Accrues when the task starts = 1, accrues when the task ends = 2, accrues as the task progresses (prorated) = 3. + * The accrual method that defines how the baseline task accrues fixed costs: Accrues when the task starts = 1, + * accrues when the task ends = 2, accrues as the task progresses (prorated) = 3. */ Baseline4FixedCostAccrual, /** @@ -6083,7 +6592,8 @@ declare namespace Office { */ Baseline5FixedCost, /** - * The accrual method that defines how the baseline task accrues fixed costs: Accrues when the task starts = 1, accrues when the task ends = 2, accrues as the task progresses (prorated) = 3. + * The accrual method that defines how the baseline task accrues fixed costs: Accrues when the task starts = 1, + * accrues when the task ends = 2, accrues as the task progresses (prorated) = 3. */ Baseline5FixedCostAccrual, /** @@ -6119,7 +6629,8 @@ declare namespace Office { */ Baseline6FixedCost, /** - * The accrual method that defines how the baseline task accrues fixed costs: Accrues when the task starts = 1, accrues when the task ends = 2, accrues as the task progresses (prorated) = 3. + * The accrual method that defines how the baseline task accrues fixed costs: Accrues when the task starts = 1, + * accrues when the task ends = 2, accrues as the task progresses (prorated) = 3. */ Baseline6FixedCostAccrual, /** @@ -6155,7 +6666,8 @@ declare namespace Office { */ Baseline7FixedCost, /** - * The accrual method that defines how the baseline task accrues fixed costs: Accrues when the task starts = 1, accrues when the task ends = 2, accrues as the task progresses (prorated) = 3. + * The accrual method that defines how the baseline task accrues fixed costs: Accrues when the task starts = 1, + * accrues when the task ends = 2, accrues as the task progresses (prorated) = 3. */ Baseline7FixedCostAccrual, /** @@ -6191,7 +6703,8 @@ declare namespace Office { */ Baseline8FixedCost, /** - * The accrual method that defines how the baseline task accrues fixed costs: Accrues when the task starts = 1, accrues when the task ends = 2, accrues as the task progresses (prorated) = 3. + * The accrual method that defines how the baseline task accrues fixed costs: Accrues when the task starts = 1, + * accrues when the task ends = 2, accrues as the task progresses (prorated) = 3. */ Baseline8FixedCostAccrual, /** @@ -6227,7 +6740,8 @@ declare namespace Office { */ Baseline9FixedCost, /** - * The accrual method that defines how the baseline task accrues fixed costs: Accrues when the task starts = 1, accrues when the task ends = 2, accrues as the task progresses (prorated) = 3. + * The accrual method that defines how the baseline task accrues fixed costs: Accrues when the task starts = 1, + * accrues when the task ends = 2, accrues as the task progresses (prorated) = 3. */ Baseline9FixedCostAccrual, /** @@ -6263,7 +6777,8 @@ declare namespace Office { */ BaselineFixedCost, /** - * The accrual method that defines how the baseline task accrues fixed costs: Accrues when the task starts = 1, accrues when the task ends = 2, accrues as the task progresses (prorated) = 3. + * The accrual method that defines how the baseline task accrues fixed costs: Accrues when the task starts = 1, + * accrues when the task ends = 2, accrues as the task progresses (prorated) = 3. */ BaselineFixedCostAccrual, /** @@ -6293,7 +6808,8 @@ declare namespace Office { */ ConstraintDate, /** - * A constraint type for the task: As Soon As Possible = 0, As Late As Possible = 1, Must Start On = 2, Must Finish On = 3, Start No Earlier Than = 4, Start No Later Than = 5, Finish No Earlier Than = 6, Finish No Later Than = 7. + * A constraint type for the task: As Soon As Possible = 0, As Late As Possible = 1, Must Start On = 2, Must Finish On = 3, + * Start No Earlier Than = 4, Start No Later Than = 5, Finish No Earlier Than = 6, Finish No Later Than = 7. */ ConstraintType, /** @@ -6437,7 +6953,8 @@ declare namespace Office { */ FixedCost, /** - * The accrual method that defines how the baseline task accrues fixed costs: Accrues when the task starts = 1, accrues when the task ends = 2, accrues as the task progresses (prorated) = 3. + * The accrual method that defines how the baseline task accrues fixed costs: Accrues when the task starts = 1, + * accrues when the task ends = 2, accrues as the task progresses (prorated) = 3. */ FixedCostAccrual, /** @@ -6781,13 +7298,16 @@ declare namespace Office { * Specifies the types of views that the {@link Office.Document | Document}.getSelectedViewAsync method can recognize. * * @remarks - * The {@link Office.Document | Document}.getSelectedViewAsync method returns the ProjectViewTypes constant value and name that corresponds to the active view. + * The {@link Office.Document | Document}.getSelectedViewAsync method returns the ProjectViewTypes constant value and name that corresponds to the + * active view. * * **Support details** * - * A capital Y in the following matrix indicates that this enumeration is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this enumeration. + * A capital Y in the following matrix indicates that this enumeration is supported in the corresponding Office host application. + * An empty cell indicates that the Office host application doesn't support this enumeration. * - * For more information about Office host application and server requirements, see {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. + * For more information about Office host application and server requirements, see + * {@link https://docs.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported hosts, by platform* *
@@ -7115,7 +7635,8 @@ declare namespace Office { */ TwoColumns = "TwoColumns", /** - Three column view. Displayed when the screen is wide. For example, Outlook Web App uses this view in a full screen window on a desktop computer. + Three column view. Displayed when the screen is wide. For example, Outlook Web App uses this view in a full screen window on a desktop + computer. */ ThreeColumns = "ThreeColumns" } @@ -7871,7 +8392,8 @@ declare namespace Office { /** * Gets or sets the date and time that the appointment is to end. * - * The end property is expressed as a Coordinated Universal Time (UTC) date and time value. You can use the convertToLocalClientTime method to convert the end property value to the client's local date and time. + * The end property is expressed as a Coordinated Universal Time (UTC) date and time value. You can use the convertToLocalClientTime method to + * convert the end property value to the client's local date and time. * * *Read mode* * @@ -7881,7 +8403,8 @@ declare namespace Office { * * The end property returns a Time object. * - * When you use the Time.setAsync method to set the end time, you should use the convertToUtcClientTime method to convert the local time on the client to UTC for the server. + * When you use the Time.setAsync method to set the end time, you should use the convertToUtcClientTime method to convert the local time on + * the client to UTC for the server. * * [Api set: Mailbox 1.0] * @@ -7955,7 +8478,8 @@ declare namespace Office { /** * Gets or sets the date and time that the appointment is to begin. * - * The start property is expressed as a Coordinated Universal Time (UTC) date and time value. You can use the convertToLocalClientTime method to convert the value to the client's local date and time. + * The start property is expressed as a Coordinated Universal Time (UTC) date and time value. You can use the convertToLocalClientTime method + * to convert the value to the client's local date and time. * * *Read mode* * @@ -7965,7 +8489,8 @@ declare namespace Office { * * The start property returns a Time object. * - * When you use the Time.setAsync method to set the start time, you should use the convertToUtcClientTime method to convert the local time on the client to UTC for the server. + * When you use the Time.setAsync method to set the start time, you should use the convertToUtcClientTime method to convert the local time on + * the client to UTC for the server. * * [Api set: Mailbox 1.0] * @@ -8038,7 +8563,8 @@ declare namespace Office { size: number; } /** - * The body object provides methods for adding and updating the content of the message or appointment. It is returned in the body property of the selected item. + * The body object provides methods for adding and updating the content of the message or appointment. + * It is returned in the body property of the selected item. * * [Api set: Mailbox 1.1] * @@ -8053,7 +8579,9 @@ declare namespace Office { * * This method returns the entire current body in the format specified by coercionType. * - * When working with HTML-formatted bodies, it is important to note that the Body.getAsync and Body.setAsync methods are not idempotent. The value returned from the getAsync method will not necessarily be exactly the same as the value that was passed in the setAsync method previously. The client may modify the value passed to setAsync in order to make it render efficiently with its rendering engine. + * When working with HTML-formatted bodies, it is important to note that the Body.getAsync and Body.setAsync methods are not idempotent. + * The value returned from the getAsync method will not necessarily be exactly the same as the value that was passed in the setAsync method previously. + * The client may modify the value passed to setAsync in order to make it render efficiently with its rendering engine. * * [Api set: Mailbox 1.3] * @@ -8064,20 +8592,23 @@ declare namespace Office { * * In addition to the main signature, this method also has this signature: * - * `getAsync(coerciontype: Office.CoercionType, callback: (result: AsyncResult) => void): void;` + * `getAsync(coerciontype: Office.CoercionType, callback: (result: AsyncResult) => void): void;` * * @param coercionType The format for the returned body. * @param options Optional. An object literal that contains one or more of the following properties: * asyncContext: Developers can provide any object they wish to access in the callback method. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. The body is provided in the requested format in the asyncResult.value property. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. + * The body is provided in the requested format in the asyncResult.value property. */ - getAsync(coerciontype: Office.CoercionType, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + getAsync(coerciontype: Office.CoercionType, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Returns the current body in a specified format. * * This method returns the entire current body in the format specified by coercionType. * - * When working with HTML-formatted bodies, it is important to note that the Body.getAsync and Body.setAsync methods are not idempotent. The value returned from the getAsync method will not necessarily be exactly the same as the value that was passed in the setAsync method previously. The client may modify the value passed to setAsync in order to make it render efficiently with its rendering engine. + * When working with HTML-formatted bodies, it is important to note that the Body.getAsync and Body.setAsync methods are not idempotent. + * The value returned from the getAsync method will not necessarily be exactly the same as the value that was passed in the setAsync method previously. + * The client may modify the value passed to setAsync in order to make it render efficiently with its rendering engine. * * [Api set: Mailbox 1.3] * @@ -8087,9 +8618,10 @@ declare namespace Office { *
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
* * @param coercionType The format for the returned body. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. The body is provided in the requested format in the asyncResult.value property. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type {@link Office.AsyncResult}. + * The body is provided in the requested format in the asyncResult.value property. */ - getAsync(coerciontype: Office.CoercionType, callback: (result: AsyncResult) => void): void; + getAsync(coerciontype: Office.CoercionType, callback: (result: AsyncResult) => void): void; /** * Gets a value that indicates whether the content is in HTML or text format. @@ -8103,15 +8635,18 @@ declare namespace Office { * * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. The content type is returned as one of the CoercionType values in the asyncResult.value property. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type {@link Office.AsyncResult}. + * The content type is returned as one of the CoercionType values in the asyncResult.value property. */ - getTypeAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + getTypeAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Adds the specified content to the beginning of the item body. * - * The prependAsync method inserts the specified string at the beginning of the item body. After insertion, the cursor is returned to its original place, relative to the inserted content. + * The prependAsync method inserts the specified string at the beginning of the item body. + * After insertion, the cursor is returned to its original place, relative to the inserted content. * - * When including links in HTML markup, you can disable online link preview by setting the id attribute on the anchor () to "LPNoLP" (please see the Examples section for a sample). + * When including links in HTML markup, you can disable online link preview by setting the id attribute on the anchor () to "LPNoLP" + * (please see the Examples section for a sample). * * [Api set: Mailbox 1.1] * @@ -8126,7 +8661,7 @@ declare namespace Office { * * `prependAsync(data: string, options: Office.AsyncContextOptions & CoercionTypeOptions): void;` * - * `prependAsync(data: string, callback: (result: AsyncResult) => void): void;` + * `prependAsync(data: string, callback: (result: AsyncResult) => void): void;` * * `prependAsync(data: string): void;` * @@ -8134,15 +8669,18 @@ declare namespace Office { * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. * coercionType: The desired format for the body. The string in the data parameter will be converted to this format. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. Any errors encountered will be provided in the asyncResult.error property. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type {@link Office.AsyncResult}. + * Any errors encountered will be provided in the asyncResult.error property. */ - prependAsync(data: string, options?: Office.AsyncContextOptions & CoercionTypeOptions, callback?: (result: AsyncResult) => void): void; + prependAsync(data: string, options?: Office.AsyncContextOptions & CoercionTypeOptions, callback?: (result: AsyncResult) => void): void; /** * Adds the specified content to the beginning of the item body. * - * The prependAsync method inserts the specified string at the beginning of the item body. After insertion, the cursor is returned to its original place, relative to the inserted content. + * The prependAsync method inserts the specified string at the beginning of the item body. + * After insertion, the cursor is returned to its original place, relative to the inserted content. * - * When including links in HTML markup, you can disable online link preview by setting the id attribute on the anchor () to "LPNoLP" (please see the Examples section for a sample). + * When including links in HTML markup, you can disable online link preview by setting the id attribute on the anchor () to "LPNoLP" + * (please see the Examples section for a sample). * * [Api set: Mailbox 1.1] * @@ -8162,9 +8700,11 @@ declare namespace Office { /** * Adds the specified content to the beginning of the item body. * - * The prependAsync method inserts the specified string at the beginning of the item body. After insertion, the cursor is returned to its original place, relative to the inserted content. + * The prependAsync method inserts the specified string at the beginning of the item body. + * After insertion, the cursor is returned to its original place, relative to the inserted content. * - * When including links in HTML markup, you can disable online link preview by setting the id attribute on the anchor () to "LPNoLP" (please see the Examples section for a sample). + * When including links in HTML markup, you can disable online link preview by setting the id attribute on the anchor () to "LPNoLP" + * (please see the Examples section for a sample). * * [Api set: Mailbox 1.1] * @@ -8174,15 +8714,18 @@ declare namespace Office { * ErrorsDataExceedsMaximumSize - The data parameter is longer than 1,000,000 characters. * * @param data The string to be inserted at the beginning of the body. The string is limited to 1,000,000 characters. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. Any errors encountered will be provided in the asyncResult.error property. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type {@link Office.AsyncResult}. + * Any errors encountered will be provided in the asyncResult.error property. */ - prependAsync(data: string, callback: (result: AsyncResult) => void): void; + prependAsync(data: string, callback: (result: AsyncResult) => void): void; /** * Adds the specified content to the beginning of the item body. * - * The prependAsync method inserts the specified string at the beginning of the item body. After insertion, the cursor is returned to its original place, relative to the inserted content. + * The prependAsync method inserts the specified string at the beginning of the item body. + * After insertion, the cursor is returned to its original place, relative to the inserted content. * - * When including links in HTML markup, you can disable online link preview by setting the id attribute on the anchor () to "LPNoLP" (please see the Examples section for a sample). + * When including links in HTML markup, you can disable online link preview by setting the id attribute on the anchor () to "LPNoLP" + * (please see the Examples section for a sample). * * [Api set: Mailbox 1.1] * @@ -8197,9 +8740,12 @@ declare namespace Office { /** * Replaces the entire body with the specified text. * - * When working with HTML-formatted bodies, it is important to note that the Body.getAsync and Body.setAsync methods are not idempotent. The value returned from the getAsync method will not necessarily be exactly the same as the value that was passed in the setAsync method previously. The client may modify the value passed to setAsync in order to make it render efficiently with its rendering engine. + * When working with HTML-formatted bodies, it is important to note that the Body.getAsync and Body.setAsync methods are not idempotent. + * The value returned from the getAsync method will not necessarily be exactly the same as the value that was passed in the setAsync method + * previously. The client may modify the value passed to setAsync in order to make it render efficiently with its rendering engine. * - * When including links in HTML markup, you can disable online link preview by setting the id attribute on the anchor () to "LPNoLP" (please see the Examples section for a sample). + * When including links in HTML markup, you can disable online link preview by setting the id attribute on the anchor () to "LPNoLP" + * (please see the Examples section for a sample). * * [Api set: Mailbox 1.3] * @@ -8214,7 +8760,7 @@ declare namespace Office { * * `setAsync(data: string, options: Office.AsyncContextOptions & CoercionTypeOptions): void;` * - * `setAsync(data: string, callback: (result: AsyncResult) => void): void;` + * `setAsync(data: string, callback: (result: AsyncResult) => void): void;` * * `setAsync(data: string): void;` * @@ -8222,15 +8768,19 @@ declare namespace Office { * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. * coercionType: The desired format for the body. The string in the data parameter will be converted to this format. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. Any errors encountered will be provided in the asyncResult.error property. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type {@link Office.AsyncResult}. + * Any errors encountered will be provided in the asyncResult.error property. */ - setAsync(data: string, options?: Office.AsyncContextOptions & CoercionTypeOptions, callback?: (result: AsyncResult) => void): void; + setAsync(data: string, options?: Office.AsyncContextOptions & CoercionTypeOptions, callback?: (result: AsyncResult) => void): void; /** * Replaces the entire body with the specified text. * - * When working with HTML-formatted bodies, it is important to note that the Body.getAsync and Body.setAsync methods are not idempotent. The value returned from the getAsync method will not necessarily be exactly the same as the value that was passed in the setAsync method previously. The client may modify the value passed to setAsync in order to make it render efficiently with its rendering engine. + * When working with HTML-formatted bodies, it is important to note that the Body.getAsync and Body.setAsync methods are not idempotent. + * The value returned from the getAsync method will not necessarily be exactly the same as the value that was passed in the setAsync method + * previously. The client may modify the value passed to setAsync in order to make it render efficiently with its rendering engine. * - * When including links in HTML markup, you can disable online link preview by setting the id attribute on the anchor () to "LPNoLP" (please see the Examples section for a sample). + * When including links in HTML markup, you can disable online link preview by setting the id attribute on the anchor () to "LPNoLP" + * (please see the Examples section for a sample). * * [Api set: Mailbox 1.3] * @@ -8250,9 +8800,12 @@ declare namespace Office { /** * Replaces the entire body with the specified text. * - * When working with HTML-formatted bodies, it is important to note that the Body.getAsync and Body.setAsync methods are not idempotent. The value returned from the getAsync method will not necessarily be exactly the same as the value that was passed in the setAsync method previously. The client may modify the value passed to setAsync in order to make it render efficiently with its rendering engine. + * When working with HTML-formatted bodies, it is important to note that the Body.getAsync and Body.setAsync methods are not idempotent. + * The value returned from the getAsync method will not necessarily be exactly the same as the value that was passed in the setAsync method + * previously. The client may modify the value passed to setAsync in order to make it render efficiently with its rendering engine. * - * When including links in HTML markup, you can disable online link preview by setting the id attribute on the anchor () to "LPNoLP" (please see the Examples section for a sample). + * When including links in HTML markup, you can disable online link preview by setting the id attribute on the anchor () to "LPNoLP" + * (please see the Examples section for a sample). * * [Api set: Mailbox 1.3] * @@ -8264,15 +8817,19 @@ declare namespace Office { * ErrorsDataExceedsMaximumSize - The data parameter is longer than 1,000,000 characters.InvalidFormatError - The options.coercionType parameter is set to Office.CoercionType.Html and the message body is in plain text. * * @param data The string that will replace the existing body. The string is limited to 1,000,000 characters. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. Any errors encountered will be provided in the asyncResult.error property. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type {@link Office.AsyncResult}. + * Any errors encountered will be provided in the asyncResult.error property. */ - setAsync(data: string, callback: (result: AsyncResult) => void): void; + setAsync(data: string, callback: (result: AsyncResult) => void): void; /** * Replaces the entire body with the specified text. * - * When working with HTML-formatted bodies, it is important to note that the Body.getAsync and Body.setAsync methods are not idempotent. The value returned from the getAsync method will not necessarily be exactly the same as the value that was passed in the setAsync method previously. The client may modify the value passed to setAsync in order to make it render efficiently with its rendering engine. + * When working with HTML-formatted bodies, it is important to note that the Body.getAsync and Body.setAsync methods are not idempotent. + * The value returned from the getAsync method will not necessarily be exactly the same as the value that was passed in the setAsync method + * previously. The client may modify the value passed to setAsync in order to make it render efficiently with its rendering engine. * - * When including links in HTML markup, you can disable online link preview by setting the id attribute on the anchor () to "LPNoLP" (please see the Examples section for a sample). + * When including links in HTML markup, you can disable online link preview by setting the id attribute on the anchor () to "LPNoLP" + * (please see the Examples section for a sample). * * [Api set: Mailbox 1.3] * @@ -8290,11 +8847,14 @@ declare namespace Office { /** * Replaces the selection in the body with the specified text. * - * The setSelectedDataAsync method inserts the specified string at the cursor location in the body of the item, or, if text is selected in the editor, it replaces the selected text. If the cursor was never in the body of the item, or if the body of the item lost focus in the UI, the string will be inserted at the top of the body content. After insertion, the cursor is placed at the end of the inserted content. + * The setSelectedDataAsync method inserts the specified string at the cursor location in the body of the item, or, if text is selected in + * the editor, it replaces the selected text. If the cursor was never in the body of the item, or if the body of the item lost focus in the + * UI, the string will be inserted at the top of the body content. After insertion, the cursor is placed at the end of the inserted content. * - * When including links in HTML markup, you can disable online link preview by setting the id attribute on the anchor () to "LPNoLP" (please see the Examples section for a sample). + * When including links in HTML markup, you can disable online link preview by setting the id attribute on the anchor () to "LPNoLP" + * (please see the Examples section for a sample). * - * [Api set: Mailbox 1.2] + * [Api set: Mailbox 1.1] * * @remarks * @@ -8307,7 +8867,7 @@ declare namespace Office { * * `setSelectedDataAsync(data: string, options: Office.AsyncContextOptions & CoercionTypeOptions): void;` * - * `setSelectedDataAsync(data: string, callback: (result: AsyncResult) => void): void;` + * `setSelectedDataAsync(data: string, callback: (result: AsyncResult) => void): void;` * * `setSelectedDataAsync(data: string): void;` * @@ -8315,17 +8875,21 @@ declare namespace Office { * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. * coercionType: The desired format for the body. The string in the data parameter will be converted to this format. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. Any errors encountered will be provided in the asyncResult.error property. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type {@link Office.AsyncResult}. + * Any errors encountered will be provided in the asyncResult.error property. */ - setSelectedDataAsync(data: string, options?: Office.AsyncContextOptions & CoercionTypeOptions, callback?: (result: AsyncResult) => void): void; + setSelectedDataAsync(data: string, options?: Office.AsyncContextOptions & CoercionTypeOptions, callback?: (result: AsyncResult) => void): void; /** * Replaces the selection in the body with the specified text. * - * The setSelectedDataAsync method inserts the specified string at the cursor location in the body of the item, or, if text is selected in the editor, it replaces the selected text. If the cursor was never in the body of the item, or if the body of the item lost focus in the UI, the string will be inserted at the top of the body content. After insertion, the cursor is placed at the end of the inserted content. + * The setSelectedDataAsync method inserts the specified string at the cursor location in the body of the item, or, if text is selected in + * the editor, it replaces the selected text. If the cursor was never in the body of the item, or if the body of the item lost focus in the + * UI, the string will be inserted at the top of the body content. After insertion, the cursor is placed at the end of the inserted content. * - * When including links in HTML markup, you can disable online link preview by setting the id attribute on the anchor () to "LPNoLP" (please see the Examples section for a sample). + * When including links in HTML markup, you can disable online link preview by setting the id attribute on the anchor () to "LPNoLP" + * (please see the Examples section for a sample). * - * [Api set: Mailbox 1.2] + * [Api set: Mailbox 1.1] * * @remarks *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
@@ -8343,11 +8907,14 @@ declare namespace Office { /** * Replaces the selection in the body with the specified text. * - * The setSelectedDataAsync method inserts the specified string at the cursor location in the body of the item, or, if text is selected in the editor, it replaces the selected text. If the cursor was never in the body of the item, or if the body of the item lost focus in the UI, the string will be inserted at the top of the body content. After insertion, the cursor is placed at the end of the inserted content. + * The setSelectedDataAsync method inserts the specified string at the cursor location in the body of the item, or, if text is selected in + * the editor, it replaces the selected text. If the cursor was never in the body of the item, or if the body of the item lost focus in the + * UI, the string will be inserted at the top of the body content. After insertion, the cursor is placed at the end of the inserted content. * - * When including links in HTML markup, you can disable online link preview by setting the id attribute on the anchor () to "LPNoLP" (please see the Examples section for a sample). + * When including links in HTML markup, you can disable online link preview by setting the id attribute on the anchor () to "LPNoLP" + * (please see the Examples section for a sample). * - * [Api set: Mailbox 1.2] + * [Api set: Mailbox 1.1] * * @remarks *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
@@ -8357,17 +8924,21 @@ declare namespace Office { *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
ErrorsDataExceedsMaximumSize - The data parameter is longer than 1,000,000 characters.
InvalidFormatError - The options.coercionType parameter is set to Office.CoercionType.Html and the message body is in plain text.
* * @param data The string that will replace the existing body. The string is limited to 1,000,000 characters. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. Any errors encountered will be provided in the asyncResult.error property. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type {@link Office.AsyncResult}. + * Any errors encountered will be provided in the asyncResult.error property. */ - setSelectedDataAsync(data: string, callback: (result: AsyncResult) => void): void; + setSelectedDataAsync(data: string, callback: (result: AsyncResult) => void): void; /** * Replaces the selection in the body with the specified text. * - * The setSelectedDataAsync method inserts the specified string at the cursor location in the body of the item, or, if text is selected in the editor, it replaces the selected text. If the cursor was never in the body of the item, or if the body of the item lost focus in the UI, the string will be inserted at the top of the body content. After insertion, the cursor is placed at the end of the inserted content. + * The setSelectedDataAsync method inserts the specified string at the cursor location in the body of the item, or, if text is selected in + * the editor, it replaces the selected text. If the cursor was never in the body of the item, or if the body of the item lost focus in the + * UI, the string will be inserted at the top of the body content. After insertion, the cursor is placed at the end of the inserted content. * - * When including links in HTML markup, you can disable online link preview by setting the id attribute on the anchor () to "LPNoLP" (please see the Examples section for a sample). + * When including links in HTML markup, you can disable online link preview by setting the id attribute on the anchor () to "LPNoLP" + * (please see the Examples section for a sample). * - * [Api set: Mailbox 1.2] + * [Api set: Mailbox 1.1] * * @remarks * @@ -8383,7 +8954,8 @@ declare namespace Office { /** * Represents a contact stored on the server. Read mode only. * - * The list of contacts associated with an email message or appointment is returned in the contacts property of the {@link Office.Entities} object that is returned by the getEntities or getEntitiesByType method of the active item. + * The list of contacts associated with an email message or appointment is returned in the contacts property of the {@link Office.Entities} object + * that is returned by the getEntities or getEntitiesByType method of the active item. * * [Api set: Mailbox 1.0] * @@ -8419,7 +8991,10 @@ declare namespace Office { urls: Array; } /** - * The CustomProperties object represents custom properties that are specific to a particular item and specific to a mail add-in for Outlook. For example, there might be a need for a mail add-in to save some data that is specific to the current email message that activated the add-in. If the user revisits the same message in the future and activates the mail add-in again, the add-in will be able to retrieve the data that had been saved as custom properties. + * The CustomProperties object represents custom properties that are specific to a particular item and specific to a mail add-in for Outlook. + * For example, there might be a need for a mail add-in to save some data that is specific to the current email message that activated the add-in. + * If the user revisits the same message in the future and activates the mail add-in again, the add-in will be able to retrieve the data that had + * been saved as custom properties. * * Because Outlook for Mac doesn't cache custom properties, if the user's network goes down, mail add-ins cannot access their custom properties. * @@ -8449,7 +9024,9 @@ declare namespace Office { * * The set method sets the specified property to the specified value. You must use the saveAsync method to save the property to the server. * - * The set method creates a new property if the specified property does not already exist; otherwise, the existing value is replaced with the new value. The value parameter can be of any type; however, it is always passed to the server as a string. + * The set method creates a new property if the specified property does not already exist; + * otherwise, the existing value is replaced with the new value. + * The value parameter can be of any type; however, it is always passed to the server as a string. * * [Api set: Mailbox 1.0] * @@ -8479,11 +9056,17 @@ declare namespace Office { /** * Saves item-specific custom properties to the server. * - * You must call the saveAsync method to persist any changes made with the set method or the remove method of the CustomProperties object. The saving action is asynchronous. + * You must call the saveAsync method to persist any changes made with the set method or the remove method of the CustomProperties object. + * The saving action is asynchronous. * - * It's a good practice to have your callback function check for and handle errors from saveAsync. In particular, a read add-in can be activated while the user is in a connected state in a read form, and subsequently the user becomes disconnected. If the add-in calls saveAsync while in the disconnected state, saveAsync would return an error. Your callback method should handle this error accordingly. + * It's a good practice to have your callback function check for and handle errors from saveAsync. + * In particular, a read add-in can be activated while the user is in a connected state in a read form, and subsequently the user becomes + * disconnected. + * If the add-in calls saveAsync while in the disconnected state, saveAsync would return an error. + * Your callback method should handle this error accordingly. * - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of + * type {@link Office.AsyncResult}. * @param asyncContext Optional. Any state data that is passed to the callback method. * * [Api set: Mailbox 1.0] @@ -8493,7 +9076,7 @@ declare namespace Office { * *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read
*/ - saveAsync(callback?: (result: AsyncResult) => void, asyncContext?: any): void; + saveAsync(callback?: (result: AsyncResult) => void, asyncContext?: any): void; } /** * Provides diagnostic information to an Outlook add-in. @@ -8522,7 +9105,8 @@ declare namespace Office { /** * Gets a string that represents the version of either the host application or the Exchange Server. * - * If the mail add-in is running on the Outlook desktop client or Outlook for iOS, the hostVersion property returns the version of the host application, Outlook. In Outlook Web App, the property returns the version of the Exchange Server. An example is the string 15.0.468.0. + * If the mail add-in is running on the Outlook desktop client or Outlook for iOS, the hostVersion property returns the version of the host + * application, Outlook. In Outlook Web App, the property returns the version of the Exchange Server. An example is the string 15.0.468.0. * * [Api set: Mailbox 1.0] * @@ -8541,11 +9125,13 @@ declare namespace Office { * * Outlook Web App has three views that correspond to the width of the screen and the window, and the number of columns that can be displayed: * - * - OneColumn, which is displayed when the screen is narrow. Outlook Web App uses this single-column layout on the entire screen of a smartphone. + * - OneColumn, which is displayed when the screen is narrow. Outlook Web App uses this single-column layout on the entire screen of a + * smartphone. * * - TwoColumns, which is displayed when the screen is wider. Outlook Web App uses this view on most tablets. * - * - ThreeColumns, which is displayed when the screen is wide. For example, Outlook Web App uses this view in a full screen window on a desktop computer. + * - ThreeColumns, which is displayed when the screen is wide. For example, Outlook Web App uses this view in a full screen window on a + * desktop computer. * * [Api set: Mailbox 1.0] * @@ -8576,7 +9162,9 @@ declare namespace Office { */ displayName: string; /** - * Gets the response that an attendee returned for an appointment. This property applies to only an attendee of an appointment, as represented by the optionalAttendees or requiredAttendees property. This property returns undefined in other scenarios. + * Gets the response that an attendee returned for an appointment. + * This property applies to only an attendee of an appointment, as represented by the optionalAttendees or requiredAttendees property. + * This property returns undefined in other scenarios. */ appointmentResponse: Office.MailboxEnums.ResponseType; /** @@ -8607,17 +9195,25 @@ declare namespace Office { /** * Represents a collection of entities found in an email message or appointment. Read mode only. * - * The Entities object is a container for the entity arrays returned by the getEntities and getEntitiesByType methods when the item (either an email message or an appointment) contains one or more entities that have been found by the server. You can use these entities in your code to provide additional context information to the viewer, such as a map to an address found in the item, or to open a dialer for a phone number found in the item. + * The Entities object is a container for the entity arrays returned by the getEntities and getEntitiesByType methods when the item + * (either an email message or an appointment) contains one or more entities that have been found by the server. + * You can use these entities in your code to provide additional context information to the viewer, such as a map to an address found in the item, + * or to open a dialer for a phone number found in the item. * - * If no entities of the type specified in the property are present in the item, the property associated with that entity is null. For example, if a message contains a street address and a phone number, the addresses property and phoneNumbers property would contain information, and the other properties would be null. + * If no entities of the type specified in the property are present in the item, the property associated with that entity is null. + * For example, if a message contains a street address and a phone number, the addresses property and phoneNumbers property would contain + * information, and the other properties would be null. * - * To be recognized as an address, the string must contain a United States postal address that has at least a subset of the elements of a street number, street name, city, state, and zip code. + * To be recognized as an address, the string must contain a United States postal address that has at least a subset of the elements of a street + * number, street name, city, state, and zip code. * * To be recognized as a phone number, the string must contain a North American phone number format. * - * Entity recognition relies on natural language recognition that is based on machine learning of large amounts of data. The recognition of an entity is non-deterministic and success sometimes relies on the particular context in the item. + * Entity recognition relies on natural language recognition that is based on machine learning of large amounts of data. + * The recognition of an entity is non-deterministic and success sometimes relies on the particular context in the item. * - * When the property arrays are returned by the getEntitiesByType method, only the property for the specified entity contains data; all other properties are null. + * When the property arrays are returned by the getEntitiesByType method, only the property for the specified entity contains data; + * all other properties are null. * * [Api set: Mailbox 1.0] * @@ -8686,19 +9282,20 @@ declare namespace Office { * * In addition to this signature, the method also has the following signature: * - * `getAsync(callback?: (result: AsyncResult) => void): void;` + * `getAsync(callback?: (result: AsyncResult) => void): void;` * * @param options An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. - * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an AsyncResult object. + * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an {@link Office.AsyncResult} object. + * The `value` property of the result is message's from value, as an EmailAddressDetails object. */ - getAsync(options: Office.AsyncContextOptions, callback: (result: AsyncResult) => void): void; + getAsync(options: Office.AsyncContextOptions, callback: (result: AsyncResult) => void): void; /** * Gets the from value of a message. * * The getAsync method starts an asynchronous call to the Exchange server to get the from value of a message. * - * The from value of the item is provided as an EmailAddressDetails in the asyncResult.value property. + * The from value of the item is provided as an {@link Office.EmailAddressDetails} in the asyncResult.value property. * * [Api set: Mailbox Preview] * @@ -8708,9 +9305,10 @@ declare namespace Office { * * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose * - * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an AsyncResult object. + * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an {@link Office.AsyncResult} object. + * The `value` property of the result is message's from value, as an EmailAddressDetails object. */ - getAsync(callback?: (result: AsyncResult) => void): void; + getAsync(callback?: (result: AsyncResult) => void): void; } /** @@ -8740,21 +9338,24 @@ declare namespace Office { * @param options An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an AsyncResult object. + * The `value` property of the result is message's organizer value, as an EmailAddressDetails object. */ - getAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + getAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; } /** * The subclass of {@link Office.Item} dealing with appointments. * - * Important: This is an internal Outlook object, not directly exposed through existing interfaces. You should treat this as a mode of Office.context.mailbox.item. Refer to the Object Model pages for more information. + * Important: This is an internal Outlook object, not directly exposed through existing interfaces. + * You should treat this as a mode of Office.context.mailbox.item. Refer to the Object Model pages for more information. */ interface Appointment extends Item { } /** * The appointment organizer mode of {@link Office.Item | Office.context.mailbox.item}. * - * Important: This is an internal Outlook object, not directly exposed through existing interfaces. You should treat this as a mode of `Office.context.mailbox.item`. Refer to the Object Model pages for more information. + * Important: This is an internal Outlook object, not directly exposed through existing interfaces. + * You should treat this as a mode of `Office.context.mailbox.item`. Refer to the Object Model pages for more information. */ interface AppointmentCompose extends Appointment, ItemCompose { /** @@ -8798,9 +9399,11 @@ declare namespace Office { /** * Gets or sets the date and time that the appointment is to end. * - * The end property is an {@link Office.Time} object expressed as a Coordinated Universal Time (UTC) date and time value. You can use the convertToLocalClientTime method to convert the end property value to the client's local date and time. + * The end property is an {@link Office.Time} object expressed as a Coordinated Universal Time (UTC) date and time value. + * You can use the convertToLocalClientTime method to convert the end property value to the client's local date and time. * - * When you use the Time.setAsync method to set the end time, you should use the convertToUtcClientTime method to convert the local time on the client to UTC for the server. + * When you use the Time.setAsync method to set the end time, you should use the convertToUtcClientTime method to convert the local time on + * the client to UTC for the server. * * [Api set: Mailbox 1.0] * @@ -8826,7 +9429,8 @@ declare namespace Office { */ itemType: Office.MailboxEnums.ItemType; /** - * Gets or sets the {@link Office.Location} of an appointment. The location property returns a Location object that provides methods that are used to get and set the location of the appointment. + * Gets or sets the {@link Office.Location} of an appointment. The location property returns a Location object that provides methods that are + * used to get and set the location of the appointment. * * [Api set: Mailbox 1.0] * @@ -8850,7 +9454,9 @@ declare namespace Office { */ notificationMessages: Office.NotificationMessages; /** - * Provides access to the optional attendees of an event. The type of object and level of access depends on the mode of the current item. The optionalAttendees property returns an {@link Office.Recipients} object that provides methods to get or update the optional attendees for a meeting. + * Provides access to the optional attendees of an event. The type of object and level of access depends on the mode of the current item. + * The optionalAttendees property returns an {@link Office.Recipients} object that provides methods to get or update the optional attendees + * for a meeting. * * [Api set: Mailbox 1.0] * @@ -8880,11 +9486,13 @@ declare namespace Office { /** * Gets or sets the recurrence pattern of an appointment. * - * The recurrence property returns a recurrence object for recurring appointments or meetings requests if an item is a series or an instance in a series. null is returned for single appointments and meeting requests of single appointments. + * The recurrence property returns a recurrence object for recurring appointments or meetings requests if an item is a series or an instance + * in a series. `null` is returned for single appointments and meeting requests of single appointments. * * Note: Meeting requests have an itemClass value of IPM.Schedule.Meeting.Request. * - * Note: If the recurrence object is null, this indicates that the object is a single appointment or a meeting request of a single appointment and NOT a part of a series. + * Note: If the recurrence object is null, this indicates that the object is a single appointment or a meeting request of a single + * appointment and NOT a part of a series. * * [Api set: Mailbox Preview] * @@ -8898,7 +9506,9 @@ declare namespace Office { */ recurrence: Recurrence; /** - * Provides access to the required attendees of an event. The type of object and level of access depends on the mode of the current item. The requiredAttendees property returns an {@link Office.Recipients} object that provides methods to get or update the required attendees for a meeting. + * Provides access to the required attendees of an event. The type of object and level of access depends on the mode of the current item. + * The requiredAttendees property returns an {@link Office.Recipients} object that provides methods to get or update the required attendees + * for a meeting. * * [Api set: Mailbox 1.0] * @@ -8912,11 +9522,16 @@ declare namespace Office { /** * Gets the id of the series that an instance belongs to. * - * In OWA and Outlook, the seriesId returns the Exchange Web Services (EWS) ID of the parent (series) item that this item belongs to. However, in iOS and Android, the seriesId returns the REST ID of the parent item. + * In OWA and Outlook, the seriesId returns the Exchange Web Services (EWS) ID of the parent (series) item that this item belongs to. + * However, in iOS and Android, the seriesId returns the REST ID of the parent item. * - * Note: The identifier returned by the seriesId property is the same as the Exchange Web Services item identifier. The seriesId property is not identical to the Outlook IDs used by the Outlook REST API. Before making REST API calls using this value, it should be converted using Office.context.mailbox.convertToRestId. For more details, see {@link https://docs.microsoft.com/outlook/add-ins/use-rest-api | Use the Outlook REST APIs from an Outlook add-in}. + * Note: The identifier returned by the seriesId property is the same as the Exchange Web Services item identifier. + * The seriesId property is not identical to the Outlook IDs used by the Outlook REST API. + * Before making REST API calls using this value, it should be converted using Office.context.mailbox.convertToRestId. + * For more details, see {@link https://docs.microsoft.com/outlook/add-ins/use-rest-api | Use the Outlook REST APIs from an Outlook add-in}. * - * The seriesId property returns null for items that do not have parent items such as single appointments, series items, or meeting requests and returns undefined for any other items that are not meeting requests. + * The seriesId property returns null for items that do not have parent items such as single appointments, series items, or meeting requests + * and returns undefined for any other items that are not meeting requests. * * [Api set: Mailbox Preview] * @@ -8932,9 +9547,11 @@ declare namespace Office { /** * Gets or sets the date and time that the appointment is to begin. * - * The start property is an {@link Office.Time} object expressed as a Coordinated Universal Time (UTC) date and time value. You can use the convertToLocalClientTime method to convert the value to the client's local date and time. + * The start property is an {@link Office.Time} object expressed as a Coordinated Universal Time (UTC) date and time value. + * You can use the convertToLocalClientTime method to convert the value to the client's local date and time. * - * When you use the Time.setAsync method to set the start time, you should use the convertToUtcClientTime method to convert the local time on the client to UTC for the server. + * When you use the Time.setAsync method to set the start time, you should use the convertToUtcClientTime method to convert the local time on + * the client to UTC for the server. * * [Api set: Mailbox 1.0] * @@ -8983,16 +9600,18 @@ declare namespace Office { * * `addFileAttachmentAsync(uri: string, attachmentName: string, options: Office.AsyncContextOptions): void;` * - * `addFileAttachmentAsync(uri: string, attachmentName: string, callback: (result: AsyncResult) => void): void;` + * `addFileAttachmentAsync(uri: string, attachmentName: string, callback: (result: AsyncResult) => void): void;` * * @param uri The URI that provides the location of the file to attach to the message or appointment. The maximum length is 2048 characters. * @param attachmentName The name of the attachment that is shown while the attachment is uploading. The maximum length is 255 characters. * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. - * isInline: If true, indicates that the attachment will be shown inline in the message body and should not be displayed in the attachment list. - * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type asyncResult. On success, the attachment identifier will be provided in the asyncResult.value property. If uploading the attachment fails, the asyncResult object will contain an Error object that provides a description of the error. + * isInline: If true, indicates that the attachment will be shown inline in the message body, and should not be displayed in the attachment list. + * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type asyncResult. + * On success, the attachment identifier will be provided in the asyncResult.value property. + * If uploading the attachment fails, the asyncResult object will contain an Error object that provides a description of the error. */ - addFileAttachmentAsync(uri: string, attachmentName: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + addFileAttachmentAsync(uri: string, attachmentName: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Adds a file to a message or appointment as an attachment. * @@ -9054,9 +9673,11 @@ declare namespace Office { * * @param uri The URI that provides the location of the file to attach to the message or appointment. The maximum length is 2048 characters. * @param attachmentName The name of the attachment that is shown while the attachment is uploading. The maximum length is 255 characters. - * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type asyncResult. On success, the attachment identifier will be provided in the asyncResult.value property. If uploading the attachment fails, the asyncResult object will contain an Error object that provides a description of the error. + * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type asyncResult. + * On success, the attachment identifier will be provided in the asyncResult.value property. + * If uploading the attachment fails, the asyncResult object will contain an Error object that provides a description of the error. */ - addFileAttachmentAsync(uri: string, attachmentName: string, callback: (result: AsyncResult) => void): void; + addFileAttachmentAsync(uri: string, attachmentName: string, callback: (result: AsyncResult) => void): void; /** * Adds a file to a message or appointment as an attachment. * @@ -9078,9 +9699,11 @@ declare namespace Office { * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. * isInline: If true, indicates that the attachment will be shown inline in the message body and should not be displayed in the attachment list. - * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type asyncResult. On success, the attachment identifier will be provided in the asyncResult.value property. If uploading the attachment fails, the asyncResult object will contain an Error object that provides a description of the error. + * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type asyncResult. + * On success, the attachment identifier will be provided in the asyncResult.value property. + * If uploading the attachment fails, the asyncResult object will contain an Error object that provides a description of the error. */ - addFileAttachmentFromBase64Async(base64File: string, attachmentName: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + addFileAttachmentFromBase64Async(base64File: string, attachmentName: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Adds an event handler for a supported event. * @@ -9096,21 +9719,24 @@ declare namespace Office { * * In addition to this signature, the method also has the following signature: * - * `addHandlerAsync(eventType:EventType, handler: any, callback?: (result: AsyncResult) => void): void;` + * `addHandlerAsync(eventType:EventType, handler: any, callback?: (result: AsyncResult) => void): void;` * * @param eventType The event that should invoke the handler. - * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. The type property on the parameter will match the eventType parameter passed to addHandlerAsync. + * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. + * The type property on the parameter will match the eventType parameter passed to addHandlerAsync. * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an AsyncResult object. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, + * asyncResult, which is an {@link Office.AsyncResult} object. * * @beta */ - addHandlerAsync(eventType:EventType, handler: any, options?: any, callback?: (result: AsyncResult) => void): void; + addHandlerAsync(eventType:EventType, handler: any, options?: any, callback?: (result: AsyncResult) => void): void; /** * Adds an event handler for a supported event. * - * Currently the supported event types are `Office.EventType.AppointmentTimeChanged`, `Office.EventType.RecipientsChanged`, and `Office.EventType.RecurrencePatternChanged`. + * Currently the supported event types are `Office.EventType.AppointmentTimeChanged`, `Office.EventType.RecipientsChanged`, and + * `Office.EventType.RecurrencePatternChanged`. * * [Api set: Mailbox Preview] * @@ -9121,20 +9747,26 @@ declare namespace Office { * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer * * @param eventType The event that should invoke the handler. - * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. The type property on the parameter will match the eventType parameter passed to addHandlerAsync. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an AsyncResult object. + * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. + * The type property on the parameter will match the eventType parameter passed to addHandlerAsync. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, + * asyncResult, which is an {@link Office.AsyncResult} object. * * @beta */ - addHandlerAsync(eventType:EventType, handler: any, callback?: (result: AsyncResult) => void): void; + addHandlerAsync(eventType:EventType, handler: any, callback?: (result: AsyncResult) => void): void; /** * Adds an Exchange item, such as a message, as an attachment to the message or appointment. * - * The addItemAttachmentAsync method attaches the item with the specified Exchange identifier to the item in the compose form. If you specify a callback method, the method is called with one parameter, asyncResult, which contains either the attachment identifier or a code that indicates any error that occurred while attaching the item. You can use the options parameter to pass state information to the callback method, if needed. + * The addItemAttachmentAsync method attaches the item with the specified Exchange identifier to the item in the compose form. + * If you specify a callback method, the method is called with one parameter, asyncResult, which contains either the attachment identifier or + * a code that indicates any error that occurred while attaching the item. + * You can use the options parameter to pass state information to the callback method, if needed. * * You can subsequently use the identifier with the removeAttachmentAsync method to remove the attachment in the same session. * - * If your Office add-in is running in Outlook Web App, the addItemAttachmentAsync method can attach items to items other than the item that you are editing; however, this is not supported and is not recommended. + * If your Office add-in is running in Outlook Web App, the addItemAttachmentAsync method can attach items to items other than the item that + * you are editing; however, this is not supported and is not recommended. * * [Api set: Mailbox 1.1] * @@ -9151,23 +9783,29 @@ declare namespace Office { * * `addItemAttachmentAsync(itemId: any, attachmentName: string, options: Office.AsyncContextOptions): void;` * - * `addItemAttachmentAsync(itemId: any, attachmentName: string, callback: (result: AsyncResult) => void): void;` + * `addItemAttachmentAsync(itemId: any, attachmentName: string, callback: (result: AsyncResult) => void): void;` * * @param itemId The Exchange identifier of the item to attach. The maximum length is 100 characters. * @param attachmentName The name of the attachment that is shown while the attachment is uploading. The maximum length is 255 characters. * @param options An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. - * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. On success, the attachment identifier will be provided in the asyncResult.value property. If adding the attachment fails, the asyncResult object will contain an Error object that provides a description of the error. + * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type {@link Office.AsyncResult}. + * On success, the attachment identifier will be provided in the asyncResult.value property. + * If adding the attachment fails, the asyncResult object will contain an Error object that provides a description of the error. */ - addItemAttachmentAsync(itemId: any, attachmentName: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + addItemAttachmentAsync(itemId: any, attachmentName: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Adds an Exchange item, such as a message, as an attachment to the message or appointment. * - * The addItemAttachmentAsync method attaches the item with the specified Exchange identifier to the item in the compose form. If you specify a callback method, the method is called with one parameter, asyncResult, which contains either the attachment identifier or a code that indicates any error that occurred while attaching the item. You can use the options parameter to pass state information to the callback method, if needed. + * The addItemAttachmentAsync method attaches the item with the specified Exchange identifier to the item in the compose form. + * If you specify a callback method, the method is called with one parameter, asyncResult, which contains either the attachment identifier or + * a code that indicates any error that occurred while attaching the item. + * You can use the options parameter to pass state information to the callback method, if needed. * * You can subsequently use the identifier with the removeAttachmentAsync method to remove the attachment in the same session. * - * If your Office add-in is running in Outlook Web App, the addItemAttachmentAsync method can attach items to items other than the item that you are editing; however, this is not supported and is not recommended. + * If your Office add-in is running in Outlook Web App, the addItemAttachmentAsync method can attach items to items other than the item that + * you are editing; however, this is not supported and is not recommended. * * [Api set: Mailbox 1.1] * @@ -9185,11 +9823,15 @@ declare namespace Office { /** * Adds an Exchange item, such as a message, as an attachment to the message or appointment. * - * The addItemAttachmentAsync method attaches the item with the specified Exchange identifier to the item in the compose form. If you specify a callback method, the method is called with one parameter, asyncResult, which contains either the attachment identifier or a code that indicates any error that occurred while attaching the item. You can use the options parameter to pass state information to the callback method, if needed. + * The addItemAttachmentAsync method attaches the item with the specified Exchange identifier to the item in the compose form. + * If you specify a callback method, the method is called with one parameter, asyncResult, which contains either the attachment identifier or + * a code that indicates any error that occurred while attaching the item. + * You can use the options parameter to pass state information to the callback method, if needed. * * You can subsequently use the identifier with the removeAttachmentAsync method to remove the attachment in the same session. * - * If your Office add-in is running in Outlook Web App, the addItemAttachmentAsync method can attach items to items other than the item that you are editing; however, this is not supported and is not recommended. + * If your Office add-in is running in Outlook Web App, the addItemAttachmentAsync method can attach items to items other than the item that + * you are editing; however, this is not supported and is not recommended. * * [Api set: Mailbox 1.1] * @@ -9209,11 +9851,15 @@ declare namespace Office { /** * Adds an Exchange item, such as a message, as an attachment to the message or appointment. * - * The addItemAttachmentAsync method attaches the item with the specified Exchange identifier to the item in the compose form. If you specify a callback method, the method is called with one parameter, asyncResult, which contains either the attachment identifier or a code that indicates any error that occurred while attaching the item. You can use the options parameter to pass state information to the callback method, if needed. + * The addItemAttachmentAsync method attaches the item with the specified Exchange identifier to the item in the compose form. + * If you specify a callback method, the method is called with one parameter, asyncResult, which contains either the attachment identifier or + * a code that indicates any error that occurred while attaching the item. + * You can use the options parameter to pass state information to the callback method, if needed. * * You can subsequently use the identifier with the removeAttachmentAsync method to remove the attachment in the same session. * - * If your Office add-in is running in Outlook Web App, the addItemAttachmentAsync method can attach items to items other than the item that you are editing; however, this is not supported and is not recommended. + * If your Office add-in is running in Outlook Web App, the addItemAttachmentAsync method can attach items to items other than the item that + * you are editing; however, this is not supported and is not recommended. * * [Api set: Mailbox 1.1] * @@ -9226,17 +9872,21 @@ declare namespace Office { * * @param itemId The Exchange identifier of the item to attach. The maximum length is 100 characters. * @param attachmentName The name of the attachment that is shown while the attachment is uploading. The maximum length is 255 characters. - * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. On success, the attachment identifier will be provided in the asyncResult.value property. If adding the attachment fails, the asyncResult object will contain an Error object that provides a description of the error. + * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type {@link Office.AsyncResult}. + * On success, the attachment identifier will be provided in the asyncResult.value property. + * If adding the attachment fails, the asyncResult object will contain an Error object that provides a description of the error. */ - addItemAttachmentAsync(itemId: any, attachmentName: string, callback: (result: AsyncResult) => void): void; + addItemAttachmentAsync(itemId: any, attachmentName: string, callback: (result: AsyncResult) => void): void; /** * Closes the current item that is being composed * - * The behaviors of the close method depends on the current state of the item being composed. If the item has unsaved changes, the client prompts the user to save, discard, or close the action. + * The behaviors of the close method depends on the current state of the item being composed. + * If the item has unsaved changes, the client prompts the user to save, discard, or close the action. * * In the Outlook desktop client, if the message is an inline reply, the close method has no effect. * - * Note: In Outlook on the web, if the item is an appointment and it has previously been saved using saveAsync, the user is prompted to save, discard, or cancel even if no changes have occurred since the item was last saved. + * Note: In Outlook on the web, if the item is an appointment and it has previously been saved using saveAsync, the user is prompted to save, + * discard, or cancel even if no changes have occurred since the item was last saved. * * [Api set: Mailbox 1.3] * @@ -9264,19 +9914,21 @@ declare namespace Office { * * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. - * On success, the initialization data is provided in the asyncResult.value property as a string. - * If there is no initialization context, the asyncResult object will contain an Error object with its code property set to 9020 and its name property set to GenericResponseError. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type {@link Office.AsyncResult}. + * On success, the initialization data is provided in the asyncResult.value property as a string. + * If there is no initialization context, the asyncResult object will contain an Error object with its code property set to 9020 and its name property set to GenericResponseError. * * @beta */ - getInitializationContextAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + getInitializationContextAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Asynchronously returns selected data from the subject or body of a message. * - * If there is no selection but the cursor is in the body or subject, the method returns null for the selected data. If a field other than the body or subject is selected, the method returns the InvalidSelection error. + * If there is no selection but the cursor is in the body or subject, the method returns null for the selected data. + * If a field other than the body or subject is selected, the method returns the InvalidSelection error. * - * To access the selected data from the callback method, call asyncResult.value.data. To access the source property that the selection comes from, call asyncResult.value.sourceProperty, which will be either body or subject. + * To access the selected data from the callback method, call asyncResult.value.data. + * To access the source property that the selection comes from, call asyncResult.value.sourceProperty, which will be either body or subject. * * [Api set: Mailbox 1.2] * @@ -9289,18 +9941,21 @@ declare namespace Office { * * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer * - * @param coercionType Requests a format for the data. If Text, the method returns the plain text as a string , removing any HTML tags present. If HTML, the method returns the selected text, whether it is plaintext or HTML. + * @param coercionType Requests a format for the data. If Text, the method returns the plain text as a string , removing any HTML tags present. + * If HTML, the method returns the selected text, whether it is plaintext or HTML. * @param options An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. */ - getSelectedDataAsync(coerciontype: Office.CoercionType, options: Office.AsyncContextOptions, callback: (result: AsyncResult) => void): void; + getSelectedDataAsync(coerciontype: Office.CoercionType, options: Office.AsyncContextOptions, callback: (result: AsyncResult) => void): void; /** * Asynchronously returns selected data from the subject or body of a message. * - * If there is no selection but the cursor is in the body or subject, the method returns null for the selected data. If a field other than the body or subject is selected, the method returns the InvalidSelection error. + * If there is no selection but the cursor is in the body or subject, the method returns null for the selected data. + * If a field other than the body or subject is selected, the method returns the InvalidSelection error. * - * To access the selected data from the callback method, call asyncResult.value.data. To access the source property that the selection comes from, call asyncResult.value.sourceProperty, which will be either body or subject. + * To access the selected data from the callback method, call asyncResult.value.data. + * To access the source property that the selection comes from, call asyncResult.value.sourceProperty, which will be either body or subject. * * [Api set: Mailbox 1.2] * @@ -9313,16 +9968,22 @@ declare namespace Office { * * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer * - * @param coercionType Requests a format for the data. If Text, the method returns the plain text as a string , removing any HTML tags present. If HTML, the method returns the selected text, whether it is plaintext or HTML. - * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. + * @param coercionType Requests a format for the data. If Text, the method returns the plain text as a string , removing any HTML tags present. + * If HTML, the method returns the selected text, whether it is plaintext or HTML. + * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of + * type {@link Office.AsyncResult}. */ - getSelectedDataAsync(coerciontype: Office.CoercionType, callback: (result: AsyncResult) => void): void; + getSelectedDataAsync(coerciontype: Office.CoercionType, callback: (result: AsyncResult) => void): void; /** * Asynchronously loads custom properties for this add-in on the selected item. * - * Custom properties are stored as key/value pairs on a per-app, per-item basis. This method returns a CustomProperties object in the callback, which provides methods to access the custom properties specific to the current item and the current add-in. Custom properties are not encrypted on the item, so this should not be used as secure storage. + * Custom properties are stored as key/value pairs on a per-app, per-item basis. + * This method returns a CustomProperties object in the callback, which provides methods to access the custom properties specific to the + * current item and the current add-in. Custom properties are not encrypted on the item, so this should not be used as secure storage. * - * The custom properties are provided as a CustomProperties object in the asyncResult.value property. This object can be used to get, set, and remove custom properties from the item and save changes to the custom property set back to the server. + * The custom properties are provided as a CustomProperties object in the asyncResult.value property. + * This object can be used to get, set, and remove custom properties from the item and save changes to the custom property set back to + * the server. * * [Api set: Mailbox 1.0] * @@ -9332,14 +9993,20 @@ declare namespace Office { * * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer * - * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. - * @param userContext Optional. Developers can provide any object they wish to access in the callback function. This object can be accessed by the asyncResult.asyncContext property in the callback function. + * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of + * type {@link Office.AsyncResult}. + * @param userContext Optional. Developers can provide any object they wish to access in the callback function. + * This object can be accessed by the asyncResult.asyncContext property in the callback function. */ - loadCustomPropertiesAsync(callback: (result: AsyncResult) => void, userContext?: any): void; + loadCustomPropertiesAsync(callback: (result: AsyncResult) => void, userContext?: any): void; /** * Removes an attachment from a message or appointment. * - * The removeAttachmentAsync method removes the attachment with the specified identifier from the item. As a best practice, you should use the attachment identifier to remove an attachment only if the same mail app has added that attachment in the same session. In Outlook Web App and OWA for Devices, the attachment identifier is valid only within the same session. A session is over when the user closes the app, or if the user starts composing in an inline form and subsequently pops out the inline form to continue in a separate window. + * The removeAttachmentAsync method removes the attachment with the specified identifier from the item. + * As a best practice, you should use the attachment identifier to remove an attachment only if the same mail app has added that attachment + * in the same session. In Outlook Web App and OWA for Devices, the attachment identifier is valid only within the same session. + * A session is over when the user closes the app, or if the user starts composing in an inline form and subsequently pops out the inline form + * to continue in a separate window. * * [Api set: Mailbox 1.1] * @@ -9357,18 +10024,23 @@ declare namespace Office { * * `removeAttachmentAsync(attachmentIndex: string, options: Office.AsyncContextOptions): void;` * - * `removeAttachmentAsync(attachmentIndex: string, callback: (result: AsyncResult) => void): void;` + * `removeAttachmentAsync(attachmentIndex: string, callback: (result: AsyncResult) => void): void;` * * @param attachmentIndex The identifier of the attachment to remove. The maximum length of the string is 100 characters. * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. If removing the attachment fails, the asyncResult.error property will contain an error code with the reason for the failure. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type {@link Office.AsyncResult}. + * If removing the attachment fails, the asyncResult.error property will contain an error code with the reason for the failure. */ - removeAttachmentAsync(attachmentIndex: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + removeAttachmentAsync(attachmentIndex: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Removes an attachment from a message or appointment. * - * The removeAttachmentAsync method removes the attachment with the specified identifier from the item. As a best practice, you should use the attachment identifier to remove an attachment only if the same mail app has added that attachment in the same session. In Outlook Web App and OWA for Devices, the attachment identifier is valid only within the same session. A session is over when the user closes the app, or if the user starts composing in an inline form and subsequently pops out the inline form to continue in a separate window. + * The removeAttachmentAsync method removes the attachment with the specified identifier from the item. + * As a best practice, you should use the attachment identifier to remove an attachment only if the same mail app has added that attachment + * in the same session. In Outlook Web App and OWA for Devices, the attachment identifier is valid only within the same session. + * A session is over when the user closes the app, or if the user starts composing in an inline form and subsequently pops out the inline form + * to continue in a separate window. * * [Api set: Mailbox 1.1] * @@ -9386,7 +10058,11 @@ declare namespace Office { /** * Removes an attachment from a message or appointment. * - * The removeAttachmentAsync method removes the attachment with the specified identifier from the item. As a best practice, you should use the attachment identifier to remove an attachment only if the same mail app has added that attachment in the same session. In Outlook Web App and OWA for Devices, the attachment identifier is valid only within the same session. A session is over when the user closes the app, or if the user starts composing in an inline form and subsequently pops out the inline form to continue in a separate window. + * The removeAttachmentAsync method removes the attachment with the specified identifier from the item. + * As a best practice, you should use the attachment identifier to remove an attachment only if the same mail app has added that attachment + * in the same session. In Outlook Web App and OWA for Devices, the attachment identifier is valid only within the same session. + * A session is over when the user closes the app, or if the user starts composing in an inline form and subsequently pops out the inline form + * to continue in a separate window. * * [Api set: Mailbox 1.1] * @@ -9406,7 +10082,12 @@ declare namespace Office { /** * Removes an attachment from a message or appointment. * - * The removeAttachmentAsync method removes the attachment with the specified identifier from the item. As a best practice, you should use the attachment identifier to remove an attachment only if the same mail app has added that attachment in the same session. In Outlook Web App and OWA for Devices, the attachment identifier is valid only within the same session. A session is over when the user closes the app, or if the user starts composing in an inline form and subsequently pops out the inline form to continue in a separate window. + * The removeAttachmentAsync method removes the attachment with the specified identifier from the item. + * As a best practice, you should use the attachment identifier to remove an attachment only if the same mail app has added that attachment + * in the same session. + * In Outlook Web App and OWA for Devices, the attachment identifier is valid only within the same session. + * A session is over when the user closes the app, or if the user starts composing in an inline form and subsequently pops out the inline form + * to continue in a separate window. * * [Api set: Mailbox 1.1] * @@ -9419,13 +10100,16 @@ declare namespace Office { * ErrorsInvalidAttachmentId - The attachment identifier does not exist. * * @param attachmentIndex The identifier of the attachment to remove. The maximum length of the string is 100 characters. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. If removing the attachment fails, the asyncResult.error property will contain an error code with the reason for the failure. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of + * type {@link Office.AsyncResult}. + * If removing the attachment fails, the asyncResult.error property will contain an error code with the reason for the failure. */ - removeAttachmentAsync(attachmentIndex: string, callback: (result: AsyncResult) => void): void; + removeAttachmentAsync(attachmentIndex: string, callback: (result: AsyncResult) => void): void; /** * Removes an event handler for a supported event. * - * Currently the supported event types are `Office.EventType.AppointmentTimeChanged`, `Office.EventType.RecipientsChanged`, and `Office.EventType.RecurrencePatternChanged`. + * Currently the supported event types are `Office.EventType.AppointmentTimeChanged`, `Office.EventType.RecipientsChanged`, and + * `Office.EventType.RecurrencePatternChanged`. * * [Api set: Mailbox Preview] * @@ -9437,17 +10121,19 @@ declare namespace Office { * * In addition to this signature, the method also has the following signature: * - * `removeHandlerAsync(eventType:EventType, handler: any, callback?: (result: AsyncResult) => void): void;` + * `removeHandlerAsync(eventType:EventType, handler: any, callback?: (result: AsyncResult) => void): void;` * * @param eventType The event that should invoke the handler. - * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. The type property on the parameter will match the eventType parameter passed to removeHandlerAsync. + * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. + * The type property on the parameter will match the eventType parameter passed to removeHandlerAsync. * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an AsyncResult object. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, + * asyncResult, which is an {@link Office.AsyncResult} object. * * @beta */ - removeHandlerAsync(eventType:EventType, handler: any, options?: any, callback?: (result: AsyncResult) => void): void; + removeHandlerAsync(eventType:EventType, handler: any, options?: any, callback?: (result: AsyncResult) => void): void; /** * Removes an event handler for a supported event. * @@ -9462,20 +10148,28 @@ declare namespace Office { * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer * * @param eventType The event that should invoke the handler. - * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. The type property on the parameter will match the eventType parameter passed to removeHandlerAsync. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an AsyncResult object. + * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. + * The type property on the parameter will match the eventType parameter passed to removeHandlerAsync. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, + * asyncResult, which is an {@link Office.AsyncResult} object. * * @beta */ - removeHandlerAsync(eventType:EventType, handler: any, callback?: (result: AsyncResult) => void): void; + removeHandlerAsync(eventType:EventType, handler: any, callback?: (result: AsyncResult) => void): void; /** * Asynchronously saves an item. * - * When invoked, this method saves the current message as a draft and returns the item id via the callback method. In Outlook Web App or Outlook in online mode, the item is saved to the server. In Outlook in cached mode, the item is saved to the local cache. + * When invoked, this method saves the current message as a draft and returns the item id via the callback method. + * In Outlook Web App or Outlook in online mode, the item is saved to the server. + * In Outlook in cached mode, the item is saved to the local cache. * - * Since appointments have no draft state, if saveAsync is called on an appointment in compose mode, the item will be saved as a normal appointment on the user's calendar. For new appointments that have not been saved before, no invitation will be sent. Saving an existing appointment will send an update to added or removed attendees. + * Since appointments have no draft state, if saveAsync is called on an appointment in compose mode, the item will be saved as a normal + * appointment on the user's calendar. For new appointments that have not been saved before, no invitation will be sent. + * Saving an existing appointment will send an update to added or removed attendees. * - * Note: If your add-in calls saveAsync on an item in compose mode in order to get an itemId to use with EWS or the REST API, be aware that when Outlook is in cached mode, it may take some time before the item is actually synced to the server. Until the item is synced, using the itemId will return an error. + * Note: If your add-in calls saveAsync on an item in compose mode in order to get an itemId to use with EWS or the REST API, be aware that + * when Outlook is in cached mode, it may take some time before the item is actually synced to the server. + * Until the item is synced, using the itemId will return an error. * * Note: The following clients have different behavior for saveAsync on appointments in compose mode: * @@ -9499,21 +10193,27 @@ declare namespace Office { * * `saveAsync(options: Office.AsyncContextOptions): void;` * - * `saveAsync(callback: (result: AsyncResult) => void): void;` + * `saveAsync(callback: (result: AsyncResult) => void): void;` * * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. If removing the attachment fails, the asyncResult.error property will contain an error code with the reason for the failure. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type {@link Office.AsyncResult}. */ - saveAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + saveAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Asynchronously saves an item. * - * When invoked, this method saves the current message as a draft and returns the item id via the callback method. In Outlook Web App or Outlook in online mode, the item is saved to the server. In Outlook in cached mode, the item is saved to the local cache. + * When invoked, this method saves the current message as a draft and returns the item id via the callback method. + * In Outlook Web App or Outlook in online mode, the item is saved to the server. + * In Outlook in cached mode, the item is saved to the local cache. * - * Since appointments have no draft state, if saveAsync is called on an appointment in compose mode, the item will be saved as a normal appointment on the user's calendar. For new appointments that have not been saved before, no invitation will be sent. Saving an existing appointment will send an update to added or removed attendees. + * Since appointments have no draft state, if saveAsync is called on an appointment in compose mode, the item will be saved as a normal + * appointment on the user's calendar. For new appointments that have not been saved before, no invitation will be sent. + * Saving an existing appointment will send an update to added or removed attendees. * - * Note: If your add-in calls saveAsync on an item in compose mode in order to get an itemId to use with EWS or the REST API, be aware that when Outlook is in cached mode, it may take some time before the item is actually synced to the server. Until the item is synced, using the itemId will return an error. + * Note: If your add-in calls saveAsync on an item in compose mode in order to get an itemId to use with EWS or the REST API, be aware that + * when Outlook is in cached mode, it may take some time before the item is actually synced to the server. + * Until the item is synced, using the itemId will return an error. * * Note: The following clients have different behavior for saveAsync on appointments in compose mode: * @@ -9536,11 +10236,17 @@ declare namespace Office { /** * Asynchronously saves an item. * - * When invoked, this method saves the current message as a draft and returns the item id via the callback method. In Outlook Web App or Outlook in online mode, the item is saved to the server. In Outlook in cached mode, the item is saved to the local cache. + * When invoked, this method saves the current message as a draft and returns the item id via the callback method. + * In Outlook Web App or Outlook in online mode, the item is saved to the server. + * In Outlook in cached mode, the item is saved to the local cache. * - * Since appointments have no draft state, if saveAsync is called on an appointment in compose mode, the item will be saved as a normal appointment on the user's calendar. For new appointments that have not been saved before, no invitation will be sent. Saving an existing appointment will send an update to added or removed attendees. + * Since appointments have no draft state, if saveAsync is called on an appointment in compose mode, the item will be saved as a normal + * appointment on the user's calendar. For new appointments that have not been saved before, no invitation will be sent. + * Saving an existing appointment will send an update to added or removed attendees. * - * Note: If your add-in calls saveAsync on an item in compose mode in order to get an itemId to use with EWS or the REST API, be aware that when Outlook is in cached mode, it may take some time before the item is actually synced to the server. Until the item is synced, using the itemId will return an error. + * Note: If your add-in calls saveAsync on an item in compose mode in order to get an itemId to use with EWS or the REST API, be aware that + * when Outlook is in cached mode, it may take some time before the item is actually synced to the server. + * Until the item is synced, using the itemId will return an error. * * Note: The following clients have different behavior for saveAsync on appointments in compose mode: * @@ -9565,11 +10271,16 @@ declare namespace Office { /** * Asynchronously saves an item. * - * When invoked, this method saves the current message as a draft and returns the item id via the callback method. In Outlook Web App or Outlook in online mode, the item is saved to the server. In Outlook in cached mode, the item is saved to the local cache. + * When invoked, this method saves the current message as a draft and returns the item id via the callback method. + * In Outlook Web App or Outlook in online mode, the item is saved to the server. In Outlook in cached mode, the item is saved to the local cache. * - * Since appointments have no draft state, if saveAsync is called on an appointment in compose mode, the item will be saved as a normal appointment on the user's calendar. For new appointments that have not been saved before, no invitation will be sent. Saving an existing appointment will send an update to added or removed attendees. + * Since appointments have no draft state, if saveAsync is called on an appointment in compose mode, the item will be saved as a normal + * appointment on the user's calendar. For new appointments that have not been saved before, no invitation will be sent. + * Saving an existing appointment will send an update to added or removed attendees. * - * Note: If your add-in calls saveAsync on an item in compose mode in order to get an itemId to use with EWS or the REST API, be aware that when Outlook is in cached mode, it may take some time before the item is actually synced to the server. Until the item is synced, using the itemId will return an error. + * Note: If your add-in calls saveAsync on an item in compose mode in order to get an itemId to use with EWS or the REST API, be aware that + * when Outlook is in cached mode, it may take some time before the item is actually synced to the server. + * Until the item is synced, using the itemId will return an error. * * Note: The following clients have different behavior for saveAsync on appointments in compose mode: * @@ -9587,13 +10298,15 @@ declare namespace Office { * * ErrorsInvalidAttachmentId - The attachment identifier does not exist. * - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. If removing the attachment fails, the asyncResult.error property will contain an error code with the reason for the failure. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type {@link Office.AsyncResult}. */ - saveAsync(callback: (result: AsyncResult) => void): void; + saveAsync(callback: (result: AsyncResult) => void): void; /** * Asynchronously inserts data into the body or subject of a message. * - * The setSelectedDataAsync method inserts the specified string at the cursor location in the subject or body of the item, or, if text is selected in the editor, it replaces the selected text. If the cursor is not in the body or subject field, an error is returned. After insertion, the cursor is placed at the end of the inserted content. + * The setSelectedDataAsync method inserts the specified string at the cursor location in the subject or body of the item, or, if text is + * selected in the editor, it replaces the selected text. If the cursor is not in the body or subject field, an error is returned. + * After insertion, the cursor is placed at the end of the inserted content. * * [Api set: Mailbox 1.2] * @@ -9611,19 +10324,29 @@ declare namespace Office { * * `setSelectedDataAsync(data: string, options: Office.AsyncContextOptions & CoercionTypeOptions): void;` * - * `setSelectedDataAsync(data: string, callback: (result: AsyncResult) => void): void;` + * `setSelectedDataAsync(data: string, callback: (result: AsyncResult) => void): void;` * - * @param data The data to be inserted. Data is not to exceed 1,000,000 characters. If more than 1,000,000 characters are passed in, an ArgumentOutOfRange exception is thrown. + * @param data The data to be inserted. Data is not to exceed 1,000,000 characters. + * If more than 1,000,000 characters are passed in, an ArgumentOutOfRange exception is thrown. * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. - * coercionType: If text, the current style is applied in Outlook Web App and Outlook. If the field is an HTML editor, only the text data is inserted, even if the data is HTML. If html and the field supports HTML (the subject doesn't), the current style is applied in Outlook Web App and the default style is applied in Outlook. If the field is a text field, an InvalidDataFormat error is returned. If coercionType is not set, the result depends on the field: if the field is HTML then HTML is used; if the field is text, then plain text is used. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. If removing the attachment fails, the asyncResult.error property will contain an error code with the reason for the failure. + * coercionType: If text, the current style is applied in Outlook Web App and Outlook. + * If the field is an HTML editor, only the text data is inserted, even if the data is HTML. + * If html and the field supports HTML (the subject doesn't), the current style is applied in Outlook Web App and the + * default style is applied in Outlook. + * If the field is a text field, an InvalidDataFormat error is returned. + * If coercionType is not set, the result depends on the field: if the field is HTML then HTML is used; + * if the field is text, then plain text is used. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of + * type {@link Office.AsyncResult}. */ - setSelectedDataAsync(data: string, options?: Office.AsyncContextOptions & CoercionTypeOptions, callback?: (result: AsyncResult) => void): void; + setSelectedDataAsync(data: string, options?: Office.AsyncContextOptions & CoercionTypeOptions, callback?: (result: AsyncResult) => void): void; /** * Asynchronously inserts data into the body or subject of a message. * - * The setSelectedDataAsync method inserts the specified string at the cursor location in the subject or body of the item, or, if text is selected in the editor, it replaces the selected text. If the cursor is not in the body or subject field, an error is returned. After insertion, the cursor is placed at the end of the inserted content. + * The setSelectedDataAsync method inserts the specified string at the cursor location in the subject or body of the item, or, if text is + * selected in the editor, it replaces the selected text. If the cursor is not in the body or subject field, an error is returned. + * After insertion, the cursor is placed at the end of the inserted content. * * [Api set: Mailbox 1.2] * @@ -9635,13 +10358,16 @@ declare namespace Office { * * ErrorsInvalidAttachmentId - The attachment identifier does not exist. * - * @param data The data to be inserted. Data is not to exceed 1,000,000 characters. If more than 1,000,000 characters are passed in, an ArgumentOutOfRange exception is thrown. + * @param data The data to be inserted. Data is not to exceed 1,000,000 characters. + * If more than 1,000,000 characters are passed in, an ArgumentOutOfRange exception is thrown. */ setSelectedDataAsync(data: string): void; /** * Asynchronously inserts data into the body or subject of a message. * - * The setSelectedDataAsync method inserts the specified string at the cursor location in the subject or body of the item, or, if text is selected in the editor, it replaces the selected text. If the cursor is not in the body or subject field, an error is returned. After insertion, the cursor is placed at the end of the inserted content. + * The setSelectedDataAsync method inserts the specified string at the cursor location in the subject or body of the item, or, if text is + * selected in the editor, it replaces the selected text. If the cursor is not in the body or subject field, an error is returned. + * After insertion, the cursor is placed at the end of the inserted content. * * [Api set: Mailbox 1.2] * @@ -9653,16 +10379,24 @@ declare namespace Office { * * ErrorsInvalidAttachmentId - The attachment identifier does not exist. * - * @param data The data to be inserted. Data is not to exceed 1,000,000 characters. If more than 1,000,000 characters are passed in, an ArgumentOutOfRange exception is thrown. + * @param data The data to be inserted. Data is not to exceed 1,000,000 characters. + * If more than 1,000,000 characters are passed in, an ArgumentOutOfRange exception is thrown. * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. - * coercionType: If text, the current style is applied in Outlook Web App and Outlook. If the field is an HTML editor, only the text data is inserted, even if the data is HTML. If html and the field supports HTML (the subject doesn't), the current style is applied in Outlook Web App and the default style is applied in Outlook. If the field is a text field, an InvalidDataFormat error is returned. If coercionType is not set, the result depends on the field: if the field is HTML then HTML is used; if the field is text, then plain text is used. + * coercionType: If text, the current style is applied in Outlook Web App and Outlook. + * If the field is an HTML editor, only the text data is inserted, even if the data is HTML. + * If html and the field supports HTML (the subject doesn't), the current style is applied in Outlook Web App and the + * default style is applied in Outlook. If the field is a text field, an InvalidDataFormat error is returned. + * If coercionType is not set, the result depends on the field: if the field is HTML then HTML is used; + * if the field is text, then plain text is used. */ setSelectedDataAsync(data: string, options: Office.AsyncContextOptions & CoercionTypeOptions): void; /** * Asynchronously inserts data into the body or subject of a message. * - * The setSelectedDataAsync method inserts the specified string at the cursor location in the subject or body of the item, or, if text is selected in the editor, it replaces the selected text. If the cursor is not in the body or subject field, an error is returned. After insertion, the cursor is placed at the end of the inserted content. + * The setSelectedDataAsync method inserts the specified string at the cursor location in the subject or body of the item, or, if text is + * selected in the editor, it replaces the selected text. If the cursor is not in the body or subject field, an error is returned. + * After insertion, the cursor is placed at the end of the inserted content. * * [Api set: Mailbox 1.2] * @@ -9674,16 +10408,19 @@ declare namespace Office { * * ErrorsInvalidAttachmentId - The attachment identifier does not exist. * - * @param data The data to be inserted. Data is not to exceed 1,000,000 characters. If more than 1,000,000 characters are passed in, an ArgumentOutOfRange exception is thrown. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. If removing the attachment fails, the asyncResult.error property will contain an error code with the reason for the failure. + * @param data The data to be inserted. Data is not to exceed 1,000,000 characters. + * If more than 1,000,000 characters are passed in, an ArgumentOutOfRange exception is thrown. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of + * type {@link Office.AsyncResult}. */ - setSelectedDataAsync(data: string, callback: (result: AsyncResult) => void): void; + setSelectedDataAsync(data: string, callback: (result: AsyncResult) => void): void; } /** * The appointment attendee mode of {@link Office.Item | Office.context.mailbox.item}. * - * Important: This is an internal Outlook object, not directly exposed through existing interfaces. You should treat this as a mode of 'Office.context.mailbox.item'. Refer to the Object Model pages for more information. + * Important: This is an internal Outlook object, not directly exposed through existing interfaces. + * You should treat this as a mode of 'Office.context.mailbox.item'. Refer to the Object Model pages for more information. */ interface AppointmentRead extends Appointment, ItemRead { /** @@ -9697,7 +10434,8 @@ declare namespace Office { * * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee * - * Note: Certain types of files are blocked by Outlook due to potential security issues and are therefore not returned. For more information, see {@link https://support.office.com/article/Blocked-attachments-in-Outlook-434752E1-02D3-4E90-9124-8B81E49A8519 | Blocked attachments in Outlook}. + * Note: Certain types of files are blocked by Outlook due to potential security issues and are therefore not returned. For more information, see + * {@link https://support.office.com/article/Blocked-attachments-in-Outlook-434752E1-02D3-4E90-9124-8B81E49A8519 | Blocked attachments in Outlook}. * */ attachments: Office.AttachmentDetails[]; @@ -9742,9 +10480,11 @@ declare namespace Office { /** * Gets the date and time that the appointment is to end. * - * The end property is a Date object expressed as a Coordinated Universal Time (UTC) date and time value. You can use the convertToLocalClientTime method to convert the end property value to the client's local date and time. + * The end property is a Date object expressed as a Coordinated Universal Time (UTC) date and time value. + * You can use the convertToLocalClientTime method to convert the end property value to the client's local date and time. * - * When you use the Time.setAsync method to set the end time, you should use the convertToUtcClientTime method to convert the local time on the client to UTC for the server. + * When you use the Time.setAsync method to set the end time, you should use the convertToUtcClientTime method to convert the local time on + * the client to UTC for the server. * * [Api set: Mailbox 1.0] * @@ -9794,9 +10534,14 @@ declare namespace Office { /** * Gets the Exchange Web Services item identifier for the current item. * - * The itemId property is not available in compose mode. If an item identifier is required, the saveAsync method can be used to save the item to the store, which will return the item identifier in the AsyncResult.value parameter in the callback function. + * The itemId property is not available in compose mode. + * If an item identifier is required, the saveAsync method can be used to save the item to the store, which will return the item identifier + * in the AsyncResult.value parameter in the callback function. * - * Note: The identifier returned by the itemId property is the same as the Exchange Web Services item identifier. The itemId property is not identical to the Outlook Entry ID or the ID used by the Outlook REST API. Before making REST API calls using this value, it should be converted using Office.context.mailbox.convertToRestId. For more details, see Use the Outlook REST APIs from an Outlook add-in. + * Note: The identifier returned by the itemId property is the same as the Exchange Web Services item identifier. + * The itemId property is not identical to the Outlook Entry ID or the ID used by the Outlook REST API. + * Before making REST API calls using this value, it should be converted using Office.context.mailbox.convertToRestId. + * For more details, see {@link https://docs.microsoft.com/outlook/add-ins/use-rest-api#get-the-item-id | Use the Outlook REST APIs from an Outlook add-in}. * * [Api set: Mailbox 1.0] * @@ -9838,7 +10583,8 @@ declare namespace Office { /** * Gets the subject of an item, with all prefixes removed (including RE: and FWD:). * - * The normalizedSubject property gets the subject of the item, with any standard prefixes (such as RE: and FW:) that are added by email programs. To get the subject of the item with the prefixes intact, use the subject property. + * The normalizedSubject property gets the subject of the item, with any standard prefixes (such as RE: and FW:) that are added by email programs. + * To get the subject of the item with the prefixes intact, use the subject property. * * [Api set: Mailbox 1.0] * @@ -9864,7 +10610,8 @@ declare namespace Office { /** * Provides access to the optional attendees of an event. The type of object and level of access depends on the mode of the current item. * - * The optionalAttendees property returns an array that contains an {@link Office.EmailAddressDetails} object for each optional attendee to the meeting. + * The optionalAttendees property returns an array that contains an {@link Office.EmailAddressDetails} object for each optional attendee to + * the meeting. * * [Api set: Mailbox 1.0] * @@ -9890,11 +10637,13 @@ declare namespace Office { /** * Gets the recurrence pattern of an appointment. Gets the recurrence pattern of a meeting request. * - * The recurrence property returns a recurrence object for recurring appointments or meetings requests if an item is a series or an instance in a series. null is returned for single appointments and meeting requests of single appointments. + * The recurrence property returns a recurrence object for recurring appointments or meetings requests if an item is a series or an instance + * in a series. `null` is returned for single appointments and meeting requests of single appointments. * * Note: Meeting requests have an itemClass value of IPM.Schedule.Meeting.Request. * - * Note: If the recurrence object is null, this indicates that the object is a single appointment or a meeting request of a single appointment and NOT a part of a series. + * Note: If the recurrence object is null, this indicates that the object is a single appointment or a meeting request of a single + * appointment and NOT a part of a series. * * [Api set: Mailbox Preview] * @@ -9910,7 +10659,8 @@ declare namespace Office { /** * Provides access to the required attendees of an event. The type of object and level of access depends on the mode of the current item. * - * The requiredAttendees property returns an array that contains an {@link Office.EmailAddressDetails} object for each required attendee to the meeting. + * The requiredAttendees property returns an array that contains an {@link Office.EmailAddressDetails} object for each required attendee to + * the meeting. * * [Api set: Mailbox 1.0] * @@ -9924,7 +10674,8 @@ declare namespace Office { /** * Gets the date and time that the appointment is to begin. * - * The start property is a Date object expressed as a Coordinated Universal Time (UTC) date and time value. You can use the convertToLocalClientTime method to convert the value to the client's local date and time. + * The start property is a Date object expressed as a Coordinated Universal Time (UTC) date and time value. + * You can use the convertToLocalClientTime method to convert the value to the client's local date and time. * * [Api set: Mailbox 1.0] * @@ -9938,11 +10689,16 @@ declare namespace Office { /** * Gets the id of the series that an instance belongs to. * - * In OWA and Outlook, the seriesId returns the Exchange Web Services (EWS) ID of the parent (series) item that this item belongs to. However, in iOS and Android, the seriesId returns the REST ID of the parent item. + * In OWA and Outlook, the seriesId returns the Exchange Web Services (EWS) ID of the parent (series) item that this item belongs to. + * However, in iOS and Android, the seriesId returns the REST ID of the parent item. * - * Note: The identifier returned by the seriesId property is the same as the Exchange Web Services item identifier. The seriesId property is not identical to the Outlook IDs used by the Outlook REST API. Before making REST API calls using this value, it should be converted using Office.context.mailbox.convertToRestId. For more details, see {@link https://docs.microsoft.com/outlook/add-ins/use-rest-api | Use the Outlook REST APIs from an Outlook add-in}. + * Note: The identifier returned by the seriesId property is the same as the Exchange Web Services item identifier. + * The seriesId property is not identical to the Outlook IDs used by the Outlook REST API. Before making REST API calls using this value, it + * should be converted using Office.context.mailbox.convertToRestId. + * For more details, see {@link https://docs.microsoft.com/outlook/add-ins/use-rest-api | Use the Outlook REST APIs from an Outlook add-in}. * - * The seriesId property returns null for items that do not have parent items such as single appointments, series items, or meeting requests and returns undefined for any other items that are not meeting requests. + * The seriesId property returns null for items that do not have parent items such as single appointments, series items, or meeting requests + * and returns undefined for any other items that are not meeting requests. * * [Api set: Mailbox Preview] * @@ -9975,7 +10731,8 @@ declare namespace Office { /** * Adds an event handler for a supported event. * - * Currently the supported event types are `Office.EventType.AppointmentTimeChanged`, `Office.EventType.RecipientsChanged`, and `Office.EventType.RecurrencePatternChanged`. + * Currently the supported event types are `Office.EventType.AppointmentTimeChanged`, `Office.EventType.RecipientsChanged`, and + * `Office.EventType.RecurrencePatternChanged`. * * [Api set: Mailbox Preview] * @@ -9987,22 +10744,25 @@ declare namespace Office { * * In addition to this signature, the method also has the following signature: * - * `addHandlerAsync(eventType: Office.EventType, handler: any, callback?: (result: AsyncResult) => void): void;` + * `addHandlerAsync(eventType: Office.EventType, handler: any, callback?: (result: AsyncResult) => void): void;` * * @param eventType The event that should invoke the handler. - * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. The type property on the parameter will match the eventType parameter passed to addHandlerAsync. + * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. + * The type property on the parameter will match the eventType parameter passed to addHandlerAsync. * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an AsyncResult object. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, + * asyncResult, which is an {@link Office.AsyncResult} object. * * @beta */ - addHandlerAsync(eventType: Office.EventType, handler: any, options?: any, callback?: (result: AsyncResult) => void): void; + addHandlerAsync(eventType: Office.EventType, handler: any, options?: any, callback?: (result: AsyncResult) => void): void; /** * Adds an event handler for a supported event. * - * Currently the supported event types are `Office.EventType.AppointmentTimeChanged`, `Office.EventType.RecipientsChanged`, and `Office.EventType.RecurrencePatternChanged`. + * Currently the supported event types are `Office.EventType.AppointmentTimeChanged`, `Office.EventType.RecipientsChanged`, and + * `Office.EventType.RecurrencePatternChanged`. * * [Api set: Mailbox Preview] * @@ -10013,20 +10773,25 @@ declare namespace Office { * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee * * @param eventType The event that should invoke the handler. - * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. The type property on the parameter will match the eventType parameter passed to addHandlerAsync. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an AsyncResult object. + * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. + * The type property on the parameter will match the eventType parameter passed to addHandlerAsync. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, + * asyncResult, which is an {@link Office.AsyncResult} object. * * @beta */ - addHandlerAsync(eventType:EventType, handler: any, callback?: (result: AsyncResult) => void): void; + addHandlerAsync(eventType:EventType, handler: any, callback?: (result: AsyncResult) => void): void; /** - * Displays a reply form that includes the sender and all recipients of the selected message or the organizer and all attendees of the selected appointment. + * Displays a reply form that includes the sender and all recipients of the selected message or the organizer and all attendees of the + * selected appointment. * * In Outlook Web App, the reply form is displayed as a pop-out form in the 3-column view and a pop-up form in the 2- or 1-column view. * * If any of the string parameters exceed their limits, displayReplyAllForm throws an exception. * - * When attachments are specified in the formData.attachments parameter, Outlook and Outlook Web App attempt to download all attachments and attach them to the reply form. If any attachments fail to be added, an error is shown in the form UI. If this isn't possible, then no error message is thrown. + * When attachments are specified in the formData.attachments parameter, Outlook and Outlook Web App attempt to download all attachments and + * attach them to the reply form. If any attachments fail to be added, an error is shown in the form UI. + * If this isn't possible, then no error message is thrown. * * Note: This method is not supported in Outlook for iOS or Outlook for Android. * @@ -10049,7 +10814,9 @@ declare namespace Office { * * If any of the string parameters exceed their limits, displayReplyForm throws an exception. * - * When attachments are specified in the formData.attachments parameter, Outlook and Outlook Web App attempt to download all attachments and attach them to the reply form. If any attachments fail to be added, an error is shown in the form UI. If this isn't possible, then no error message is thrown. + * When attachments are specified in the formData.attachments parameter, Outlook and Outlook Web App attempt to download all attachments and + * attach them to the reply form. If any attachments fail to be added, an error is shown in the form UI. + * If this isn't possible, then no error message is thrown. * * Note: This method is not supported in Outlook for iOS or Outlook for Android. * @@ -10069,7 +10836,8 @@ declare namespace Office { /** * Gets initialization data passed when the add-in is {@link https://docs.microsoft.com/outlook/actionable-messages/invoke-add-in-from-actionable-message | activated by an actionable message}. * - * Note: This method is only supported by Outlook 2016 for Windows (Click-to-Run versions greater than 16.0.8413.1000) and Outlook on the web for Office 365. + * Note: This method is only supported by Outlook 2016 for Windows (Click-to-Run versions greater than 16.0.8413.1000) and Outlook on the web + * for Office 365. * * [Api set: Mailbox Preview] * @@ -10081,17 +10849,19 @@ declare namespace Office { * * In addition to this signature, the method also has the following signature: * - * `getInitializationContextAsync(callback?: (result: AsyncResult) => void): void;` + * `getInitializationContextAsync(callback?: (result: AsyncResult) => void): void;` * * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an AsyncResult object. - * On success, the initialization data is provided in the asyncResult.value property as a string. - * If there is no initialization context, the asyncResult object will contain an Error object with its code property set to 9020 and its name property set to GenericResponseError. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, + * asyncResult, which is an {@link Office.AsyncResult} object. + * On success, the initialization data is provided in the asyncResult.value property as a string. + * If there is no initialization context, the asyncResult object will contain an Error object with its code property + * set to 9020 and its name property set to GenericResponseError. * * @beta */ - getInitializationContextAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + getInitializationContextAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Gets initialization data passed when the add-in is {@link https://docs.microsoft.com/outlook/actionable-messages/invoke-add-in-from-actionable-message | activated by an actionable message}. * @@ -10105,13 +10875,15 @@ declare namespace Office { * * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee * - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an AsyncResult object. - * On success, the initialization data is provided in the asyncResult.value property as a string. - * If there is no initialization context, the asyncResult object will contain an Error object with its code property set to 9020 and its name property set to GenericResponseError. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, + * asyncResult, which is an {@link Office.AsyncResult} object. + * On success, the initialization data is provided in the asyncResult.value property as a string. + * If there is no initialization context, the asyncResult object will contain an Error object with its code property + * set to 9020 and its name property set to GenericResponseError. * * @beta */ - getInitializationContextAsync(callback?: (result: AsyncResult) => void): void; + getInitializationContextAsync(callback?: (result: AsyncResult) => void): void; /** * Gets the entities found in the selected item's body. * @@ -10136,7 +10908,9 @@ declare namespace Office { * @param entityType One of the EntityType enumeration values. * * @returns - * If the value passed in entityType is not a valid member of the EntityType enumeration, the method returns null. If no entities of the specified type are present in the item's body, the method returns an empty array. Otherwise, the type of the objects in the returned array depends on the type of entity requested in the entityType parameter. + * If the value passed in entityType is not a valid member of the EntityType enumeration, the method returns null. + * If no entities of the specified type are present in the item's body, the method returns an empty array. + * Otherwise, the type of the objects in the returned array depends on the type of entity requested in the entityType parameter. * * @remarks * @@ -10192,7 +10966,8 @@ declare namespace Office { /** * Returns well-known entities in the selected item that pass the named filter defined in the manifest XML file. * - * The getFilteredEntitiesByName method returns the entities that match the regular expression defined in the ItemHasKnownEntity rule element in the manifest XML file with the specified FilterName element value. + * The getFilteredEntitiesByName method returns the entities that match the regular expression defined in the ItemHasKnownEntity rule element + * in the manifest XML file with the specified FilterName element value. * * Note: This method is not supported in Outlook for iOS or Outlook for Android. * @@ -10205,22 +10980,33 @@ declare namespace Office { *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}Restricted
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
* * @param name The name of the ItemHasKnownEntity rule element that defines the filter to match. - * @returns If there is no ItemHasKnownEntity element in the manifest with a FilterName element value that matches the name parameter, the method returns null. If the name parameter does match an ItemHasKnownEntity element in the manifest, but there are no entities in the current item that match, the method return an empty array. + * @returns If there is no ItemHasKnownEntity element in the manifest with a FilterName element value that matches the name parameter, + * the method returns null. + * If the name parameter does match an ItemHasKnownEntity element in the manifest, but there are no entities in the current item that match, + * the method return an empty array. */ getFilteredEntitiesByName(name: string): (string | Contact | MeetingSuggestion | PhoneNumber | TaskSuggestion)[]; /** * Returns string values in the selected item that match the regular expressions defined in the manifest XML file. * - * The getRegExMatches method returns the strings that match the regular expression defined in each ItemHasRegularExpressionMatch or ItemHasKnownEntity rule element in the manifest XML file. For an ItemHasRegularExpressionMatch rule, a matching string has to occur in the property of the item that is specified by that rule. The PropertyName simple type defines the supported properties. + * The getRegExMatches method returns the strings that match the regular expression defined in each ItemHasRegularExpressionMatch or + * ItemHasKnownEntity rule element in the manifest XML file. + * For an ItemHasRegularExpressionMatch rule, a matching string has to occur in the property of the item that is specified by that rule. + * The PropertyName simple type defines the supported properties. * - * If you specify an ItemHasRegularExpressionMatch rule on the body property of an item, the regular expression should further filter the body and should not attempt to return the entire body of the item. Using a regular expression such as .* to obtain the entire body of an item does not always return the expected results. Instead, use the Body.getAsync method to retrieve the entire body. + * If you specify an ItemHasRegularExpressionMatch rule on the body property of an item, the regular expression should further filter the body + * and should not attempt to return the entire body of the item. + * Using a regular expression such as .* to obtain the entire body of an item does not always return the expected results. + * Instead, use the Body.getAsync method to retrieve the entire body. * * Note: This method is not supported in Outlook for iOS or Outlook for Android. * * [Api set: Mailbox 1.0] * * @returns - * An object that contains arrays of strings that match the regular expressions defined in the manifest XML file. The name of each array is equal to the corresponding value of the RegExName attribute of the matching ItemHasRegularExpressionMatch rule or the FilterName attribute of the matching ItemHasKnownEntity rule. + * An object that contains arrays of strings that match the regular expressions defined in the manifest XML file. + * The name of each array is equal to the corresponding value of the RegExName attribute of the matching ItemHasRegularExpressionMatch rule + * or the FilterName attribute of the matching ItemHasKnownEntity rule. * * @remarks * @@ -10232,9 +11018,12 @@ declare namespace Office { /** * Returns string values in the selected item that match the named regular expression defined in the manifest XML file. * - * The getRegExMatchesByName method returns the strings that match the regular expression defined in the ItemHasRegularExpressionMatch rule element in the manifest XML file with the specified RegExName element value. + * The getRegExMatchesByName method returns the strings that match the regular expression defined in the ItemHasRegularExpressionMatch rule + * element in the manifest XML file with the specified RegExName element value. * - * If you specify an ItemHasRegularExpressionMatch rule on the body property of an item, the regular expression should further filter the body and should not attempt to return the entire body of the item. Using a regular expression such as .* to obtain the entire body of an item does not always return the expected results. + * If you specify an ItemHasRegularExpressionMatch rule on the body property of an item, the regular expression should further filter the body + * and should not attempt to return the entire body of the item. + * Using a regular expression such as .* to obtain the entire body of an item does not always return the expected results. * * Note: This method is not supported in Outlook for iOS or Outlook for Android. * @@ -10269,18 +11058,27 @@ declare namespace Office { */ getSelectedEntities(): Entities; /** - * Returns string values in a highlighted match that match the regular expressions defined in the manifest XML file. Highlighted matches apply to contextual add-ins. + * Returns string values in a highlighted match that match the regular expressions defined in the manifest XML file. + * Highlighted matches apply to contextual add-ins. * - * The getSelectedRegExMatches method returns the strings that match the regular expression defined in each ItemHasRegularExpressionMatch or ItemHasKnownEntity rule element in the manifest XML file. For an ItemHasRegularExpressionMatch rule, a matching string has to occur in the property of the item that is specified by that rule. The PropertyName simple type defines the supported properties. + * The getSelectedRegExMatches method returns the strings that match the regular expression defined in each ItemHasRegularExpressionMatch or + * ItemHasKnownEntity rule element in the manifest XML file. + * For an ItemHasRegularExpressionMatch rule, a matching string has to occur in the property of the item that is specified by that rule. + * The PropertyName simple type defines the supported properties. * - * If you specify an ItemHasRegularExpressionMatch rule on the body property of an item, the regular expression should further filter the body and should not attempt to return the entire body of the item. Using a regular expression such as .* to obtain the entire body of an item does not always return the expected results. Instead, use the Body.getAsync method to retrieve the entire body. + * If you specify an ItemHasRegularExpressionMatch rule on the body property of an item, the regular expression should further filter the body + * and should not attempt to return the entire body of the item. + * Using a regular expression such as .* to obtain the entire body of an item does not always return the expected results. + * Instead, use the Body.getAsync method to retrieve the entire body. * * Note: This method is not supported in Outlook for iOS or Outlook for Android. * * [Api set: Mailbox 1.6] * * @returns - * An object that contains arrays of strings that match the regular expressions defined in the manifest XML file. The name of each array is equal to the corresponding value of the RegExName attribute of the matching ItemHasRegularExpressionMatch rule or the FilterName attribute of the matching ItemHasKnownEntity rule. + * An object that contains arrays of strings that match the regular expressions defined in the manifest XML file. + * The name of each array is equal to the corresponding value of the RegExName attribute of the matching ItemHasRegularExpressionMatch rule + * or the FilterName attribute of the matching ItemHasKnownEntity rule. * * @remarks * @@ -10292,9 +11090,13 @@ declare namespace Office { /** * Asynchronously loads custom properties for this add-in on the selected item. * - * Custom properties are stored as key/value pairs on a per-app, per-item basis. This method returns a CustomProperties object in the callback, which provides methods to access the custom properties specific to the current item and the current add-in. Custom properties are not encrypted on the item, so this should not be used as secure storage. + * Custom properties are stored as key/value pairs on a per-app, per-item basis. + * This method returns a CustomProperties object in the callback, which provides methods to access the custom properties specific to the + * current item and the current add-in. Custom properties are not encrypted on the item, so this should not be used as secure storage. * - * The custom properties are provided as a CustomProperties object in the asyncResult.value property. This object can be used to get, set, and remove custom properties from the item and save changes to the custom property set back to the server. + * The custom properties are provided as a CustomProperties object in the asyncResult.value property. + * This object can be used to get, set, and remove custom properties from the item and save changes to the custom property set back to + * the server. * * [Api set: Mailbox 1.0] * @@ -10304,15 +11106,18 @@ declare namespace Office { * * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee * - * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. - * @param userContext Optional. Developers can provide any object they wish to access in the callback function. This object can be accessed by the asyncResult.asyncContext property in the callback function. + * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of + * type {@link Office.AsyncResult}. + * @param userContext Optional. Developers can provide any object they wish to access in the callback function. + * This object can be accessed by the asyncResult.asyncContext property in the callback function. */ - loadCustomPropertiesAsync(callback: (result: AsyncResult) => void, userContext?: any): void; + loadCustomPropertiesAsync(callback: (result: AsyncResult) => void, userContext?: any): void; /** * Removes an event handler for a supported event. * - * Currently the supported event types are `Office.EventType.AppointmentTimeChanged`, `Office.EventType.RecipientsChanged`, and `Office.EventType.RecurrencePatternChanged`. + * Currently the supported event types are `Office.EventType.AppointmentTimeChanged`, `Office.EventType.RecipientsChanged`, and + * `Office.EventType.RecurrencePatternChanged`. * * [Api set: Mailbox Preview] * @@ -10324,21 +11129,24 @@ declare namespace Office { * * In addition to this signature, the method also has the following signature: * - * `removeHandlerAsync(eventType:EventType, handler: any, callback?: (result: AsyncResult) => void): void;` + * `removeHandlerAsync(eventType:EventType, handler: any, callback?: (result: AsyncResult) => void): void;` * * @param eventType The event that should invoke the handler. - * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. The type property on the parameter will match the eventType parameter passed to removeHandlerAsync. + * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. + * The type property on the parameter will match the eventType parameter passed to removeHandlerAsync. * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an AsyncResult object. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, + * asyncResult, which is an {@link Office.AsyncResult} object. * * @beta */ - removeHandlerAsync(eventType:EventType, handler: any, options?: any, callback?: (result: AsyncResult) => void): void; + removeHandlerAsync(eventType:EventType, handler: any, options?: any, callback?: (result: AsyncResult) => void): void; /** * Removes an event handler for a supported event. * - * Currently the supported event types are `Office.EventType.AppointmentTimeChanged`, `Office.EventType.RecipientsChanged`, and `Office.EventType.RecurrencePatternChanged`. + * Currently the supported event types are `Office.EventType.AppointmentTimeChanged`, `Office.EventType.RecipientsChanged`, and + * `Office.EventType.RecurrencePatternChanged`. * * [Api set: Mailbox Preview] * @@ -10349,16 +11157,19 @@ declare namespace Office { * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee * * @param eventType The event that should invoke the handler. - * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. The type property on the parameter will match the eventType parameter passed to removeHandlerAsync. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an AsyncResult object. + * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. + * The type property on the parameter will match the eventType parameter passed to removeHandlerAsync. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, + * asyncResult, which is an {@link Office.AsyncResult} object. * * @beta */ - removeHandlerAsync(eventType:EventType, handler: any, callback?: (result: AsyncResult) => void): void; + removeHandlerAsync(eventType:EventType, handler: any, callback?: (result: AsyncResult) => void): void; } /** - * The item namespace is used to access the currently selected message, meeting request, or appointment. You can determine the type of the item by using the `itemType` property. + * The item namespace is used to access the currently selected message, meeting request, or appointment. + * You can determine the type of the item by using the `itemType` property. * * [Api set: Mailbox 1.0] * @@ -10409,7 +11220,8 @@ declare namespace Office { /** * Gets the type of item that an instance represents. * - * The itemType property returns one of the ItemType enumeration values, indicating whether the item object instance is a message or an appointment. + * The itemType property returns one of the ItemType enumeration values, indicating whether the item object instance is a message or + * an appointment. * * [Api set: Mailbox 1.0] * @@ -10434,13 +11246,17 @@ declare namespace Office { notificationMessages: Office.NotificationMessages; /** - * Gets or sets the recurrence pattern of an appointment. Gets the recurrence pattern of a meeting request. Read and compose modes for appointment items. Read mode for meeting request items. + * Gets or sets the recurrence pattern of an appointment. Gets the recurrence pattern of a meeting request. + * Read and compose modes for appointment items. Read mode for meeting request items. * - * The recurrence property returns a recurrence object for recurring appointments or meetings requests if an item is a series or an instance in a series. null is returned for single appointments and meeting requests of single appointments. undefined is returned for messages that are not meeting requests. + * The recurrence property returns a recurrence object for recurring appointments or meetings requests if an item is a series or an instance + * in a series. `null` is returned for single appointments and meeting requests of single appointments. + * `undefined` is returned for messages that are not meeting requests. * * Note: Meeting requests have an itemClass value of IPM.Schedule.Meeting.Request. * - * Note: If the recurrence object is null, this indicates that the object is a single appointment or a meeting request of a single appointment and NOT a part of a series. + * Note: If the recurrence object is null, this indicates that the object is a single appointment or a meeting request of a single appointment + * and NOT a part of a series. * * [Api set: Mailbox Preview] * @@ -10457,11 +11273,16 @@ declare namespace Office { /** * Gets the id of the series that an instance belongs to. * - * In OWA and Outlook, the seriesId returns the Exchange Web Services (EWS) ID of the parent (series) item that this item belongs to. However, in iOS and Android, the seriesId returns the REST ID of the parent item. + * In OWA and Outlook, the seriesId returns the Exchange Web Services (EWS) ID of the parent (series) item that this item belongs to. + * However, in iOS and Android, the seriesId returns the REST ID of the parent item. * - * Note: The identifier returned by the seriesId property is the same as the Exchange Web Services item identifier. The seriesId property is not identical to the Outlook IDs used by the Outlook REST API. Before making REST API calls using this value, it should be converted using Office.context.mailbox.convertToRestId. For more details, see {@link https://docs.microsoft.com/outlook/add-ins/use-rest-api | Use the Outlook REST APIs from an Outlook add-in}. + * Note: The identifier returned by the seriesId property is the same as the Exchange Web Services item identifier. + * The seriesId property is not identical to the Outlook IDs used by the Outlook REST API. + * Before making REST API calls using this value, it should be converted using Office.context.mailbox.convertToRestId. + * For more details, see {@link https://docs.microsoft.com/outlook/add-ins/use-rest-api | Use the Outlook REST APIs from an Outlook add-in}. * - * The seriesId property returns null for items that do not have parent items such as single appointments, series items, or meeting requests and returns undefined for any other items that are not meeting requests. + * The seriesId property returns null for items that do not have parent items such as single appointments, series items, or meeting requests + * and returns undefined for any other items that are not meeting requests. * * [Api set: Mailbox Preview] * @@ -10490,17 +11311,19 @@ declare namespace Office { * * In addition to this signature, the method also has the following signature: * - * `addHandlerAsync(eventType: Office.EventType, handler: any, callback?: (result: AsyncResult) => void): void;` + * `addHandlerAsync(eventType: Office.EventType, handler: any, callback?: (result: AsyncResult) => void): void;` * * @param eventType The event that should invoke the handler. - * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. The type property on the parameter will match the eventType parameter passed to addHandlerAsync. + * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. + * The type property on the parameter will match the eventType parameter passed to addHandlerAsync. * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an AsyncResult object. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, + * asyncResult, which is an {@link Office.AsyncResult} object. * * @beta */ - addHandlerAsync(eventType: Office.EventType, handler: any, options?: any, callback?: (result: AsyncResult) => void): void; + addHandlerAsync(eventType: Office.EventType, handler: any, options?: any, callback?: (result: AsyncResult) => void): void; /** * Adds an event handler for a supported event. @@ -10516,19 +11339,25 @@ declare namespace Office { * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read * * @param eventType The event that should invoke the handler. - * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. The type property on the parameter will match the eventType parameter passed to addHandlerAsync. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an AsyncResult object. + * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. + * The type property on the parameter will match the eventType parameter passed to addHandlerAsync. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, + * asyncResult, which is an {@link Office.AsyncResult} object. * * @beta */ - addHandlerAsync(eventType: Office.EventType, handler: any, callback?: (result: AsyncResult) => void): void; + addHandlerAsync(eventType: Office.EventType, handler: any, callback?: (result: AsyncResult) => void): void; /** * Asynchronously loads custom properties for this add-in on the selected item. * - * Custom properties are stored as key/value pairs on a per-app, per-item basis. This method returns a CustomProperties object in the callback, which provides methods to access the custom properties specific to the current item and the current add-in. Custom properties are not encrypted on the item, so this should not be used as secure storage. + * Custom properties are stored as key/value pairs on a per-app, per-item basis. + * This method returns a CustomProperties object in the callback, which provides methods to access the custom properties specific to the + * current item and the current add-in. Custom properties are not encrypted on the item, so this should not be used as secure storage. * - * The custom properties are provided as a CustomProperties object in the asyncResult.value property. This object can be used to get, set, and remove custom properties from the item and save changes to the custom property set back to the server. + * The custom properties are provided as a CustomProperties object in the asyncResult.value property. + * This object can be used to get, set, and remove custom properties from the item and save changes to the custom property set back to + * the server. * * [Api set: Mailbox 1.0] * @@ -10538,15 +11367,18 @@ declare namespace Office { * * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read * - * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. - * @param userContext Optional. Developers can provide any object they wish to access in the callback function. This object can be accessed by the asyncResult.asyncContext property in the callback function. + * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of + * type {@link Office.AsyncResult}. + * @param userContext Optional. Developers can provide any object they wish to access in the callback function. + * This object can be accessed by the asyncResult.asyncContext property in the callback function. */ - loadCustomPropertiesAsync(callback: (result: AsyncResult) => void, userContext?: any): void; + loadCustomPropertiesAsync(callback: (result: AsyncResult) => void, userContext?: any): void; /** * Removes an event handler for a supported event. * - * Currently the supported event types are `Office.EventType.AppointmentTimeChanged`, `Office.EventType.RecipientsChanged`, and `Office.EventType.RecurrencePatternChanged`. + * Currently the supported event types are `Office.EventType.AppointmentTimeChanged`, `Office.EventType.RecipientsChanged`, and + * `Office.EventType.RecurrencePatternChanged`. * * [Api set: Mailbox Preview] * @@ -10558,22 +11390,25 @@ declare namespace Office { * * In addition to this signature, the method also has the following signature: * - * `removeHandlerAsync(eventType: Office.EventType, handler: any, callback?: (result: AsyncResult) => void): void;` + * `removeHandlerAsync(eventType: Office.EventType, handler: any, callback?: (result: AsyncResult) => void): void;` * * @param eventType The event that should invoke the handler. - * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. The type property on the parameter will match the eventType parameter passed to removeHandlerAsync. + * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. + * The type property on the parameter will match the eventType parameter passed to removeHandlerAsync. * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an AsyncResult object. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, + * asyncResult, which is an {@link Office.AsyncResult} object. * * @beta */ - removeHandlerAsync(eventType: Office.EventType, handler: any, options?: any, callback?: (result: AsyncResult) => void): void; + removeHandlerAsync(eventType: Office.EventType, handler: any, options?: any, callback?: (result: AsyncResult) => void): void; /** * Removes an event handler for a supported event. * - * Currently the supported event types are `Office.EventType.AppointmentTimeChanged`, `Office.EventType.RecipientsChanged`, and `Office.EventType.RecurrencePatternChanged`. + * Currently the supported event types are `Office.EventType.AppointmentTimeChanged`, `Office.EventType.RecipientsChanged`, and + * `Office.EventType.RecurrencePatternChanged`. * * [Api set: Mailbox Preview] * @@ -10584,17 +11419,20 @@ declare namespace Office { * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read * * @param eventType The event that should invoke the handler. - * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. The type property on the parameter will match the eventType parameter passed to removeHandlerAsync. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an AsyncResult object. + * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. + * The type property on the parameter will match the eventType parameter passed to removeHandlerAsync. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, + * asyncResult, which is an {@link Office.AsyncResult} object. * * @beta */ - removeHandlerAsync(eventType: Office.EventType, handler: any, callback?: (result: AsyncResult) => void): void; + removeHandlerAsync(eventType: Office.EventType, handler: any, callback?: (result: AsyncResult) => void): void; } /** * The compose mode of {@link Office.Item | Office.context.mailbox.item}. * - * Important: This is an internal Outlook object, not directly exposed through existing interfaces. You should treat this as a mode of `Office.context.mailbox.item`. Refer to the Object Model pages for more information. + * Important: This is an internal Outlook object, not directly exposed through existing interfaces. + * You should treat this as a mode of `Office.context.mailbox.item`. Refer to the Object Model pages for more information. */ interface ItemCompose extends Item { /** @@ -10635,16 +11473,20 @@ declare namespace Office { * * `addFileAttachmentAsync(uri: string, attachmentName: string, options: Office.AsyncContextOptions): void;` * - * `addFileAttachmentAsync(uri: string, attachmentName: string, callback: (result: AsyncResult) => void): void;` + * `addFileAttachmentAsync(uri: string, attachmentName: string, callback: (result: AsyncResult) => void): void;` * * @param uri The URI that provides the location of the file to attach to the message or appointment. The maximum length is 2048 characters. * @param attachmentName The name of the attachment that is shown while the attachment is uploading. The maximum length is 255 characters. * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. - * isInline: If true, indicates that the attachment will be shown inline in the message body and should not be displayed in the attachment list. - * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type asyncResult. On success, the attachment identifier will be provided in the asyncResult.value property. If uploading the attachment fails, the asyncResult object will contain an Error object that provides a description of the error. + * isInline: If true, indicates that the attachment will be shown inline in the message body, and should not be displayed in the + * attachment list. + * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of + * type asyncResult. On success, the attachment identifier will be provided in the asyncResult.value property. + * If uploading the attachment fails, the asyncResult object will contain an Error object that provides a description of + * the error. */ - addFileAttachmentAsync(uri: string, attachmentName: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + addFileAttachmentAsync(uri: string, attachmentName: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Adds a file to a message or appointment as an attachment. * @@ -10685,7 +11527,8 @@ declare namespace Office { * @param attachmentName The name of the attachment that is shown while the attachment is uploading. The maximum length is 255 characters. * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. - * isInline: If true, indicates that the attachment will be shown inline in the message body and should not be displayed in the attachment list. + * isInline: If true, indicates that the attachment will be shown inline in the message body, and should not be displayed in the + * attachment list. */ addFileAttachmentAsync(uri: string, attachmentName: string, options: Office.AsyncContextOptions): void; /** @@ -10706,9 +11549,12 @@ declare namespace Office { * * @param uri The URI that provides the location of the file to attach to the message or appointment. The maximum length is 2048 characters. * @param attachmentName The name of the attachment that is shown while the attachment is uploading. The maximum length is 255 characters. - * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type asyncResult. On success, the attachment identifier will be provided in the asyncResult.value property. If uploading the attachment fails, the asyncResult object will contain an Error object that provides a description of the error. + * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of + * type {@link Office.AsyncResult}. On success, the attachment identifier will be provided in the asyncResult.value property. + * If uploading the attachment fails, the asyncResult object will contain an Error object that provides a description of + * the error. */ - addFileAttachmentAsync(uri: string, attachmentName: string, callback: (result: AsyncResult) => void): void; + addFileAttachmentAsync(uri: string, attachmentName: string, callback: (result: AsyncResult) => void): void; /** * Adds a file to a message or appointment as an attachment. @@ -10731,18 +11577,24 @@ declare namespace Office { * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. * isInline: If true, indicates that the attachment will be shown inline in the message body and should not be displayed in the attachment list. - * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type asyncResult. On success, the attachment identifier will be provided in the asyncResult.value property. If uploading the attachment fails, the asyncResult object will contain an Error object that provides a description of the error. + * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type asyncResult. + * On success, the attachment identifier will be provided in the asyncResult.value property. + * If uploading the attachment fails, the asyncResult object will contain an Error object that provides a description of the error. */ - addFileAttachmentFromBase64Async(base64File: string, attachmentName: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + addFileAttachmentFromBase64Async(base64File: string, attachmentName: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Adds an Exchange item, such as a message, as an attachment to the message or appointment. * - * The addItemAttachmentAsync method attaches the item with the specified Exchange identifier to the item in the compose form. If you specify a callback method, the method is called with one parameter, asyncResult, which contains either the attachment identifier or a code that indicates any error that occurred while attaching the item. You can use the options parameter to pass state information to the callback method, if needed. + * The addItemAttachmentAsync method attaches the item with the specified Exchange identifier to the item in the compose form. + * If you specify a callback method, the method is called with one parameter, asyncResult, which contains either the attachment identifier or + * a code that indicates any error that occurred while attaching the item. You can use the options parameter to pass state information to the + * callback method, if needed. * * You can subsequently use the identifier with the removeAttachmentAsync method to remove the attachment in the same session. * - * If your Office add-in is running in Outlook Web App, the addItemAttachmentAsync method can attach items to items other than the item that you are editing; however, this is not supported and is not recommended. + * If your Office add-in is running in Outlook Web App, the addItemAttachmentAsync method can attach items to items other than the item that + * you are editing; however, this is not supported and is not recommended. * * [Api set: Mailbox 1.1] * @@ -10759,23 +11611,30 @@ declare namespace Office { * * `addItemAttachmentAsync(itemId: any, attachmentName: string, options: Office.AsyncContextOptions): void;` * - * `addItemAttachmentAsync(itemId: any, attachmentName: string, callback: (result: AsyncResult) => void): void;` + * `addItemAttachmentAsync(itemId: any, attachmentName: string, callback: (result: AsyncResult) => void): void;` * * @param itemId The Exchange identifier of the item to attach. The maximum length is 100 characters. * @param attachmentName The name of the attachment that is shown while the attachment is uploading. The maximum length is 255 characters. * @param options An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. - * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. On success, the attachment identifier will be provided in the asyncResult.value property. If adding the attachment fails, the asyncResult object will contain an Error object that provides a description of the error. + * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of + * type {@link Office.AsyncResult}. On success, the attachment identifier will be provided in the asyncResult.value property. + * If adding the attachment fails, the asyncResult object will contain an Error object that provides a description of + * the error. */ - addItemAttachmentAsync(itemId: any, attachmentName: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + addItemAttachmentAsync(itemId: any, attachmentName: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Adds an Exchange item, such as a message, as an attachment to the message or appointment. * - * The addItemAttachmentAsync method attaches the item with the specified Exchange identifier to the item in the compose form. If you specify a callback method, the method is called with one parameter, asyncResult, which contains either the attachment identifier or a code that indicates any error that occurred while attaching the item. You can use the options parameter to pass state information to the callback method, if needed. + * The addItemAttachmentAsync method attaches the item with the specified Exchange identifier to the item in the compose form. + * If you specify a callback method, the method is called with one parameter, asyncResult, which contains either the attachment identifier or + * a code that indicates any error that occurred while attaching the item. You can use the options parameter to pass state information to the + * callback method, if needed. * * You can subsequently use the identifier with the removeAttachmentAsync method to remove the attachment in the same session. * - * If your Office add-in is running in Outlook Web App, the addItemAttachmentAsync method can attach items to items other than the item that you are editing; however, this is not supported and is not recommended. + * If your Office add-in is running in Outlook Web App, the addItemAttachmentAsync method can attach items to items other than the item that + * you are editing; however, this is not supported and is not recommended. * * [Api set: Mailbox 1.1] * @@ -10793,11 +11652,15 @@ declare namespace Office { /** * Adds an Exchange item, such as a message, as an attachment to the message or appointment. * - * The addItemAttachmentAsync method attaches the item with the specified Exchange identifier to the item in the compose form. If you specify a callback method, the method is called with one parameter, asyncResult, which contains either the attachment identifier or a code that indicates any error that occurred while attaching the item. You can use the options parameter to pass state information to the callback method, if needed. + * The addItemAttachmentAsync method attaches the item with the specified Exchange identifier to the item in the compose form. + * If you specify a callback method, the method is called with one parameter, asyncResult, which contains either the attachment identifier or + * a code that indicates any error that occurred while attaching the item. You can use the options parameter to pass state information to the + * callback method, if needed. * * You can subsequently use the identifier with the removeAttachmentAsync method to remove the attachment in the same session. * - * If your Office add-in is running in Outlook Web App, the addItemAttachmentAsync method can attach items to items other than the item that you are editing; however, this is not supported and is not recommended. + * If your Office add-in is running in Outlook Web App, the addItemAttachmentAsync method can attach items to items other than the item that + * you are editing; however, this is not supported and is not recommended. * * [Api set: Mailbox 1.1] * @@ -10817,11 +11680,15 @@ declare namespace Office { /** * Adds an Exchange item, such as a message, as an attachment to the message or appointment. * - * The addItemAttachmentAsync method attaches the item with the specified Exchange identifier to the item in the compose form. If you specify a callback method, the method is called with one parameter, asyncResult, which contains either the attachment identifier or a code that indicates any error that occurred while attaching the item. You can use the options parameter to pass state information to the callback method, if needed. + * The addItemAttachmentAsync method attaches the item with the specified Exchange identifier to the item in the compose form. + * If you specify a callback method, the method is called with one parameter, asyncResult, which contains either the attachment identifier or + * a code that indicates any error that occurred while attaching the item. You can use the options parameter to pass state information to the + * callback method, if needed. * * You can subsequently use the identifier with the removeAttachmentAsync method to remove the attachment in the same session. * - * If your Office add-in is running in Outlook Web App, the addItemAttachmentAsync method can attach items to items other than the item that you are editing; however, this is not supported and is not recommended. + * If your Office add-in is running in Outlook Web App, the addItemAttachmentAsync method can attach items to items other than the item that + * you are editing; however, this is not supported and is not recommended. * * [Api set: Mailbox 1.1] * @@ -10834,18 +11701,23 @@ declare namespace Office { * * @param itemId The Exchange identifier of the item to attach. The maximum length is 100 characters. * @param attachmentName The name of the attachment that is shown while the attachment is uploading. The maximum length is 255 characters. - * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. On success, the attachment identifier will be provided in the asyncResult.value property. If adding the attachment fails, the asyncResult object will contain an Error object that provides a description of the error. + * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of + * type {@link Office.AsyncResult}. On success, the attachment identifier will be provided in the asyncResult.value property. + * If adding the attachment fails, the asyncResult object will contain an Error object that provides a description of + * the error. */ - addItemAttachmentAsync(itemId: any, attachmentName: string, callback: (result: AsyncResult) => void): void; + addItemAttachmentAsync(itemId: any, attachmentName: string, callback: (result: AsyncResult) => void): void; /** * Closes the current item that is being composed * - * The behaviors of the close method depends on the current state of the item being composed. If the item has unsaved changes, the client prompts the user to save, discard, or close the action. + * The behaviors of the close method depends on the current state of the item being composed. + * If the item has unsaved changes, the client prompts the user to save, discard, or close the action. * * In the Outlook desktop client, if the message is an inline reply, the close method has no effect. * - * Note: In Outlook on the web, if the item is an appointment and it has previously been saved using saveAsync, the user is prompted to save, discard, or cancel even if no changes have occurred since the item was last saved. + * Note: In Outlook on the web, if the item is an appointment and it has previously been saved using saveAsync, the user is prompted to save, + * discard, or cancel even if no changes have occurred since the item was last saved. * * [Api set: Mailbox 1.3] * @@ -10873,19 +11745,23 @@ declare namespace Office { * * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. - * On success, the initialization data is provided in the asyncResult.value property as a string. - * If there is no initialization context, the asyncResult object will contain an Error object with its code property set to 9020 and its name property set to GenericResponseError. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of + * type {@link Office.AsyncResult}. + * On success, the initialization data is provided in the asyncResult.value property as a string. + * If there is no initialization context, the asyncResult object will contain an Error object with its code property + * set to 9020 and its name property set to GenericResponseError. * * @beta */ - getInitializationContextAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + getInitializationContextAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Asynchronously returns selected data from the subject or body of a message. * - * If there is no selection but the cursor is in the body or subject, the method returns null for the selected data. If a field other than the body or subject is selected, the method returns the InvalidSelection error. + * If there is no selection but the cursor is in the body or subject, the method returns null for the selected data. + * If a field other than the body or subject is selected, the method returns the InvalidSelection error. * - * To access the selected data from the callback method, call asyncResult.value.data. To access the source property that the selection comes from, call asyncResult.value.sourceProperty, which will be either body or subject. + * To access the selected data from the callback method, call asyncResult.value.data. To access the source property that the selection comes + * from, call asyncResult.value.sourceProperty, which will be either body or subject. * * [Api set: Mailbox 1.2] * @@ -10898,16 +11774,20 @@ declare namespace Office { * * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose * - * @param coercionType Requests a format for the data. If Text, the method returns the plain text as a string , removing any HTML tags present. If HTML, the method returns the selected text, whether it is plaintext or HTML. - * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. + * @param coercionType Requests a format for the data. If Text, the method returns the plain text as a string , removing any HTML tags present. + * If HTML, the method returns the selected text, whether it is plaintext or HTML. + * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of + * type {@link Office.AsyncResult}. */ - getSelectedDataAsync(coerciontype: Office.CoercionType, callback: (result: AsyncResult) => void): void; + getSelectedDataAsync(coerciontype: Office.CoercionType, callback: (result: AsyncResult) => void): void; /** * Asynchronously returns selected data from the subject or body of a message. * - * If there is no selection but the cursor is in the body or subject, the method returns null for the selected data. If a field other than the body or subject is selected, the method returns the InvalidSelection error. + * If there is no selection but the cursor is in the body or subject, the method returns null for the selected data. + * If a field other than the body or subject is selected, the method returns the InvalidSelection error. * - * To access the selected data from the callback method, call asyncResult.value.data. To access the source property that the selection comes from, call asyncResult.value.sourceProperty, which will be either body or subject. + * To access the selected data from the callback method, call asyncResult.value.data. + * To access the source property that the selection comes from, call asyncResult.value.sourceProperty, which will be either body or subject. * * [Api set: Mailbox 1.2] * @@ -10920,16 +11800,22 @@ declare namespace Office { * * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose * - * @param coercionType Requests a format for the data. If Text, the method returns the plain text as a string , removing any HTML tags present. If HTML, the method returns the selected text, whether it is plaintext or HTML. + * @param coercionType Requests a format for the data. If Text, the method returns the plain text as a string, removing any HTML tags present. + * If HTML, the method returns the selected text, whether it is plaintext or HTML. * @param options An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. - * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. + * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of + * type {@link Office.AsyncResult}. */ - getSelectedDataAsync(coerciontype: Office.CoercionType, options: Office.AsyncContextOptions, callback: (result: AsyncResult) => void): void; + getSelectedDataAsync(coerciontype: Office.CoercionType, options: Office.AsyncContextOptions, callback: (result: AsyncResult) => void): void; /** * Removes an attachment from a message or appointment. * - * The removeAttachmentAsync method removes the attachment with the specified identifier from the item. As a best practice, you should use the attachment identifier to remove an attachment only if the same mail app has added that attachment in the same session. In Outlook Web App and OWA for Devices, the attachment identifier is valid only within the same session. A session is over when the user closes the app, or if the user starts composing in an inline form and subsequently pops out the inline form to continue in a separate window. + * The removeAttachmentAsync method removes the attachment with the specified identifier from the item. + * As a best practice, you should use the attachment identifier to remove an attachment only if the same mail app has added that attachment + * in the same session. In Outlook Web App and OWA for Devices, the attachment identifier is valid only within the same session. + * A session is over when the user closes the app, or if the user starts composing in an inline form and subsequently pops out the inline form + * to continue in a separate window. * * [Api set: Mailbox 1.1] * @@ -10947,18 +11833,24 @@ declare namespace Office { * * `removeAttachmentAsync(attachmentIndex: string, options: Office.AsyncContextOptions): void;` * - * `removeAttachmentAsync(attachmentIndex: string, callback: (result: AsyncResult) => void): void;` + * `removeAttachmentAsync(attachmentIndex: string, callback: (result: AsyncResult) => void): void;` * * @param attachmentIndex The identifier of the attachment to remove. The maximum length of the string is 100 characters. * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. If removing the attachment fails, the asyncResult.error property will contain an error code with the reason for the failure. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of + * type {@link Office.AsyncResult}. + * If removing the attachment fails, the asyncResult.error property will contain an error code with the reason for the failure. */ - removeAttachmentAsync(attachmentIndex: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + removeAttachmentAsync(attachmentIndex: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Removes an attachment from a message or appointment. * - * The removeAttachmentAsync method removes the attachment with the specified identifier from the item. As a best practice, you should use the attachment identifier to remove an attachment only if the same mail app has added that attachment in the same session. In Outlook Web App and OWA for Devices, the attachment identifier is valid only within the same session. A session is over when the user closes the app, or if the user starts composing in an inline form and subsequently pops out the inline form to continue in a separate window. + * The removeAttachmentAsync method removes the attachment with the specified identifier from the item. + * As a best practice, you should use the attachment identifier to remove an attachment only if the same mail app has added that attachment + * in the same session. In Outlook Web App and OWA for Devices, the attachment identifier is valid only within the same session. + * A session is over when the user closes the app, or if the user starts composing in an inline form and subsequently pops out the inline form + * to continue in a separate window. * * [Api set: Mailbox 1.1] * @@ -10976,7 +11868,11 @@ declare namespace Office { /** * Removes an attachment from a message or appointment. * - * The removeAttachmentAsync method removes the attachment with the specified identifier from the item. As a best practice, you should use the attachment identifier to remove an attachment only if the same mail app has added that attachment in the same session. In Outlook Web App and OWA for Devices, the attachment identifier is valid only within the same session. A session is over when the user closes the app, or if the user starts composing in an inline form and subsequently pops out the inline form to continue in a separate window. + * The removeAttachmentAsync method removes the attachment with the specified identifier from the item. + * As a best practice, you should use the attachment identifier to remove an attachment only if the same mail app has added that attachment + * in the same session. In Outlook Web App and OWA for Devices, the attachment identifier is valid only within the same session. + * A session is over when the user closes the app, or if the user starts composing in an inline form and subsequently pops out the inline form + * to continue in a separate window. * * [Api set: Mailbox 1.1] * @@ -10996,7 +11892,11 @@ declare namespace Office { /** * Removes an attachment from a message or appointment. * - * The removeAttachmentAsync method removes the attachment with the specified identifier from the item. As a best practice, you should use the attachment identifier to remove an attachment only if the same mail app has added that attachment in the same session. In Outlook Web App and OWA for Devices, the attachment identifier is valid only within the same session. A session is over when the user closes the app, or if the user starts composing in an inline form and subsequently pops out the inline form to continue in a separate window. + * The removeAttachmentAsync method removes the attachment with the specified identifier from the item. + * As a best practice, you should use the attachment identifier to remove an attachment only if the same mail app has added that attachment + * in the same session. In Outlook Web App and OWA for Devices, the attachment identifier is valid only within the same session. + * A session is over when the user closes the app, or if the user starts composing in an inline form and subsequently pops out the inline form + * to continue in a separate window. * * [Api set: Mailbox 1.1] * @@ -11009,18 +11909,26 @@ declare namespace Office { * ErrorsInvalidAttachmentId - The attachment identifier does not exist. * * @param attachmentIndex The identifier of the attachment to remove. The maximum length of the string is 100 characters. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. If removing the attachment fails, the asyncResult.error property will contain an error code with the reason for the failure. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of + * type {@link Offfice.AsyncResult}. + * If removing the attachment fails, the asyncResult.error property will contain an error code with the reason for the failure. */ - removeAttachmentAsync(attachmentIndex: string, callback: (result: AsyncResult) => void): void; + removeAttachmentAsync(attachmentIndex: string, callback: (result: AsyncResult) => void): void; /** * Asynchronously saves an item. * - * When invoked, this method saves the current message as a draft and returns the item id via the callback method. In Outlook Web App or Outlook in online mode, the item is saved to the server. In Outlook in cached mode, the item is saved to the local cache. + * When invoked, this method saves the current message as a draft and returns the item id via the callback method. + * In Outlook Web App or Outlook in online mode, the item is saved to the server. + * In Outlook in cached mode, the item is saved to the local cache. * - * Since appointments have no draft state, if saveAsync is called on an appointment in compose mode, the item will be saved as a normal appointment on the user's calendar. For new appointments that have not been saved before, no invitation will be sent. Saving an existing appointment will send an update to added or removed attendees. + * Since appointments have no draft state, if saveAsync is called on an appointment in compose mode, the item will be saved as a normal + * appointment on the user's calendar. For new appointments that have not been saved before, no invitation will be sent. + * Saving an existing appointment will send an update to added or removed attendees. * - * Note: If your add-in calls saveAsync on an item in compose mode in order to get an itemId to use with EWS or the REST API, be aware that when Outlook is in cached mode, it may take some time before the item is actually synced to the server. Until the item is synced, using the itemId will return an error. + * Note: If your add-in calls saveAsync on an item in compose mode in order to get an itemId to use with EWS or the REST API, be aware that + * when Outlook is in cached mode, it may take some time before the item is actually synced to the server. + * Until the item is synced, using the itemId will return an error. * * Note: The following clients have different behavior for saveAsync on appointments in compose mode: * @@ -11044,21 +11952,29 @@ declare namespace Office { * * `saveAsync(options: Office.AsyncContextOptions): void;` * - * `saveAsync(callback: (result: AsyncResult) => void): void;` + * `saveAsync(callback: (result: AsyncResult) => void): void;` * * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. If removing the attachment fails, the asyncResult.error property will contain an error code with the reason for the failure. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of + * type {@link Office.AsyncResult}. + * If removing the attachment fails, the asyncResult.error property will contain an error code with the reason for the failure. */ - saveAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + saveAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Asynchronously saves an item. * - * When invoked, this method saves the current message as a draft and returns the item id via the callback method. In Outlook Web App or Outlook in online mode, the item is saved to the server. In Outlook in cached mode, the item is saved to the local cache. + * When invoked, this method saves the current message as a draft and returns the item id via the callback method. + * In Outlook Web App or Outlook in online mode, the item is saved to the server. + * In Outlook in cached mode, the item is saved to the local cache. * - * Since appointments have no draft state, if saveAsync is called on an appointment in compose mode, the item will be saved as a normal appointment on the user's calendar. For new appointments that have not been saved before, no invitation will be sent. Saving an existing appointment will send an update to added or removed attendees. + * Since appointments have no draft state, if saveAsync is called on an appointment in compose mode, the item will be saved as a normal + * appointment on the user's calendar. For new appointments that have not been saved before, no invitation will be sent. + * Saving an existing appointment will send an update to added or removed attendees. * - * Note: If your add-in calls saveAsync on an item in compose mode in order to get an itemId to use with EWS or the REST API, be aware that when Outlook is in cached mode, it may take some time before the item is actually synced to the server. Until the item is synced, using the itemId will return an error. + * Note: If your add-in calls saveAsync on an item in compose mode in order to get an itemId to use with EWS or the REST API, be aware that + * when Outlook is in cached mode, it may take some time before the item is actually synced to the server. + * Until the item is synced, using the itemId will return an error. * * Note: The following clients have different behavior for saveAsync on appointments in compose mode: * @@ -11081,11 +11997,17 @@ declare namespace Office { /** * Asynchronously saves an item. * - * When invoked, this method saves the current message as a draft and returns the item id via the callback method. In Outlook Web App or Outlook in online mode, the item is saved to the server. In Outlook in cached mode, the item is saved to the local cache. + * When invoked, this method saves the current message as a draft and returns the item id via the callback method. + * In Outlook Web App or Outlook in online mode, the item is saved to the server. + * In Outlook in cached mode, the item is saved to the local cache. * - * Since appointments have no draft state, if saveAsync is called on an appointment in compose mode, the item will be saved as a normal appointment on the user's calendar. For new appointments that have not been saved before, no invitation will be sent. Saving an existing appointment will send an update to added or removed attendees. + * Since appointments have no draft state, if saveAsync is called on an appointment in compose mode, the item will be saved as a normal + * appointment on the user's calendar. For new appointments that have not been saved before, no invitation will be sent. + * Saving an existing appointment will send an update to added or removed attendees. * - * Note: If your add-in calls saveAsync on an item in compose mode in order to get an itemId to use with EWS or the REST API, be aware that when Outlook is in cached mode, it may take some time before the item is actually synced to the server. Until the item is synced, using the itemId will return an error. + * Note: If your add-in calls saveAsync on an item in compose mode in order to get an itemId to use with EWS or the REST API, be aware that + * when Outlook is in cached mode, it may take some time before the item is actually synced to the server. + * Until the item is synced, using the itemId will return an error. * * Note: The following clients have different behavior for saveAsync on appointments in compose mode: * @@ -11110,11 +12032,17 @@ declare namespace Office { /** * Asynchronously saves an item. * - * When invoked, this method saves the current message as a draft and returns the item id via the callback method. In Outlook Web App or Outlook in online mode, the item is saved to the server. In Outlook in cached mode, the item is saved to the local cache. + * When invoked, this method saves the current message as a draft and returns the item id via the callback method. + * In Outlook Web App or Outlook in online mode, the item is saved to the server. + * In Outlook in cached mode, the item is saved to the local cache. * - * Since appointments have no draft state, if saveAsync is called on an appointment in compose mode, the item will be saved as a normal appointment on the user's calendar. For new appointments that have not been saved before, no invitation will be sent. Saving an existing appointment will send an update to added or removed attendees. + * Since appointments have no draft state, if saveAsync is called on an appointment in compose mode, the item will be saved as a normal + * appointment on the user's calendar. For new appointments that have not been saved before, no invitation will be sent. + * Saving an existing appointment will send an update to added or removed attendees. * - * Note: If your add-in calls saveAsync on an item in compose mode in order to get an itemId to use with EWS or the REST API, be aware that when Outlook is in cached mode, it may take some time before the item is actually synced to the server. Until the item is synced, using the itemId will return an error. + * Note: If your add-in calls saveAsync on an item in compose mode in order to get an itemId to use with EWS or the REST API, be aware that + * when Outlook is in cached mode, it may take some time before the item is actually synced to the server. + * Until the item is synced, using the itemId will return an error. * * Note: The following clients have different behavior for saveAsync on appointments in compose mode: * @@ -11132,13 +12060,17 @@ declare namespace Office { * * ErrorsInvalidAttachmentId - The attachment identifier does not exist. * - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. If removing the attachment fails, the asyncResult.error property will contain an error code with the reason for the failure. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of + * type {@link Office.AsyncResult}. + * If removing the attachment fails, the asyncResult.error property will contain an error code with the reason for the failure. */ - saveAsync(callback: (result: AsyncResult) => void): void; + saveAsync(callback: (result: AsyncResult) => void): void; /** * Asynchronously inserts data into the body or subject of a message. * - * The setSelectedDataAsync method inserts the specified string at the cursor location in the subject or body of the item, or, if text is selected in the editor, it replaces the selected text. If the cursor is not in the body or subject field, an error is returned. After insertion, the cursor is placed at the end of the inserted content. + * The setSelectedDataAsync method inserts the specified string at the cursor location in the subject or body of the item, or, if text is + * selected in the editor, it replaces the selected text. If the cursor is not in the body or subject field, an error is returned. + * After insertion, the cursor is placed at the end of the inserted content. * * [Api set: Mailbox 1.2] * @@ -11156,19 +12088,29 @@ declare namespace Office { * * `setSelectedDataAsync(data: string, options: Office.AsyncContextOptions & CoercionTypeOptions): void;` * - * `setSelectedDataAsync(data: string, callback: (result: AsyncResult) => void): void;` + * `setSelectedDataAsync(data: string, callback: (result: AsyncResult) => void): void;` * - * @param data The data to be inserted. Data is not to exceed 1,000,000 characters. If more than 1,000,000 characters are passed in, an ArgumentOutOfRange exception is thrown. + * @param data The data to be inserted. Data is not to exceed 1,000,000 characters. + * If more than 1,000,000 characters are passed in, an ArgumentOutOfRange exception is thrown. * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. - * coercionType: If text, the current style is applied in Outlook Web App and Outlook. If the field is an HTML editor, only the text data is inserted, even if the data is HTML. If html and the field supports HTML (the subject doesn't), the current style is applied in Outlook Web App and the default style is applied in Outlook. If the field is a text field, an InvalidDataFormat error is returned. If coercionType is not set, the result depends on the field: if the field is HTML then HTML is used; if the field is text, then plain text is used. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. If removing the attachment fails, the asyncResult.error property will contain an error code with the reason for the failure. + * coercionType: If text, the current style is applied in Outlook Web App and Outlook. + * If the field is an HTML editor, only the text data is inserted, even if the data is HTML. + * If html and the field supports HTML (the subject doesn't), the current style is applied in Outlook Web App and the default style is + * applied in Outlook. + * If the field is a text field, an InvalidDataFormat error is returned. + * If coercionType is not set, the result depends on the field: if the field is HTML then HTML is used; + * if the field is text, then plain text is used. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of + * type {@link Office.AsyncResult}. */ - setSelectedDataAsync(data: string, options?: Office.AsyncContextOptions & CoercionTypeOptions, callback?: (result: AsyncResult) => void): void; + setSelectedDataAsync(data: string, options?: Office.AsyncContextOptions & CoercionTypeOptions, callback?: (result: AsyncResult) => void): void; /** * Asynchronously inserts data into the body or subject of a message. * - * The setSelectedDataAsync method inserts the specified string at the cursor location in the subject or body of the item, or, if text is selected in the editor, it replaces the selected text. If the cursor is not in the body or subject field, an error is returned. After insertion, the cursor is placed at the end of the inserted content. + * The setSelectedDataAsync method inserts the specified string at the cursor location in the subject or body of the item, or, if text is + * selected in the editor, it replaces the selected text. If the cursor is not in the body or subject field, an error is returned. + * After insertion, the cursor is placed at the end of the inserted content. * * [Api set: Mailbox 1.2] * @@ -11180,13 +12122,16 @@ declare namespace Office { * * ErrorsInvalidAttachmentId - The attachment identifier does not exist. * - * @param data The data to be inserted. Data is not to exceed 1,000,000 characters. If more than 1,000,000 characters are passed in, an ArgumentOutOfRange exception is thrown. + * @param data The data to be inserted. Data is not to exceed 1,000,000 characters. + * If more than 1,000,000 characters are passed in, an ArgumentOutOfRange exception is thrown. */ setSelectedDataAsync(data: string): void; /** * Asynchronously inserts data into the body or subject of a message. * - * The setSelectedDataAsync method inserts the specified string at the cursor location in the subject or body of the item, or, if text is selected in the editor, it replaces the selected text. If the cursor is not in the body or subject field, an error is returned. After insertion, the cursor is placed at the end of the inserted content. + * The setSelectedDataAsync method inserts the specified string at the cursor location in the subject or body of the item, or, if text is + * selected in the editor, it replaces the selected text. If the cursor is not in the body or subject field, an error is returned. + * After insertion, the cursor is placed at the end of the inserted content. * * [Api set: Mailbox 1.2] * @@ -11198,16 +12143,25 @@ declare namespace Office { * * ErrorsInvalidAttachmentId - The attachment identifier does not exist. * - * @param data The data to be inserted. Data is not to exceed 1,000,000 characters. If more than 1,000,000 characters are passed in, an ArgumentOutOfRange exception is thrown. + * @param data The data to be inserted. Data is not to exceed 1,000,000 characters. + * If more than 1,000,000 characters are passed in, an ArgumentOutOfRange exception is thrown. * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. - * coercionType: If text, the current style is applied in Outlook Web App and Outlook. If the field is an HTML editor, only the text data is inserted, even if the data is HTML. If html and the field supports HTML (the subject doesn't), the current style is applied in Outlook Web App and the default style is applied in Outlook. If the field is a text field, an InvalidDataFormat error is returned. If coercionType is not set, the result depends on the field: if the field is HTML then HTML is used; if the field is text, then plain text is used. + * coercionType: If text, the current style is applied in Outlook Web App and Outlook. + * If the field is an HTML editor, only the text data is inserted, even if the data is HTML. + * If html and the field supports HTML (the subject doesn't), the current style is applied in Outlook Web App and the default style is + * applied in Outlook. + * If the field is a text field, an InvalidDataFormat error is returned. + * If coercionType is not set, the result depends on the field: if the field is HTML then HTML is used; + * if the field is text, then plain text is used. */ setSelectedDataAsync(data: string, options: Office.AsyncContextOptions & CoercionTypeOptions): void; /** * Asynchronously inserts data into the body or subject of a message. * - * The setSelectedDataAsync method inserts the specified string at the cursor location in the subject or body of the item, or, if text is selected in the editor, it replaces the selected text. If the cursor is not in the body or subject field, an error is returned. After insertion, the cursor is placed at the end of the inserted content. + * The setSelectedDataAsync method inserts the specified string at the cursor location in the subject or body of the item, or, if text is + * selected in the editor, it replaces the selected text. If the cursor is not in the body or subject field, an error is returned. + * After insertion, the cursor is placed at the end of the inserted content. * * [Api set: Mailbox 1.2] * @@ -11219,15 +12173,18 @@ declare namespace Office { * * ErrorsInvalidAttachmentId - The attachment identifier does not exist. * - * @param data The data to be inserted. Data is not to exceed 1,000,000 characters. If more than 1,000,000 characters are passed in, an ArgumentOutOfRange exception is thrown. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. If removing the attachment fails, the asyncResult.error property will contain an error code with the reason for the failure. + * @param data The data to be inserted. Data is not to exceed 1,000,000 characters. + * If more than 1,000,000 characters are passed in, an ArgumentOutOfRange exception is thrown. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of + * type {@link Office.AsyncResult}. */ - setSelectedDataAsync(data: string, callback: (result: AsyncResult) => void): void; + setSelectedDataAsync(data: string, callback: (result: AsyncResult) => void): void; } /** * The read mode of {@link Office.Item | Office.context.mailbox.item}. * - * Important: This is an internal Outlook object, not directly exposed through existing interfaces. You should treat this as a mode of `Office.context.mailbox.item`. Refer to the Object Model pages for more information. + * Important: This is an internal Outlook object, not directly exposed through existing interfaces. + * You should treat this as a mode of `Office.context.mailbox.item`. Refer to the Object Model pages for more information. */ interface ItemRead extends Item { /** @@ -11240,7 +12197,9 @@ declare namespace Office { * * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Read * - * Note: Certain types of files are blocked by Outlook due to potential security issues and are therefore not returned. For more information, see {@link https://support.office.com/article/Blocked-attachments-in-Outlook-434752E1-02D3-4E90-9124-8B81E49A8519 | Blocked attachments in Outlook}. + * Note: Certain types of files are blocked by Outlook due to potential security issues and are therefore not returned. + * For more information, see + * {@link https://support.office.com/article/Blocked-attachments-in-Outlook-434752E1-02D3-4E90-9124-8B81E49A8519 | Blocked attachments in Outlook}. * */ attachments: Office.AttachmentDetails[]; @@ -11248,7 +12207,8 @@ declare namespace Office { * Gets the Exchange Web Services item class of the selected item. * * - * You can create custom message classes that extends a default message class, for example, a custom appointment message class IPM.Appointment.Contoso. + * You can create custom message classes that extends a default message class, for example, a custom appointment message class + * IPM.Appointment.Contoso. * * [Api set: Mailbox 1.0] * @@ -11258,7 +12218,8 @@ declare namespace Office { * * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Read * - * The itemClass property specifies the message class of the selected item. The following are the default message classes for the message or appointment item. + * The itemClass property specifies the message class of the selected item. The following are the default message classes for the message or + * appointment item. * * * @@ -11282,9 +12243,14 @@ declare namespace Office { /** * Gets the Exchange Web Services item identifier for the current item. * - * The itemId property is not available in compose mode. If an item identifier is required, the saveAsync method can be used to save the item to the store, which will return the item identifier in the AsyncResult.value parameter in the callback function. + * The itemId property is not available in compose mode. + * If an item identifier is required, the saveAsync method can be used to save the item to the store, which will return the item identifier + * in the AsyncResult.value parameter in the callback function. * - * Note: The identifier returned by the itemId property is the same as the Exchange Web Services item identifier. The itemId property is not identical to the Outlook Entry ID or the ID used by the Outlook REST API. Before making REST API calls using this value, it should be converted using Office.context.mailbox.convertToRestId. For more details, see Use the Outlook REST APIs from an Outlook add-in. + * Note: The identifier returned by the itemId property is the same as the Exchange Web Services item identifier. + * The itemId property is not identical to the Outlook Entry ID or the ID used by the Outlook REST API. + * Before making REST API calls using this value, it should be converted using Office.context.mailbox.convertToRestId. + * For more details, see {@link https://docs.microsoft.com/outlook/add-ins/use-rest-api#get-the-item-id | Use the Outlook REST APIs from an Outlook add-in}. * * [Api set: Mailbox 1.0] * @@ -11298,7 +12264,8 @@ declare namespace Office { /** * Gets the subject of an item, with all prefixes removed (including RE: and FWD:). * - * The normalizedSubject property gets the subject of the item, with any standard prefixes (such as RE: and FW:) that are added by email programs. To get the subject of the item with the prefixes intact, use the subject property. + * The normalizedSubject property gets the subject of the item, with any standard prefixes (such as RE: and FW:) that are added by + * email programs. To get the subject of the item with the prefixes intact, use the subject property. * * [Api set: Mailbox 1.0] * @@ -11326,13 +12293,16 @@ declare namespace Office { */ subject: string; /** - * Displays a reply form that includes the sender and all recipients of the selected message or the organizer and all attendees of the selected appointment. + * Displays a reply form that includes the sender and all recipients of the selected message or the organizer and all attendees of the + * selected appointment. * * In Outlook Web App, the reply form is displayed as a pop-out form in the 3-column view and a pop-up form in the 2- or 1-column view. * * If any of the string parameters exceed their limits, displayReplyAllForm throws an exception. * - * When attachments are specified in the formData.attachments parameter, Outlook and Outlook Web App attempt to download all attachments and attach them to the reply form. If any attachments fail to be added, an error is shown in the form UI. If this isn't possible, then no error message is thrown. + * When attachments are specified in the formData.attachments parameter, Outlook and Outlook Web App attempt to download all attachments and + * attach them to the reply form. If any attachments fail to be added, an error is shown in the form UI. + * If this isn't possible, then no error message is thrown. * * Note: This method is not supported in Outlook for iOS or Outlook for Android. * @@ -11355,7 +12325,9 @@ declare namespace Office { * * If any of the string parameters exceed their limits, displayReplyForm throws an exception. * - * When attachments are specified in the formData.attachments parameter, Outlook and Outlook Web App attempt to download all attachments and attach them to the reply form. If any attachments fail to be added, an error is shown in the form UI. If this isn't possible, then no error message is thrown. + * When attachments are specified in the formData.attachments parameter, Outlook and Outlook Web App attempt to download all attachments and + * attach them to the reply form. If any attachments fail to be added, an error is shown in the form UI. + * If this isn't possible, then no error message is thrown. * * Note: This method is not supported in Outlook for iOS or Outlook for Android. * @@ -11375,7 +12347,8 @@ declare namespace Office { /** * Gets initialization data passed when the add-in is {@link https://docs.microsoft.com/outlook/actionable-messages/invoke-add-in-from-actionable-message | activated by an actionable message}. * - * Note: This method is only supported by Outlook 2016 for Windows (Click-to-Run versions greater than 16.0.8413.1000) and Outlook on the web for Office 365. + * Note: This method is only supported by Outlook 2016 for Windows (Click-to-Run versions greater than 16.0.8413.1000) and Outlook on the web + * for Office 365. * * [Api set: Mailbox Preview] * @@ -11387,21 +12360,24 @@ declare namespace Office { * * In addition to this signature, the method also has the following signature: * - * `getInitializationContextAsync(callback?: (result: AsyncResult) => void): void;` + * `getInitializationContextAsync(callback?: (result: AsyncResult) => void): void;` * * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an AsyncResult object. - * On success, the initialization data is provided in the asyncResult.value property as a string. - * If there is no initialization context, the asyncResult object will contain an Error object with its code property set to 9020 and its name property set to GenericResponseError. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, + * asyncResult, which is an {@link Office.AsyncResult} object. + * On success, the initialization data is provided in the asyncResult.value property as a string. + * If there is no initialization context, the asyncResult object will contain an Error object with its code property + * set to 9020 and its name property set to GenericResponseError. * * @beta */ - getInitializationContextAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + getInitializationContextAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Gets initialization data passed when the add-in is {@link https://docs.microsoft.com/outlook/actionable-messages/invoke-add-in-from-actionable-message | activated by an actionable message}. * - * Note: This method is only supported by Outlook 2016 for Windows (Click-to-Run versions greater than 16.0.8413.1000) and Outlook on the web for Office 365. + * Note: This method is only supported by Outlook 2016 for Windows (Click-to-Run versions greater than 16.0.8413.1000) and Outlook on the web + * for Office 365. * * [Api set: Mailbox Preview] * @@ -11411,13 +12387,15 @@ declare namespace Office { * *
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Read
* - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an AsyncResult object. - * On success, the initialization data is provided in the asyncResult.value property as a string. - * If there is no initialization context, the asyncResult object will contain an Error object with its code property set to 9020 and its name property set to GenericResponseError. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, + * asyncResult, which is an {@link Office.AsyncResult} object. + * On success, the initialization data is provided in the asyncResult.value property as a string. + * If there is no initialization context, the asyncResult object will contain an Error object with its code property + * set to 9020 and its name property set to GenericResponseError. * * @beta */ - getInitializationContextAsync(callback?: (result: AsyncResult) => void): void; + getInitializationContextAsync(callback?: (result: AsyncResult) => void): void; /** * Gets the entities found in the selected item's body. * @@ -11442,14 +12420,17 @@ declare namespace Office { * @param entityType One of the EntityType enumeration values. * * @returns - * If the value passed in entityType is not a valid member of the EntityType enumeration, the method returns null. If no entities of the specified type are present in the item's body, the method returns an empty array. Otherwise, the type of the objects in the returned array depends on the type of entity requested in the entityType parameter. + * If the value passed in entityType is not a valid member of the EntityType enumeration, the method returns null. + * If no entities of the specified type are present in the item's body, the method returns an empty array. + * Otherwise, the type of the objects in the returned array depends on the type of entity requested in the entityType parameter. * * @remarks * * *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}Restricted
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Read
* - * While the minimum permission level to use this method is Restricted, some entity types require ReadItem to access, as specified in the following table. + * While the minimum permission level to use this method is Restricted, some entity types require ReadItem to access, as specified in the + * following table. * * * @@ -11498,7 +12479,8 @@ declare namespace Office { /** * Returns well-known entities in the selected item that pass the named filter defined in the manifest XML file. * - * The getFilteredEntitiesByName method returns the entities that match the regular expression defined in the ItemHasKnownEntity rule element in the manifest XML file with the specified FilterName element value. + * The getFilteredEntitiesByName method returns the entities that match the regular expression defined in the ItemHasKnownEntity rule element + * in the manifest XML file with the specified FilterName element value. * * Note: This method is not supported in Outlook for iOS or Outlook for Android. * @@ -11511,22 +12493,33 @@ declare namespace Office { *
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Read
* * @param name The name of the ItemHasKnownEntity rule element that defines the filter to match. - * @returns If there is no ItemHasKnownEntity element in the manifest with a FilterName element value that matches the name parameter, the method returns null. If the name parameter does match an ItemHasKnownEntity element in the manifest, but there are no entities in the current item that match, the method return an empty array. + * @returns If there is no ItemHasKnownEntity element in the manifest with a FilterName element value that matches the name parameter, + * the method returns null. + * If the name parameter does match an ItemHasKnownEntity element in the manifest, but there are no entities in the current item that match, + * the method return an empty array. */ getFilteredEntitiesByName(name: string): (string | Contact | MeetingSuggestion | PhoneNumber | TaskSuggestion)[]; /** * Returns string values in the selected item that match the regular expressions defined in the manifest XML file. * - * The getRegExMatches method returns the strings that match the regular expression defined in each ItemHasRegularExpressionMatch or ItemHasKnownEntity rule element in the manifest XML file. For an ItemHasRegularExpressionMatch rule, a matching string has to occur in the property of the item that is specified by that rule. The PropertyName simple type defines the supported properties. + * The getRegExMatches method returns the strings that match the regular expression defined in each ItemHasRegularExpressionMatch or + * ItemHasKnownEntity rule element in the manifest XML file. + * For an ItemHasRegularExpressionMatch rule, a matching string has to occur in the property of the item that is specified by that rule. + * The PropertyName simple type defines the supported properties. * - * If you specify an ItemHasRegularExpressionMatch rule on the body property of an item, the regular expression should further filter the body and should not attempt to return the entire body of the item. Using a regular expression such as .* to obtain the entire body of an item does not always return the expected results. Instead, use the Body.getAsync method to retrieve the entire body. + * If you specify an ItemHasRegularExpressionMatch rule on the body property of an item, the regular expression should further filter the body + * and should not attempt to return the entire body of the item. + * Using a regular expression such as .* to obtain the entire body of an item does not always return the expected results. + * Instead, use the Body.getAsync method to retrieve the entire body. * * Note: This method is not supported in Outlook for iOS or Outlook for Android. * * [Api set: Mailbox 1.0] * * @returns - * An object that contains arrays of strings that match the regular expressions defined in the manifest XML file. The name of each array is equal to the corresponding value of the RegExName attribute of the matching ItemHasRegularExpressionMatch rule or the FilterName attribute of the matching ItemHasKnownEntity rule. + * An object that contains arrays of strings that match the regular expressions defined in the manifest XML file. + * The name of each array is equal to the corresponding value of the RegExName attribute of the matching ItemHasRegularExpressionMatch rule + * or the FilterName attribute of the matching ItemHasKnownEntity rule. * * @remarks * @@ -11538,9 +12531,12 @@ declare namespace Office { /** * Returns string values in the selected item that match the named regular expression defined in the manifest XML file. * - * The getRegExMatchesByName method returns the strings that match the regular expression defined in the ItemHasRegularExpressionMatch rule element in the manifest XML file with the specified RegExName element value. + * The getRegExMatchesByName method returns the strings that match the regular expression defined in the ItemHasRegularExpressionMatch rule + * element in the manifest XML file with the specified RegExName element value. * - * If you specify an ItemHasRegularExpressionMatch rule on the body property of an item, the regular expression should further filter the body and should not attempt to return the entire body of the item. Using a regular expression such as .* to obtain the entire body of an item does not always return the expected results. + * If you specify an ItemHasRegularExpressionMatch rule on the body property of an item, the regular expression should further filter the body + * and should not attempt to return the entire body of the item. + * Using a regular expression such as .* to obtain the entire body of an item does not always return the expected results. * * Note: This method is not supported in Outlook for iOS or Outlook for Android. * @@ -11575,18 +12571,25 @@ declare namespace Office { */ getSelectedEntities(): Entities; /** - * Returns string values in a highlighted match that match the regular expressions defined in the manifest XML file. Highlighted matches apply to contextual add-ins. + * Returns string values in a highlighted match that match the regular expressions defined in the manifest XML file. + * Highlighted matches apply to contextual add-ins. * - * The getSelectedRegExMatches method returns the strings that match the regular expression defined in each ItemHasRegularExpressionMatch or ItemHasKnownEntity rule element in the manifest XML file. For an ItemHasRegularExpressionMatch rule, a matching string has to occur in the property of the item that is specified by that rule. The PropertyName simple type defines the supported properties. + * The getSelectedRegExMatches method returns the strings that match the regular expression defined in each ItemHasRegularExpressionMatch or + * ItemHasKnownEntity rule element in the manifest XML file. For an ItemHasRegularExpressionMatch rule, a matching string has to occur in the property of the item that is specified by that rule. The PropertyName simple type defines the supported properties. * - * If you specify an ItemHasRegularExpressionMatch rule on the body property of an item, the regular expression should further filter the body and should not attempt to return the entire body of the item. Using a regular expression such as .* to obtain the entire body of an item does not always return the expected results. Instead, use the Body.getAsync method to retrieve the entire body. + * If you specify an ItemHasRegularExpressionMatch rule on the body property of an item, the regular expression should further filter the body + * and should not attempt to return the entire body of the item. + * Using a regular expression such as .* to obtain the entire body of an item does not always return the expected results. + * Instead, use the Body.getAsync method to retrieve the entire body. * * Note: This method is not supported in Outlook for iOS or Outlook for Android. * * [Api set: Mailbox 1.6] * * @returns - * An object that contains arrays of strings that match the regular expressions defined in the manifest XML file. The name of each array is equal to the corresponding value of the RegExName attribute of the matching ItemHasRegularExpressionMatch rule or the FilterName attribute of the matching ItemHasKnownEntity rule. + * An object that contains arrays of strings that match the regular expressions defined in the manifest XML file. + * The name of each array is equal to the corresponding value of the RegExName attribute of the matching ItemHasRegularExpressionMatch rule + * or the FilterName attribute of the matching ItemHasKnownEntity rule. * * @remarks * @@ -11599,15 +12602,19 @@ declare namespace Office { /** * A subclass of {@link Office.Item} for messages. * - * Important: This is an internal Outlook object, not directly exposed through existing interfaces. You should treat this as a mode of `Office.context.mailbox.item`. Refer to the Object Model pages for more information. + * Important: This is an internal Outlook object, not directly exposed through existing interfaces. + * You should treat this as a mode of `Office.context.mailbox.item`. Refer to the Object Model pages for more information. */ interface Message extends Item { /** * Gets an identifier for the email conversation that contains a particular message. * - * You can get an integer for this property if your mail app is activated in read forms or responses in compose forms. If subsequently the user changes the subject of the reply message, upon sending the reply, the conversation ID for that message will change and that value you obtained earlier will no longer apply. + * You can get an integer for this property if your mail app is activated in read forms or responses in compose forms. + * If subsequently the user changes the subject of the reply message, upon sending the reply, the conversation ID for that message will + * change and that value you obtained earlier will no longer apply. * - * You get null for this property for a new item in a compose form. If the user sets a subject and saves the item, the conversationId property will return a value. + * You get null for this property for a new item in a compose form. + * If the user sets a subject and saves the item, the conversationId property will return a value. * * [Api set: Mailbox 1.0] * @@ -11623,7 +12630,8 @@ declare namespace Office { /** * The message compose mode of {@link Office.Item | Office.context.mailbox.item}. * - * Important: This is an internal Outlook object, not directly exposed through existing interfaces. You should treat this as a mode of `Office.context.mailbox.item`. Refer to the Object Model pages for more information. + * Important: This is an internal Outlook object, not directly exposed through existing interfaces. + * You should treat this as a mode of `Office.context.mailbox.item`. Refer to the Object Model pages for more information. */ interface MessageCompose extends Message, ItemCompose { /** @@ -11651,9 +12659,11 @@ declare namespace Office { */ body: Office.Body; /** - * Provides access to the Cc (carbon copy) recipients of a message. The type of object and level of access depends on the mode of the current item. + * Provides access to the Cc (carbon copy) recipients of a message. The type of object and level of access depends on the mode of the + * current item. * - * The cc property returns a {@link Office.Recipients} object that provides methods to get or update the recipients on the Cc line of the message. + * The cc property returns a {@link Office.Recipients} object that provides methods to get or update the recipients on the Cc line of + * the message. * * [Api set: Mailbox 1.0] * @@ -11667,9 +12677,12 @@ declare namespace Office { /** * Gets an identifier for the email conversation that contains a particular message. * - * You can get an integer for this property if your mail app is activated in read forms or responses in compose forms. If subsequently the user changes the subject of the reply message, upon sending the reply, the conversation ID for that message will change and that value you obtained earlier will no longer apply. + * You can get an integer for this property if your mail app is activated in read forms or responses in compose forms. + * If subsequently the user changes the subject of the reply message, upon sending the reply, the conversation ID for that message will change + * and that value you obtained earlier will no longer apply. * - * You get null for this property for a new item in a compose form. If the user sets a subject and saves the item, the conversationId property will return a value. + * You get null for this property for a new item in a compose form. + * If the user sets a subject and saves the item, the conversationId property will return a value. * * [Api set: Mailbox 1.0] * @@ -11709,7 +12722,8 @@ declare namespace Office { /** * Gets the email address of the sender of a message. * - * The from and sender properties represent the same person unless the message is sent by a delegate. In that case, the from property represents the delegator, and the sender property represents the delegate. + * The from and sender properties represent the same person unless the message is sent by a delegate. + * In that case, the from property represents the delegator, and the sender property represents the delegate. * * The from property returns a From object that provides a method to get the from value. * @@ -11727,7 +12741,8 @@ declare namespace Office { /** * Gets the type of item that an instance represents. * - * The itemType property returns one of the ItemType enumeration values, indicating whether the item object instance is a message or an appointment. + * The itemType property returns one of the ItemType enumeration values, indicating whether the item object instance is a message or + * an appointment. * * [Api set: Mailbox 1.0] * @@ -11751,13 +12766,17 @@ declare namespace Office { */ notificationMessages: Office.NotificationMessages; /** - * Gets or sets the recurrence pattern of an appointment. Gets the recurrence pattern of a meeting request. Read and compose modes for appointment items. Read mode for meeting request items. + * Gets or sets the recurrence pattern of an appointment. Gets the recurrence pattern of a meeting request. + * Read and compose modes for appointment items. Read mode for meeting request items. * - * The recurrence property returns a recurrence object for recurring appointments or meetings requests if an item is a series or an instance in a series. null is returned for single appointments and meeting requests of single appointments. undefined is returned for messages that are not meeting requests. + * The recurrence property returns a recurrence object for recurring appointments or meetings requests if an item is a series or an instance + * in a series. `null` is returned for single appointments and meeting requests of single appointments. + * `undefined` is returned for messages that are not meeting requests. * * Note: Meeting requests have an itemClass value of IPM.Schedule.Meeting.Request. * - * Note: If the recurrence object is null, this indicates that the object is a single appointment or a meeting request of a single appointment and NOT a part of a series. + * Note: If the recurrence object is null, this indicates that the object is a single appointment or a meeting request of a single appointment + * and NOT a part of a series. * * [Api set: Mailbox Preview] * @@ -11773,11 +12792,16 @@ declare namespace Office { /** * Gets the id of the series that an instance belongs to. * - * In OWA and Outlook, the seriesId returns the Exchange Web Services (EWS) ID of the parent (series) item that this item belongs to. However, in iOS and Android, the seriesId returns the REST ID of the parent item. + * In OWA and Outlook, the seriesId returns the Exchange Web Services (EWS) ID of the parent (series) item that this item belongs to. + * However, in iOS and Android, the seriesId returns the REST ID of the parent item. * - * Note: The identifier returned by the seriesId property is the same as the Exchange Web Services item identifier. The seriesId property is not identical to the Outlook IDs used by the Outlook REST API. Before making REST API calls using this value, it should be converted using Office.context.mailbox.convertToRestId. For more details, see {@link https://docs.microsoft.com/outlook/add-ins/use-rest-api | Use the Outlook REST APIs from an Outlook add-in}. + * Note: The identifier returned by the seriesId property is the same as the Exchange Web Services item identifier. + * The seriesId property is not identical to the Outlook IDs used by the Outlook REST API. + * Before making REST API calls using this value, it should be converted using Office.context.mailbox.convertToRestId. + * For more details, see {@link https://docs.microsoft.com/outlook/add-ins/use-rest-api | Use the Outlook REST APIs from an Outlook add-in}. * - * The seriesId property returns null for items that do not have parent items such as single appointments, series items, or meeting requests and returns undefined for any other items that are not meeting requests. + * The seriesId property returns null for items that do not have parent items such as single appointments, series items, or meeting requests + * and returns undefined for any other items that are not meeting requests. * * [Api set: Mailbox Preview] * @@ -11807,7 +12831,8 @@ declare namespace Office { */ subject: Subject; /** - * Provides access to the recipients on the To line of a message. The type of object and level of access depends on the mode of the current item. + * Provides access to the recipients on the To line of a message. The type of object and level of access depends on the mode of the + * current item. * * The to property returns a Recipients object that provides methods to get or update the recipients on the To line of the message. * @@ -11843,16 +12868,20 @@ declare namespace Office { * * `addFileAttachmentAsync(uri: string, attachmentName: string, options: AsyncContextOptions): void;` * - * `addFileAttachmentAsync(uri: string, attachmentName: string, callback: (result: AsyncResult) => void): void;` + * `addFileAttachmentAsync(uri: string, attachmentName: string, callback: (result: AsyncResult) => void): void;` * * @param uri The URI that provides the location of the file to attach to the message or appointment. The maximum length is 2048 characters. * @param attachmentName The name of the attachment that is shown while the attachment is uploading. The maximum length is 255 characters. * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. - * isInline: If true, indicates that the attachment will be shown inline in the message body and should not be displayed in the attachment list. - * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type asyncResult. On success, the attachment identifier will be provided in the asyncResult.value property. If uploading the attachment fails, the asyncResult object will contain an Error object that provides a description of the error. + * isInline: If true, indicates that the attachment will be shown inline in the message body, and should not be displayed in the + * attachment list. + * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of + * type {@link Office.asyncResult}. On success, the attachment identifier will be provided in the asyncResult.value property. + * If uploading the attachment fails, the asyncResult object will contain an Error object that provides a description of + * the error. */ - addFileAttachmentAsync(uri: string, attachmentName: string, options?: AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + addFileAttachmentAsync(uri: string, attachmentName: string, options?: AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Adds a file to a message or appointment as an attachment. * @@ -11914,9 +12943,12 @@ declare namespace Office { * * @param uri The URI that provides the location of the file to attach to the message or appointment. The maximum length is 2048 characters. * @param attachmentName The name of the attachment that is shown while the attachment is uploading. The maximum length is 255 characters. - * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type asyncResult. On success, the attachment identifier will be provided in the asyncResult.value property. If uploading the attachment fails, the asyncResult object will contain an Error object that provides a description of the error. + * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of + * type {@link Office.AsyncResult}. On success, the attachment identifier will be provided in the asyncResult.value property. + * If uploading the attachment fails, the asyncResult object will contain an Error object that provides a description of + * the error. */ - addFileAttachmentAsync(uri: string, attachmentName: string, callback: (result: AsyncResult) => void): void; + addFileAttachmentAsync(uri: string, attachmentName: string, callback: (result: AsyncResult) => void): void; /** * Adds a file to a message or appointment as an attachment. * @@ -11938,9 +12970,11 @@ declare namespace Office { * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. * isInline: If true, indicates that the attachment will be shown inline in the message body and should not be displayed in the attachment list. - * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type asyncResult. On success, the attachment identifier will be provided in the asyncResult.value property. If uploading the attachment fails, the asyncResult object will contain an Error object that provides a description of the error. + * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type asyncResult. + * On success, the attachment identifier will be provided in the asyncResult.value property. + * If uploading the attachment fails, the asyncResult object will contain an Error object that provides a description of the error. */ - addFileAttachmentFromBase64Async(base64File: string, attachmentName: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + addFileAttachmentFromBase64Async(base64File: string, attachmentName: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Adds an event handler for a supported event. * @@ -11956,21 +12990,24 @@ declare namespace Office { * * In addition to this signature, the method also has the following signature: * - * `addHandlerAsync(eventType:EventType, handler: any, callback?: (result: AsyncResult) => void): void;` + * `addHandlerAsync(eventType:EventType, handler: any, callback?: (result: AsyncResult) => void): void;` * * @param eventType The event that should invoke the handler. - * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. The type property on the parameter will match the eventType parameter passed to addHandlerAsync. + * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. + * The type property on the parameter will match the eventType parameter passed to addHandlerAsync. * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an AsyncResult object. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, + * asyncResult, which is an {@link Office.AsyncResult} object. * * @beta */ - addHandlerAsync(eventType:EventType, handler: any, options?: any, callback?: (result: AsyncResult) => void): void; + addHandlerAsync(eventType:EventType, handler: any, options?: any, callback?: (result: AsyncResult) => void): void; /** * Adds an event handler for a supported event. * - * Currently the supported event types are `Office.EventType.AppointmentTimeChanged`, `Office.EventType.RecipientsChanged`, and `Office.EventType.RecurrencePatternChanged`. + * Currently the supported event types are `Office.EventType.AppointmentTimeChanged`, `Office.EventType.RecipientsChanged`, and + * `Office.EventType.RecurrencePatternChanged`. * * [Api set: Mailbox Preview] * @@ -11981,20 +13018,26 @@ declare namespace Office { * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose * * @param eventType The event that should invoke the handler. - * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. The type property on the parameter will match the eventType parameter passed to addHandlerAsync. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an AsyncResult object. + * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. + * The type property on the parameter will match the eventType parameter passed to addHandlerAsync. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, + * asyncResult, which is an {@link Office.AsyncResult} object. * * @beta */ - addHandlerAsync(eventType:EventType, handler: any, callback?: (result: AsyncResult) => void): void; + addHandlerAsync(eventType:EventType, handler: any, callback?: (result: AsyncResult) => void): void; /** * Adds an Exchange item, such as a message, as an attachment to the message or appointment. * - * The addItemAttachmentAsync method attaches the item with the specified Exchange identifier to the item in the compose form. If you specify a callback method, the method is called with one parameter, asyncResult, which contains either the attachment identifier or a code that indicates any error that occurred while attaching the item. You can use the options parameter to pass state information to the callback method, if needed. + * The addItemAttachmentAsync method attaches the item with the specified Exchange identifier to the item in the compose form. + * If you specify a callback method, the method is called with one parameter, asyncResult, which contains either the attachment identifier or + * a code that indicates any error that occurred while attaching the item. You can use the options parameter to pass state information to the + * callback method, if needed. * * You can subsequently use the identifier with the removeAttachmentAsync method to remove the attachment in the same session. * - * If your Office add-in is running in Outlook Web App, the addItemAttachmentAsync method can attach items to items other than the item that you are editing; however, this is not supported and is not recommended. + * If your Office add-in is running in Outlook Web App, the addItemAttachmentAsync method can attach items to items other than the item that + * you are editing; however, this is not supported and is not recommended. * * [Api set: Mailbox 1.1] * @@ -12011,23 +13054,30 @@ declare namespace Office { * * `addItemAttachmentAsync(itemId: any, attachmentName: string, options: Office.AsyncContextOptions): void;` * - * `addItemAttachmentAsync(itemId: any, attachmentName: string, callback: (result: AsyncResult) => void): void;` + * `addItemAttachmentAsync(itemId: any, attachmentName: string, callback: (result: AsyncResult) => void): void;` * * @param itemId The Exchange identifier of the item to attach. The maximum length is 100 characters. * @param attachmentName The name of the attachment that is shown while the attachment is uploading. The maximum length is 255 characters. * @param options An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. - * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. On success, the attachment identifier will be provided in the asyncResult.value property. If adding the attachment fails, the asyncResult object will contain an Error object that provides a description of the error. + * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of + * type AsyncResult. On success, the attachment identifier will be provided in the asyncResult.value property. + * If adding the attachment fails, the asyncResult object will contain an Error object that provides a description of + * the error. */ - addItemAttachmentAsync(itemId: any, attachmentName: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + addItemAttachmentAsync(itemId: any, attachmentName: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Adds an Exchange item, such as a message, as an attachment to the message or appointment. * - * The addItemAttachmentAsync method attaches the item with the specified Exchange identifier to the item in the compose form. If you specify a callback method, the method is called with one parameter, asyncResult, which contains either the attachment identifier or a code that indicates any error that occurred while attaching the item. You can use the options parameter to pass state information to the callback method, if needed. + * The addItemAttachmentAsync method attaches the item with the specified Exchange identifier to the item in the compose form. + * If you specify a callback method, the method is called with one parameter, asyncResult, which contains either the attachment identifier or + * a code that indicates any error that occurred while attaching the item. + * You can use the options parameter to pass state information to the callback method, if needed. * * You can subsequently use the identifier with the removeAttachmentAsync method to remove the attachment in the same session. * - * If your Office add-in is running in Outlook Web App, the addItemAttachmentAsync method can attach items to items other than the item that you are editing; however, this is not supported and is not recommended. + * If your Office add-in is running in Outlook Web App, the addItemAttachmentAsync method can attach items to items other than the item that + * you are editing; however, this is not supported and is not recommended. * * [Api set: Mailbox 1.1] * @@ -12045,11 +13095,15 @@ declare namespace Office { /** * Adds an Exchange item, such as a message, as an attachment to the message or appointment. * - * The addItemAttachmentAsync method attaches the item with the specified Exchange identifier to the item in the compose form. If you specify a callback method, the method is called with one parameter, asyncResult, which contains either the attachment identifier or a code that indicates any error that occurred while attaching the item. You can use the options parameter to pass state information to the callback method, if needed. + * The addItemAttachmentAsync method attaches the item with the specified Exchange identifier to the item in the compose form. + * If you specify a callback method, the method is called with one parameter, asyncResult, which contains either the attachment identifier or + * a code that indicates any error that occurred while attaching the item. + * You can use the options parameter to pass state information to the callback method, if needed. * * You can subsequently use the identifier with the removeAttachmentAsync method to remove the attachment in the same session. * - * If your Office add-in is running in Outlook Web App, the addItemAttachmentAsync method can attach items to items other than the item that you are editing; however, this is not supported and is not recommended. + * If your Office add-in is running in Outlook Web App, the addItemAttachmentAsync method can attach items to items other than the item that + * you are editing; however, this is not supported and is not recommended. * * [Api set: Mailbox 1.1] * @@ -12069,11 +13123,15 @@ declare namespace Office { /** * Adds an Exchange item, such as a message, as an attachment to the message or appointment. * - * The addItemAttachmentAsync method attaches the item with the specified Exchange identifier to the item in the compose form. If you specify a callback method, the method is called with one parameter, asyncResult, which contains either the attachment identifier or a code that indicates any error that occurred while attaching the item. You can use the options parameter to pass state information to the callback method, if needed. + * The addItemAttachmentAsync method attaches the item with the specified Exchange identifier to the item in the compose form. + * If you specify a callback method, the method is called with one parameter, asyncResult, which contains either the attachment identifier or + * a code that indicates any error that occurred while attaching the item. + * You can use the options parameter to pass state information to the callback method, if needed. * * You can subsequently use the identifier with the removeAttachmentAsync method to remove the attachment in the same session. * - * If your Office add-in is running in Outlook Web App, the addItemAttachmentAsync method can attach items to items other than the item that you are editing; however, this is not supported and is not recommended. + * If your Office add-in is running in Outlook Web App, the addItemAttachmentAsync method can attach items to items other than the item that + * you are editing; however, this is not supported and is not recommended. * * [Api set: Mailbox 1.1] * @@ -12086,17 +13144,22 @@ declare namespace Office { * * @param itemId The Exchange identifier of the item to attach. The maximum length is 100 characters. * @param attachmentName The name of the attachment that is shown while the attachment is uploading. The maximum length is 255 characters. - * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. On success, the attachment identifier will be provided in the asyncResult.value property. If adding the attachment fails, the asyncResult object will contain an Error object that provides a description of the error. + * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of + * type {@link Office.AsyncResult}. On success, the attachment identifier will be provided in the asyncResult.value property. + * If adding the attachment fails, the asyncResult object will contain an Error object that provides a description of + * the error. */ - addItemAttachmentAsync(itemId: any, attachmentName: string, callback: (result: AsyncResult) => void): void; + addItemAttachmentAsync(itemId: any, attachmentName: string, callback: (result: AsyncResult) => void): void; /** * Closes the current item that is being composed * - * The behaviors of the close method depends on the current state of the item being composed. If the item has unsaved changes, the client prompts the user to save, discard, or close the action. + * The behaviors of the close method depends on the current state of the item being composed. + * If the item has unsaved changes, the client prompts the user to save, discard, or close the action. * * In the Outlook desktop client, if the message is an inline reply, the close method has no effect. * - * Note: In Outlook on the web, if the item is an appointment and it has previously been saved using saveAsync, the user is prompted to save, discard, or cancel even if no changes have occurred since the item was last saved. + * Note: In Outlook on the web, if the item is an appointment and it has previously been saved using saveAsync, the user is prompted to save, + * discard, or cancel even if no changes have occurred since the item was last saved. * * [Api set: Mailbox 1.3] * @@ -12110,7 +13173,8 @@ declare namespace Office { /** * Gets initialization data passed when the add-in is activated by an actionable message. * - * Note: This method is only supported by Outlook 2016 for Windows (Click-to-Run versions greater than 16.0.8413.1000) and Outlook on the web for Office 365. + * Note: This method is only supported by Outlook 2016 for Windows (Click-to-Run versions greater than 16.0.8413.1000) and Outlook on the web + * for Office 365. * * [Api set: Mailbox Preview] * @@ -12124,19 +13188,23 @@ declare namespace Office { * * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. - * On success, the initialization data is provided in the asyncResult.value property as a string. - * If there is no initialization context, the asyncResult object will contain an Error object with its code property set to 9020 and its name property set to GenericResponseError. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of + * type {@link Office.AsyncResult}. + * On success, the initialization data is provided in the asyncResult.value property as a string. + * If there is no initialization context, the asyncResult object will contain an Error object with its code property + * set to 9020 and its name property set to GenericResponseError. * * @beta */ - getInitializationContextAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + getInitializationContextAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Asynchronously returns selected data from the subject or body of a message. * - * If there is no selection but the cursor is in the body or subject, the method returns null for the selected data. If a field other than the body or subject is selected, the method returns the InvalidSelection error. + * If there is no selection but the cursor is in the body or subject, the method returns null for the selected data. + * If a field other than the body or subject is selected, the method returns the InvalidSelection error. * - * To access the selected data from the callback method, call asyncResult.value.data. To access the source property that the selection comes from, call asyncResult.value.sourceProperty, which will be either body or subject. + * To access the selected data from the callback method, call asyncResult.value.data. + * To access the source property that the selection comes from, call asyncResult.value.sourceProperty, which will be either body or subject. * * [Api set: Mailbox 1.2] * @@ -12149,16 +13217,20 @@ declare namespace Office { * * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose * - * @param coercionType Requests a format for the data. If Text, the method returns the plain text as a string , removing any HTML tags present. If HTML, the method returns the selected text, whether it is plaintext or HTML. - * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. + * @param coercionType Requests a format for the data. If Text, the method returns the plain text as a string, removing any HTML tags present. + * If HTML, the method returns the selected text, whether it is plaintext or HTML. + * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of + * type {@link Office.AsyncResult}. */ - getSelectedDataAsync(coerciontype: Office.CoercionType, callback: (result: AsyncResult) => void): void; + getSelectedDataAsync(coerciontype: Office.CoercionType, callback: (result: AsyncResult) => void): void; /** * Asynchronously returns selected data from the subject or body of a message. * - * If there is no selection but the cursor is in the body or subject, the method returns null for the selected data. If a field other than the body or subject is selected, the method returns the InvalidSelection error. + * If there is no selection but the cursor is in the body or subject, the method returns null for the selected data. + * If a field other than the body or subject is selected, the method returns the InvalidSelection error. * - * To access the selected data from the callback method, call asyncResult.value.data. To access the source property that the selection comes from, call asyncResult.value.sourceProperty, which will be either body or subject. + * To access the selected data from the callback method, call asyncResult.value.data. + * To access the source property that the selection comes from, call asyncResult.value.sourceProperty, which will be either body or subject. * * [Api set: Mailbox 1.2] * @@ -12171,18 +13243,24 @@ declare namespace Office { * * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose * - * @param coercionType Requests a format for the data. If Text, the method returns the plain text as a string , removing any HTML tags present. If HTML, the method returns the selected text, whether it is plaintext or HTML. + * @param coercionType Requests a format for the data. If Text, the method returns the plain text as a string, removing any HTML tags present. + * If HTML, the method returns the selected text, whether it is plaintext or HTML. * @param options An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. - * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. + * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of + * type {@link Office.AsyncResult}. */ - getSelectedDataAsync(coerciontype: Office.CoercionType, options: Office.AsyncContextOptions, callback: (result: AsyncResult) => void): void; + getSelectedDataAsync(coerciontype: Office.CoercionType, options: Office.AsyncContextOptions, callback: (result: AsyncResult) => void): void; /** * Asynchronously loads custom properties for this add-in on the selected item. * - * Custom properties are stored as key/value pairs on a per-app, per-item basis. This method returns a CustomProperties object in the callback, which provides methods to access the custom properties specific to the current item and the current add-in. Custom properties are not encrypted on the item, so this should not be used as secure storage. + * Custom properties are stored as key/value pairs on a per-app, per-item basis. + * This method returns a CustomProperties object in the callback, which provides methods to access the custom properties specific to the + * current item and the current add-in. Custom properties are not encrypted on the item, so this should not be used as secure storage. * - * The custom properties are provided as a CustomProperties object in the asyncResult.value property. This object can be used to get, set, and remove custom properties from the item and save changes to the custom property set back to the server. + * The custom properties are provided as a CustomProperties object in the asyncResult.value property. + * This object can be used to get, set, and remove custom properties from the item and save changes to the custom property set back to + * the server. * * [Api set: Mailbox 1.0] * @@ -12192,14 +13270,20 @@ declare namespace Office { * * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose * - * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. - * @param userContext Optional. Developers can provide any object they wish to access in the callback function. This object can be accessed by the asyncResult.asyncContext property in the callback function. + * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of + * type {@link Office.AsyncResult}. + * @param userContext Optional. Developers can provide any object they wish to access in the callback function. + * This object can be accessed by the asyncResult.asyncContext property in the callback function. */ - loadCustomPropertiesAsync(callback: (result: AsyncResult) => void, userContext?: any): void; + loadCustomPropertiesAsync(callback: (result: AsyncResult) => void, userContext?: any): void; /** * Removes an attachment from a message or appointment. * - * The removeAttachmentAsync method removes the attachment with the specified identifier from the item. As a best practice, you should use the attachment identifier to remove an attachment only if the same mail app has added that attachment in the same session. In Outlook Web App and OWA for Devices, the attachment identifier is valid only within the same session. A session is over when the user closes the app, or if the user starts composing in an inline form and subsequently pops out the inline form to continue in a separate window. + * The removeAttachmentAsync method removes the attachment with the specified identifier from the item. + * As a best practice, you should use the attachment identifier to remove an attachment only if the same mail app has added that attachment + * in the same session. In Outlook Web App and OWA for Devices, the attachment identifier is valid only within the same session. + * A session is over when the user closes the app, or if the user starts composing in an inline form and subsequently pops out the inline form + * to continue in a separate window. * * [Api set: Mailbox 1.1] * @@ -12217,18 +13301,24 @@ declare namespace Office { * * `removeAttachmentAsync(attachmentIndex: string, options: Office.AsyncContextOptions): void;` * - * `removeAttachmentAsync(attachmentIndex: string, callback: (result: AsyncResult) => void): void;` + * `removeAttachmentAsync(attachmentIndex: string, callback: (result: AsyncResult) => void): void;` * * @param attachmentIndex The identifier of the attachment to remove. The maximum length of the string is 100 characters. * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. If removing the attachment fails, the asyncResult.error property will contain an error code with the reason for the failure. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of + * type {@link Office.AsyncResult}. + * If removing the attachment fails, the asyncResult.error property will contain an error code with the reason for the failure. */ - removeAttachmentAsync(attachmentIndex: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + removeAttachmentAsync(attachmentIndex: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Removes an attachment from a message or appointment. * - * The removeAttachmentAsync method removes the attachment with the specified identifier from the item. As a best practice, you should use the attachment identifier to remove an attachment only if the same mail app has added that attachment in the same session. In Outlook Web App and OWA for Devices, the attachment identifier is valid only within the same session. A session is over when the user closes the app, or if the user starts composing in an inline form and subsequently pops out the inline form to continue in a separate window. + * The removeAttachmentAsync method removes the attachment with the specified identifier from the item. + * As a best practice, you should use the attachment identifier to remove an attachment only if the same mail app has added that attachment + * in the same session. In Outlook Web App and OWA for Devices, the attachment identifier is valid only within the same session. + * A session is over when the user closes the app, or if the user starts composing in an inline form and subsequently pops out the inline form + * to continue in a separate window. * * [Api set: Mailbox 1.1] * @@ -12246,7 +13336,11 @@ declare namespace Office { /** * Removes an attachment from a message or appointment. * - * The removeAttachmentAsync method removes the attachment with the specified identifier from the item. As a best practice, you should use the attachment identifier to remove an attachment only if the same mail app has added that attachment in the same session. In Outlook Web App and OWA for Devices, the attachment identifier is valid only within the same session. A session is over when the user closes the app, or if the user starts composing in an inline form and subsequently pops out the inline form to continue in a separate window. + * The removeAttachmentAsync method removes the attachment with the specified identifier from the item. + * As a best practice, you should use the attachment identifier to remove an attachment only if the same mail app has added that attachment + * in the same session. In Outlook Web App and OWA for Devices, the attachment identifier is valid only within the same session. + * A session is over when the user closes the app, or if the user starts composing in an inline form and subsequently pops out the inline form + * to continue in a separate window. * * [Api set: Mailbox 1.1] * @@ -12266,7 +13360,11 @@ declare namespace Office { /** * Removes an attachment from a message or appointment. * - * The removeAttachmentAsync method removes the attachment with the specified identifier from the item. As a best practice, you should use the attachment identifier to remove an attachment only if the same mail app has added that attachment in the same session. In Outlook Web App and OWA for Devices, the attachment identifier is valid only within the same session. A session is over when the user closes the app, or if the user starts composing in an inline form and subsequently pops out the inline form to continue in a separate window. + * The removeAttachmentAsync method removes the attachment with the specified identifier from the item. + * As a best practice, you should use the attachment identifier to remove an attachment only if the same mail app has added that attachment + * in the same session. In Outlook Web App and OWA for Devices, the attachment identifier is valid only within the same session. + * A session is over when the user closes the app, or if the user starts composing in an inline form and subsequently pops out the inline form + * to continue in a separate window. * * [Api set: Mailbox 1.1] * @@ -12279,13 +13377,16 @@ declare namespace Office { * ErrorsInvalidAttachmentId - The attachment identifier does not exist. * * @param attachmentIndex The identifier of the attachment to remove. The maximum length of the string is 100 characters. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. If removing the attachment fails, the asyncResult.error property will contain an error code with the reason for the failure. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of + * type {@link Office.AsyncResult}. + * If removing the attachment fails, the asyncResult.error property will contain an error code with the reason for the failure. */ - removeAttachmentAsync(attachmentIndex: string, callback: (result: AsyncResult) => void): void; + removeAttachmentAsync(attachmentIndex: string, callback: (result: AsyncResult) => void): void; /** * Removes an event handler for a supported event. * - * Currently the supported event types are `Office.EventType.AppointmentTimeChanged`, `Office.EventType.RecipientsChanged`, and `Office.EventType.RecurrencePatternChanged`. + * Currently the supported event types are `Office.EventType.AppointmentTimeChanged`, `Office.EventType.RecipientsChanged`, and + * `Office.EventType.RecurrencePatternChanged`. * * [Api set: Mailbox Preview] * @@ -12297,21 +13398,24 @@ declare namespace Office { * * In addition to this signature, the method also has the following signature: * - * `removeHandlerAsync(eventType:EventType, handler: any, callback?: (result: AsyncResult) => void): void;` + * `removeHandlerAsync(eventType:EventType, handler: any, callback?: (result: AsyncResult) => void): void;` * * @param eventType The event that should invoke the handler. - * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. The type property on the parameter will match the eventType parameter passed to removeHandlerAsync. + * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. + * The type property on the parameter will match the eventType parameter passed to removeHandlerAsync. * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an AsyncResult object. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, + * asyncResult, which is an {@link Office.AsyncResult} object. * * @beta */ - removeHandlerAsync(eventType:EventType, handler: any, options?: any, callback?: (result: AsyncResult) => void): void; + removeHandlerAsync(eventType:EventType, handler: any, options?: any, callback?: (result: AsyncResult) => void): void; /** * Removes an event handler for a supported event. * - * Currently the supported event types are `Office.EventType.AppointmentTimeChanged`, `Office.EventType.RecipientsChanged`, and `Office.EventType.RecurrencePatternChanged`. + * Currently the supported event types are `Office.EventType.AppointmentTimeChanged`, `Office.EventType.RecipientsChanged`, and + * `Office.EventType.RecurrencePatternChanged`. * * [Api set: Mailbox Preview] * @@ -12322,20 +13426,28 @@ declare namespace Office { * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose * * @param eventType The event that should invoke the handler. - * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. The type property on the parameter will match the eventType parameter passed to removeHandlerAsync. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an AsyncResult object. + * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. + * The type property on the parameter will match the eventType parameter passed to removeHandlerAsync. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, + * asyncResult, which is an {@link Office.AsyncResult} object. * * @beta */ - removeHandlerAsync(eventType:EventType, handler: any, callback?: (result: AsyncResult) => void): void; + removeHandlerAsync(eventType:EventType, handler: any, callback?: (result: AsyncResult) => void): void; /** * Asynchronously saves an item. * - * When invoked, this method saves the current message as a draft and returns the item id via the callback method. In Outlook Web App or Outlook in online mode, the item is saved to the server. In Outlook in cached mode, the item is saved to the local cache. + * When invoked, this method saves the current message as a draft and returns the item id via the callback method. + * In Outlook Web App or Outlook in online mode, the item is saved to the server. + * In Outlook in cached mode, the item is saved to the local cache. * - * Since appointments have no draft state, if saveAsync is called on an appointment in compose mode, the item will be saved as a normal appointment on the user's calendar. For new appointments that have not been saved before, no invitation will be sent. Saving an existing appointment will send an update to added or removed attendees. + * Since appointments have no draft state, if saveAsync is called on an appointment in compose mode, the item will be saved as a normal + * appointment on the user's calendar. For new appointments that have not been saved before, no invitation will be sent. + * Saving an existing appointment will send an update to added or removed attendees. * - * Note: If your add-in calls saveAsync on an item in compose mode in order to get an itemId to use with EWS or the REST API, be aware that when Outlook is in cached mode, it may take some time before the item is actually synced to the server. Until the item is synced, using the itemId will return an error. + * Note: If your add-in calls saveAsync on an item in compose mode in order to get an itemId to use with EWS or the REST API, be aware that + * when Outlook is in cached mode, it may take some time before the item is actually synced to the server. + * Until the item is synced, using the itemId will return an error. * * Note: The following clients have different behavior for saveAsync on appointments in compose mode: * @@ -12359,21 +13471,28 @@ declare namespace Office { * * `saveAsync(options: Office.AsyncContextOptions): void;` * - * `saveAsync(callback: (result: AsyncResult) => void): void;` + * `saveAsync(callback: (result: AsyncResult) => void): void;` * * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. If removing the attachment fails, the asyncResult.error property will contain an error code with the reason for the failure. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of + * type {@link Office.AsyncResult}. */ - saveAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + saveAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Asynchronously saves an item. * - * When invoked, this method saves the current message as a draft and returns the item id via the callback method. In Outlook Web App or Outlook in online mode, the item is saved to the server. In Outlook in cached mode, the item is saved to the local cache. + * When invoked, this method saves the current message as a draft and returns the item id via the callback method. + * In Outlook Web App or Outlook in online mode, the item is saved to the server. + * In Outlook in cached mode, the item is saved to the local cache. * - * Since appointments have no draft state, if saveAsync is called on an appointment in compose mode, the item will be saved as a normal appointment on the user's calendar. For new appointments that have not been saved before, no invitation will be sent. Saving an existing appointment will send an update to added or removed attendees. + * Since appointments have no draft state, if saveAsync is called on an appointment in compose mode, the item will be saved as a normal + * appointment on the user's calendar. For new appointments that have not been saved before, no invitation will be sent. + * Saving an existing appointment will send an update to added or removed attendees. * - * Note: If your add-in calls saveAsync on an item in compose mode in order to get an itemId to use with EWS or the REST API, be aware that when Outlook is in cached mode, it may take some time before the item is actually synced to the server. Until the item is synced, using the itemId will return an error. + * Note: If your add-in calls saveAsync on an item in compose mode in order to get an itemId to use with EWS or the REST API, be aware that + * when Outlook is in cached mode, it may take some time before the item is actually synced to the server. + * Until the item is synced, using the itemId will return an error. * * Note: The following clients have different behavior for saveAsync on appointments in compose mode: * @@ -12396,11 +13515,16 @@ declare namespace Office { /** * Asynchronously saves an item. * - * When invoked, this method saves the current message as a draft and returns the item id via the callback method. In Outlook Web App or Outlook in online mode, the item is saved to the server. In Outlook in cached mode, the item is saved to the local cache. + * When invoked, this method saves the current message as a draft and returns the item id via the callback method. + * In Outlook Web App or Outlook in online mode, the item is saved to the server. + * In Outlook in cached mode, the item is saved to the local cache. * - * Since appointments have no draft state, if saveAsync is called on an appointment in compose mode, the item will be saved as a normal appointment on the user's calendar. For new appointments that have not been saved before, no invitation will be sent. Saving an existing appointment will send an update to added or removed attendees. + * Since appointments have no draft state, if saveAsync is called on an appointment in compose mode, the item will be saved as a normal + * appointment on the user's calendar. For new appointments that have not been saved before, no invitation will be sent. Saving an existing appointment will send an update to added or removed attendees. * - * Note: If your add-in calls saveAsync on an item in compose mode in order to get an itemId to use with EWS or the REST API, be aware that when Outlook is in cached mode, it may take some time before the item is actually synced to the server. Until the item is synced, using the itemId will return an error. + * Note: If your add-in calls saveAsync on an item in compose mode in order to get an itemId to use with EWS or the REST API, be aware that + * when Outlook is in cached mode, it may take some time before the item is actually synced to the server. + * Until the item is synced, using the itemId will return an error. * * Note: The following clients have different behavior for saveAsync on appointments in compose mode: * @@ -12425,11 +13549,17 @@ declare namespace Office { /** * Asynchronously saves an item. * - * When invoked, this method saves the current message as a draft and returns the item id via the callback method. In Outlook Web App or Outlook in online mode, the item is saved to the server. In Outlook in cached mode, the item is saved to the local cache. + * When invoked, this method saves the current message as a draft and returns the item id via the callback method. + * In Outlook Web App or Outlook in online mode, the item is saved to the server. + * In Outlook in cached mode, the item is saved to the local cache. * - * Since appointments have no draft state, if saveAsync is called on an appointment in compose mode, the item will be saved as a normal appointment on the user's calendar. For new appointments that have not been saved before, no invitation will be sent. Saving an existing appointment will send an update to added or removed attendees. + * Since appointments have no draft state, if saveAsync is called on an appointment in compose mode, the item will be saved as a normal + * appointment on the user's calendar. For new appointments that have not been saved before, no invitation will be sent. + * Saving an existing appointment will send an update to added or removed attendees. * - * Note: If your add-in calls saveAsync on an item in compose mode in order to get an itemId to use with EWS or the REST API, be aware that when Outlook is in cached mode, it may take some time before the item is actually synced to the server. Until the item is synced, using the itemId will return an error. + * Note: If your add-in calls saveAsync on an item in compose mode in order to get an itemId to use with EWS or the REST API, be aware that + * when Outlook is in cached mode, it may take some time before the item is actually synced to the server. + * Until the item is synced, using the itemId will return an error. * * Note: The following clients have different behavior for saveAsync on appointments in compose mode: * @@ -12447,13 +13577,16 @@ declare namespace Office { * * ErrorsInvalidAttachmentId - The attachment identifier does not exist. * - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. If removing the attachment fails, the asyncResult.error property will contain an error code with the reason for the failure. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of + * type {@link Office.AsyncResult}. */ - saveAsync(callback: (result: AsyncResult) => void): void; + saveAsync(callback: (result: AsyncResult) => void): void; /** * Asynchronously inserts data into the body or subject of a message. * - * The setSelectedDataAsync method inserts the specified string at the cursor location in the subject or body of the item, or, if text is selected in the editor, it replaces the selected text. If the cursor is not in the body or subject field, an error is returned. After insertion, the cursor is placed at the end of the inserted content. + * The setSelectedDataAsync method inserts the specified string at the cursor location in the subject or body of the item, or, if text is + * selected in the editor, it replaces the selected text. If the cursor is not in the body or subject field, an error is returned. + * After insertion, the cursor is placed at the end of the inserted content. * * [Api set: Mailbox 1.2] * @@ -12471,19 +13604,28 @@ declare namespace Office { * * `setSelectedDataAsync(data: string, options: Office.AsyncContextOptions & CoercionTypeOptions): void;` * - * `setSelectedDataAsync(data: string, callback: (result: AsyncResult) => void): void;` + * `setSelectedDataAsync(data: string, callback: (result: AsyncResult) => void): void;` * - * @param data The data to be inserted. Data is not to exceed 1,000,000 characters. If more than 1,000,000 characters are passed in, an ArgumentOutOfRange exception is thrown. + * @param data The data to be inserted. Data is not to exceed 1,000,000 characters. + * If more than 1,000,000 characters are passed in, an ArgumentOutOfRange exception is thrown. * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. - * coercionType: If text, the current style is applied in Outlook Web App and Outlook. If the field is an HTML editor, only the text data is inserted, even if the data is HTML. If html and the field supports HTML (the subject doesn't), the current style is applied in Outlook Web App and the default style is applied in Outlook. If the field is a text field, an InvalidDataFormat error is returned. If coercionType is not set, the result depends on the field: if the field is HTML then HTML is used; if the field is text, then plain text is used. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. If removing the attachment fails, the asyncResult.error property will contain an error code with the reason for the failure. + * coercionType: If text, the current style is applied in Outlook Web App and Outlook. + * If the field is an HTML editor, only the text data is inserted, even if the data is HTML. + * If html and the field supports HTML (the subject doesn't), the current style is applied in Outlook Web App and the default style is + * applied in Outlook. If the field is a text field, an InvalidDataFormat error is returned. + * If coercionType is not set, the result depends on the field: if the field is HTML then HTML is used; + * if the field is text, then plain text is used. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of + * type {@link Office.AsyncResult}. */ - setSelectedDataAsync(data: string, options?: Office.AsyncContextOptions & CoercionTypeOptions, callback?: (result: AsyncResult) => void): void; + setSelectedDataAsync(data: string, options?: Office.AsyncContextOptions & CoercionTypeOptions, callback?: (result: AsyncResult) => void): void; /** * Asynchronously inserts data into the body or subject of a message. * - * The setSelectedDataAsync method inserts the specified string at the cursor location in the subject or body of the item, or, if text is selected in the editor, it replaces the selected text. If the cursor is not in the body or subject field, an error is returned. After insertion, the cursor is placed at the end of the inserted content. + * The setSelectedDataAsync method inserts the specified string at the cursor location in the subject or body of the item, or, if text is + * selected in the editor, it replaces the selected text. If the cursor is not in the body or subject field, an error is returned. + * After insertion, the cursor is placed at the end of the inserted content. * * [Api set: Mailbox 1.2] * @@ -12495,13 +13637,16 @@ declare namespace Office { * * ErrorsInvalidAttachmentId - The attachment identifier does not exist. * - * @param data The data to be inserted. Data is not to exceed 1,000,000 characters. If more than 1,000,000 characters are passed in, an ArgumentOutOfRange exception is thrown. + * @param data The data to be inserted. Data is not to exceed 1,000,000 characters. + * If more than 1,000,000 characters are passed in, an ArgumentOutOfRange exception is thrown. */ setSelectedDataAsync(data: string): void; /** * Asynchronously inserts data into the body or subject of a message. * - * The setSelectedDataAsync method inserts the specified string at the cursor location in the subject or body of the item, or, if text is selected in the editor, it replaces the selected text. If the cursor is not in the body or subject field, an error is returned. After insertion, the cursor is placed at the end of the inserted content. + * The setSelectedDataAsync method inserts the specified string at the cursor location in the subject or body of the item, or, if text is + * selected in the editor, it replaces the selected text. If the cursor is not in the body or subject field, an error is returned. + * After insertion, the cursor is placed at the end of the inserted content. * * [Api set: Mailbox 1.2] * @@ -12513,16 +13658,24 @@ declare namespace Office { * * ErrorsInvalidAttachmentId - The attachment identifier does not exist. * - * @param data The data to be inserted. Data is not to exceed 1,000,000 characters. If more than 1,000,000 characters are passed in, an ArgumentOutOfRange exception is thrown. + * @param data The data to be inserted. Data is not to exceed 1,000,000 characters. + * If more than 1,000,000 characters are passed in, an ArgumentOutOfRange exception is thrown. * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. - * coercionType: If text, the current style is applied in Outlook Web App and Outlook. If the field is an HTML editor, only the text data is inserted, even if the data is HTML. If html and the field supports HTML (the subject doesn't), the current style is applied in Outlook Web App and the default style is applied in Outlook. If the field is a text field, an InvalidDataFormat error is returned. If coercionType is not set, the result depends on the field: if the field is HTML then HTML is used; if the field is text, then plain text is used. + * coercionType: If text, the current style is applied in Outlook Web App and Outlook. + * If the field is an HTML editor, only the text data is inserted, even if the data is HTML. + * If html and the field supports HTML (the subject doesn't), the current style is applied in Outlook Web App and the default style is + * applied in Outlook. If the field is a text field, an InvalidDataFormat error is returned. + * If coercionType is not set, the result depends on the field: if the field is HTML then HTML is used; + * if the field is text, then plain text is used. */ setSelectedDataAsync(data: string, options: Office.AsyncContextOptions & CoercionTypeOptions): void; /** * Asynchronously inserts data into the body or subject of a message. * - * The setSelectedDataAsync method inserts the specified string at the cursor location in the subject or body of the item, or, if text is selected in the editor, it replaces the selected text. If the cursor is not in the body or subject field, an error is returned. After insertion, the cursor is placed at the end of the inserted content. + * The setSelectedDataAsync method inserts the specified string at the cursor location in the subject or body of the item, or, if text is + * selected in the editor, it replaces the selected text. If the cursor is not in the body or subject field, an error is returned. + * After insertion, the cursor is placed at the end of the inserted content. * * [Api set: Mailbox 1.2] * @@ -12534,15 +13687,18 @@ declare namespace Office { * * ErrorsInvalidAttachmentId - The attachment identifier does not exist. * - * @param data The data to be inserted. Data is not to exceed 1,000,000 characters. If more than 1,000,000 characters are passed in, an ArgumentOutOfRange exception is thrown. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. If removing the attachment fails, the asyncResult.error property will contain an error code with the reason for the failure. + * @param data The data to be inserted. Data is not to exceed 1,000,000 characters. + * If more than 1,000,000 characters are passed in, an ArgumentOutOfRange exception is thrown. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of + * type{@link Office.AsyncResult}. */ - setSelectedDataAsync(data: string, callback: (result: AsyncResult) => void): void; + setSelectedDataAsync(data: string, callback: (result: AsyncResult) => void): void; } /** * The message read mode of {@link Office.Item | Office.context.mailbox.item}. * - * Important: This is an internal Outlook object, not directly exposed through existing interfaces. You should treat this as a mode of Office.context.mailbox.item. Refer to the Object Model pages for more information. + * Important: This is an internal Outlook object, not directly exposed through existing interfaces. + * You should treat this as a mode of Office.context.mailbox.item. Refer to the Object Model pages for more information. */ interface MessageRead extends Message, ItemRead { /** @@ -12556,7 +13712,9 @@ declare namespace Office { * * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read * - * Note: Certain types of files are blocked by Outlook due to potential security issues and are therefore not returned. For more information, see {@link https://support.office.com/article/Blocked-attachments-in-Outlook-434752E1-02D3-4E90-9124-8B81E49A8519 | Blocked attachments in Outlook}. + * Note: Certain types of files are blocked by Outlook due to potential security issues and are therefore not returned. + * For more information, see + * {@link https://support.office.com/article/Blocked-attachments-in-Outlook-434752E1-02D3-4E90-9124-8B81E49A8519 | Blocked attachments in Outlook}. * */ attachments: Office.AttachmentDetails[]; @@ -12573,9 +13731,11 @@ declare namespace Office { */ body: Office.Body; /** - * Provides access to the Cc (carbon copy) recipients of a message. The type of object and level of access depends on the mode of the current item. + * Provides access to the Cc (carbon copy) recipients of a message. The type of object and level of access depends on the mode of the + * current item. * - * The cc property returns an array that contains an EmailAddressDetails object for each recipient listed on the Cc line of the message. The collection is limited to a maximum of 100 members. + * The cc property returns an array that contains an EmailAddressDetails object for each recipient listed on the Cc line of the message. + * The collection is limited to a maximum of 100 members. * * [Api set: Mailbox 1.0] * @@ -12589,9 +13749,12 @@ declare namespace Office { /** * Gets an identifier for the email conversation that contains a particular message. * - * You can get an integer for this property if your mail app is activated in read forms or responses in compose forms. If subsequently the user changes the subject of the reply message, upon sending the reply, the conversation ID for that message will change and that value you obtained earlier will no longer apply. + * You can get an integer for this property if your mail app is activated in read forms or responses in compose forms. + * If subsequently the user changes the subject of the reply message, upon sending the reply, the conversation ID for that message will change + * and that value you obtained earlier will no longer apply. * - * You get null for this property for a new item in a compose form. If the user sets a subject and saves the item, the conversationId property will return a value. + * You get null for this property for a new item in a compose form. + * If the user sets a subject and saves the item, the conversationId property will return a value. * * [Api set: Mailbox 1.0] * @@ -12631,7 +13794,8 @@ declare namespace Office { /** * Gets the email address of the sender of a message. * - * The from and sender properties represent the same person unless the message is sent by a delegate. In that case, the from property represents the delegator, and the sender property represents the delegate. + * The from and sender properties represent the same person unless the message is sent by a delegate. + * In that case, the from property represents the delegator, and the sender property represents the delegate. * * Note: The recipientType property of the EmailAddressDetails object in the from property is undefined. * @@ -12661,7 +13825,8 @@ declare namespace Office { /** * Gets the Exchange Web Services item class of the selected item. * - * You can create custom message classes that extends a default message class, for example, a custom appointment message class IPM.Appointment.Contoso. + * You can create custom message classes that extends a default message class, for example, a custom appointment message class + * IPM.Appointment.Contoso. * * [Api set: Mailbox 1.0] * @@ -12671,7 +13836,8 @@ declare namespace Office { * * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read - * The itemClass property specifies the message class of the selected item. The following are the default message classes for the message or appointment item. + * The itemClass property specifies the message class of the selected item. + * The following are the default message classes for the message or appointment item. * * * @@ -12696,9 +13862,14 @@ declare namespace Office { /** * Gets the Exchange Web Services item identifier for the current item. * - * The itemId property is not available in compose mode. If an item identifier is required, the saveAsync method can be used to save the item to the store, which will return the item identifier in the AsyncResult.value parameter in the callback function. + * The itemId property is not available in compose mode. + * If an item identifier is required, the saveAsync method can be used to save the item to the store, which will return the item identifier + * in the AsyncResult.value parameter in the callback function. * - * Note: The identifier returned by the itemId property is the same as the Exchange Web Services item identifier. The itemId property is not identical to the Outlook Entry ID or the ID used by the Outlook REST API. Before making REST API calls using this value, it should be converted using Office.context.mailbox.convertToRestId. For more details, see Use the Outlook REST APIs from an Outlook add-in. + * Note: The identifier returned by the itemId property is the same as the Exchange Web Services item identifier. + * The itemId property is not identical to the Outlook Entry ID or the ID used by the Outlook REST API. + * Before making REST API calls using this value, it should be converted using Office.context.mailbox.convertToRestId. + * For more details, see {@link https://docs.microsoft.com/outlook/add-ins/use-rest-api#get-the-item-id | Use the Outlook REST APIs from an Outlook add-in}. * * [Api set: Mailbox 1.0] * @@ -12712,7 +13883,8 @@ declare namespace Office { /** * Gets the type of item that an instance represents. * - * The itemType property returns one of the ItemType enumeration values, indicating whether the item object instance is a message or an appointment. + * The itemType property returns one of the ItemType enumeration values, indicating whether the item object instance is a message or + * an appointment. * * [Api set: Mailbox 1.0] * @@ -12726,7 +13898,9 @@ declare namespace Office { /** * Gets the subject of an item, with all prefixes removed (including RE: and FWD:). * - * The normalizedSubject property gets the subject of the item, with any standard prefixes (such as RE: and FW:) that are added by email programs. To get the subject of the item with the prefixes intact, use the subject property. + * The normalizedSubject property gets the subject of the item, with any standard prefixes (such as RE: and FW:) that are added by + * email programs. + * To get the subject of the item with the prefixes intact, use the subject property. * * [Api set: Mailbox 1.0] * @@ -12750,13 +13924,17 @@ declare namespace Office { */ notificationMessages: Office.NotificationMessages; /** - * Gets the recurrence pattern of an appointment. Gets the recurrence pattern of a meeting request. Read and compose modes for appointment items. Read mode for meeting request items. + * Gets the recurrence pattern of an appointment. Gets the recurrence pattern of a meeting request. + * Read and compose modes for appointment items. Read mode for meeting request items. * - * The recurrence property returns a recurrence object for recurring appointments or meetings requests if an item is a series or an instance in a series. null is returned for single appointments and meeting requests of single appointments. undefined is returned for messages that are not meeting requests. + * The recurrence property returns a recurrence object for recurring appointments or meetings requests if an item is a series or an instance + * in a series. `null` is returned for single appointments and meeting requests of single appointments. + * `undefined` is returned for messages that are not meeting requests. * * Note: Meeting requests have an itemClass value of IPM.Schedule.Meeting.Request. * - * Note: If the recurrence object is null, this indicates that the object is a single appointment or a meeting request of a single appointment and NOT a part of a series. + * Note: If the recurrence object is null, this indicates that the object is a single appointment or a meeting request of a single appointment + * and NOT a part of a series. * * [Api set: Mailbox Preview] * @@ -12772,11 +13950,16 @@ declare namespace Office { /** * Gets the id of the series that an instance belongs to. * - * In OWA and Outlook, the seriesId returns the Exchange Web Services (EWS) ID of the parent (series) item that this item belongs to. However, in iOS and Android, the seriesId returns the REST ID of the parent item. + * In OWA and Outlook, the seriesId returns the Exchange Web Services (EWS) ID of the parent (series) item that this item belongs to. + * However, in iOS and Android, the seriesId returns the REST ID of the parent item. * - * Note: The identifier returned by the seriesId property is the same as the Exchange Web Services item identifier. The seriesId property is not identical to the Outlook IDs used by the Outlook REST API. Before making REST API calls using this value, it should be converted using Office.context.mailbox.convertToRestId. For more details, see {@link https://docs.microsoft.com/outlook/add-ins/use-rest-api | Use the Outlook REST APIs from an Outlook add-in}. + * Note: The identifier returned by the seriesId property is the same as the Exchange Web Services item identifier. + * The seriesId property is not identical to the Outlook IDs used by the Outlook REST API. + * Before making REST API calls using this value, it should be converted using Office.context.mailbox.convertToRestId. + * For more details, see {@link https://docs.microsoft.com/outlook/add-ins/use-rest-api | Use the Outlook REST APIs from an Outlook add-in}. * - * The seriesId property returns null for items that do not have parent items such as single appointments, series items, or meeting requests and returns undefined for any other items that are not meeting requests. + * The seriesId property returns null for items that do not have parent items such as single appointments, series items, or meeting requests + * and returns undefined for any other items that are not meeting requests. * * [Api set: Mailbox Preview] * @@ -12792,7 +13975,8 @@ declare namespace Office { /** * Gets the email address of the sender of an email message. * - * The from and sender properties represent the same person unless the message is sent by a delegate. In that case, the from property represents the delegator, and the sender property represents the delegate. + * The from and sender properties represent the same person unless the message is sent by a delegate. + * In that case, the from property represents the delegator, and the sender property represents the delegate. * * Note: The recipientType property of the EmailAddressDetails object in the sender property is undefined. * @@ -12822,9 +14006,11 @@ declare namespace Office { */ subject: string; /** - * Provides access to the recipients on the To line of a message. The type of object and level of access depends on the mode of the current item. + * Provides access to the recipients on the To line of a message. The type of object and level of access depends on the mode of the + * current item. * - * The to property returns an array that contains an EmailAddressDetails object for each recipient listed on the To line of the message. The collection is limited to a maximum of 100 members. + * The to property returns an array that contains an EmailAddressDetails object for each recipient listed on the To line of the message. + * The collection is limited to a maximum of 100 members. * * [Api set: Mailbox 1.0] * @@ -12839,7 +14025,8 @@ declare namespace Office { /** * Adds an event handler for a supported event. * - * Currently the supported event types are `Office.EventType.AppointmentTimeChanged`, `Office.EventType.RecipientsChanged`, and `Office.EventType.RecurrencePatternChanged`. + * Currently the supported event types are `Office.EventType.AppointmentTimeChanged`, `Office.EventType.RecipientsChanged`, and + * `Office.EventType.RecurrencePatternChanged`. * * [Api set: Mailbox Preview] * @@ -12851,22 +14038,25 @@ declare namespace Office { * * In addition to this signature, the method also has the following signature: * - * `addHandlerAsync(eventType:EventType, handler: any, callback?: (result: AsyncResult) => void): void;` + * `addHandlerAsync(eventType:EventType, handler: any, callback?: (result: AsyncResult) => void): void;` * * @param eventType The event that should invoke the handler. - * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. The type property on the parameter will match the eventType parameter passed to addHandlerAsync. + * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. + * The type property on the parameter will match the eventType parameter passed to addHandlerAsync. * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an AsyncResult object. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, + * asyncResult, which is an {@link Office.AsyncResult} object. * * @beta */ - addHandlerAsync(eventType:EventType, handler: any, options?: any, callback?: (result: AsyncResult) => void): void; + addHandlerAsync(eventType:EventType, handler: any, options?: any, callback?: (result: AsyncResult) => void): void; /** * Adds an event handler for a supported event. * - * Currently the supported event types are `Office.EventType.AppointmentTimeChanged`, `Office.EventType.RecipientsChanged`, and `Office.EventType.RecurrencePatternChanged`. + * Currently the supported event types are `Office.EventType.AppointmentTimeChanged`, `Office.EventType.RecipientsChanged`, and + * `Office.EventType.RecurrencePatternChanged`. * * [Api set: Mailbox Preview] * @@ -12877,20 +14067,25 @@ declare namespace Office { *
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
* * @param eventType The event that should invoke the handler. - * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. The type property on the parameter will match the eventType parameter passed to addHandlerAsync. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an AsyncResult object. + * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. + * The type property on the parameter will match the eventType parameter passed to addHandlerAsync. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, + * asyncResult, which is an {@link Office.AsyncResult} object. * * @beta */ - addHandlerAsync(eventType:EventType, handler: any, callback?: (result: AsyncResult) => void): void; + addHandlerAsync(eventType:EventType, handler: any, callback?: (result: AsyncResult) => void): void; /** - * Displays a reply form that includes the sender and all recipients of the selected message or the organizer and all attendees of the selected appointment. + * Displays a reply form that includes the sender and all recipients of the selected message or the organizer and all attendees of the + * selected appointment. * * In Outlook Web App, the reply form is displayed as a pop-out form in the 3-column view and a pop-up form in the 2- or 1-column view. * * If any of the string parameters exceed their limits, displayReplyAllForm throws an exception. * - * When attachments are specified in the formData.attachments parameter, Outlook and Outlook Web App attempt to download all attachments and attach them to the reply form. If any attachments fail to be added, an error is shown in the form UI. If this isn't possible, then no error message is thrown. + * When attachments are specified in the formData.attachments parameter, Outlook and Outlook Web App attempt to download all attachments and + * attach them to the reply form. If any attachments fail to be added, an error is shown in the form UI. + * If this isn't possible, then no error message is thrown. * * Note: This method is not supported in Outlook for iOS or Outlook for Android. * @@ -12913,7 +14108,9 @@ declare namespace Office { * * If any of the string parameters exceed their limits, displayReplyForm throws an exception. * - * When attachments are specified in the formData.attachments parameter, Outlook and Outlook Web App attempt to download all attachments and attach them to the reply form. If any attachments fail to be added, an error is shown in the form UI. If this isn't possible, then no error message is thrown. + * When attachments are specified in the formData.attachments parameter, Outlook and Outlook Web App attempt to download all attachments and + * attach them to the reply form. If any attachments fail to be added, an error is shown in the form UI. + * If this isn't possible, then no error message is thrown. * * Note: This method is not supported in Outlook for iOS or Outlook for Android. * @@ -12931,9 +14128,11 @@ declare namespace Office { */ displayReplyForm(formData: string | ReplyFormData): void; /** - * Gets initialization data passed when the add-in is {@link https://docs.microsoft.com/outlook/actionable-messages/invoke-add-in-from-actionable-message | activated by an actionable message}. + * Gets initialization data passed when the add-in is + * {@link https://docs.microsoft.com/outlook/actionable-messages/invoke-add-in-from-actionable-message | activated by an actionable message}. * - * Note: This method is only supported by Outlook 2016 for Windows (Click-to-Run versions greater than 16.0.8413.1000) and Outlook on the web for Office 365. + * Note: This method is only supported by Outlook 2016 for Windows (Click-to-Run versions greater than 16.0.8413.1000) and Outlook on the web + * for Office 365. * * [Api set: Mailbox Preview] * @@ -12945,21 +14144,25 @@ declare namespace Office { * * In addition to this signature, the method also has the following signature: * - * `getInitializationContextAsync(callback?: (result: AsyncResult) => void): void;` + * `getInitializationContextAsync(callback?: (result: AsyncResult) => void): void;` * * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an AsyncResult object. - * On success, the initialization data is provided in the asyncResult.value property as a string. - * If there is no initialization context, the asyncResult object will contain an Error object with its code property set to 9020 and its name property set to GenericResponseError. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, + * asyncResult, which is an {@link Office.AsyncResult} object. + * On success, the initialization data is provided in the asyncResult.value property as a string. + * If there is no initialization context, the asyncResult object will contain an Error object with its code property + * set to 9020 and its name property set to GenericResponseError. * * @beta */ - getInitializationContextAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + getInitializationContextAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** - * Gets initialization data passed when the add-in is {@link https://docs.microsoft.com/outlook/actionable-messages/invoke-add-in-from-actionable-message | activated by an actionable message}. + * Gets initialization data passed when the add-in is + * {@link https://docs.microsoft.com/outlook/actionable-messages/invoke-add-in-from-actionable-message | activated by an actionable message}. * - * Note: This method is only supported by Outlook 2016 for Windows (Click-to-Run versions greater than 16.0.8413.1000) and Outlook on the web for Office 365. + * Note: This method is only supported by Outlook 2016 for Windows (Click-to-Run versions greater than 16.0.8413.1000) and Outlook on the + * web for Office 365. * * [Api set: Mailbox Preview] * @@ -12969,13 +14172,15 @@ declare namespace Office { * * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read * - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an AsyncResult object. - * On success, the initialization data is provided in the asyncResult.value property as a string. - * If there is no initialization context, the asyncResult object will contain an Error object with its code property set to 9020 and its name property set to GenericResponseError. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, + * asyncResult, which is an {@link Office.AsyncResult} object. + * On success, the initialization data is provided in the asyncResult.value property as a string. + * If there is no initialization context, the asyncResult object will contain an Error object with its code property + * set to 9020 and its name property set to GenericResponseError. * * @beta */ - getInitializationContextAsync(callback?: (result: AsyncResult) => void): void; + getInitializationContextAsync(callback?: (result: AsyncResult) => void): void; /** * Gets the entities found in the selected item's body. * @@ -13000,7 +14205,9 @@ declare namespace Office { * @param entityType One of the EntityType enumeration values. * * @returns - * If the value passed in entityType is not a valid member of the EntityType enumeration, the method returns null. If no entities of the specified type are present in the item's body, the method returns an empty array. Otherwise, the type of the objects in the returned array depends on the type of entity requested in the entityType parameter. + * If the value passed in entityType is not a valid member of the EntityType enumeration, the method returns null. + * If no entities of the specified type are present in the item's body, the method returns an empty array. + * Otherwise, the type of the objects in the returned array depends on the type of entity requested in the entityType parameter. * * @remarks * @@ -13008,7 +14215,8 @@ declare namespace Office { * * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Read * - * While the minimum permission level to use this method is Restricted, some entity types require ReadItem to access, as specified in the following table. + * While the minimum permission level to use this method is Restricted, some entity types require ReadItem to access, as specified in the + * following table. * * * @@ -13057,7 +14265,8 @@ declare namespace Office { /** * Returns well-known entities in the selected item that pass the named filter defined in the manifest XML file. * - * The getFilteredEntitiesByName method returns the entities that match the regular expression defined in the ItemHasKnownEntity rule element in the manifest XML file with the specified FilterName element value. + * The getFilteredEntitiesByName method returns the entities that match the regular expression defined in the ItemHasKnownEntity rule element + * in the manifest XML file with the specified FilterName element value. * * Note: This method is not supported in Outlook for iOS or Outlook for Android. * @@ -13070,22 +14279,33 @@ declare namespace Office { *
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
* * @param name The name of the ItemHasKnownEntity rule element that defines the filter to match. - * @returns If there is no ItemHasKnownEntity element in the manifest with a FilterName element value that matches the name parameter, the method returns null. If the name parameter does match an ItemHasKnownEntity element in the manifest, but there are no entities in the current item that match, the method return an empty array. + * @returns If there is no ItemHasKnownEntity element in the manifest with a FilterName element value that matches the name parameter, + * the method returns null. + * If the name parameter does match an ItemHasKnownEntity element in the manifest, but there are no entities in the current item that match, + * the method return an empty array. */ getFilteredEntitiesByName(name: string): (string | Contact | MeetingSuggestion | PhoneNumber | TaskSuggestion)[]; /** * Returns string values in the selected item that match the regular expressions defined in the manifest XML file. * - * The getRegExMatches method returns the strings that match the regular expression defined in each ItemHasRegularExpressionMatch or ItemHasKnownEntity rule element in the manifest XML file. For an ItemHasRegularExpressionMatch rule, a matching string has to occur in the property of the item that is specified by that rule. The PropertyName simple type defines the supported properties. + * The getRegExMatches method returns the strings that match the regular expression defined in each ItemHasRegularExpressionMatch or + * ItemHasKnownEntity rule element in the manifest XML file. + * For an ItemHasRegularExpressionMatch rule, a matching string has to occur in the property of the item that is specified by that rule. + * The PropertyName simple type defines the supported properties. * - * If you specify an ItemHasRegularExpressionMatch rule on the body property of an item, the regular expression should further filter the body and should not attempt to return the entire body of the item. Using a regular expression such as .* to obtain the entire body of an item does not always return the expected results. Instead, use the Body.getAsync method to retrieve the entire body. + * If you specify an ItemHasRegularExpressionMatch rule on the body property of an item, the regular expression should further filter the body + * and should not attempt to return the entire body of the item. + * Using a regular expression such as .* to obtain the entire body of an item does not always return the expected results. + * Instead, use the Body.getAsync method to retrieve the entire body. * * Note: This method is not supported in Outlook for iOS or Outlook for Android. * * [Api set: Mailbox 1.0] * * @returns - * An object that contains arrays of strings that match the regular expressions defined in the manifest XML file. The name of each array is equal to the corresponding value of the RegExName attribute of the matching ItemHasRegularExpressionMatch rule or the FilterName attribute of the matching ItemHasKnownEntity rule. + * An object that contains arrays of strings that match the regular expressions defined in the manifest XML file. + * The name of each array is equal to the corresponding value of the RegExName attribute of the matching ItemHasRegularExpressionMatch rule + * or the FilterName attribute of the matching ItemHasKnownEntity rule. * * @remarks * @@ -13097,9 +14317,12 @@ declare namespace Office { /** * Returns string values in the selected item that match the named regular expression defined in the manifest XML file. * - * The getRegExMatchesByName method returns the strings that match the regular expression defined in the ItemHasRegularExpressionMatch rule element in the manifest XML file with the specified RegExName element value. + * The getRegExMatchesByName method returns the strings that match the regular expression defined in the ItemHasRegularExpressionMatch rule + * element in the manifest XML file with the specified RegExName element value. * - * If you specify an ItemHasRegularExpressionMatch rule on the body property of an item, the regular expression should further filter the body and should not attempt to return the entire body of the item. Using a regular expression such as .* to obtain the entire body of an item does not always return the expected results. + * If you specify an ItemHasRegularExpressionMatch rule on the body property of an item, the regular expression should further filter the body + * and should not attempt to return the entire body of the item. + * Using a regular expression such as .* to obtain the entire body of an item does not always return the expected results. * * Note: This method is not supported in Outlook for iOS or Outlook for Android. * @@ -13134,18 +14357,27 @@ declare namespace Office { */ getSelectedEntities(): Entities; /** - * Returns string values in a highlighted match that match the regular expressions defined in the manifest XML file. Highlighted matches apply to contextual add-ins. + * Returns string values in a highlighted match that match the regular expressions defined in the manifest XML file. + * Highlighted matches apply to contextual add-ins. * - * The getSelectedRegExMatches method returns the strings that match the regular expression defined in each ItemHasRegularExpressionMatch or ItemHasKnownEntity rule element in the manifest XML file. For an ItemHasRegularExpressionMatch rule, a matching string has to occur in the property of the item that is specified by that rule. The PropertyName simple type defines the supported properties. + * The getSelectedRegExMatches method returns the strings that match the regular expression defined in each ItemHasRegularExpressionMatch or + * ItemHasKnownEntity rule element in the manifest XML file. + * For an ItemHasRegularExpressionMatch rule, a matching string has to occur in the property of the item that is specified by that rule. + * The PropertyName simple type defines the supported properties. * - * If you specify an ItemHasRegularExpressionMatch rule on the body property of an item, the regular expression should further filter the body and should not attempt to return the entire body of the item. Using a regular expression such as .* to obtain the entire body of an item does not always return the expected results. Instead, use the Body.getAsync method to retrieve the entire body. + * If you specify an ItemHasRegularExpressionMatch rule on the body property of an item, the regular expression should further filter the body + * and should not attempt to return the entire body of the item. + * Using a regular expression such as .* to obtain the entire body of an item does not always return the expected results. + * Instead, use the Body.getAsync method to retrieve the entire body. * * Note: This method is not supported in Outlook for iOS or Outlook for Android. * * [Api set: Mailbox 1.6] * * @returns - * An object that contains arrays of strings that match the regular expressions defined in the manifest XML file. The name of each array is equal to the corresponding value of the RegExName attribute of the matching ItemHasRegularExpressionMatch rule or the FilterName attribute of the matching ItemHasKnownEntity rule. + * An object that contains arrays of strings that match the regular expressions defined in the manifest XML file. + * The name of each array is equal to the corresponding value of the RegExName attribute of the matching ItemHasRegularExpressionMatch rule or + * the FilterName attribute of the matching ItemHasKnownEntity rule. * * @remarks * @@ -13157,9 +14389,13 @@ declare namespace Office { /** * Asynchronously loads custom properties for this add-in on the selected item. * - * Custom properties are stored as key/value pairs on a per-app, per-item basis. This method returns a CustomProperties object in the callback, which provides methods to access the custom properties specific to the current item and the current add-in. Custom properties are not encrypted on the item, so this should not be used as secure storage. + * Custom properties are stored as key/value pairs on a per-app, per-item basis. + * This method returns a CustomProperties object in the callback, which provides methods to access the custom properties specific to the + * current item and the current add-in. Custom properties are not encrypted on the item, so this should not be used as secure storage. * - * The custom properties are provided as a CustomProperties object in the asyncResult.value property. This object can be used to get, set, and remove custom properties from the item and save changes to the custom property set back to the server. + * The custom properties are provided as a CustomProperties object in the asyncResult.value property. + * This object can be used to get, set, and remove custom properties from the item and save changes to the custom property set back to + * the server. * * [Api set: Mailbox 1.0] * @@ -13169,14 +14405,17 @@ declare namespace Office { * * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read * - * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. - * @param userContext Optional. Developers can provide any object they wish to access in the callback function. This object can be accessed by the asyncResult.asyncContext property in the callback function. + * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of + * type {@link Office.AsyncResult}. + * @param userContext Optional. Developers can provide any object they wish to access in the callback function. + * This object can be accessed by the asyncResult.asyncContext property in the callback function. */ - loadCustomPropertiesAsync(callback: (result: AsyncResult) => void, userContext?: any): void; + loadCustomPropertiesAsync(callback: (result: AsyncResult) => void, userContext?: any): void; /** * Removes an event handler for a supported event. * - * Currently the supported event types are `Office.EventType.AppointmentTimeChanged`, `Office.EventType.RecipientsChanged`, and `Office.EventType.RecurrencePatternChanged`. + * Currently the supported event types are `Office.EventType.AppointmentTimeChanged`, `Office.EventType.RecipientsChanged`, and + * `Office.EventType.RecurrencePatternChanged`. * * [Api set: Mailbox Preview] * @@ -13188,21 +14427,24 @@ declare namespace Office { * * In addition to this signature, the method also has the following signature: * - * `removeHandlerAsync(eventType:EventType, handler: any, callback?: (result: AsyncResult) => void): void;` + * `removeHandlerAsync(eventType:EventType, handler: any, callback?: (result: AsyncResult) => void): void;` * * @param eventType The event that should invoke the handler. - * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. The type property on the parameter will match the eventType parameter passed to removeHandlerAsync. + * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. + * The type property on the parameter will match the eventType parameter passed to removeHandlerAsync. * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an AsyncResult object. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, + * asyncResult, which is an {@link Office.AsyncResult} object. * * @beta */ - removeHandlerAsync(eventType:EventType, handler: any, options?: any, callback?: (result: AsyncResult) => void): void; + removeHandlerAsync(eventType:EventType, handler: any, options?: any, callback?: (result: AsyncResult) => void): void; /** * Removes an event handler for a supported event. * - * Currently the supported event types are `Office.EventType.AppointmentTimeChanged`, `Office.EventType.RecipientsChanged`, and `Office.EventType.RecurrencePatternChanged`. + * Currently the supported event types are `Office.EventType.AppointmentTimeChanged`, `Office.EventType.RecipientsChanged`, and + * `Office.EventType.RecurrencePatternChanged`. * * [Api set: Mailbox Preview] * @@ -13213,12 +14455,14 @@ declare namespace Office { * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read * * @param eventType The event that should invoke the handler. - * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. The type property on the parameter will match the eventType parameter passed to removeHandlerAsync. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an AsyncResult object. + * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. + * The type property on the parameter will match the eventType parameter passed to removeHandlerAsync. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, + * asyncResult, which is an {@link Office.AsyncResult} object. * * @beta */ - removeHandlerAsync(eventType:EventType, handler: any, callback?: (result: AsyncResult) => void): void; + removeHandlerAsync(eventType:EventType, handler: any, callback?: (result: AsyncResult) => void): void; } /** @@ -13280,11 +14524,13 @@ declare namespace Office { /** * Gets the location of an appointment. * - * The getAsync method starts an asynchronous call to the Exchange server to get the location of an appointment. The location of the appointment is provided as a string in the asyncResult.value property. + * The getAsync method starts an asynchronous call to the Exchange server to get the location of an appointment. + * The location of the appointment is provided as a string in the asyncResult.value property. * * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of + * type {@link Office.AsyncResult}. * * [Api set: Mailbox 1.1] * @@ -13295,16 +14541,18 @@ declare namespace Office { * * In addition to this signature, the method also has the following signature: * - * `getAsync(callback: (result: AsyncResult) => void): void;` + * `getAsync(callback: (result: AsyncResult) => void): void;` * */ - getAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + getAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Gets the location of an appointment. * - * The getAsync method starts an asynchronous call to the Exchange server to get the location of an appointment. The location of the appointment is provided as a string in the asyncResult.value property. + * The getAsync method starts an asynchronous call to the Exchange server to get the location of an appointment. + * The location of the appointment is provided as a string in the asyncResult.value property. * - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of + * type {@link Office.AsyncResult}. * * [Api set: Mailbox 1.1] * @@ -13313,16 +14561,18 @@ declare namespace Office { * * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose */ - getAsync(callback: (result: AsyncResult) => void): void; + getAsync(callback: (result: AsyncResult) => void): void; /** * Sets the location of an appointment. * - * The setAsync method starts an asynchronous call to the Exchange server to set the location of an appointment. Setting the location of an appointment overwrites the current location. + * The setAsync method starts an asynchronous call to the Exchange server to set the location of an appointment. + * Setting the location of an appointment overwrites the current location. * * @param location The location of the appointment. The string is limited to 255 characters. * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. If setting the location fails, the asyncResult.error property will contain an error code. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of + * type {@link Office.AsyncResult}. If setting the location fails, the asyncResult.error property will contain an error code. * * [Api set: Mailbox 1.1] * @@ -13339,13 +14589,14 @@ declare namespace Office { * * `setAsync(location: string, options: Office.AsyncContextOptions): void;` * - * `setAsync(location: string, callback: (result: AsyncResult) => void): void;` + * `setAsync(location: string, callback: (result: AsyncResult) => void): void;` */ - setAsync(location: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + setAsync(location: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Sets the location of an appointment. * - * The setAsync method starts an asynchronous call to the Exchange server to set the location of an appointment. Setting the location of an appointment overwrites the current location. + * The setAsync method starts an asynchronous call to the Exchange server to set the location of an appointment. + * Setting the location of an appointment overwrites the current location. * * @param location The location of the appointment. The string is limited to 255 characters. * @@ -13362,7 +14613,8 @@ declare namespace Office { /** * Sets the location of an appointment. * - * The setAsync method starts an asynchronous call to the Exchange server to set the location of an appointment. Setting the location of an appointment overwrites the current location. + * The setAsync method starts an asynchronous call to the Exchange server to set the location of an appointment. + * Setting the location of an appointment overwrites the current location. * * @param location The location of the appointment. The string is limited to 255 characters. * @param options Optional. An object literal that contains one or more of the following properties. @@ -13381,10 +14633,12 @@ declare namespace Office { /** * Sets the location of an appointment. * - * The setAsync method starts an asynchronous call to the Exchange server to set the location of an appointment. Setting the location of an appointment overwrites the current location. + * The setAsync method starts an asynchronous call to the Exchange server to set the location of an appointment. + * Setting the location of an appointment overwrites the current location. * * @param location The location of the appointment. The string is limited to 255 characters. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. If setting the location fails, the asyncResult.error property will contain an error code. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of + * type {@link Office.AsyncResult}. If setting the location fails, the asyncResult.error property will contain an error code. * * [Api set: Mailbox 1.1] * @@ -13395,7 +14649,7 @@ declare namespace Office { * * ErrorsDataExceedsMaximumSize - The location parameter is longer than 255 characters. */ - setAsync(location: string, callback: (result: AsyncResult) => void): void; + setAsync(location: string, callback: (result: AsyncResult) => void): void; } /** * Provides access to the Outlook Add-in object model for Microsoft Outlook and Microsoft Outlook on the web. @@ -13421,11 +14675,18 @@ declare namespace Office { * * Contains the following members: * - * - hostName (string): A string that represents the name of the host application. It be one of the following values: Outlook, Mac Outlook, OutlookIOS, or OutlookWebApp. + * - hostName (string): A string that represents the name of the host application. + * It be one of the following values: Outlook, Mac Outlook, OutlookIOS, or OutlookWebApp. * - * - hostVersion (string): A string that represents the version of either the host application or the Exchange Server. If the mail add-in is running on the Outlook desktop client or Outlook for iOS, the hostVersion property returns the version of the host application, Outlook. In Outlook Web App, the property returns the version of the Exchange Server. An example is the string 15.0.468.0. + * - hostVersion (string): A string that represents the version of either the host application or the Exchange Server. + * If the mail add-in is running on the Outlook desktop client or Outlook for iOS, the hostVersion property returns the version of the + * host application, Outlook. In Outlook Web App, the property returns the version of the Exchange Server. An example is the string 15.0.468.0. * - * - OWAView (MailboxEnums.OWAView or string): An enum (or string literal) that represents the current view of Outlook Web App. If the host application is not Outlook Web App, then accessing this property results in undefined. Outlook Web App has three views (OneColumn - displayed when the screen is narrow, TwoColumns - displayed when the screen is wider, and ThreeColumns - displayed when the screen is wide) that correspond to the width of the screen and the window, and the number of columns that can be displayed. + * - OWAView (MailboxEnums.OWAView or string): An enum (or string literal) that represents the current view of Outlook Web App. + * If the host application is not Outlook Web App, then accessing this property results in undefined. + * Outlook Web App has three views (OneColumn - displayed when the screen is narrow, TwoColumns - displayed when the screen is wider, + * and ThreeColumns - displayed when the screen is wide) that correspond to the width of the screen and the window, and the number of columns + * that can be displayed. * * More information is under {@link Office.Diagnostics}. * @@ -13442,7 +14703,8 @@ declare namespace Office { * * Your app must have the ReadItem permission specified in its manifest to call the ewsUrl member in read mode. * - * In compose mode you must call the saveAsync method before you can use the ewsUrl member. Your app must have ReadWriteItem permissions to call the saveAsync method. + * In compose mode you must call the saveAsync method before you can use the ewsUrl member. + * Your app must have ReadWriteItem permissions to call the saveAsync method. * * [Api set: Mailbox 1.0] * @@ -13468,7 +14730,8 @@ declare namespace Office { * * Your app must have the ReadItem permission specified in its manifest to call the restUrl member in read mode. * - * In compose mode you must call the saveAsync method before you can use the restUrl member. Your app must have ReadWriteItem permissions to call the saveAsync method. + * In compose mode you must call the saveAsync method before you can use the restUrl member. + * Your app must have ReadWriteItem permissions to call the saveAsync method. * * [Api set: Mailbox 1.5] * @@ -13490,7 +14753,9 @@ declare namespace Office { /** * Adds an event handler for a supported event. * - * Currently the only supported event type is Office.EventType.ItemChanged, which is invoked when the user selects a new item. This event is used by add-ins that implement a pinnable taskpane, and allows the add-in to refresh the taskpane UI based on the currently selected item. + * Currently the only supported event type is Office.EventType.ItemChanged, which is invoked when the user selects a new item. + * This event is used by add-ins that implement a pinnable taskpane, and allows the add-in to refresh the taskpane UI based on the currently + * selected item. * * [Api set: Mailbox 1.5] * @@ -13501,15 +14766,18 @@ declare namespace Office { * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read * * @param eventType The event that should invoke the handler. - * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. The type property on the parameter will match the eventType parameter passed to addHandlerAsync. + * @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. + * The type property on the parameter will match the eventType parameter passed to addHandlerAsync. * @param options Optional. Provides an option for preserving context data of any type, unchanged, for use in a callback. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of + * type {@link Office.AsyncResult}. */ - addHandlerAsync(eventType: Office.EventType, handler: (type: EventType) => void, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + addHandlerAsync(eventType: Office.EventType, handler: (type: EventType) => void, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Converts an item ID formatted for REST into EWS format. * - * Item IDs retrieved via a REST API (such as the Outlook Mail API or the Microsoft Graph) use a different format than the format used by Exchange Web Services (EWS). The convertToEwsId method converts a REST-formatted ID into the proper format for EWS. + * Item IDs retrieved via a REST API (such as the Outlook Mail API or the Microsoft Graph) use a different format than the format used by + * Exchange Web Services (EWS). The convertToEwsId method converts a REST-formatted ID into the proper format for EWS. * * Note: This method is not supported in Outlook for iOS or Outlook for Android. * @@ -13528,9 +14796,15 @@ declare namespace Office { /** * Gets a dictionary containing time information in local client time. * - * The dates and times used by a mail app for Outlook or Outlook Web App can use different time zones. Outlook uses the client computer time zone; Outlook Web App uses the time zone set on the Exchange Admin Center (EAC). You should handle date and time values so that the values you display on the user interface are always consistent with the time zone that the user expects. + * The dates and times used by a mail app for Outlook or Outlook Web App can use different time zones. + * Outlook uses the client computer time zone; Outlook Web App uses the time zone set on the Exchange Admin Center (EAC). + * You should handle date and time values so that the values you display on the user interface are always consistent with the time zone that + * the user expects. * - * If the mail app is running in Outlook, the convertToLocalClientTime method will return a dictionary object with the values set to the client computer time zone. If the mail app is running in Outlook Web App, the convertToLocalClientTime method will return a dictionary object with the values set to the time zone specified in the EAC. + * If the mail app is running in Outlook, the convertToLocalClientTime method will return a dictionary object with the values set to the + * client computer time zone. + * If the mail app is running in Outlook Web App, the convertToLocalClientTime method will return a dictionary object with the values set to + * the time zone specified in the EAC. * * [Api set: Mailbox 1.0] * @@ -13556,7 +14830,9 @@ declare namespace Office { * * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read * - * Item IDs retrieved via EWS or via the itemId property use a different format than the format used by REST APIs (such as the {@link https://msdn.microsoft.com/office/office365/APi/mail-rest-operations | Outlook Mail API} or the {@link http://graph.microsoft.io/ | Microsoft Graph}. The convertToRestId method converts an EWS-formatted ID into the proper format for REST. + * Item IDs retrieved via EWS or via the itemId property use a different format than the format used by REST APIs (such as the + * {@link https://msdn.microsoft.com/office/office365/APi/mail-rest-operations | Outlook Mail API} or the {@link http://graph.microsoft.io/ | Microsoft Graph}. + * The convertToRestId method converts an EWS-formatted ID into the proper format for REST. * * @param itemId An item ID formatted for Exchange Web Services (EWS) * @param restVersion A value indicating the version of the Outlook REST API that the converted ID will be used with. @@ -13565,7 +14841,8 @@ declare namespace Office { /** * Gets a Date object from a dictionary containing time information. * - * The convertToUtcClientTime method converts a dictionary containing a local date and time to a Date object with the correct values for the local date and time. + * The convertToUtcClientTime method converts a dictionary containing a local date and time to a Date object with the correct values for the + * local date and time. * * [Api set: Mailbox 1.0] * @@ -13582,13 +14859,17 @@ declare namespace Office { /** * Displays an existing calendar appointment. * - * The displayAppointmentForm method opens an existing calendar appointment in a new window on the desktop or in a dialog box on mobile devices. + * The displayAppointmentForm method opens an existing calendar appointment in a new window on the desktop or in a dialog box on + * mobile devices. * - * In Outlook for Mac, you can use this method to display a single appointment that is not part of a recurring series, or the master appointment of a recurring series, but you cannot display an instance of the series. This is because in Outlook for Mac, you cannot access the properties (including the item ID) of instances of a recurring series. + * In Outlook for Mac, you can use this method to display a single appointment that is not part of a recurring series, or the + * master appointment of a recurring series, but you cannot display an instance of the series. + * This is because in Outlook for Mac, you cannot access the properties (including the item ID) of instances of a recurring series. * * In Outlook Web App, this method opens the specified form only if the body of the form is less than or equal to 32KB number of characters. * - * If the specified item identifier does not identify an existing appointment, a blank pane opens on the client computer or device, and no error message will be returned. + * If the specified item identifier does not identify an existing appointment, a blank pane opens on the client computer or device, and + * no error message will be returned. * * Note: This method is not supported in Outlook for iOS or Outlook for Android. * @@ -13610,9 +14891,11 @@ declare namespace Office { * * In Outlook Web App, this method opens the specified form only if the body of the form is less than or equal to 32 KB number of characters. * - * If the specified item identifier does not identify an existing message, no message will be displayed on the client computer, and no error message will be returned. + * If the specified item identifier does not identify an existing message, no message will be displayed on the client computer, and + * no error message will be returned. * - * Do not use the displayMessageForm with an itemId that represents an appointment. Use the displayAppointmentForm method to display an existing appointment, and displayNewAppointmentForm to display a form to create a new appointment. + * Do not use the displayMessageForm with an itemId that represents an appointment. Use the displayAppointmentForm method to display + * an existing appointment, and displayNewAppointmentForm to display a form to create a new appointment. * * Note: This method is not supported in Outlook for iOS or Outlook for Android. * @@ -13630,11 +14913,16 @@ declare namespace Office { /** * Displays a form for creating a new calendar appointment. * - * The displayNewAppointmentForm method opens a form that enables the user to create a new appointment or meeting. If parameters are specified, the appointment form fields are automatically populated with the contents of the parameters. + * The displayNewAppointmentForm method opens a form that enables the user to create a new appointment or meeting. + * If parameters are specified, the appointment form fields are automatically populated with the contents of the parameters. * - * In Outlook Web App and OWA for Devices, this method always displays a form with an attendees field. If you do not specify any attendees as input arguments, the method displays a form with a Save button. If you have specified attendees, the form would include the attendees and a Send button. + * In Outlook Web App and OWA for Devices, this method always displays a form with an attendees field. + * If you do not specify any attendees as input arguments, the method displays a form with a Save button. + * If you have specified attendees, the form would include the attendees and a Send button. * - * In the Outlook rich client and Outlook RT, if you specify any attendees or resources in the requiredAttendees, optionalAttendees, or resources parameter, this method displays a meeting form with a Send button. If you don't specify any recipients, this method displays an appointment form with a Save & Close button. + * In the Outlook rich client and Outlook RT, if you specify any attendees or resources in the requiredAttendees, optionalAttendees, or + * resources parameter, this method displays a meeting form with a Send button. + * If you don't specify any recipients, this method displays an appointment form with a Save & Close button. * * If any of the parameters exceed the specified size limits, or if an unknown parameter name is specified, an exception is thrown. * @@ -13654,7 +14942,8 @@ declare namespace Office { /** * Displays a form for creating a new message. * - * The displayNewMessageForm method opens a form that enables the user to create a new message. If parameters are specified, the message form fields are automatically populated with the contents of the parameters. + * The displayNewMessageForm method opens a form that enables the user to create a new message. If parameters are specified, the message form + * fields are automatically populated with the contents of the parameters. * * If any of the parameters exceed the specified size limits, or if an unknown parameter name is specified, an exception is thrown. * @@ -13668,11 +14957,14 @@ declare namespace Office { * * @param parameters A dictionary containing all values to be filled in for the user in the new form. All parameters are optional. * - * toRecipients: An array of strings containing the email addresses or an array containing an {@link Office.EmailAddressDetails} object for each of the recipients on the To line. The array is limited to a maximum of 100 entries. + * toRecipients: An array of strings containing the email addresses or an array containing an {@link Office.EmailAddressDetails} object + * for each of the recipients on the To line. The array is limited to a maximum of 100 entries. * - * ccRecipients: An array of strings containing the email addresses or an array containing an {@link Office.EmailAddressDetails} object for each of the recipients on the Cc line. The array is limited to a maximum of 100 entries. + * ccRecipients: An array of strings containing the email addresses or an array containing an {@link Office.EmailAddressDetails} object + * for each of the recipients on the Cc line. The array is limited to a maximum of 100 entries. * - * bccRecipients: An array of strings containing the email addresses or an array containing an {@link Office.EmailAddressDetails} object for each of the recipients on the Bcc line. The array is limited to a maximum of 100 entries. + * bccRecipients: An array of strings containing the email addresses or an array containing an {@link Office.EmailAddressDetails} object + * for each of the recipients on the Bcc line. The array is limited to a maximum of 100 entries. * * subject: A string containing the subject of the message. The string is limited to a maximum of 255 characters. * @@ -13686,25 +14978,33 @@ declare namespace Office { * * attachments.url: Only used if type is set to file. The URI of the location for the file. * - * attachments.isInline: Only used if type is set to file. If true, indicates that the attachment will be shown inline in the message body, and should not be displayed in the attachment list. + * attachments.isInline: Only used if type is set to file. If true, indicates that the attachment will be shown inline in the + * message body, and should not be displayed in the attachment list. * - * attachments.itemId: Only used if type is set to item. The EWS item id of the existing e-mail you want to attach to the new message. This is a string up to 100 characters. + * attachments.itemId: Only used if type is set to item. The EWS item id of the existing e-mail you want to attach to the new message. + * This is a string up to 100 characters. */ displayNewMessageForm(parameters: any): void; /** * Gets a string that contains a token used to call REST APIs or Exchange Web Services. * - * The getCallbackTokenAsync method makes an asynchronous call to get an opaque token from the Exchange Server that hosts the user's mailbox. The lifetime of the callback token is 5 minutes. + * The getCallbackTokenAsync method makes an asynchronous call to get an opaque token from the Exchange Server that hosts the user's mailbox. + * The lifetime of the callback token is 5 minutes. * * *REST Tokens* * - * When a REST token is requested (options.isRest = true), the resulting token will not work to authenticate Exchange Web Services calls. The token will be limited in scope to read-only access to the current item and its attachments, unless the add-in has specified the ReadWriteMailbox permission in its manifest. If the ReadWriteMailbox permission is specified, the resulting token will grant read/write access to mail, calendar, and contacts, including the ability to send mail. + * When a REST token is requested (options.isRest = true), the resulting token will not work to authenticate Exchange Web Services calls. + * The token will be limited in scope to read-only access to the current item and its attachments, unless the add-in has specified the + * ReadWriteMailbox permission in its manifest. + * If the ReadWriteMailbox permission is specified, the resulting token will grant read/write access to mail, calendar, and contacts, + * including the ability to send mail. * * The add-in should use the restUrl property to determine the correct URL to use when making REST API calls. * * *EWS Tokens* * - * When an EWS token is requested (options.isRest = false), the resulting token will not work to authenticate REST API calls. The token will be limited in scope to accessing the current item. + * When an EWS token is requested (options.isRest = false), the resulting token will not work to authenticate REST API calls. + * The token will be limited in scope to accessing the current item. * * The add-in should use the ewsUrl property to determine the correct URL to use when making EWS calls. * @@ -13720,26 +15020,31 @@ declare namespace Office { * * In addition to this signature, the method has the following signatures: * - * `getCallbackTokenAsync(callback: (result: AsyncResult) => void): void;` + * `getCallbackTokenAsync(callback: (result: AsyncResult) => void): void;` * - * `getCallbackTokenAsync(callback: (result: AsyncResult) => void, userContext?: any): void;` + * `getCallbackTokenAsync(callback: (result: AsyncResult) => void, userContext?: any): void;` * * @param options An object literal that contains one or more of the following properties. * isRest: Determines if the token provided will be used for the Outlook REST APIs or Exchange Web Services. Default value is false. * asyncContext: Any state data that is passed to the asynchronous method. - * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. The token is provided as a string in the asyncResult.value property. + * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of + * type {@link Office.AsyncResult}. The token is provided as a string in the asyncResult.value property. */ - getCallbackTokenAsync(options: Office.AsyncContextOptions & { isRest?: boolean }, callback: (result: AsyncResult) => void): void; + getCallbackTokenAsync(options: Office.AsyncContextOptions & { isRest?: boolean }, callback: (result: AsyncResult) => void): void; /** * Gets a string that contains a token used to get an attachment or item from an Exchange Server. * - * The getCallbackTokenAsync method makes an asynchronous call to get an opaque token from the Exchange Server that hosts the user's mailbox. The lifetime of the callback token is 5 minutes. + * The getCallbackTokenAsync method makes an asynchronous call to get an opaque token from the Exchange Server that hosts the user's mailbox. + * The lifetime of the callback token is 5 minutes. * - * You can pass the token and an attachment identifier or item identifier to a third-party system. The third-party system uses the token as a bearer authorization token to call the Exchange Web Services (EWS) GetAttachment or GetItem operation to return an attachment or item. For example, you can create a remote service to get attachments from the selected item. + * You can pass the token and an attachment identifier or item identifier to a third-party system. + * The third-party system uses the token as a bearer authorization token to call the Exchange Web Services (EWS) GetAttachment or + * GetItem operation to return an attachment or item. For example, you can create a remote service to get attachments from the selected item. * * Your app must have the ReadItem permission specified in its manifest to call the getCallbackTokenAsync method in read mode. * - * In compose mode you must call the saveAsync method to get an item identifier to pass to the getCallbackTokenAsync method. Your app must have ReadWriteItem permissions to call the saveAsync method. + * In compose mode you must call the saveAsync method to get an item identifier to pass to the getCallbackTokenAsync method. + * Your app must have ReadWriteItem permissions to call the saveAsync method. * * [Api set: Mailbox 1.5] * @@ -13749,19 +15054,24 @@ declare namespace Office { * * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose and read * - * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. The token is provided as a string in the asyncResult.value property. + * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. + * The token is provided as a string in the asyncResult.value property. */ - getCallbackTokenAsync(callback: (result: AsyncResult) => void): void; + getCallbackTokenAsync(callback: (result: AsyncResult) => void): void; /** * Gets a string that contains a token used to get an attachment or item from an Exchange Server. * - * The getCallbackTokenAsync method makes an asynchronous call to get an opaque token from the Exchange Server that hosts the user's mailbox. The lifetime of the callback token is 5 minutes. + * The getCallbackTokenAsync method makes an asynchronous call to get an opaque token from the Exchange Server that hosts the user's mailbox. + * The lifetime of the callback token is 5 minutes. * - * You can pass the token and an attachment identifier or item identifier to a third-party system. The third-party system uses the token as a bearer authorization token to call the Exchange Web Services (EWS) GetAttachment or GetItem operation to return an attachment or item. For example, you can create a remote service to get attachments from the selected item. + * You can pass the token and an attachment identifier or item identifier to a third-party system. + * The third-party system uses the token as a bearer authorization token to call the Exchange Web Services (EWS) GetAttachment or + * GetItem operation to return an attachment or item. For example, you can create a remote service to get attachments from the selected item. * * Your app must have the ReadItem permission specified in its manifest to call the getCallbackTokenAsync method in read mode. * - * In compose mode you must call the saveAsync method to get an item identifier to pass to the getCallbackTokenAsync method. Your app must have ReadWriteItem permissions to call the saveAsync method. + * In compose mode you must call the saveAsync method to get an item identifier to pass to the getCallbackTokenAsync method. + * Your app must have ReadWriteItem permissions to call the saveAsync method. * * [Api set: Mailbox 1.3] * @@ -13771,10 +15081,11 @@ declare namespace Office { * * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose and read * - * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. The token is provided as a string in the asyncResult.value property. + * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of + * type {@link Office.AsyncResult}. The token is provided as a string in the asyncResult.value property. * @param userContext Optional. Any state data that is passed to the asynchronous method. */ - getCallbackTokenAsync(callback: (result: AsyncResult) => void, userContext?: any): void; + getCallbackTokenAsync(callback: (result: AsyncResult) => void, userContext?: any): void; /** * Gets a token identifying the user and the Office Add-in. * @@ -13788,12 +15099,15 @@ declare namespace Office { * * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose and read * - * The getUserIdentityTokenAsync method returns a token that you can use to identify and {@link https://msdn.microsoft.com/library/office/fp179828.aspx | authenticate the add-in and user with a third-party system}. + * The getUserIdentityTokenAsync method returns a token that you can use to identify and + * {@link https://msdn.microsoft.com/library/office/fp179828.aspx | authenticate the add-in and user with a third-party system}. * - * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. + * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of + * type {@link Office.AsyncResult}. + * The token is provided as a string in the asyncResult.value property. * @param userContext Optional. Any state data that is passed to the asynchronous method.| */ - getUserIdentityTokenAsync(callback: (result: AsyncResult) => void, userContext?: any): void; + getUserIdentityTokenAsync(callback: (result: AsyncResult) => void, userContext?: any): void; /** * Makes an asynchronous request to an Exchange Web Services (EWS) service on the Exchange server that hosts the user's mailbox. * @@ -13805,21 +15119,32 @@ declare namespace Office { * * The XML request must specify UTF-8 encoding. * - * Your add-in must have the ReadWriteMailbox permission to use the makeEwsRequestAsync method. For information about using the ReadWriteMailbox permission and the EWS operations that you can call with the makeEwsRequestAsync method, see Specify permissions for mail add-in access to the user's mailbox. + * Your add-in must have the ReadWriteMailbox permission to use the makeEwsRequestAsync method. + * For information about using the ReadWriteMailbox permission and the EWS operations that you can call with the makeEwsRequestAsync method, + * see {@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Specify permissions for mail add-in access to the user's mailbox}. * - * The XML result of the EWS call is provided as a string in the asyncResult.value property. If the result exceeds 1 MB in size, an error message is returned instead. + * The XML result of the EWS call is provided as a string in the asyncResult.value property. + * If the result exceeds 1 MB in size, an error message is returned instead. * - * Note: This method is not supported in the following scenarios. - In Outlook for iOS or Outlook for Android - When the add-in is loaded in a Gmail mailbox + * Note: This method is not supported in the following scenarios: + * + * - In Outlook for iOS or Outlook for Android. + * + * - When the add-in is loaded in a Gmail mailbox. * - * Note: The server administrator must set OAuthAuthentication to true on the Client Access Server EWS directory to enable the makeEwsRequestAsync method to make EWS requests. + * Note: The server administrator must set OAuthAuthentication to true on the Client Access Server EWS directory to enable the + * makeEwsRequestAsync method to make EWS requests. * * *Version differences* * - * When you use the makeEwsRequestAsync method in mail apps running in Outlook versions earlier than version 15.0.4535.1004, you should set the encoding value to ISO-8859-1. + * When you use the makeEwsRequestAsync method in mail apps running in Outlook versions earlier than version 15.0.4535.1004, you should set + * the encoding value to ISO-8859-1. * * `` * - * You do not need to set the encoding value when your mail app is running in Outlook on the web. You can determine whether your mail app is running in Outlook or Outlook on the web by using the mailbox.diagnostics.hostName property. You can determine what version of Outlook is running by using the mailbox.diagnostics.hostVersion property. + * You do not need to set the encoding value when your mail app is running in Outlook on the web. + * You can determine whether your mail app is running in Outlook or Outlook on the web by using the mailbox.diagnostics.hostName property. + * You can determine what version of Outlook is running by using the mailbox.diagnostics.hostVersion property. * * [Api set: Mailbox 1.0] * @@ -13830,18 +15155,23 @@ declare namespace Office { * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose and read * * @param data The EWS request. - * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. + * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type {@link Office.AsyncResult}. + * The `value` property of the result is the XML of the EWS request provided as a string. + * If the result exceeds 1 MB in size, an error message is returned instead. * @param userContext Optional. Any state data that is passed to the asynchronous method. */ - makeEwsRequestAsync(data: any, callback: (result: AsyncResult) => void, userContext?: any): void; + makeEwsRequestAsync(data: any, callback: (result: AsyncResult) => void, userContext?: any): void; } /** * Represents a suggested meeting found in an item. Read mode only. * - * The list of meetings suggested in an email message is returned in the meetingSuggestions property of the Entities object that is returned when the getEntities or getEntitiesByType method is called on the active item. + * The list of meetings suggested in an email message is returned in the meetingSuggestions property of the Entities object that is returned when + * the getEntities or getEntitiesByType method is called on the active item. * - * The start and end values are string representations of a Date object that contains the date and time at which the suggested meeting is to begin and end. The values are in the default time zone specified for the current user. + * The start and end values are string representations of a Date object that contains the date and time at which the suggested meeting is to + * begin and end. + * The values are in the default time zone specified for the current user. * * [Api set: Mailbox 1.0] * @@ -13892,19 +15222,27 @@ declare namespace Office { */ key?: string; /** - * Specifies the ItemNotificationMessageType of message. If type is ProgressIndicator or ErrorMessage, an icon is automatically supplied and the message is not persistent. Therefore the icon and persistent properties are not valid for these types of messages. Including them will result in an ArgumentException. If type is ProgressIndicator, the developer should remove or replace the progress indicator when the action is complete. + * Specifies the ItemNotificationMessageType of message. If type is ProgressIndicator or ErrorMessage, an icon is automatically supplied and + * the message is not persistent. Therefore the icon and persistent properties are not valid for these types of messages. + * Including them will result in an ArgumentException. + * If type is ProgressIndicator, the developer should remove or replace the progress indicator when the action is complete. */ type: Office.MailboxEnums.ItemNotificationMessageType; /** - * A reference to an icon that is defined in the manifest in the Resources section. It appears in the infobar area. It is only applicable if the type is InformationalMessage. Specifying this parameter for an unsupported type results in an exception. + * A reference to an icon that is defined in the manifest in the Resources section. It appears in the infobar area. + * It is only applicable if the type is InformationalMessage. Specifying this parameter for an unsupported type results in an exception. */ icon?: string; /** - * The text of the notification message. Maximum length is 150 characters. If the developer passes in a longer string, an ArgumentOutOfRange exception is thrown. + * The text of the notification message. Maximum length is 150 characters. + * If the developer passes in a longer string, an ArgumentOutOfRange exception is thrown. */ message: string; /** - * Only applicable when type is InformationalMessage. If true, the message remains until removed by this add-in or dismissed by the user. If false, it is removed when the user navigates to a different item. For error notifications, the message persists until the user sees it once. Specifying this parameter for an unsupported type throws an exception. + * Only applicable when type is InformationalMessage. If true, the message remains until removed by this add-in or dismissed by the user. + * If false, it is removed when the user navigates to a different item. + * For error notifications, the message persists until the user sees it once. + * Specifying this parameter for an unsupported type throws an exception. */ persistent?: Boolean; } @@ -13924,11 +15262,14 @@ declare namespace Office { * * There are a maximum of 5 notifications per message. Setting more will return a NumberOfNotificationMessagesExceeded error. * - * @param key A developer-specified key used to reference this notification message. Developers can use it to modify this message later. It can't be longer than 32 characters. - * @param JSONmessage A JSON object that contains the notification message to be added to the item. It contains a NotificationMessageDetails object. + * @param key A developer-specified key used to reference this notification message. + * Developers can use it to modify this message later. It can't be longer than 32 characters. + * @param JSONmessage A JSON object that contains the notification message to be added to the item. + * It contains a NotificationMessageDetails object. * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of + * type {@link Office.AsyncResult}. * * [Api set: Mailbox 1.3] * @@ -13943,17 +15284,19 @@ declare namespace Office { * * `addAsync(key: string, JSONmessage: NotificationMessageDetails, options: Office.AsyncContextOptions): void;` * - * `addAsync(key: string, JSONmessage: NotificationMessageDetails, callback: (result: AsyncResult) => void): void;` + * `addAsync(key: string, JSONmessage: NotificationMessageDetails, callback: (result: AsyncResult) => void): void;` * */ - addAsync(key: string, JSONmessage: NotificationMessageDetails, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + addAsync(key: string, JSONmessage: NotificationMessageDetails, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Adds a notification to an item. * * There are a maximum of 5 notifications per message. Setting more will return a NumberOfNotificationMessagesExceeded error. * - * @param key A developer-specified key used to reference this notification message. Developers can use it to modify this message later. It can't be longer than 32 characters. - * @param JSONmessage A JSON object that contains the notification message to be added to the item. It contains a NotificationMessageDetails object. + * @param key A developer-specified key used to reference this notification message. Developers can use it to modify this message later. + * It can't be longer than 32 characters. + * @param JSONmessage A JSON object that contains the notification message to be added to the item. + * It contains a NotificationMessageDetails object. * * [Api set: Mailbox 1.3] * @@ -13968,8 +15311,10 @@ declare namespace Office { * * There are a maximum of 5 notifications per message. Setting more will return a NumberOfNotificationMessagesExceeded error. * - * @param key A developer-specified key used to reference this notification message. Developers can use it to modify this message later. It can't be longer than 32 characters. - * @param JSONmessage A JSON object that contains the notification message to be added to the item. It contains a NotificationMessageDetails object. + * @param key A developer-specified key used to reference this notification message. Developers can use it to modify this message later. + * It can't be longer than 32 characters. + * @param JSONmessage A JSON object that contains the notification message to be added to the item. + * It contains a NotificationMessageDetails object. * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. * @@ -13986,9 +15331,12 @@ declare namespace Office { * * There are a maximum of 5 notifications per message. Setting more will return a NumberOfNotificationMessagesExceeded error. * - * @param key A developer-specified key used to reference this notification message. Developers can use it to modify this message later. It can't be longer than 32 characters. - * @param JSONmessage A JSON object that contains the notification message to be added to the item. It contains a NotificationMessageDetails object. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. + * @param key A developer-specified key used to reference this notification message. Developers can use it to modify this message later. + * It can't be longer than 32 characters. + * @param JSONmessage A JSON object that contains the notification message to be added to the item. + * It contains a NotificationMessageDetails object. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of + * type {@link Office.AsyncResult}. * * [Api set: Mailbox 1.3] * @@ -13997,7 +15345,7 @@ declare namespace Office { * * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read */ - addAsync(key: string, JSONmessage: NotificationMessageDetails, callback: (result: AsyncResult) => void): void; + addAsync(key: string, JSONmessage: NotificationMessageDetails, callback: (result: AsyncResult) => void): void; /** * Returns all keys and messages for an item. * @@ -14010,13 +15358,14 @@ declare namespace Office { * * In addition to the main signature, this method also has this signature: * - * `getAllAsync(callback: (result: AsyncResult) => void): void;` + * `getAllAsync(callback: (result: AsyncResult) => void): void;` * * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type {@link Office.AsyncResult}. + * The `value` property of the result is an array of NotificationMessageDetails objects. */ - getAllAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + getAllAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Returns all keys and messages for an item. * @@ -14027,9 +15376,10 @@ declare namespace Office { * * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read * - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type {@link Office.AsyncResult}. + * The `value` property of the result is an array of NotificationMessageDetails objects. */ - getAllAsync(callback: (result: AsyncResult) => void): void; + getAllAsync(callback: (result: AsyncResult) => void): void; /** * Removes a notification message for an item. * @@ -14046,14 +15396,15 @@ declare namespace Office { * * `removeAsync(key: string, options: Office.AsyncContextOptions): void;` * - * `removeAsync(key: string, callback: (result: AsyncResult) => void): void;` + * `removeAsync(key: string, callback: (result: AsyncResult) => void): void;` * * @param key The key for the notification message to remove. * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of + * type {@link Office.AsyncResult}. */ - removeAsync(key: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + removeAsync(key: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Removes a notification message for an item. * @@ -14093,9 +15444,10 @@ declare namespace Office { * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read * * @param key The key for the notification message to remove. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of + * type {@link Office.AsyncResult}. */ - removeAsync(key: string, callback: (result: AsyncResult) => void): void; + removeAsync(key: string, callback: (result: AsyncResult) => void): void; /** * Replaces a notification message that has a given key with another message. * @@ -14114,15 +15466,17 @@ declare namespace Office { * * `replaceAsync(key: string, JSONmessage: NotificationMessageDetails, options: Office.AsyncContextOptions): void;` * - * `replaceAsync(key: string, JSONmessage: NotificationMessageDetails, callback: (result: AsyncResult) => void): void;` + * `replaceAsync(key: string, JSONmessage: NotificationMessageDetails, callback: (result: AsyncResult) => void): void;` * * @param key The key for the notification message to replace. It can't be longer than 32 characters. - * @param JSONmessage A JSON object that contains the new notification message to replace the existing message. It contains a NotificationMessageDetails object. + * @param JSONmessage A JSON object that contains the new notification message to replace the existing message. + * It contains a NotificationMessageDetails object. * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of + * type {@link Office.AsyncResult}. */ - replaceAsync(key: string, JSONmessage: NotificationMessageDetails, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + replaceAsync(key: string, JSONmessage: NotificationMessageDetails, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Replaces a notification message that has a given key with another message. * @@ -14136,7 +15490,8 @@ declare namespace Office { * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read * * @param key The key for the notification message to replace. It can't be longer than 32 characters. - * @param JSONmessage A JSON object that contains the new notification message to replace the existing message. It contains a NotificationMessageDetails object. + * @param JSONmessage A JSON object that contains the new notification message to replace the existing message. + * It contains a NotificationMessageDetails object. */ replaceAsync(key: string, JSONmessage: NotificationMessageDetails): void; /** @@ -14152,7 +15507,8 @@ declare namespace Office { * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read * * @param key The key for the notification message to replace. It can't be longer than 32 characters. - * @param JSONmessage A JSON object that contains the new notification message to replace the existing message. It contains a NotificationMessageDetails object. + * @param JSONmessage A JSON object that contains the new notification message to replace the existing message. + * It contains a NotificationMessageDetails object. * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. */ @@ -14170,15 +15526,18 @@ declare namespace Office { * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read * * @param key The key for the notification message to replace. It can't be longer than 32 characters. - * @param JSONmessage A JSON object that contains the new notification message to replace the existing message. It contains a NotificationMessageDetails object. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. + * @param JSONmessage A JSON object that contains the new notification message to replace the existing message. + * It contains a NotificationMessageDetails object. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of + * type {@link Office.AsyncResult}. */ - replaceAsync(key: string, JSONmessage: NotificationMessageDetails, callback: (result: AsyncResult) => void): void; + replaceAsync(key: string, JSONmessage: NotificationMessageDetails, callback: (result: AsyncResult) => void): void; } /** * Represents a phone number identified in an item. Read mode only. * - * An array of PhoneNumber objects containing the phone numbers found in an email message is returned in the phoneNumbers property of the Entities object that is returned when you call the getEntities method on the selected item. + * An array of PhoneNumber objects containing the phone numbers found in an email message is returned in the phoneNumbers property of the + * Entities object that is returned when you call the getEntities method on the selected item. * * [Api set: Mailbox 1.0] * @@ -14236,14 +15595,15 @@ declare namespace Office { * * `addAsync(recipients: (string | EmailUser | EmailAddressDetails)[], options: Office.AsyncContextOptions): void;` * - * `addAsync(recipients: (string | EmailUser | EmailAddressDetails)[], callback: (result: AsyncResult) => void): void;` + * `addAsync(recipients: (string | EmailUser | EmailAddressDetails)[], callback: (result: AsyncResult) => void): void;` * * @param recipients The recipients to add to the recipients list. * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. If adding the recipients fails, the asyncResult.error property will contain an error code. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of + * type {@link Office.AsyncResult}. If adding the recipients fails, the asyncResult.error property will contain an error code. */ - addAsync(recipients: (string | EmailUser | EmailAddressDetails)[], options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + addAsync(recipients: (string | EmailUser | EmailAddressDetails)[], options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Adds a recipient list to the existing recipients for an appointment or message. * @@ -14313,13 +15673,14 @@ declare namespace Office { * ErrorsNumberOfRecipientsExceeded - The number of recipients exceeded 100 entries. * * @param recipients The recipients to add to the recipients list. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. If adding the recipients fails, the asyncResult.error property will contain an error code. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of + * type {@link Office.AsyncResult}. If adding the recipients fails, the asyncResult.error property will contain an error code. */ - addAsync(recipients: (string | EmailUser | EmailAddressDetails)[], callback: (result: AsyncResult) => void): void; + addAsync(recipients: (string | EmailUser | EmailAddressDetails)[], callback: (result: AsyncResult) => void): void; /** * Gets a recipient list for an appointment or message. * - * When the call completes, the asyncResult.value property will contain an array of{@link Office.EmailAddressDetails} objects. + * When the call completes, the asyncResult.value property will contain an array of {@link Office.EmailAddressDetails} objects. * * [Api set: Mailbox 1.1] * @@ -14330,13 +15691,15 @@ declare namespace Office { * * In addition to the main signature, this method also has this signature: * - * `getAsync(callback: (result: AsyncResult) => void): void;` + * `getAsync(callback: (result: AsyncResult) => void): void;` * * @param options An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. - * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. + * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of + * type {@link Office.AsyncResult}. + * The `value` property of the result is an array of EmailAddressDetails objects. */ - getAsync(options: Office.AsyncContextOptions, callback: (result: AsyncResult) => void): void; + getAsync(options: Office.AsyncContextOptions, callback: (result: AsyncResult) => void): void; /** * Gets a recipient list for an appointment or message. * @@ -14349,9 +15712,11 @@ declare namespace Office { * * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose * - * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. + * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of + * type {@link Office.AsyncResult}. + * The `value` property of the result is an array of EmailAddressDetails objects. */ - getAsync(callback: (result: AsyncResult) => void): void; + getAsync(callback: (result: AsyncResult) => void): void; /** * Sets a recipient list for an appointment or message. * @@ -14380,14 +15745,17 @@ declare namespace Office { * * `setAsync(recipients: (string | EmailUser | EmailAddressDetails)[], options: Office.AsyncContextOptions): void;` * - * `setAsync(recipients: (string | EmailUser | EmailAddressDetails)[], callback: (result: AsyncResult) => void): void;` + * `setAsync(recipients: (string | EmailUser | EmailAddressDetails)[], callback: (result: AsyncResult) => void): void;` * * @param recipients The recipients to add to the recipients list. * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. If setting the recipients fails the asyncResult.error property will contain a code that indicates any error that occurred while adding the data. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of + * type {@link Office.AsyncResult}. + * If setting the recipients fails the asyncResult.error property will contain a code that indicates any error that occurred + * while adding the data. */ - setAsync(recipients: (string | EmailUser | EmailAddressDetails)[], options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + setAsync(recipients: (string | EmailUser | EmailAddressDetails)[], options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Sets a recipient list for an appointment or message. * @@ -14463,14 +15831,19 @@ declare namespace Office { * ErrorsNumberOfRecipientsExceeded - The number of recipients exceeded 100 entries. * * @param recipients The recipients to add to the recipients list. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. If setting the recipients fails the asyncResult.error property will contain a code that indicates any error that occurred while adding the data. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of + * type {@link Office.AsyncResult}. + * If setting the recipients fails the asyncResult.error property will contain a code that indicates any error that occurred + * while adding the data. */ - setAsync(recipients: (string | EmailUser | EmailAddressDetails)[], callback: (result: AsyncResult) => void): void; + setAsync(recipients: (string | EmailUser | EmailAddressDetails)[], callback: (result: AsyncResult) => void): void; } /** - * The recurrence object provides methods to get and set the recurrence pattern of appointments but only get the recurrence pattern of meeting requests. It will have a dictionary with the following keys: seriesTime, recurrenceType, recurrenceProperties, and recurrenceTimeZone (optional). + * The recurrence object provides methods to get and set the recurrence pattern of appointments but only get the recurrence pattern of + * meeting requests. + * It will have a dictionary with the following keys: seriesTime, recurrenceType, recurrenceProperties, and recurrenceTimeZone (optional). * * [Api set: Mailbox Preview] * @@ -14562,7 +15935,9 @@ declare namespace Office { recurrenceType: Office.MailboxEnums.RecurrenceType; /** - * The {@link Office.SeriesTime} object enables you to manage the start and end dates of the recurring appointment series and the usual start and end times of instances. **This object is not in UTC time.** Instead, it is set in the time zone specified by the recurrenceTimeZone value or defaulted to the item's time zone. + * The {@link Office.SeriesTime} object enables you to manage the start and end dates of the recurring appointment series and the usual start + * and end times of instances. **This object is not in UTC time.** + * Instead, it is set in the time zone specified by the recurrenceTimeZone value or defaulted to the item's time zone. * * [Api set: Mailbox Preview] * @@ -14589,13 +15964,15 @@ declare namespace Office { * * In addition to the main signature, this method also has this signature: * - * `getAsync(callback?: (result: AsyncResult) => void): void;` + * `getAsync(callback?: (result: AsyncResult) => void): void;` * * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an AsyncResult object. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, + * asyncResult, which is an {@link Office.AsyncResult} object. + * The `value` property of the result is a Recurrence object. */ - getAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + getAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Returns the current recurrence object of an appointment series. @@ -14610,9 +15987,11 @@ declare namespace Office { * * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read * - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an AsyncResult object. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, + * asyncResult, which is an {@link Office.AsyncResult} object. + * The `value` property of the result is a Recurrence object. */ - getAsync(callback?: (result: AsyncResult) => void): void; + getAsync(callback?: (result: AsyncResult) => void): void; /** * Sets the recurrence pattern of an appointment series. @@ -14631,14 +16010,15 @@ declare namespace Office { * * In addition to the main signature, this method also has this signature: * - * `setAsync(recurrencePattern: Recurrence, callback?: (result: AsyncResult) => void): void;` + * `setAsync(recurrencePattern: Recurrence, callback?: (result: AsyncResult) => void): void;` * * @param recurrencePattern A recurrence object. * @param options Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an AsyncResult object. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, + * asyncResult, which is an {@link Office.AsyncResult} object. */ - setAsync(recurrencePattern: Recurrence, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + setAsync(recurrencePattern: Recurrence, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Sets the recurrence pattern of an appointment series. @@ -14656,9 +16036,10 @@ declare namespace Office { * ErrorsInvalidEndTime - The appointment end time is before its start time. * * @param recurrencePattern A recurrence object. - * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an AsyncResult object. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, + * asyncResult, which is an {@link Office.AsyncResult} object. */ - setAsync(recurrencePattern: Recurrence, callback?: (result: AsyncResult) => void): void; + setAsync(recurrencePattern: Recurrence, callback?: (result: AsyncResult) => void): void; } /** @@ -14700,7 +16081,8 @@ declare namespace Office { */ month: Office.MailboxEnums.Month; /** - * Represents your chosen first day of the week otherwise the default is the value in the current user's settings. Valid values are: 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', and 'Sun'. + * Represents your chosen first day of the week otherwise the default is the value in the current user's settings. + * Valid values are: 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', and 'Sun'. */ firstDayOfWeek: Office.MailboxEnums.Days; } @@ -14722,7 +16104,8 @@ declare namespace Office { */ url?: string; /** - * Only used if type is set to file. If true, indicates that the attachment will be shown inline in the message body, and should not be displayed in the attachment list. + * Only used if type is set to file. If true, indicates that the attachment will be shown inline in the message body, and should not be + * displayed in the attachment list. */ inLine?: boolean; /** @@ -14744,20 +16127,27 @@ declare namespace Office { */ attachments?: ReplyFormAttachment[]; /** - * When the reply display call completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an AsyncResult object. + * When the reply display call completes, the function passed in the callback parameter is called with a single parameter, + * asyncResult, which is an {@link Office.AsyncResult} object. */ - callback?: (result: AsyncResult) => void; + callback?: (result: AsyncResult) => void; } /** - * The settings created by using the methods of the RoamingSettings object are saved per add-in and per user. That is, they are available only to the add-in that created them, and only from the user's mail box in which they are saved. + * The settings created by using the methods of the RoamingSettings object are saved per add-in and per user. + * That is, they are available only to the add-in that created them, and only from the user's mail box in which they are saved. * - * While the Outlook Add-in API limits access to these settings to only the add-in that created them, these settings should not be considered secure storage. They can be accessed by Exchange Web Services or Extended MAPI. They should not be used to store sensitive information such as user credentials or security tokens. + * While the Outlook Add-in API limits access to these settings to only the add-in that created them, these settings should not be considered + * secure storage. They can be accessed by Exchange Web Services or Extended MAPI. + * They should not be used to store sensitive information such as user credentials or security tokens. * * The name of a setting is a String, while the value can be a String, Number, Boolean, null, Object, or Array. * * The RoamingSettings object is accessible via the roamingSettings property in the Office.context namespace. * - * Important: The RoamingSettings object is initialized from the persisted storage only when the add-in is first loaded. For task panes, this means that it is only initialized when the task pane first opens. If the task pane navigates to another page or reloads the current page, the in-memory object is reset to its initial values, even if your add-in has persisted changes. The persisted changes will not be available until the task pane is closed and reopened. + * Important: The RoamingSettings object is initialized from the persisted storage only when the add-in is first loaded. + * For task panes, this means that it is only initialized when the task pane first opens. + * If the task pane navigates to another page or reloads the current page, the in-memory object is reset to its initial values, even if + * your add-in has persisted changes. The persisted changes will not be available until the task pane is closed and reopened. * * [Api set: Mailbox 1.0] * @@ -14797,7 +16187,9 @@ declare namespace Office { /** * Saves the settings. * - * Any settings previously saved by an add-in are loaded when it is initialized, so during the lifetime of the session you can just use the set and get methods to work with the in-memory copy of the settings property bag. When you want to persist the settings so that they are available the next time the add-in is used, use the saveAsync method. + * Any settings previously saved by an add-in are loaded when it is initialized, so during the lifetime of the session you can just use + * the set and get methods to work with the in-memory copy of the settings property bag. + * When you want to persist the settings so that they are available the next time the add-in is used, use the saveAsync method. * * [Api set: Mailbox 1.0] * @@ -14806,13 +16198,15 @@ declare namespace Office { * * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or read * - * @param callback Optional? When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. + * @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of + * type {@link Office.AsyncResult}. */ - saveAsync(callback?: (result: AsyncResult) => void): void; + saveAsync(callback?: (result: AsyncResult) => void): void; /** * Sets or creates the specified setting. * - * The set method creates a new setting of the specified name if it does not already exist, or sets an existing setting of the specified name. The value is stored in the document as the serialized JSON representation of its data type. + * The set method creates a new setting of the specified name if it does not already exist, or sets an existing setting of the specified name. + * The value is stored in the document as the serialized JSON representation of its data type. * * A maximum of 2MB is available for the settings of each add-in, and each individual setting is limited to 32KB. * @@ -14832,7 +16226,8 @@ declare namespace Office { } /** - * The SeriesTime object provides methods to get and set the dates and times of appointments in a recurring series and get the dates and times of meeting requests in a recurring series. + * The SeriesTime object provides methods to get and set the dates and times of appointments in a recurring series and get the dates and times of + * meeting requests in a recurring series. * * [Api set: Mailbox Preview] * @@ -14869,7 +16264,9 @@ declare namespace Office { getEndDate(): string; /** - * Gets the end time of a usual appointment or meeting request instance of a recurrence pattern in whichever time zone that the user or add-in set the recurrence pattern using the following {@link https://www.iso.org/iso-8601-date-and-time-format.html | ISO 8601} format: "THH:mm:ss:mmm" + * Gets the end time of a usual appointment or meeting request instance of a recurrence pattern in whichever time zone that the user or + * add-in set the recurrence pattern using the following {@link https://www.iso.org/iso-8601-date-and-time-format.html | ISO 8601} format: + * "THH:mm:ss:mmm" * * [Api set: Mailbox Preview] * @@ -14893,7 +16290,8 @@ declare namespace Office { getStartDate(): string; /** - * Gets the start time of a usual appointment instance of a recurrence pattern in whichever time zone that the user/add-in set the recurrence pattern using the following {@link https://www.iso.org/iso-8601-date-and-time-format.html | ISO 8601} format: "THH:mm:ss:mmm" + * Gets the start time of a usual appointment instance of a recurrence pattern in whichever time zone that the user/add-in set the + * recurrence pattern using the following {@link https://www.iso.org/iso-8601-date-and-time-format.html | ISO 8601} format: "THH:mm:ss:mmm" * * [Api set: Mailbox Preview] * @@ -14932,7 +16330,8 @@ declare namespace Office { * * In addition to the main signature, this method also has this signature: * - * `setEndDate(date: string): void;` (Where date is the end date of the recurring appointment series represented in the {@link https://www.iso.org/iso-8601-date-and-time-format.html | ISO 8601} date format: "YYYY-MM-DD"). + * `setEndDate(date: string): void;` (Where date is the end date of the recurring appointment series represented in the + * {@link https://www.iso.org/iso-8601-date-and-time-format.html | ISO 8601} date format: "YYYY-MM-DD"). * * @param year The year value of the end date. * @param month The month value of the end date. Valid range is 0-11 where 0 represents the 1st month and 11 represents the 12th month. @@ -14993,7 +16392,8 @@ declare namespace Office { setStartDate(date:string): void; /** - * Sets the start time of all instances of a recurring appointment series in whichever time zone the recurrence pattern is set (the item's time zone is used by default). + * Sets the start time of all instances of a recurring appointment series in whichever time zone the recurrence pattern is set + * (the item's time zone is used by default). * * [Api set: Mailbox Preview] * @@ -15014,7 +16414,8 @@ declare namespace Office { setStartTime(hours: number, minutes: number): void; /** - * Sets the start time of all instances of a recurring appointment series in whichever time zone the recurrence pattern is set (the item's time zone is used by default). + * Sets the start time of all instances of a recurring appointment series in whichever time zone the recurrence pattern is set + * (the item's time zone is used by default). * * [Api set: Mailbox Preview] * @@ -15055,15 +16456,18 @@ declare namespace Office { * * In addition to the main signature, this method also has this signature: * - * `getAsync(callback: (result: AsyncResult) => void): void;` + * `getAsync(callback: (result: AsyncResult) => void): void;` * * @param options An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. - * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. + * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of + * type {@link Office.AsyncResult}. + * The `value` property of the result is the subject of the item. */ - getAsync(options: Office.AsyncContextOptions, callback: (result: AsyncResult) => void): void; + getAsync(options: Office.AsyncContextOptions, callback: (result: AsyncResult) => void): void; /** * Gets the subject of an appointment or message. + * * The getAsync method starts an asynchronous call to the Exchange server to get the subject of an appointment or message. * * [Api set: Mailbox 1.1] @@ -15074,12 +16478,14 @@ declare namespace Office { * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose * * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. + * The `value` property of the result is the subject of the item. */ - getAsync(callback: (result: AsyncResult) => void): void; + getAsync(callback: (result: AsyncResult) => void): void; /** * Sets the subject of an appointment or message. * - * The setAsync method starts an asynchronous call to the Exchange server to set the subject of an appointment or message. Setting the subject overwrites the current subject, but leaves any prefixes, such as "Fwd:" or "Re:" in place. + * The setAsync method starts an asynchronous call to the Exchange server to set the subject of an appointment or message. + * Setting the subject overwrites the current subject, but leaves any prefixes, such as "Fwd:" or "Re:" in place. * * [Api set: Mailbox 1.1] * @@ -15096,18 +16502,20 @@ declare namespace Office { * * `setAsync(subject: string, options: Office.AsyncContextOptions): void;` * - * `setAsync(subject: string, callback: (result: AsyncResult) => void): void;` + * `setAsync(subject: string, callback: (result: AsyncResult) => void): void;` * * @param subject The subject of the appointment or message. The string is limited to 255 characters. * @param options An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. - * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. If setting the subject fails, the asyncResult.error property will contain an error code. + * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of + * type {@link Office.AsyncResult}. If setting the subject fails, the asyncResult.error property will contain an error code. */ - setAsync(subject: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + setAsync(subject: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Sets the subject of an appointment or message. * - * The setAsync method starts an asynchronous call to the Exchange server to set the subject of an appointment or message. Setting the subject overwrites the current subject, but leaves any prefixes, such as "Fwd:" or "Re:" in place. + * The setAsync method starts an asynchronous call to the Exchange server to set the subject of an appointment or message. + * Setting the subject overwrites the current subject, but leaves any prefixes, such as "Fwd:" or "Re:" in place. * * [Api set: Mailbox 1.1] * @@ -15124,7 +16532,8 @@ declare namespace Office { /** * Sets the subject of an appointment or message. * - * The setAsync method starts an asynchronous call to the Exchange server to set the subject of an appointment or message. Setting the subject overwrites the current subject, but leaves any prefixes, such as "Fwd:" or "Re:" in place. + * The setAsync method starts an asynchronous call to the Exchange server to set the subject of an appointment or message. + * Setting the subject overwrites the current subject, but leaves any prefixes, such as "Fwd:" or "Re:" in place. * * [Api set: Mailbox 1.1] * @@ -15143,7 +16552,8 @@ declare namespace Office { /** * Sets the subject of an appointment or message. * - * The setAsync method starts an asynchronous call to the Exchange server to set the subject of an appointment or message. Setting the subject overwrites the current subject, but leaves any prefixes, such as "Fwd:" or "Re:" in place. + * The setAsync method starts an asynchronous call to the Exchange server to set the subject of an appointment or message. + * Setting the subject overwrites the current subject, but leaves any prefixes, such as "Fwd:" or "Re:" in place. * * [Api set: Mailbox 1.1] * @@ -15155,15 +16565,17 @@ declare namespace Office { * ErrorsDataExceedsMaximumSize - The subject parameter is longer than 255 characters. * * @param subject The subject of the appointment or message. The string is limited to 255 characters. - * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. If setting the subject fails, the asyncResult.error property will contain an error code. + * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of + * type {@link Office.AsyncResult}. If setting the subject fails, the asyncResult.error property will contain an error code. */ - setAsync(data: string, callback: (result: AsyncResult) => void): void; + setAsync(data: string, callback: (result: AsyncResult) => void): void; } /** * Represents a suggested task identified in an item. Read mode only. * - * The list of tasks suggested in an email message is returned in the taskSuggestions property of the [Entities]Entities object that is returned when the getEntities or getEntitiesByType method is called on the active item. + * The list of tasks suggested in an email message is returned in the taskSuggestions property of the {@link Office.Entities | Entities} object + * that is returned when the getEntities or getEntitiesByType method is called on the active item. * * [Api set: Mailbox 1.0] * @@ -15196,7 +16608,8 @@ declare namespace Office { /** * Gets the start or end time of an appointment. * - * The date and time is provided as a Date object in the asyncResult.value property. The value is in Coordinated Universal Time (UTC). You can convert the UTC time to the local client time by using the convertToLocalClientTime method. + * The date and time is provided as a Date object in the asyncResult.value property. The value is in Coordinated Universal Time (UTC). + * You can convert the UTC time to the local client time by using the convertToLocalClientTime method. * * [Api set: Mailbox 1.1] * @@ -15207,17 +16620,19 @@ declare namespace Office { * * In addition to the main signature, this method also has this signature: * - * `getAsync(callback: (result: AsyncResult) => void): void;` + * `getAsync(callback: (result: AsyncResult) => void): void;` * * @param options An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. + * The `value` property of the result is a Date object. */ - getAsync(options: Office.AsyncContextOptions, callback: (result: AsyncResult) => void): void; + getAsync(options: Office.AsyncContextOptions, callback: (result: AsyncResult) => void): void; /** * Gets the start or end time of an appointment. * - * The date and time is provided as a Date object in the asyncResult.value property. The value is in Coordinated Universal Time (UTC). You can convert the UTC time to the local client time by using the convertToLocalClientTime method. + * The date and time is provided as a Date object in the asyncResult.value property. The value is in Coordinated Universal Time (UTC). + * You can convert the UTC time to the local client time by using the convertToLocalClientTime method. * * [Api set: Mailbox 1.1] * @@ -15227,12 +16642,14 @@ declare namespace Office { * {@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose * * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. + * The `value` property of the result is a Date object. */ - getAsync(callback: (result: AsyncResult) => void): void; + getAsync(callback: (result: AsyncResult) => void): void; /** * Sets the start or end time of an appointment. * - * If the setAsync method is called on the start property, the end property will be adjusted to maintain the duration of the appointment as previously set. If the setAsync method is called on the end property, the duration of the appointment will be extended to the new end time. + * If the setAsync method is called on the start property, the end property will be adjusted to maintain the duration of the appointment as + * previously set. If the setAsync method is called on the end property, the duration of the appointment will be extended to the new end time. * * The time must be in UTC; you can get the correct UTC time by using the convertToUtcClientTime method. * @@ -15251,18 +16668,21 @@ declare namespace Office { * * `setAsync(dateTime: Date, options: Office.AsyncContextOptions): void;` * - * `setAsync(dateTime: Date, callback: (result: AsyncResult) => void): void;` + * `setAsync(dateTime: Date, callback: (result: AsyncResult) => void): void;` * * @param dateTime A date-time object in Coordinated Universal Time (UTC). * @param options An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. - * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. If setting the date and time fails, the asyncResult.error property will contain an error code. + * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of + * type {@link Office.AsyncResult}. + * If setting the date and time fails, the asyncResult.error property will contain an error code. */ - setAsync(dateTime: Date, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + setAsync(dateTime: Date, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Sets the start or end time of an appointment. * - * If the setAsync method is called on the start property, the end property will be adjusted to maintain the duration of the appointment as previously set. If the setAsync method is called on the end property, the duration of the appointment will be extended to the new end time. + * If the setAsync method is called on the start property, the end property will be adjusted to maintain the duration of the appointment as + * previously set. If the setAsync method is called on the end property, the duration of the appointment will be extended to the new end time. * * The time must be in UTC; you can get the correct UTC time by using the convertToUtcClientTime method. * @@ -15281,7 +16701,8 @@ declare namespace Office { /** * Sets the start or end time of an appointment. * - * If the setAsync method is called on the start property, the end property will be adjusted to maintain the duration of the appointment as previously set. If the setAsync method is called on the end property, the duration of the appointment will be extended to the new end time. + * If the setAsync method is called on the start property, the end property will be adjusted to maintain the duration of the appointment as + * previously set. If the setAsync method is called on the end property, the duration of the appointment will be extended to the new end time. * * The time must be in UTC; you can get the correct UTC time by using the convertToUtcClientTime method. * @@ -15302,7 +16723,8 @@ declare namespace Office { /** * Sets the start or end time of an appointment. * - * If the setAsync method is called on the start property, the end property will be adjusted to maintain the duration of the appointment as previously set. If the setAsync method is called on the end property, the duration of the appointment will be extended to the new end time. + * If the setAsync method is called on the start property, the end property will be adjusted to maintain the duration of the appointment as + * previously set. If the setAsync method is called on the end property, the duration of the appointment will be extended to the new end time. * * The time must be in UTC; you can get the correct UTC time by using the convertToUtcClientTime method. * @@ -15316,9 +16738,11 @@ declare namespace Office { * ErrorsInvalidEndTime - The appointment end time is before the appointment start time. * * @param dateTime A date-time object in Coordinated Universal Time (UTC). - * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. If setting the date and time fails, the asyncResult.error property will contain an error code. + * @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of + * type {@link Office.AsyncResult}. + * If setting the date and time fails, the asyncResult.error property will contain an error code. */ - setAsync(dateTime: Date, callback: (result: AsyncResult) => void): void; + setAsync(dateTime: Date, callback: (result: AsyncResult) => void): void; } /** @@ -15423,24 +16847,31 @@ declare namespace Office { //////////////////////////////////////////////////////////////// declare namespace OfficeExtension { - /** An abstract proxy object that represents an object in an Office document. - * You create proxy objects from the context (or from other proxy objects), add commands to a queue to act on the object, and then synchronize the proxy object state with the document by calling `context.sync()`. + /** + * An abstract proxy object that represents an object in an Office document. + * You create proxy objects from the context (or from other proxy objects), add commands to a queue to act on the object, and then synchronize the + * proxy object state with the document by calling `context.sync()`. */ class ClientObject { /** The request context associated with the object */ context: ClientRequestContext; - /** Returns a boolean value for whether the corresponding object is a null object. You must call `context.sync()` before reading the isNullObject property. */ + /** + * Returns a boolean value for whether the corresponding object is a null object. You must call `context.sync()` before reading the + * isNullObject property. + */ isNullObject: boolean; } } declare namespace OfficeExtension { /** - * Specifies which properties of an object should be loaded. This load happens when the sync() method is executed. This synchronizes the states between Office objects and corresponding JavaScript proxy objects. + * Specifies which properties of an object should be loaded. This load happens when the sync() method is executed. + * This synchronizes the states between Office objects and corresponding JavaScript proxy objects. * * @remarks * - * For Word, the preferred method for specifying the properties and paging information is by using a string literal. The first two examples show the preferred way to request the text and font size properties for paragraphs in a paragraph collection: + * For Word, the preferred method for specifying the properties and paging information is by using a string literal. + * The first two examples show the preferred way to request the text and font size properties for paragraphs in a paragraph collection: * * `context.load(paragraphs, 'text, font/size');` * @@ -15452,7 +16883,8 @@ declare namespace OfficeExtension { * * `paragraphs.load({select: 'text, font/size', expand: 'font', top: 50, skip: 0});` * - * Note that if we don't specify the specific properties on the font object in the select statement, the expand statement by itself would indicate that all of the font properties are loaded. + * Note that if we don't specify the specific properties on the font object in the select statement, the expand statement by itself would + * indicate that all of the font properties are loaded. */ interface LoadOption { /** @@ -15468,7 +16900,8 @@ declare namespace OfficeExtension { */ top?: number; /** - * Only usable on collection types. Specifies the number of items in the collection that are to be skipped and not included in the result. If top is specified, the result set will start after skipping the specified number of items. + * Only usable on collection types. Specifies the number of items in the collection that are to be skipped and not included in the result. + * If top is specified, the result set will start after skipping the specified number of items. */ skip?: number; } @@ -15492,7 +16925,9 @@ declare namespace OfficeExtension { session?: RequestUrlAndHeaderInfo | T; /** - * A previously-created context, or API object, or array of objects. The batch will use the same RequestContext as the passed-in object, which means that any changes applied to the object will be picked up by `context.sync()`. + * A previously-created context, or API object, or array of objects. + * The batch will use the same RequestContext as the passed-in object, which means that any changes applied to the object will be picked up + * by `context.sync()`. */ previousObjects?: ClientObject | ClientObject[] | ClientRequestContext; } @@ -15507,7 +16942,10 @@ declare namespace OfficeExtension { pendingStatements: string[]; } - /** An abstract RequestContext object that facilitates requests to the host Office application. The `Excel.run` and `Word.run` methods provide a request context. */ + /** + * An abstract RequestContext object that facilitates requests to the host Office application. + * The `Excel.run` and `Word.run` methods provide a request context. + */ class ClientRequestContext { constructor(url?: string); @@ -15517,10 +16955,12 @@ declare namespace OfficeExtension { /** Request headers */ requestHeaders: { [name: string]: string }; - /** Queues up a command to load the specified properties of the object. You must call `context.sync()` before reading the properties. + /** + * Queues up a command to load the specified properties of the object. You must call `context.sync()` before reading the properties. * * @param object The object whose properties are loaded. - * @param option A comma-delimited string, or array of strings, that specifies the properties/relationships to load, or an {@link OfficeExtension.LoadOption} object. + * @param option A comma-delimited string, or array of strings, that specifies the properties/relationships to load, or an + * {@link OfficeExtension.LoadOption} object. */ load(object: ClientObject, option?: string | string[] | LoadOption): void; @@ -15530,15 +16970,24 @@ declare namespace OfficeExtension { * You must call `context.sync()` before reading the properties. * * @param object The object to be loaded. - * @param options The key-value pairing of load options for the types, such as `{ "Workbook": "worksheets,tables", "Worksheet": "tables", "Tables": "name" }` + * @param options The key-value pairing of load options for the types, such as + * `{ "Workbook": "worksheets,tables", "Worksheet": "tables", "Tables": "name" }` * @param maxDepth The maximum recursive depth. */ loadRecursive(object: ClientObject, options: { [typeName: string]: string | string[] | LoadOption }, maxDepth?: number): void; - /** Adds a trace message to the queue. If the promise returned by `context.sync()` is rejected due to an error, this adds a ".traceMessages" array to the OfficeExtension.Error object, containing all trace messages that were executed. These messages can help you monitor the program execution sequence and detect the cause of the error. */ + /** + * Adds a trace message to the queue. If the promise returned by `context.sync()` is rejected due to an error, this adds a ".traceMessages" + * array to the OfficeExtension.Error object, containing all trace messages that were executed. + * These messages can help you monitor the program execution sequence and detect the cause of the error. + */ trace(message: string): void; - /** Synchronizes the state between JavaScript proxy objects and the Office document, by executing instructions queued on the request context and retrieving properties of loaded Office objects for use in your code. This method returns a promise, which is resolved when the synchronization is complete. */ + /** + * Synchronizes the state between JavaScript proxy objects and the Office document, by executing instructions queued on the request context + * and retrieving properties of loaded Office objects for use in your code. + * This method returns a promise, which is resolved when the synchronization is complete. + */ sync(passThroughValue?: T): Promise; /** Debug information */ @@ -15574,10 +17023,13 @@ declare namespace OfficeExtension { /** * Determines whether to log additional error information upon failure. * - * When this property is set to true, the error object will include a "debugInfo.fullStatements" property that lists all statements in the batch request, including all statements that precede and follow the point of failure. + * When this property is set to true, the error object will include a "debugInfo.fullStatements" property that lists all statements in the + * batch request, including all statements that precede and follow the point of failure. * - * Setting this property to true will negatively impact performance and will log all statements in the batch request, including any statements that may contain potentially-sensitive data. - * It is recommended that you only set this property to true during debugging and that you never log the value of error.debugInfo.fullStatements to an external database or analytics service. + * Setting this property to true will negatively impact performance and will log all statements in the batch request, including any statements + * that may contain potentially-sensitive data. + * It is recommended that you only set this property to true during debugging and that you never log the value of + * error.debugInfo.fullStatements to an external database or analytics service. */ extendedErrorLogging: boolean; }; @@ -15596,13 +17048,15 @@ declare namespace OfficeExtension { /** * The statement that caused the error, if available. * - * This statement will never contain any potentially-sensitive data and may not match the code exactly as written, but will be a close approximation. + * This statement will never contain any potentially-sensitive data and may not match the code exactly as written, + * but will be a close approximation. */ statements?: string; /** * The statements that closely precede and follow the statement that caused the error, if available. * - * These statements will never contain any potentially-sensitive data and may not match the code exactly as written, but will be a close approximation. + * These statements will never contain any potentially-sensitive data and may not match the code exactly as written, + * but will be a close approximation. */ surroundingStatements?: string[]; /** @@ -15623,7 +17077,11 @@ declare namespace OfficeExtension { stack: string; /** Error code string, such as "InvalidArgument". */ code: string; - /** Trace messages (if any) that were added via a `context.trace()` invocation before calling `context.sync()`. If there was an error, this contains all trace messages that were executed before the error occurred. These messages can help you monitor the program execution sequence and detect the case of the error. */ + /** + * Trace messages (if any) that were added via a `context.trace()` invocation before calling `context.sync()`. + * If there was an error, this contains all trace messages that were executed before the error occurred. + * These messages can help you monitor the program execution sequence and detect the case of the error. + */ traceMessages: Array; /** Debug info (useful for detailed logging of the error, i.e., via `JSON.stringify(...)`). */ debugInfo: DebugInfo; @@ -15650,7 +17108,13 @@ declare namespace OfficeExtension { } declare namespace OfficeExtension { - /** A Promise object that represents a deferred interaction with the host Office application. The publicly-consumable {@link Office.OfficeExtension.Promise} is available starting in ExcelApi 1.2 and WordApi 1.2. Promises can be chained via ".then", and errors can be caught via ".catch". Remember to always use a ".catch" on the outer promise, and to return intermediary promises so as not to break the promise chain. When a browser-provided native Promise implementation is available, OfficeExtension.Promise will switch to use the native Promise instead. */ + /** + * A Promise object that represents a deferred interaction with the host Office application. + * The publicly-consumable {@link Office.OfficeExtension.Promise} is available starting in ExcelApi 1.2 and WordApi 1.2. + * Promises can be chained via ".then", and errors can be caught via ".catch". + * Remember to always use a ".catch" on the outer promise, and to return intermediary promises so as not to break the promise chain. + * When a browser-provided native Promise implementation is available, OfficeExtension.Promise will switch to use the native Promise instead. + */ const Promise: Office.IPromiseConstructor; type IPromise = Promise; } @@ -15659,24 +17123,38 @@ declare namespace OfficeExtension { /** Collection of tracked objects, contained within a request context. See "context.trackedObjects" for more information. */ class TrackedObjects { /** - * Track a new object for automatic adjustment based on surrounding changes in the document. Only some object types require this. If you are using an object across ".sync" calls and outside the sequential execution of a ".run" batch, and get an "InvalidObjectPath" error when setting a property or invoking a method on the object, you needed to have added the object to the tracked object collection when the object was first created. + * Track a new object for automatic adjustment based on surrounding changes in the document. Only some object types require this. + * If you are using an object across ".sync" calls and outside the sequential execution of a ".run" batch, + * and get an "InvalidObjectPath" error when setting a property or invoking a method on the object, you needed to have added the object + * to the tracked object collection when the object was first created. * * This method also has the following signature: * * `add(objects: ClientObject[]): void;` Where objects is an array of objects to be tracked. */ add(object: ClientObject): void; - /** Track a set of objects for automatic adjustment based on surrounding changes in the document. Only some object types require this. If you are using an object across ".sync" calls and outside the sequential execution of a ".run" batch, and get an "InvalidObjectPath" error when setting a property or invoking a method on the object, you needed to have added the object to the tracked object collection when the object was first created. */ + /** + * Track a set of objects for automatic adjustment based on surrounding changes in the document. Only some object types require this. + * If you are using an object across ".sync" calls and outside the sequential execution of a ".run" batch, + * and get an "InvalidObjectPath" error when setting a property or invoking a method on the object, you needed to have added the object + * to the tracked object collection when the object was first created. + */ add(objects: ClientObject[]): void; /** - * Release the memory associated with an object that was previously added to this collection. Having many tracked objects slows down the host application, so please remember to free any objects you add, once you're done using them. You will need to call `context.sync()` before the memory release takes effect. + * Release the memory associated with an object that was previously added to this collection. + * Having many tracked objects slows down the host application, so please remember to free any objects you add, once you're done using them. + * You will need to call `context.sync()` before the memory release takes effect. * * This method also has the following signature: * * `remove(objects: ClientObject[]): void;` Where objects is an array of objects to be removed. */ remove(object: ClientObject): void; - /** Release the memory associated with an object that was previously added to this collection. Having many tracked objects slows down the host application, so please remember to free any objects you add, once you're done using them. You will need to call `context.sync()` before the memory release takes effect. */ + /** + * Release the memory associated with an object that was previously added to this collection. + * Having many tracked objects slows down the host application, so please remember to free any objects you add, once you're done using them. + * You will need to call `context.sync()` before the memory release takes effect. + */ remove(objects: ClientObject[]): void; } } diff --git a/types/oja/index.d.ts b/types/oja/index.d.ts new file mode 100644 index 0000000000..f1d123d3f0 --- /dev/null +++ b/types/oja/index.d.ts @@ -0,0 +1,90 @@ +// Type definitions for oja 1.1 +// Project: https://github.com/dimichgh/oja#readme +// Definitions by: Laurens Stötzel +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +/// + +import { Readable } from "stream"; +import { EventEmitter } from "events"; +export type ConsumerCallback = (payload: any, runtime: Flow) => void; + +export type Primitive = + | boolean + | number + | string + | symbol + | null + | undefined; + +export interface State { + queue: string[]; + pending: string[]; +} + +export type DefinitionFunction = (publisher: StageContext, runtime: Flow) => any; + +export type AddableFunction = (runtime: Flow) => void; +export type AddableToAction = Action | AddableFunction; + +export class EventContext { + new(context: EventContext | object): this; + stageContext(topics: string | ReadonlyArray): StageContext; + state(): State; + repub(type: string, handler: (event: any) => void): void; + on(type: string, handler: (event: any) => void): this; + once(type: string, handler: (event: any) => void): this; + emit(name: string, value: any): this; + get(name: string): any; +} + +export class StageContext extends EventContext { + pub(data: any): void; +} + +export class ReadableStream extends Readable { + new(topic: string, emitter: EventEmitter): this; + push(data: any): boolean; +} + +export class Flow { + constructor(baseFlow?: Flow); + consume(topic: string | ReadonlyArray, callback: ConsumerCallback): this; + consume(topic: string): Promise; + consume( + topics: ReadonlyArray + ): Promise<{ + [key: string]: string; + }>; + consumeStream( + topic: string, + callback: (stream: ReadableStream) => void + ): this; + consumeStream(topic: string): ReadableStream; + getReader( + topic: string + ): { + next(): Promise; + }; + define(topics: string | ReadonlyArray): StageContext; + define( + topic: string, + data: Promise | DefinitionFunction | object | Primitive + ): this; + catch(callback: (err: any) => void): this; + timeout(topics: string | ReadonlyArray, ms: number): this; + state(): State; +} + +export class Action extends Flow { + constructor(); + activate(): this; + execute(): void; + add(...child: AddableToAction[]): this; +} + +export class FunctionAction extends Action { + constructor(callback: (runtime: FunctionAction) => any); + execute(): any; +} diff --git a/types/oja/oja-tests.ts b/types/oja/oja-tests.ts new file mode 100644 index 0000000000..9ee12587af --- /dev/null +++ b/types/oja/oja-tests.ts @@ -0,0 +1,278 @@ +import { Action, Flow, StageContext } from "oja"; + +new Action().activate(); + +class MyAction extends Action { + execute() { + this.define('foo', 'bar'); + } +} + +new MyAction() + .activate() + .consume('foo', data => console.log(data)); + +class Greet extends Action { + execute() { + this.define('greet', 'Hello'); + } +} + +// demonstrate generic function instead of action object +function who(flow: Flow) { + // demonstrate re-mapping + flow.consume('name', name => { + flow.define('who', name); + }); +} + +class Greeting extends Action { + execute() { + this.consume(['greet', 'who'], data => { + this.define('greeting', `${data.greet} ${data.who}`); + }); + } +} + +const helloAction = new Greeting(); +helloAction + .add(new Greet()) + .add(who) + .activate() + .define('name', 'World') + .consume('greeting', console.log); // prints Hello World + +// create consumer component +const flow = new Flow(); +const consumer = flow.consume('foo'); +consumer.then(foo => { + console.log(foo); // prints 'bar' +}); + +// define producer component +const producer = flow.define('foo'); +// publish +producer.pub('bar'); + +flow + .consume('foo', foo => { + console.log(foo); // prints 'bar' + }) + .define('foo', 'bar'); + +// Consuming multiple events for the given topic +// create consumer component +flow + .consume('foo', foo => { + console.log(foo); // prints 'bar1' and 'bar2' + }) + // generate events + .define('foo', 'bar1') + .define('foo', 'bar2'); + +// Consuming events as a stream +const buffer: any[] = []; +// create consumer stream +const stream = flow.consumeStream('foo'); +stream.on('data', data => buffer.push(data)); +stream.on('end', () => { + console.log(buffer); // prints one, two, three +}); +// generate some data +flow.define('foo', 'one'); +flow.define('foo', 'two'); +flow.define('foo', 'three'); +flow.define('foo', null); + +// create consumer stream +const reader = flow.getReader('foo'); +// generate some data +flow.define('foo', 'one'); +flow.define('foo', 'two'); +flow.define('foo', 'three'); +flow.define('foo', null); + +async function read() { + while (true) { + const data = await reader.next(); + if (data === undefined) { + break; + } + console.log(data); + } +} + +read(); + +// Consuming multiple topics in one short +// consume multiple topics +flow.consume(['foo', 'qoo'], input => { + console.log(input.foo); // prints faa + console.log(input.qoo); // prints qaa +}); +flow.define('foo', 'faa'); +flow.define('qoo', 'qaa'); + +// Using promise +// create consumer component +flow + .consume('foo', foo => { + console.log(foo); // prints 'bar' + }) + .define('foo', new Promise(resolve => { + resolve('bar'); + })); + +// Multiple consumers, single producer +// create consumer component +flow + .consume('foo', foo => { + console.log(foo); // prints 'bar' + }) + .consume('foo', foo => { + console.log(foo); // prints 'bar' + }) + .define('foo', 'bar'); + +// NOTE: the order of consume/define does not matter +// create consumer component +flow + .consume('foo', (foo, runtime) => { + console.log(foo); // prints 'faa' + runtime.define('qoo', 'qaa'); // can consume and produce new data + }) + .consume('qoo', (qoo, runtime) => { + console.log(qoo); // prints 'qaa' + runtime.define('woo', Promise.resolve('waa')); // can use async promise + }) + // start chain reaction here + .define('foo', 'faa') + // lets produce multiple events via event emitter + .consume('woo', (woo, runtime) => { + console.log(woo); // prints waa + // define as event emitter + const roo = runtime.define('roo'); + // simulate async flow with two event emitted + setImmediate(() => { + // generate multiple events + roo.pub('raa1'); + roo.pub('raa2'); + }); + }) + // validate + .consume('roo', roo => { + console.log(roo); // prints raa1 and raa2 + }) + // consume multiple topics + .consume(['foo', 'qoo'], input => { + console.log(input.foo); // prints faa + console.log(input.qoo); // prints qaa + }) + // can consume inside consume + .consume('foo', (foo, runtime) => { + console.log(foo); // prints faa + runtime.consume('qoo', qoo => { + console.log(qoo); // prints qaa + }); + // or + flow.consume('qoo', qoo => { + console.log(qoo); // prints qaa + }); + }) + // can generate multiple events using pub + .define('doo', (publisher: StageContext) => { + publisher.pub('daa1'); + publisher.pub('daa2'); + publisher.pub('daa3'); + publisher.pub(null); + }) + .consume('doo', doo => { + console.log(doo); // prints daa1, daa2, daa3, null + }) + .consumeStream('doo', stream => { + stream.on('data', console.log); // prints daa1, daa2, daa3 + stream.on('end', () => console.log('end of "doo"')); + }) + // NOTE: we can consume first event via promise if we are not interested in the rest + .consume('doo').then(doo => { + console.log(doo); // prints daa1 +}); + +// for debug you can listen to all events +flow.consume('*', evt => { + console.log(`Event type: ${evt.name}, data: ${evt.data}`); +}); + +// Join flows together +const base = new Flow(); +base.define('foo', 'bar'); +let subFlow = new Flow(base); +subFlow.consume('foo', foo => { + console.log(foo); // prints bar +}); + +base.consume('shared', (_, rt) => { + rt.define('foo', 'bar'); +}); +subFlow = new Flow(base); +flow.consume('foo', foo => { + console.log(foo); // prints bar +}); +flow.define('shared', ''); // trigger the chain + +// Timeouts +flow + .timeout(['foo', 'bar'], 300) // 300 ms + .define('bar', 'boo') + .catch(err => { + console.log(err.message); // prints "Topic/s (foo) timed out, pending topics (too)" + }); + +// Querying for state +console.log(flow.state()); // prints [foo, too] + +// Throwing error +flow.define('error', new Error('Boom')); +// or +flow.define('error', Promise.reject(new Error('Boom'))); +// or +flow.define('data', () => { + return new Error('Boom'); +}); +// or +flow.define('data', (runtime: StageContext) => { + runtime.pub(new Error('Boom')); +}); + +// Catching error +flow.catch(err => { + console.log(err); // prints Boom if linked to the above flow +}); +// Or +flow.consume('error', err => { + console.log(err); // prints Boom if linked to the above flow +}); + +// Error stops flow +flow + .define('foo', 'faa') + .define('boo', 'baa') + .define('error', new Error('Boom')) + .define('too', 'taa') + .consume('foo', foo => { + console.log(foo); // prints faa + }) + .consume('boo', foo => { + console.log(foo); // prints baa + }) + .consume('too', too => { + // will never happen + throw new Error('Should never happen'); + }) + .catch(err => { // catch error + console.log(err); // print Boom + }); + +// Composing complex flows +const baseFlow = new Flow(); +new Flow(baseFlow); diff --git a/types/oja/tsconfig.json b/types/oja/tsconfig.json new file mode 100644 index 0000000000..6fac615aaa --- /dev/null +++ b/types/oja/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "oja-tests.ts" + ] +} diff --git a/types/oja/tslint.json b/types/oja/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/oja/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/omggif/index.d.ts b/types/omggif/index.d.ts new file mode 100644 index 0000000000..f7d374ddbb --- /dev/null +++ b/types/omggif/index.d.ts @@ -0,0 +1,60 @@ +// Type definitions for omggif 1.0 +// Project: https://github.com/deanm/omggif +// Definitions by: Florian Keller +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 + +/// + +export interface GifOptions { + background?: number; + loop?: number; + palette?: number[]; +} + +export interface FrameOptions { + delay?: number; + disposal?: number; + palette?: number[] | null; + transparent?: number; +} + +export interface Frame { + data_length: number; + data_offset: number; + delay: number; + disposal: number; + has_local_palette: boolean; + height: number; + interlaced: boolean; + palette_offset: number | null; + palette_size: number | null; + transparent_index: number | null; + width: number; + x: number; + y: number; +} + +export class GifWriter { + height: number; + width: number; + + constructor(buf: Buffer, width: number, height: number, gopts?: GifOptions); + + addFrame(x: number, y: number, w: number, h: number, indexed_pixels: number[], opts?: FrameOptions): number; + end(): number; + getOutputBuffer(): Buffer; + getOutputBufferPosition(): number; + setOutputBuffer(v: Buffer): void; + setOutputBufferPosition(v: number): void; +} + +export class GifReader { + constructor(buf: Buffer); + + decodeAndBlitFrameBGRA(frame_num: number, pixels: number[]): void; + decodeAndBlitFrameRGBA(frame_num: number, pixels: number[]): void; + frameInfo(frame_num: number): Frame; + loopCount(): number; + numFrames(): number; +} diff --git a/types/omggif/omggif-tests.ts b/types/omggif/omggif-tests.ts new file mode 100644 index 0000000000..c20df1f446 --- /dev/null +++ b/types/omggif/omggif-tests.ts @@ -0,0 +1,84 @@ +import * as omggif from 'omggif'; + +// (c) Dean McNamee , 2013. +// Node omggif example to write out a few example images. + +// Needs to be large enough for the final full file size. Can be any type of +// buffer that supports [] (an Array, Uint8Array, Node Buffer, etc). +const buf = new Buffer(1024 * 1024); + +function gen_static_global() { + const gf = new omggif.GifWriter(buf, 2, 2, { palette: [0xff0000, 0x0000ff] }); + gf.addFrame(0, 0, 2, 2, [0, 1, 1, 0]); + return gf.end(); +} + +function gen_anim() { + // The loop parameter is the number of times to loop, or 0 for forever. + // A value of 1 will play twice (first time, and then one loop time). + // To play only once do not specify loop or pass null. + const gf = new omggif.GifWriter(buf, 2, 2, { loop: 1 }); + gf.addFrame(0, 0, 2, 2, [0, 1, 1, 0], { palette: [0xff0000, 0x0000ff] }); + gf.addFrame(0, 0, 2, 2, [1, 0, 0, 1], { + palette: [0xff0000, 0x0000ff], + delay: 10, + }); // Delay in hundredths of a sec (100 = 1s). + return gf.end(); +} + +function gen_gray_strip() { + const gf = new omggif.GifWriter(buf, 256, 1); + const palette = []; + const indices = []; + for (let i = 0; i < 256; ++i) { + palette.push((i << 16) | (i << 8) | i); + indices.push(i); + } + gf.addFrame(0, 0, 256, 1, indices, { palette }); + return gf.end(); +} + +// More than 8-bit color (via tiling of several frames). Browsers seem to +// treat this as an animation though, with an enforced minimum time between +// frames which makes it animated instead of the intended static image. +function gen_color_strip() { + const gf = new omggif.GifWriter(buf, 256, 256, { + palette: [0x000000, 0xff0000], + background: 1, + }); + + const indices = []; + for (let i = 0; i < 256; ++i) indices.push(i); + + for (let j = 0; j < 256; ++j) { + const palette = []; + for (let i = 0; i < 256; ++i) palette.push((j << 16) | (i << 8) | i); + gf.addFrame(0, j, 256, 1, indices, { palette, disposal: 1 }); + } + return gf.end(); +} + +// 1x1 white, generates the same as Google's 35 byte __utm.gif, except for some +// reason that I'm not sure of they set their background index to 255. +function gen_empty_white() { + const gf = new omggif.GifWriter(buf, 1, 1, { palette: [0xffffff, 0x000000] }); + gf.addFrame(0, 0, 1, 1, [0]); + return gf.end(); +} + +// with lzw block of 256. +// see: https://github.com/deanm/omggif/issues/5 +function gen_block256() { + const width = 4840; + const gf = new omggif.GifWriter(buf, width, 1, { + palette: [0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000], + }); + const stream = Array(width); + for (let i = 0; i < width; ++i) stream[i] = i & 0x7; + gf.addFrame(0, 0, width, 1, stream, { transparent: 0 }); + const data = buf.slice(0, gf.end()); + // Make sure it decodes. + const gr = new omggif.GifReader(data); + const frameInfo = gr.frameInfo(0); + return frameInfo; +} diff --git a/types/omggif/tsconfig.json b/types/omggif/tsconfig.json new file mode 100644 index 0000000000..fdc89342ec --- /dev/null +++ b/types/omggif/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictFunctionTypes": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "omggif-tests.ts" + ] +} diff --git a/types/omggif/tslint.json b/types/omggif/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/omggif/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/openlayers/index.d.ts b/types/openlayers/index.d.ts index 37cac7e65d..3214bad15c 100644 --- a/types/openlayers/index.d.ts +++ b/types/openlayers/index.d.ts @@ -9,6 +9,7 @@ // Yair Tawil // Pierre Marchand // Hauke Stieler +// Guillaume Beraudo // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // Definitions partially generated using tsd-jsdoc (https://github.com/englercj/tsd-jsdoc) @@ -1715,7 +1716,7 @@ export class Feature extends Object { * representing the current style of this feature. * @api stable */ - getStyleFunction(): (ol.FeatureStyleFunction); + getStyleFunction(): (ol.FeatureStyleFunction | undefined); /** * Set the default geometry for the feature. This will update the property @@ -6412,7 +6413,7 @@ export namespace layer { * @return Layer style function. * @api stable */ - getStyleFunction(): (ol.StyleFunction); + getStyleFunction(): (ol.StyleFunction | undefined); /** * Set the style for features. This can be a single style object, an array @@ -6424,7 +6425,7 @@ export namespace layer { * @param style Layer style. * @api stable */ - setStyle(style: (ol.style.Style | ol.style.Style[] | ol.StyleFunction | null)): void; + setStyle(style: (ol.style.Style | ol.style.Style[] | ol.StyleFunction | null | undefined)): void; } /** @@ -8472,7 +8473,7 @@ export namespace source { * @return Layer style function. * @api stable */ - getStyleFunction(): (ol.StyleFunction); + getStyleFunction(): (ol.StyleFunction | undefined); /** * Set the style for features. This can be a single style object, an array @@ -8484,7 +8485,7 @@ export namespace source { * @param style Layer style. * @api stable */ - setStyle(style: (ol.style.Style | ol.style.Style[] | ol.StyleFunction)): void; + setStyle(style: (ol.style.Style | ol.style.Style[] | ol.StyleFunction | null | undefined)): void; } /** @@ -10831,7 +10832,7 @@ export type FeatureLoader = (extent: ol.Extent, resolution: number, proj: ol.pro * {@link ol.Feature} to be styled. * */ -export type FeatureStyleFunction = (resolution: number) => (ol.style.Style | ol.style.Style[]); +export type FeatureStyleFunction = (resolution: number) => (ol.style.Style | ol.style.Style[] | null); /** * {@link ol.source.Vector} sources use a function of this type to get the url @@ -10981,7 +10982,7 @@ export interface StyleImageOptions { * or an array of them. This way e.g. a vector layer can be styled. * */ -export type StyleFunction = (feature: (ol.Feature | ol.render.Feature), resolution: number) => (ol.style.Style | ol.style.Style[]); +export type StyleFunction = (feature: (ol.Feature | ol.render.Feature), resolution: number) => (ol.style.Style | ol.style.Style[] | null); /** * A function that takes an {@link ol.Feature} as argument and returns an diff --git a/types/openlayers/openlayers-tests.ts b/types/openlayers/openlayers-tests.ts index 6e28ad4cd2..d631a9e9bb 100644 --- a/types/openlayers/openlayers-tests.ts +++ b/types/openlayers/openlayers-tests.ts @@ -418,6 +418,14 @@ feature.setStyle(styleArray); feature.setStyle(featureStyleFunction); feature.setStyle(styleFunction); feature.setProperties(object); +const nullStyleFunction = (feature: (ol.Feature|ol.render.Feature), resolution: number): null => { + return null; +}; +const nullFeatureStyleFunction = (resolution: number): null => { + return null; +}; +feature.setStyle(nullStyleFunction); +feature.setStyle(nullFeatureStyleFunction); // // ol.View @@ -573,6 +581,10 @@ const vectorLayer: ol.layer.Vector = new ol.layer.Vector({ zIndex: -1 }); +vectorLayer.setStyle(nullStyleFunction); +vectorLayer.setStyle(null); +vectorLayer.setStyle(undefined); + // // ol.layer.VectorTile // diff --git a/types/passport-cognito/index.d.ts b/types/passport-cognito/index.d.ts new file mode 100644 index 0000000000..d9dcbe38db --- /dev/null +++ b/types/passport-cognito/index.d.ts @@ -0,0 +1,29 @@ +// Type definitions for passport-cognito 0.1 +// Project: https://github.com/kndt84/passport-cognito +// Definitions by: Maksym Butsykin +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +import passport = require('passport'); +import express = require('express'); + +export interface CognitoStrategyOptions { + userPoolId: string; + clientId: string; + region: string; +} + +export type CognitoVerifyFunction = ( + accessToken: string, + idToken: string, + refreshToken: string, + user: object, + done: (error: any, user?: any) => void, +) => any; + +export class Strategy extends passport.Strategy { + constructor(options: CognitoStrategyOptions, verify: CognitoVerifyFunction); + + name: string; + authenticate(req: express.Request, options?: object): void; +} diff --git a/types/passport-cognito/passport-cognito-tests.ts b/types/passport-cognito/passport-cognito-tests.ts new file mode 100644 index 0000000000..02c80e8734 --- /dev/null +++ b/types/passport-cognito/passport-cognito-tests.ts @@ -0,0 +1,23 @@ +/** + * Created by Maksym Butsykin + */ + +import passport = require("passport"); +import cognito = require("passport-cognito"); + +passport.use( + new cognito.Strategy( + { + clientId: "clientId", + region: "region", + userPoolId: "userPoolId" + }, + ( + accessToken: string, + idToken: string, + refreshToken: string, + user: object, + cb: (err: Error | null, user?: object | false) => void + ) => {} + ) +); diff --git a/types/passport-cognito/tsconfig.json b/types/passport-cognito/tsconfig.json new file mode 100644 index 0000000000..eedb7f9a0f --- /dev/null +++ b/types/passport-cognito/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": false, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "passport-cognito-tests.ts" + ] +} diff --git a/types/passport-cognito/tslint.json b/types/passport-cognito/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/passport-cognito/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} diff --git a/types/passport-google-oauth/index.d.ts b/types/passport-google-oauth/index.d.ts index 8b45504cb2..26ee9888b7 100644 --- a/types/passport-google-oauth/index.d.ts +++ b/types/passport-google-oauth/index.d.ts @@ -53,6 +53,7 @@ interface IOAuth2StrategyOption { callbackURL: string; authorizationURL?: string; tokenURL?: string; + userProfileURL?: string; accessType?: string; approval_prompt?: string; prompt?: string; diff --git a/types/pg-large-object/index.d.ts b/types/pg-large-object/index.d.ts new file mode 100644 index 0000000000..804b86df1a --- /dev/null +++ b/types/pg-large-object/index.d.ts @@ -0,0 +1,15 @@ +// Type definitions for pg-large-object 2.0 +// Project: https://github.com/Joris-van-der-Wel/node-pg-large-object#readme +// Definitions by: Mateusz Krupa +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +import { WriteStream } from "fs"; + +export class LargeObjectManager { + constructor(options: any); + openAndReadableStreamAsync(oid: number, bufferSize: number): Promise<[number, NodeJS.ReadableStream]>; + createAndWritableStreamAsync(bufferSize: number): Promise<[number, WriteStream]>; + unlinkAsync(oid: number): Promise; +} diff --git a/types/pg-large-object/pg-large-object-tests.ts b/types/pg-large-object/pg-large-object-tests.ts new file mode 100644 index 0000000000..050fad80f6 --- /dev/null +++ b/types/pg-large-object/pg-large-object-tests.ts @@ -0,0 +1,8 @@ +import { LargeObjectManager } from 'pg-large-object'; + +const bufferSize = 16384; +const oid = 1; +const lom = new LargeObjectManager({}); +lom.createAndWritableStreamAsync(bufferSize); // $ExpectType Promise<[number, WriteStream]> +lom.openAndReadableStreamAsync(oid, bufferSize); // $ExpectType Promise<[number, ReadableStream]> +lom.unlinkAsync(oid); // $ExpectType Promise diff --git a/types/pg-large-object/tsconfig.json b/types/pg-large-object/tsconfig.json new file mode 100644 index 0000000000..6a23534d14 --- /dev/null +++ b/types/pg-large-object/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "pg-large-object-tests.ts" + ] +} diff --git a/types/pg-large-object/tslint.json b/types/pg-large-object/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/pg-large-object/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/pidusage/index.d.ts b/types/pidusage/index.d.ts index fbe98309b7..b16dada0ef 100644 --- a/types/pidusage/index.d.ts +++ b/types/pidusage/index.d.ts @@ -1,12 +1,50 @@ -// Type definitions for pidusage 1.1 +// Type definitions for pidusage 2.0 // Project: https://github.com/soyuka/pidusage // Definitions by: Cyril Schumacher +// wujingtao // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +declare function pidusage(pid: number | string, callback: (err: Error | null, stats: Stat) => void): void; +declare function pidusage(pids: Array, callback: (err: Error | null, stats: { [key: string]: Stat }) => void): void; +declare function pidusage(pid: number | string): Promise; +declare function pidusage(pids: Array): Promise<{ [key: string]: Stat }>; + +export default pidusage; export interface Stat { - cpu: number; - memory: number; -} + /** + * percentage (from 0 to 100*vcore) + */ + cpu: number; -export function stat(pid: number, callback: (error: Error, stat: Stat) => void): void; -export function unmonitor(pid: number): void; + /** + * bytes + */ + memory: number; + + /** + * PPID + */ + ppid: number; + + /** + * PID + */ + pid: number; + + /** + * ms user + system time + */ + ctime: number; + + /** + * ms since the start of the process + */ + elapsed: number; + + /** + * ms since epoch + */ + timestamp: number; + } diff --git a/types/pidusage/pidusage-tests.ts b/types/pidusage/pidusage-tests.ts index b1d16cbc16..614569dfa3 100644 --- a/types/pidusage/pidusage-tests.ts +++ b/types/pidusage/pidusage-tests.ts @@ -1,8 +1,38 @@ -import pusage = require("pidusage"); +import pidusage, { Stat } from 'pidusage'; -pusage.stat(0, (err: Error, stat: pusage.Stat) => { - const cpu = stat.cpu; - const memory = stat.memory; +let cpu: number; +let memory: number; +let ppid: number; +let pid: number; +let ctime: number; +let elapsed: number; +let timestamp: number; + +pidusage(1, (err: Error | null, stats: Stat) => { + cpu = stats.cpu; + memory = stats.memory; + ppid = stats.ppid; + pid = stats.pid; + ctime = stats.ctime; + elapsed = stats.elapsed; + timestamp = stats.timestamp; }); -pusage.unmonitor(0); +pidusage('two', (err: Error | null, stats: Stat) => { + cpu = stats.cpu; + memory = stats.memory; + ppid = stats.ppid; + pid = stats.pid; + ctime = stats.ctime; + elapsed = stats.elapsed; + timestamp = stats.timestamp; +}); + +pidusage([1, 'two'], (err: Error | null, stats: { [key: string]: Stat }) => { + const one: Stat = stats[1]; + const two: Stat = stats.two; +}); + +const stats_1: Promise = pidusage(1); +const stats_two: Promise = pidusage('two'); +const stats_obj: Promise<{ [key: string]: Stat }> = pidusage([1, 'two']); diff --git a/types/pino/index.d.ts b/types/pino/index.d.ts index 27d0f51fc6..42d7a4d1f6 100644 --- a/types/pino/index.d.ts +++ b/types/pino/index.d.ts @@ -1,8 +1,9 @@ -// Type definitions for pino 4.16 +// Type definitions for pino 5.20 // Project: https://github.com/pinojs/pino.git // Definitions by: Peter Snider // BendingBender // Christian Rackerseder +// GP // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -145,6 +146,10 @@ declare namespace P { * requires supplying a level value via `levelVal`. Default: 'info'. */ level?: LevelWithSilent | string; + /** + * Outputs the level as a string instead of integer. Default: `false`. + */ + useLevelLabels?: boolean; /** * When defining a custom log level via level, set to an integer value to define the new level. Default: `undefined`. */ @@ -268,6 +273,10 @@ declare namespace P { * You can pass `'silent'` to disable logging. */ level: LevelWithSilent | string; + /** + * Outputs the level as a string instead of integer. + */ + useLevelLabels: boolean; /** * Returns the integer value for the logger instance's logging level. */ diff --git a/types/pino/pino-tests.ts b/types/pino/pino-tests.ts index 6959a6cd97..356f84da30 100644 --- a/types/pino/pino-tests.ts +++ b/types/pino/pino-tests.ts @@ -96,3 +96,7 @@ pino.levels.labels[50] === 'error'; const logstderr: pino.Logger = pino(process.stderr); logstderr.error('on stderr instead of stdout'); + +log.useLevelLabels = true; +log.info('lol'); +log.level === 'info'; diff --git a/types/png.js/index.d.ts b/types/png.js/index.d.ts new file mode 100644 index 0000000000..a7d05fd837 --- /dev/null +++ b/types/png.js/index.d.ts @@ -0,0 +1,58 @@ +// Type definitions for png.js 0.2 +// Project: https://github.com/arian/pngjs +// Definitions by: Florian Keller +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +type BitDepth = 2 | 4 | 8 | 16; +type ColorType = 0 | 2 | 3 | 4 | 6; +type ParseCallback = (err: Error | undefined, png: PNG) => void; + +interface ParseOptions { + data?: boolean; +} + +declare class PNGReader { + bytes: Uint8Array | number[] | Buffer; + dataChunks: number[][]; + i: number; + png: PNG; + + constructor(bytes: Uint8Array | string | Buffer | ArrayBuffer); + parse(callback: ParseCallback): void; + parse(options: ParseOptions, callback: ParseCallback): void; +} + +declare class PNG { + alpha: boolean; + bitDepth: BitDepth; + colors: number; + colorType: ColorType; + compressionMethod: 0; + filterMethod: 0; + height: number; + interlaceMethod: 0 | 1; + palette: number[] | null; + pixelBits: number; + pixels: Buffer | null; + width: number; + + getBitDepth(): BitDepth; + getColorType(): ColorType; + getCompressionMethod(): 0; + getFilterMethod(): 0; + getHeight(): number; + getInterlaceMethod(): 0 | 1; + getPalette(): number[]; + getPixel(x: number, y: number): [number, number, number, number]; + getWidth(): number; + setBitDepth(bitDepth: BitDepth): void; + setColorType(colorType: ColorType): void; + setCompressionMethod(compressionMethod: 0): void; + setFilterMethod(filterMethod: 0): void; + setHeight(height: number): void; + setInterlaceMethod(interlaceMethod: 0 | 1): void; + setPalette(palette: number[]): void; + setWidth(width: number): void; +} + +export = PNGReader; diff --git a/types/png.js/png.js-tests.ts b/types/png.js/png.js-tests.ts new file mode 100644 index 0000000000..86cc504a75 --- /dev/null +++ b/types/png.js/png.js-tests.ts @@ -0,0 +1,37 @@ +/// + +import PNGReader = require('png.js'); + +const buffer = new Buffer([]); +const reader1 = new PNGReader(buffer); + +reader1.parse((err, png) => { + if (err) throw err; + + png.getWidth(); + png.getHeight(); + png.getPixel(1, 0)[0]; + png.getBitDepth(); + png.getColorType(); + png.getCompressionMethod(); + png.getFilterMethod(); + png.getInterlaceMethod(); + png.getPalette(); +}); + +const bytes = new Uint8Array(0); +const reader2 = new PNGReader(bytes); + +reader2.parse({data: false}, (err, png) => { + if (err) throw err; + + png.getWidth(); + png.getHeight(); + png.getPixel(1, 0)[2]; + png.getBitDepth(); + png.getColorType(); + png.getCompressionMethod(); + png.getFilterMethod(); + png.getInterlaceMethod(); + png.getPalette(); +}); diff --git a/types/png.js/tsconfig.json b/types/png.js/tsconfig.json new file mode 100644 index 0000000000..595988b23f --- /dev/null +++ b/types/png.js/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictFunctionTypes": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "png.js-tests.ts" + ] +} diff --git a/types/png.js/tslint.json b/types/png.js/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/png.js/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/pouchdb-upsert/index.d.ts b/types/pouchdb-upsert/index.d.ts index 003f310ad7..d044e9f2a4 100644 --- a/types/pouchdb-upsert/index.d.ts +++ b/types/pouchdb-upsert/index.d.ts @@ -1,6 +1,9 @@ // Type definitions for pouchdb-upsert 2.2 // Project: https://github.com/pouchdb/upsert -// Definitions by: Keith D. Moore , Andrew Mitchell , Eddie Hsu +// Definitions by: Keith D. Moore +// Andrew Mitchell +// Eddie Hsu +// John McLaughlin // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.4 @@ -55,7 +58,8 @@ declare namespace PouchDB { callback: Core.Callback): void; } - type UpsertDiffCallback = (doc: Core.Document | {}) => Core.Document | boolean; + type CancelUpsert = '' | 0 | false | null | undefined; // falsey values + type UpsertDiffCallback = (doc: Core.Document | {}) => Content & Partial | CancelUpsert; interface UpsertResponse { id: Core.DocumentId; diff --git a/types/pouchdb-upsert/pouchdb-upsert-tests.ts b/types/pouchdb-upsert/pouchdb-upsert-tests.ts index 55697e88d6..b86afedf29 100644 --- a/types/pouchdb-upsert/pouchdb-upsert-tests.ts +++ b/types/pouchdb-upsert/pouchdb-upsert-tests.ts @@ -2,9 +2,10 @@ import * as pouchdbUpsert from 'pouchdb-upsert'; PouchDB.plugin(pouchdbUpsert); interface UpsertDocModel { - _id: 'test-doc1'; - name: 'test'; + name: string; + readonly?: boolean; } + declare const docToUpsert: PouchDB.Core.Document; const db = new PouchDB(); @@ -16,10 +17,20 @@ function testUpsert_WithPromise_AndReturnDoc() { }); } -function testUpsert_WithPromise_AndReturnBoolean() { +function testUpsert_WithPromise_AndReturnFalsey() { db.upsert(docToUpsert._id, (doc: PouchDB.Core.Document) => { + if (doc.readonly) + return false; // Make some updates.... - return false; + return doc; + }).then((res: PouchDB.UpsertResponse) => { + }); +} + +function testUpsert_WithPromise_AndReturnNewObject() { + // callback return boolean + db.upsert(docToUpsert._id, (doc: PouchDB.Core.Document) => { + return {name: 'test', readonly: true}; }).then((res: PouchDB.UpsertResponse) => { }); } @@ -31,11 +42,20 @@ function testUpsert_WithCallback_AndReturnDoc() { }, (res: PouchDB.UpsertResponse) => {}); } -function testUpsert_WithCallback_AndReturnBoolean() { +function testUpsert_WithCallback_AndReturnFalsey() { // callback return boolean db.upsert(docToUpsert._id, (doc: PouchDB.Core.Document) => { + if (doc.readonly) + return false; // Make some updates.... - return false; + return doc; + }, (res: PouchDB.UpsertResponse) => {}); +} + +function testUpsert_WithCallback_AndReturnNewObject() { + // callback return boolean + db.upsert(docToUpsert._id, (doc: PouchDB.Core.Document) => { + return {name: 'test', readonly: true}; }, (res: PouchDB.UpsertResponse) => {}); } diff --git a/types/rc-select/index.d.ts b/types/rc-select/index.d.ts index b78fc03837..30fc16507f 100644 --- a/types/rc-select/index.d.ts +++ b/types/rc-select/index.d.ts @@ -20,41 +20,55 @@ export { declare namespace RcSelect { interface SelectProps { - className?: string; - prefixCls?: string; - animation?: string; - transitionName?: string; - choiceTransitionName?: string; - dropdownMatchSelectWidth?: boolean; - dropdownClassName?: string; - dropdownStyle?: { [key: string]: string }; - dropdownMenuStyle?: { [key: string]: string }; - notFoundContent?: string; - showSearch?: boolean; allowClear?: boolean; - tags?: boolean; - maxTagTextLength?: number; + animation?: string; + choiceTransitionName?: string; + className?: string; combobox?: boolean; - multiple?: boolean; + defaultActiveFirstOption?: boolean; + defaultLabel?: string | Array; + defaultValue?: string | Array; disabled?: boolean; + dropdownClassName?: string; + dropdownMatchSelectWidth?: boolean; + dropdownMenuStyle?: { [key: string]: string }; + dropdownStyle?: { [key: string]: string }; filterOption?: boolean; + getPopupContainer?: (trigger: Node) => Node; + getInputElement?: () => Node; + id?: string; + labelInValue?: boolean; + maxTagCount?: number; + maxTagPlaceholder?: React.ReactNode | Function; + maxTagTextLength?: number; + multiple?: boolean; + notFoundContent?: string; + onBlur?: () => void; + onChange?: (value: string, label: string) => void; + onDeselect?: (value: string, option: Option) => void; + onFocus?: () => void; + onInputKeyDown?: (e: Event) => void; + onPopupScroll?: () => void; + onSearch?: () => void; + onSelect?: (value: string, ontion: Option) => void; optionFilterProp?: string; optionLabelProp?: string; - defaultValue?: string | Array; + placeholder?: React.ReactNode; + prefixCls?: string; + showAction?: string[]; + showArrow?: boolean; + showSearch?: boolean; + tags?: boolean; + tokenSeparators?: string[]; + transitionName?: string; value?: string | Array; - onChange?: (value: string, label: string) => void; - onSearch?: Function; - onSelect?: (value: string, ontion: Option) => void; - onDeselect?: Function; - defaultLabel?: string | Array; - defaultActiveFirstOption?: boolean; - getPopupContainer?: (trigger: Node) => Node; } export class Select extends React.Component { } interface OptionProps { className?: string; disabled?: boolean; key?: string; + title?: string; value?: string; } export class Option extends React.Component { } diff --git a/types/rc-slider/README.md b/types/rc-slider/README.md index 6c56f6c2e1..10c7dec387 100644 --- a/types/rc-slider/README.md +++ b/types/rc-slider/README.md @@ -5,7 +5,7 @@ This package contains type definitions for rc-slider (https://github.com/react-component/slider). Additional Details - * Last updated: Fri, 15 Dec 2017 + * Last updated: Sun, 04 Aug 2018 * Dependencies: react * Global values: none diff --git a/types/rc-slider/index.d.ts b/types/rc-slider/index.d.ts index 707f5425c5..420d836034 100644 --- a/types/rc-slider/index.d.ts +++ b/types/rc-slider/index.d.ts @@ -1,9 +1,10 @@ -// Type definitions for rc-slider 8.2 +// Type definitions for rc-slider 8.6 // Project: https://github.com/react-component/slider // Definitions by: Marcinkus Mantas // Alexander Mattoni // Austin Turner // Jacob Froman +// Deanna Veale // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 @@ -68,18 +69,6 @@ export interface CommonApiProps { * @default false */ dots?: boolean; - /** - * onBeforeChange will be triggered when ontouchstart or onmousedown is triggered. - */ - onBeforeChange?(value: any): any | undefined; - /** - * onChange will be triggered while the value of Slider changing. - */ - onChange?(value: any): any | undefined; - /** - * onAfterChange will be triggered when ontouchend or onmouseup is triggered. - */ - onAfterChange?(value: any): any | undefined; /** * @deprecated in version ^6.0.0. Use rc-tooltip @@ -125,6 +114,18 @@ export interface CommonApiProps { } export interface SliderProps extends CommonApiProps { + /** + * onBeforeChange will be triggered when ontouchstart or onmousedown is triggered. + */ + onBeforeChange?(value: number): void; + /** + * onChange will be triggered while the value of Slider changing. + */ + onChange?(value: number): void; + /** + * onAfterChange will be triggered when ontouchend or onmouseup is triggered. + */ + onAfterChange?(value: number): void; /** * Set initial value of slider. * @default 0 @@ -137,6 +138,21 @@ export interface SliderProps extends CommonApiProps { } export interface RangeProps extends CommonApiProps { + /** + * onBeforeChange will be triggered when ontouchstart or onmousedown is triggered. + * For prop (count = -1) type returned is [number, undefined]. Bug raised in rc-slider https://github.com/react-component/slider/issues/457 + */ + onBeforeChange?(value: number[]): void; + /** + * onChange will be triggered while the value of Slider changing. + * For prop (count = -1) type returned is [number, undefined]. Bug raised in rc-slider https://github.com/react-component/slider/issues/457 + */ + onChange?(value: number[]): void; + /** + * onAfterChange will be triggered when ontouchend or onmouseup is triggered. + * For prop (count = -1) type returned is [number, undefined]. Bug raised in rc-slider https://github.com/react-component/slider/issues/457 + */ + onAfterChange?(value: number[]): void; /** * Set initial positions of handles. * @default [0,0] diff --git a/types/rc-slider/rc-slider-tests.tsx b/types/rc-slider/rc-slider-tests.tsx index 2de87bc4e2..5b246dd7ab 100644 --- a/types/rc-slider/rc-slider-tests.tsx +++ b/types/rc-slider/rc-slider-tests.tsx @@ -18,6 +18,11 @@ ReactDOM.render( />, document.querySelector('.another-app') ); + +const onChangeFunc1 = (string: number) => {}; + +const onChangeFunc2 = (string: number[]) => {}; + ReactDOM.render( { }} - onChange={() => { }} - onAfterChange={() => { }} + onBeforeChange={onChangeFunc1} + onChange={onChangeFunc1} + onAfterChange={onChangeFunc1} defaultValue={0.1} value={0.1} style={{backgroundColor: 'plum'}} @@ -49,6 +54,9 @@ ReactDOM.render( count={3} allowCross={false} pushable={true} + onChange={onChangeFunc2} + onAfterChange={onChangeFunc2} + onBeforeChange={onChangeFunc2} />, document.querySelector('.app') ); diff --git a/types/reach__router/index.d.ts b/types/reach__router/index.d.ts index f52b3954e3..e61e9e15ad 100644 --- a/types/reach__router/index.d.ts +++ b/types/reach__router/index.d.ts @@ -5,8 +5,8 @@ // TypeScript Version: 2.8 import * as React from "react"; - -export type WindowLocation = Window["location"]; +import { Location as HLocation } from "history"; +export type WindowLocation = Window["location"] & HLocation; export interface History { readonly location: string; @@ -60,13 +60,15 @@ export interface LinkGetProps { export class Link extends React.Component> {} -export interface RedirectProps { +export interface RedirectProps { from?: string; to: string; noThrow?: boolean; + state?: TState; + replace?: boolean; } -export class Redirect extends React.Component {} +export class Redirect extends React.Component> {} export interface MatchProps { path: string; @@ -74,7 +76,7 @@ export interface MatchProps { } export type MatchRenderFn = ( - props: MatchRenderProps, + props: MatchRenderProps ) => React.ReactNode; export interface MatchRenderProps { @@ -104,7 +106,7 @@ export interface LocationProviderProps { } export type LocationProviderRenderFn = ( - context: LocationContext, + context: LocationContext ) => React.ReactNode; export interface LocationContext { diff --git a/types/reach__router/reach__router-tests.tsx b/types/reach__router/reach__router-tests.tsx index 56e2305a2e..0cada3367d 100644 --- a/types/reach__router/reach__router-tests.tsx +++ b/types/reach__router/reach__router-tests.tsx @@ -1,4 +1,10 @@ -import { Link, Location, RouteComponentProps, Router } from "@reach/router"; +import { + Link, + Location, + RouteComponentProps, + Router, + Redirect +} from "@reach/router"; import * as React from "react"; import { render } from "react-dom"; @@ -21,9 +27,10 @@ render( + - {(context) => ( + {context => ( <>
hostname is {context.location.hostname}
- * - * - * - * // audio.js - * Page({ - * onReady: function (e) { - * // 使用 wx.createAudioContext 获取 audio 上下文 context - * this.audioCtx = wx.createAudioContext('myAudio') - * this.audioCtx.setSrc('http://ws.stream.qqmusic.qq.com/ - * M500001VfvsJ21xFqb.mp3?guid=ffffffff82def4af4b12b3cd9337d5e7& - * uin=346897220&vkey=6292F51E1E384E06DCBDC9AB7C49FD713D632D313AC4858BACB8DDD29067D3C601481D36E62053BF8DFEAF74C0A5CCFADD6471160CAF3E6A& - * fromtag=46') - * this.audioCtx.play() - * }, - * data: { - * src: '' - * }, - * audioPlay: function () { - * this.audioCtx.play() - * }, - * audioPause: function () { - * this.audioCtx.pause() - * }, - * audio14: function () { - * this.audioCtx.seek(14) - * }, - * audioStart: function () { - * this.audioCtx.seek(0) - * } - * }) - * @deprecated 1.6.0 - */ - function createAudioContext(audioId: string, instance: any): AudioContext; - interface InnerAudioContext { - /** 当前音频的长度(单位:s),只有在当前有合法的 src 时返 */ - readonly duration: number; - /** 当前音频的播放位置(单位:s),只有在当前有合法的 src 时返回,时间不取整,保留小数点后 6 */ - readonly currentTime: number; - /** 当前是是否暂停或停止状态,true 表示暂停或停止,false 表示正在播 */ - readonly paused: boolean; - /** 音频缓冲的时间点,仅保证当前播放时间点到此时间点内容已缓冲 */ - readonly buffered: number; - /** 音频的数据链接,用于直接播放。 */ - src: string; - /** 开始播放的位置(单位:s),默认 0 */ - startTime: number; - /** 是否自动开始播放,默认 false */ - autoplay: boolean; - /** 是否循环播放,默认 false */ - loop: boolean; - /** 是否遵循系统静音开关,当此参数为 false 时,即使用户打开了静音开关,也能继续发出声音,默认值 true */ - obeyMuteSwitch: boolean; - /** 播放 */ - play(): void; - /** 暂停 */ - pause(): void; - /** 停止 */ - stop(): void; - /** 跳转到指定位置,单位 s */ - seek(position: number): void; - /** 销毁当前实例 */ - destroy(): void; - /** 音频进入可以播放状态,但不保证后面可以流畅播放 */ - onCanplay(callback?: () => void): void; - /** 音频播放事件 */ - onPlay(callback?: () => void): void; - /** 音频暂停事件 */ - onPause(callback?: () => void): void; - /** 音频停止事件 */ - onStop(callback?: () => void): void; - /** 音频自然播放结束事件 */ - onEnded(callback?: () => void): void; - /** 音频播放进度更新事件 */ - onTimeUpdate(callback?: () => void): void; - /** 音频播放错误事件 */ - onError(callback?: () => void): void; - /** 音频加载中事件,当音频因为数据不足,需要停下来加载时会触发 */ - onWaiting(callback?: () => void): void; - /** 音频进行 seek 操作事件 */ - onSeeking(callback?: () => void): void; - /** 音频完成 seek 操作事件 */ - onSeeked(callback?: () => void): void; - } - /** - * 创建并返回内部 audio 上下文 innerAudioContext 对象。 - * 本接口是 wx.createAudioContext 升级版。 - * @version 1.6.0 - */ - function createInnerAudioContext(): InnerAudioContext; - // 媒体-----视频 - interface ChooseVideoOptions extends BaseOptions { - /** album 从相册选视频,camera 使用相机拍摄,默认为:['album', 'camera'] */ - sourceType?: VideoSourceType[]; - /** 拍摄视频最长拍摄时间,单位秒。最长支持60秒 */ - maxDuration?: number; - /** 前置或者后置摄像头,默认为前后都有,即:['front', 'back'] */ - camera?: CameraDevice[]; - /** 接口调用成功,返回视频文件的临时文件路径,详见返回参数说明 */ - success?(res: VideoData): void; - } - /** - * 拍摄视频或从手机相册中选视频,返回视频的临时文件路径。 - */ - function chooseVideo(options: ChooseVideoOptions): void; - // 媒体-----视频组件控制 - interface VideoContext { - /** - * 播放 - */ - play(): void; - /** - * 暂停 - */ - pause(): void; - /** - * 跳转到指定位置,单位 s - */ - seek(position: number): void; - /** - * 发送弹幕,danmu 包含两个属性 text, color。 - */ - sendDanmu(danmu: { - text: string; - color: number | string; - }): void; - } - interface VideoData { - /** 选定视频的临时文件路径 */ - tempFilePath: string; - /** 选定视频的时间长度 */ - duration: number; - /** 选定视频的数据量大小 */ - size: number; - /** 返回选定视频的长 */ - height: number; - /** 返回选定视频的宽 */ - width: number; - } - /** - * 创建并返回 video 上下文 videoContext 对象 - * @param videoId video标签id - */ - function createVideoContext(videoId: string): VideoContext; - interface TakePhotoOptions extends BaseOptions { - /** 成像质量,值为high, normal, low,默认normal */ - quality?: string; - success?(res: { tempImagePath: string }): void; - } - interface StartRecordOptions extends BaseOptions { - /** 超过30s或页面onHide时会结束录像 */ - timeoutCallback?(res: { tempThumbPath: string, tempVideoPath: string }): void; - } - interface StopRecordOptions extends BaseOptions { - success?(res: { tempThumbPath: string, tempVideoPath: string }): void; - } - interface CameraContext { - /** 拍照,可指定质量,成功则返回图片 */ - takePhoto(options: TakePhotoOptions): void; - /** 开始录像 */ - startRecord(options: StartRecordOptions): void; - /** 结束录像,成功则返回封面与视频 */ - stopRecord(options: StopRecordOptions): void; - } - /** - * 创建并返回 camera 上下文 cameraContext 对象 - * cameraContext 与页面的 camera 组件绑定 - * 一个页面只能有一个camera,通过它可以操作对应的 组件。 - * 在自定义组件下,第一个参数传入组件实例this,以操作组件内 组件 - * @version 1.6.0 - */ - function createCameraContext(instance: any): CameraContext; - interface RequestFullScreenOptions extends BaseOptions { - /** 有效值为 0(正常竖向), 90(屏幕逆时针90度), -90(屏幕顺时针90度) */ - direction: number; - } - interface LivePlayerContext { - /** 播放 */ - play(options: BaseOptions): void; - /** 停止 */ - stop(options: BaseOptions): void; - /** 静音 */ - mute(options: BaseOptions): void; - /** 进入全屏 */ - requestFullScreen(options: RequestFullScreenOptions): void; - /** 退出全屏 */ - exitFullScreen(options: BaseOptions): void; - } - /** - * 操作对应的 组件。 - * 创建并返回 live-player 上下文 LivePlayerContext 对象。 - * 在自定义组件下,第二个参数传入组件实例this,以操作组件内 组件 - * @version 1.7.0 - */ - function createLivePlayerContext(id: string, instance: any): LivePlayerContext; - // 文件 - interface SavedFileData { - /** 文件的保存路径 */ - savedFilePath: string; - } - interface SaveFileOptions extends BaseOptions { - /** 需要保存的文件的临时路径 */ - tempFilePath: string; - /** 返回文件的保存路径,res = {savedFilePath: '文件的保存路径'} */ - success?(res: SavedFileData): void; - } - /** - * 保存文件到本地。 - * 本地文件存储的大小限制为 10M - */ - function saveFile(options: SaveFileOptions): void; - interface File { - /** - * 文件的本地路径 - */ - filePath: string; - /** - * 文件的保存时的时间戳,从1970/01/01 08:00:00 到当前时间的秒数 - */ - createTime: number; - /** - * 文件大小,单位B - */ - size: number; - } - interface GetFileInfoOptions extends BaseOptions { - /** 本地文件路径 */ - filePath: string; - /** 计算文件摘要的算法,默认值 md5,有效值:md5,sha1 */ - digestAlgorithm?: string; - success?(options: GetFileInfoSuccess): void; - } - interface GetFileInfoSuccess { - /** 文件大小,单位:B */ - size: number; - /** 按照传入的 digestAlgorithm 计算得出的的文件摘要 */ - digest: string; - /** 调用结果 */ - errMsg: string; - } - /** - * 获取文件信息 - * @version 1.4.0 - */ - function getFileInfo(options: GetFileInfoOptions): void; - interface GetSavedFileListData { - /** - * 接口调用结果 - */ - errMsg: string; - /** - * 文件列表 - */ - fileList: File[]; - } - interface GetSavedFileListOptions extends BaseOptions { - /** 接口调用成功的回调函数 */ - success?(res: GetSavedFileListData): void; - } - /** - * 获取本地已保存的文件列表 - */ - function getSavedFileList(options: GetSavedFileListOptions): void; - interface SavedFileInfoData { - /** - * 接口调用结果 - */ - errMsg: string; - /** - * 文件大小,单位B - */ - size: number; - /** - * 文件的保存是的时间戳,从1970/01/01 08:00:00 到当前时间的秒数 - */ - createTime: number; - } - interface GetSavedFileInfoOptions extends BaseOptions { - filePath: string; - /** 接口调用成功的回调函数 */ - success?(res: SavedFileInfoData): void; - } - /** - * 获取本地文件的文件信息 - */ - function getSavedFileInfo(options: GetSavedFileInfoOptions): void; - type RemoveSavedFileOptions = BaseOptions; - /** - * 删除本地存储的文件 - */ - function removeSavedFile(options: RemoveSavedFileOptions): void; - interface OpenDocumentOptions extends BaseOptions { - /** - * 文件路径,可通过 downFile 获得 - */ - filePath: string; - } - /** - * 新开页面打开文档,支持格式:doc, xls, ppt, pdf, docx, xlsx, pptx - */ - function openDocument(options: OpenDocumentOptions): void; - // 数据缓存 - interface SetStorageOptions extends BaseOptions { - /** 本地缓存中的指定的 key */ - key: string; - /** 需要存储的内容 */ - data: any | string; - } - /** - * 将数据存储在本地缓存中指定的 key 中, - * 会覆盖掉原来该 key 对应的内容,这是一个异步接口。 - */ - function setStorage(options: SetStorageOptions): void; - /** - * 将 data 存储在本地缓存中指定的 key 中, - * 会覆盖掉原来该 key 对应的内容,这是一个同步接口。 - * - * @param key 本地缓存中的指定的 key - * @param data 需要存储的内容 - */ - function setStorageSync(key: string, data: any | string): void; - interface GetStorageOptions extends BaseOptions { - /** 本地缓存中的指定的 key */ - key: string; - /** 接口调用的回调函数,res = {data: key对应的内容} */ - success(res: DataResponse): void; - } - /** - * 从本地缓存中异步获取指定 key 对应的内容。 - */ - function getStorage(options: GetStorageOptions): void; - /** - * 从本地缓存中同步获取指定 key 对应的内容。 - * - */ - function getStorageSync(key: string): any | string; - interface StorageInfo { - /** - * 当前storage中所有的key - */ - keys: string[]; - /** - * 当前占用的空间大小, 单位kb - */ - currentSize: number; - /** - * 限制的空间大小,单位kb - */ - limitSize: number; - } - interface GetStorageInfoOptions extends BaseOptions { - success(res: StorageInfo): void; - } - /** - * 异步获取当前storage的相关信息 - */ - function getStorageInfo(options: GetStorageInfoOptions): void; - function getStorageInfoSync(): GetStorageInfoOptions; - interface RemoveStorageOptions extends BaseOptions { - key: string; - success?(res: DataResponse): void; - } - function removeStorage(options: RemoveStorageOptions): void; - function removeStorageSync(key: string): DataResponse; - /** - * 清理本地数据缓存。 - */ - function clearStorage(): void; - /** - * 同步清理本地数据缓存 - */ - function clearStorageSync(): void; - // #endregion - // #region 位置API列表 - // 位置-----获取位置 - interface LocationData { - /** 纬度,浮点数,范围为-90~90,负数表示南纬 */ - latitude: number; - /** 经度,浮点数,范围为-180~180,负数表示西经 */ - longitude: number; - /** 速度,浮点数,单位m/s */ - speed: number; - /** 位置的精确度 */ - accuracy: number; - } - interface GetLocationOptions extends BaseOptions { - /** 默认为 wgs84 返回 gps 坐标,gcj02 返回可用于wx.openLocation的坐标 */ - type?: 'wgs84' | 'gcj02'; - /** 接口调用成功的回调函数,返回内容详见返回参数说明。 */ - success(res: LocationData): void; - } - /** - * 获取当前的地理位置、速度。 - */ - function getLocation(options: GetLocationOptions): void; - interface ChooseLocationData { - /** - * 位置名称 - */ - name: string; - /** - * 详细地址 - */ - address: string; - /** - * 纬度,浮点数,范围为-90~90,负数表示南纬 - */ - latitude: number; - /** - * 经度,浮点数,范围为-180~180,负数表示西经 - */ - longitude: number; - } - interface ChooseLocationOptions extends BaseOptions { - success(res: ChooseLocationData): void; - } - /** - * 打开地图选择位置 - */ - function chooseLocation(options: ChooseLocationOptions): void; - // 位置-----查看位置 - interface OpenLocationOptions extends BaseOptions { - /** 纬度,范围为-90~90,负数表示南纬 */ - latitude: number; - /** 经度,范围为-180~180,负数表示西经 */ - longitude: number; - /** 缩放比例,范围1~28,默认为28 */ - scale?: number; - /** 位置名 */ - name?: string; - /** 地址的详细说明 */ - address?: string; - } - /** - * 使用微信内置地图查看位置 - */ - function openLocation(options: OpenLocationOptions): void; - // 位置-----地图组件控制 - interface GetCenterLocationOptions extends BaseOptions { - success(res: { - longitude: number; - latitude: number; - }): void; - } - /** - * mapContext 通过 mapId 跟一个 组件绑定,通过它可以操作对应的 组件。 - */ - interface MapContext { - /** - * 获取当前地图中心的经纬度,返回的是 gcj02 坐标系,可以用于 wx.openLocation - */ - getCenterLocation(options: GetCenterLocationOptions): OpenLocationOptions; - /** - * 将地图中心移动到当前定位点,需要配合map组件的show-location使用 - */ - moveToLocation(): void; - } - /** - * 创建并返回 map 上下文 mapContext 对象 - */ - function createMapContext(mapId: string): MapContext; - // #endregion - // #region 设备API列表 - // 设备-----系统信息 - interface SystemInfo { - /** 手机型号 */ - model: string; - /** 设备像素比 */ - pixelRatio: number; - /** 窗口宽度 */ - windowWidth: number; - /** 窗口高度 */ - windowHeight: number; - /** 微信设置的语言 */ - language: string; - /** 微信版本号 */ - version: string; - } - interface GetSystemInfoOptions extends BaseOptions { - /** 成功获取系统信息的回调 */ - success(res: SystemInfo): void; - } - /** - * 获取系统信息。 - */ - function getSystemInfo(options: GetSystemInfoOptions): void; - function getSystemInfoSync(): SystemInfo; - /** - * 判断小程序的API,回调,参数,组件等是否在当前版本可用。 - * String参数说明: - * 使用 ${API}.${method}.${param}.${options} - * 或者 ${component}.${attribute}.${option}方式来调用 - * 例如: - * ${API} 代表 API 名字 - * ${method} 代表调用方式,有效值为return, success, object, callback - * ${param} 代表参数或者返回值 - * ${options} 代表参数的可选值 - * ${component} 代表组件名字 - * ${attribute} 代表组件属性 - * ${option} 代表组件属性的可选值 - */ - function canIUse(api: string): boolean; - // 设备-----网络状态 - type networkType = '2g' | '3g' | '4g' | 'wifi' | 'unknown' | 'none'; - interface NetworkTypeData { - /** 返回网络类型2g,3g,4g,wifi */ - networkType: networkType; - } - interface GetNetworkTypeOptions extends BaseOptions { - /** 接口调用成功,返回网络类型 networkType */ - success(res: NetworkTypeData): void; - } - /** - * 获取网络类型。 - */ - function getNetworkType(options: GetNetworkTypeOptions): void; - /** - * 监听网络状态变化。 - * 微信客户端 6.5.6 版本开始支持 - * @version 1.1.0 - */ - function onNetworkStatusChange(callback: (res: { - isConnected: boolean; - networkType: networkType; - }) => void): void; - // 设备-----加速度计 - interface AccelerometerData { - /** X 轴 */ - x: number; - /** Y 轴 */ - y: number; - /** Z 轴 */ - z: number; - } - type AccelerometerChangeCallback = (res: AccelerometerData) => void; - /** - * 监听重力感应数据,频率:5次/秒 - */ - function onAccelerometerChange(callback: AccelerometerChangeCallback): void; - type AccelerometerOptions = BaseOptions; - /** - * 开始监听加速度数据。 - * 微信客户端 6.5.6 版本开始支持 - * @version 1.1.0 - */ - function startAccelerometer(options: AccelerometerOptions): void; - /** - * 停止监听加速度数据。 - * 微信客户端 6.5.6 版本开始支持 - * @version 1.1.0 - */ - function stopAccelerometer(options: AccelerometerOptions): void; - // 设备-----罗盘 - interface CompassData { - /** 面对的方向度数 */ - direction: number; - } - type CompassChangeCallback = (res: CompassData) => void; - /** - * 监听罗盘数据,频率:5次/秒,接口调用后会自动开始监听,可使用wx.stopCompass停止监听。 - */ - function onCompassChange(callback: CompassChangeCallback): void; - type CompassOptions = BaseOptions; - /** - * 开始监听罗盘数据。 - * 微信客户端 6.5.6 版本开始支持 - * @version 1.1.0 - */ - function startCompass(options: CompassOptions): void; - function stopCompass(options: CompassOptions): void; - // 设备-----拨打电话 - interface MakePhoneCallOptions extends BaseOptions { - /** - * 需要拨打的电话号码 - */ - phoneNumber: string; - } - /** - * 拨打电话 - */ - function makePhoneCall(options: MakePhoneCallOptions): void; - // 设备-----扫码 - type scanType = "qrCode" | "barCode"; - interface ScanCodeData { - /** - * 所扫码的内容 - */ - result: string; - /** - * 所扫码的类型 - */ - scanType: scanType; - /** - * 所扫码的字符集 - */ - charSet: string; - /** - * 当所扫的码为当前小程序的合法二维码时,会返回此字段,内容为二维码携带的 path - */ - path: string; - } - interface ScanCodeOptions extends BaseOptions { - /** - * 是否只能从相机扫码,不允许从相册选择图片 - * @version 1.2.0 - */ - onlyFromCamera?: boolean; - /** - * 扫码类型,参数类型是数组 - * 二维码是'qrCode',一维码是'barCode',DataMatrix是‘datamatrix’,pdf417是‘pdf417’。 - * @version 1.7.0 - */ - scanType?: string[]; - success(res: ScanCodeData): void; - } - /** - * 调起客户端扫码界面,扫码成功后返回对应的结果 - */ - function scanCode(options: ScanCodeOptions): void; - // 设备-----剪贴板 - interface ClipboardDataOptions extends BaseOptions { - data: string; - success?(res: DataResponse): void; - } - /** - * 设置系统剪贴板的内容 - * 微信客户端 6.5.6 版本开始支持 - * @version 1.1.0 - */ - function setClipboardData(options: ClipboardDataOptions): void; - /** - * 获取系统剪贴板内容 - * 微信客户端 6.5.6 版本开始支持 - * @version 1.1.0 - */ - function getClipboardData(options: ClipboardDataOptions): void; - // 设备-----蓝牙 - interface OpenBluetoothAdapterOptions extends BaseOptions { - success(res: any): void; - } - /** - * 初始化蓝牙适配器 - * @version 1.1.0 - */ - function openBluetoothAdapter(options: OpenBluetoothAdapterOptions): void; - interface CloseBluetoothAdapterOptions extends BaseOptions { - success(res: any): void; - } - /** - * 关闭蓝牙模块。调用该方法将断开所有已建立的链接并释放系统资源 - * @version 1.1.0 - */ - function closeBluetoothAdapter(options: CloseBluetoothAdapterOptions): void; - interface BluetoothAdapterState { - /** - * 蓝牙适配器是否可用 - */ - available: boolean; - /** - * 蓝牙适配器是否处于搜索状态 - */ - discovering: boolean; - } - interface BluetoothAdapterStateData extends ErrMsgResponse { - /** - * 蓝牙适配器信息 - */ - adapterState: BluetoothAdapterState; - } - interface GetBluetoothAdapterStateOptions extends BaseOptions { - success(res: BluetoothAdapterStateData): void; - } - /** - * 获取本机蓝牙适配器状态 - * @version 1.1.0 - */ - function getBluetoothAdapterState(options: GetBluetoothAdapterStateOptions): void; - /** - * 监听蓝牙适配器状态变化事件 - * @version 1.1.0 - */ - function onBluetoothAdapterStateChange(callback: (res: BluetoothAdapterState) => void): void; - interface StartBluetoothDevicesDiscoveryOptions extends BaseOptions { - success(res: ErrMsgResponse): void; - /** - * 蓝牙设备主 service 的 uuid 列表 - * 某些蓝牙设备会广播自己的主 service 的 uuid。如果这里传入该数组,那么根据该 uuid 列表,只搜索有这个主服务的设备。 - */ - services?: string[]; - } - /** - * 开始搜寻附近的蓝牙外围设备。 - * 注意,该操作比较耗费系统资源,请在搜索并连接到设备后调用 stop 方法停止搜索。 - * @example - * // 以微信硬件平台的蓝牙智能灯为例,主服务的 UUID 是 FEE7。传入这个参数,只搜索主服务 UUID 为 FEE7 的设备 - * wx.startBluetoothDevicesDiscovery({ - * services: ['FEE7'], - * success: function (res) { - * console.log(res) - * } - * }); - */ - function startBluetoothDevicesDiscovery(options: StartBluetoothDevicesDiscoveryOptions): void; - interface StopBluetoothDevicesDiscoveryOptions extends BaseOptions { - success(res: ErrMsgResponse): void; - } - /** - * 停止搜寻附近的蓝牙外围设备。请在确保找到需要连接的设备后调用该方法停止搜索。 - * @version 1.1.0 - */ - function stopBluetoothDevicesDiscovery(options: StopBluetoothDevicesDiscoveryOptions): void; - /** - * 蓝牙设备信息 - */ - interface BluetoothDevice { - /** - * 蓝牙设备名称,某些设备可能没有 - */ - name: string; - /** - * 用于区分设备的 id - */ - deviceId: string; - /** - * int 当前蓝牙设备的信号强度 - */ - RSSI: number; - /** - * 当前蓝牙设备的广播内容 - */ - advertisData: ArrayBuffer; - } - interface GetBluetoothDevicesOptions extends BaseOptions { - success(res: { - devices: BluetoothDevice[]; - } & ErrMsgResponse): void; - } - /** - * 获取所有已发现的蓝牙设备,包括已经和本机处于连接状态的设备 - */ - function getBluetoothDevices(options: GetBluetoothDevicesOptions): void; - /** - * 监听寻找到新设备的事件 - * @version 1.1.0 - */ - function onBluetoothDeviceFound(callback: (res: { - devices: BluetoothDevice[] - }) => void): void; - interface GetConnectedBluetoothDevicesOptions extends BaseOptions { - services: string[]; - success(res: { - devices: BluetoothDevice[] - } & ErrMsgResponse): void; - } - /** - * 根据 uuid 获取处于已连接状态的设备 - * @version 1.1.0 - */ - function getConnectedBluetoothDevices(options: GetConnectedBluetoothDevicesOptions): void; - interface CreateBLEConnectionOptions extends BaseOptions { - success(res: ErrMsgResponse): void; - } - /** - * 低功耗蓝牙接口 - * @version 1.1.0 - */ - function createBLEConnection(options: CreateBLEConnectionOptions): void; - interface CloseBLEConnectionOptions extends BaseOptions { - /** - * 蓝牙设备 id,参考 getDevices 接口 - */ - deviceId: string; - success(res: ErrMsgResponse): void; - } - /** - * 断开与低功耗蓝牙设备的连接 - * @version 1.1.0 - */ - function closeBLEConnection(options: CloseBLEConnectionOptions): void; - interface GetBLEDeviceServicesOptions extends BaseOptions { - /** - * 蓝牙设备 id,参考 getDevices 接口 - */ - deviceId: string; - /** - * 成功则返回本机蓝牙适配器状态 - */ - success(res: { - services: Array<{ - uuid: string; - isPrimary: boolean; - }>; - } & ErrMsgResponse): void; - } - /** - * 获取蓝牙设备所有 service(服务) - */ - function getBLEDeviceServices(options: GetBLEDeviceServicesOptions): void; - interface GetBLEDeviceCharacteristicsOptions extends BaseOptions { - /** - * 蓝牙设备 id,参考 device 对象 - */ - deviceId: string; - /** - * 蓝牙服务 uuid - */ - serviceId: string; - /** - * 成功则返回本机蓝牙适配器状态 - */ - success(res: { - characteristics: Array<{ - uuid: string; - properties: Array<{ - /** - * 该特征值是否支持 read 操作 - */ - read: boolean; - /** - * 该特征值是否支持 write 操作 - */ - write: boolean; - /** - * 该特征值是否支持 notify 操作 - */ - notify: boolean; - /** - * 该特征值是否支持 indicate 操作 - */ - indicate: boolean; - }>; - }>; - } & ErrMsgResponse): void; - } - /** - * 获取蓝牙设备所有 characteristic(特征值) - */ - function getBLEDeviceCharacteristics(options: GetBLEDeviceCharacteristicsOptions): void; - interface BLECharacteristicValueOptions extends BaseOptions { - /** - * 蓝牙设备 id,参考 device 对象 - */ - deviceId: string; - /** - * 蓝牙特征值对应服务的 uuid - */ - serviceId: string; - /** - * 蓝牙特征值的 uuid - */ - characteristicId: string; - success(res: { - characteristic: { + // #region 基本参数 + interface DataResponse { + /** 回调函数返回的内容 */ + data: object | string | ArrayBuffer; + /** 开发者服务器返回的 HTTP 状态码 */ + statusCode: number; + /** 开发者服务器返回的 HTTP Response Header */ + header: object; + } + interface ErrMsgResponse { + /** 成功:ok,错误:详细信息 */ + errMsg: "ok" | string; + } + interface TempFileResponse { + /** 文件的临时路径 */ + tempFilePath: string; + } + interface BaseOptions { + /** 接口调用成功的回调函数 */ + success?(res: any): void; + /** 接口调用失败的回调函数 */ + fail?(res: any): void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?(res: any): void; + } + // #endregion + // #region 网络API列表 + // 发起请求 + interface RequestHeader { + [key: string]: string; + } + interface RequestOptions extends BaseOptions { + /** 开发者服务器接口地址 */ + url: string; + /** 请求的参数 */ + data?: string | object | ArrayBuffer; + /** 设置请求的 header , header 中不能设置 Referer */ + header?: RequestHeader; + /** 默认为 GET,有效值:OPTIONS, GET, HEAD, POST, PUT, DELETE, TRACE, CONNECT */ + method?: + | "GET" + | "OPTIONS" + | "GET" + | "HEAD" + | "POST" + | "PUT" + | "DELETE" + | "TRACE" + | "CONNECT"; + /** 如果设为json,会尝试对返回的数据做一次 JSON.parse */ + dataType?: string; /** - * 蓝牙设备特征值的 uuid + * 设置响应的数据类型。合法值:text、arraybuffer + * @version 1.7.0 */ - characteristicId: string; + responseType?: string; + /** 收到开发者服务成功返回的回调函数,res = {data: '开发者服务器返回的内容'} */ + success?(res: DataResponse): void; + } + /** + * wx.request发起的是https请求。一个微信小程序,同时只能有5个网络请求连接。 + */ + function request(options: RequestOptions): RequestTask; + + /** + * 返回一个 requestTask 对象,通过 requestTask,可中断请求任务。 + */ + interface RequestTask { + abort(): void; + } + + interface UploadTask { /** - * 蓝牙设备特征值对应服务的 uuid + * 监听上传进度变化 + * @version 1.4.0 + */ + onProgressUpdate( + callback?: ( + res: { + /** 上传进度百分比 */ + progress: number; + /** 已经上传的数据长度,单位 Bytes */ + totalBytesSent: number; + /** 预期需要上传的数据总长度,单位 Bytes */ + totalBytesExpectedToSend: number; + } + ) => void + ): void; + /** + * 中断下载任务 + * @version 1.4.0 + */ + abort(): void; + } + // 上传下载 + interface UploadFileOptions extends BaseOptions { + /** 开发者服务器 url */ + url: string; + /** 要上传文件资源的路径 */ + filePath: string; + /** 文件对应的 key , 开发者在服务器端通过这个 key 可以获取到文件二进制内容 */ + name: string; + /** HTTP 请求 Header , header 中不能设置 Referer */ + header?: RequestHeader; + /** HTTP 请求中其他额外的 form data */ + formData?: any; + } + /** + * 将本地资源上传到开发者服务器。 + * 如页面通过 wx.chooseImage 等接口获取到一个本地资源的临时文件路径后, + * 可通过此接口将本地资源上传到指定服务器。 + * 客户端发起一个 HTTPS POST 请求, + * 其中 Content-Type 为 multipart/form-data 。 + */ + function uploadFile(options: UploadFileOptions): UploadTask; + interface DownloadTask { + /** + * 监听下载进度变化 + * @version 1.4.0 + */ + onProgressUpdate( + callback?: ( + res: { + /** 下载进度百分比 */ + progress: number; + /** 已经下载的数据长度,单位 Bytes */ + totalBytesWritten: number; + /** 预期需要下载的数据总长度,单位 Bytes */ + totalBytesExpectedToWrite: number; + } + ) => void + ): void; + /** + * 中断下载任务 + * @version 1.4.0 + */ + abort(): void; + } + interface DownloadFileOptions extends BaseOptions { + /** 下载资源的 url */ + url: string; + /** 下载资源的类型,用于客户端识别处理,有效值:image/audio/video */ + type?: string; + /** HTTP 请求 Header */ + header?: RequestHeader; + /** 下载成功后以 tempFilePath 的形式传给页面,res = {tempFilePath: '文件的临时路径'} */ + success?(res: TempFileResponse): void; + } + /** + * 下载文件资源到本地。客户端直接发起一个 HTTP GET 请求, + * 把下载到的资源根据 type 进行处理,并返回文件的本地临时路径。 + */ + function downloadFile(options: DownloadFileOptions): DownloadTask; + // WebSocket + interface ConnectSocketOptions extends BaseOptions { + /** 开发者服务器接口地址,必须是 HTTPS 协议,且域名必须是后台配置的合法域名 */ + url: string; + /** 请求的数据 */ + data?: any; + /** HTTP Header , header 中不能设置 Referer */ + header?: RequestHeader; + /** 默认是GET,有效值为: OPTIONS, GET, HEAD, POST, PUT, DELETE, TRACE, CONNECT */ + method?: string; + /** + * 子协议数组 + * @version 1.4.0 + */ + protocols?: string[]; + } + /** + * 创建一个 WebSocket 连接; + * 一个微信小程序同时只能有一个 WebSocket 连接, + * 如果当前已存在一个 WebSocket 连接, + * 会自动关闭该连接,并重新创建一个 WebSocket 连接。 + */ + function connectSocket(options: ConnectSocketOptions): void; + /** 监听WebSocket连接打开事件。 */ + function onSocketOpen(callback: () => void): void; + /** 监听WebSocket错误。 */ + function onSocketError(callback: (error: any) => void): void; + interface SendSocketMessageOptions extends BaseOptions { + /** 需要发送的内容 */ + data: string; + } + /** + * 通过 WebSocket 连接发送数据,需要先 wx.connectSocket, + * 并在 wx.onSocketOpen 回调之后才能发送。 + */ + function sendSocketMessage(options: SendSocketMessageOptions): void; + /** + * 监听WebSocket接受到服务器的消息事件。 + */ + function onSocketMessage(callback: (res: DataResponse) => void): void; + /** + * 关闭WebSocket连接。 + */ + function closeSocket(): void; + /** 监听WebSocket关闭。 */ + function onSocketClose(callback: () => void): void; + // #endregion + // #region 媒体API列表 + // 媒体-----图片 + type ImageSizeType = "original" | "compressed"; + type ImageSourceType = "album" | "camera"; + type VideoSourceType = "album" | "camera"; + type CameraDevice = "front" | "back"; + interface TempFile { + /** 本地文件路径 */ + path: string; + /** 本地文件大小,单位:B */ + size: number; + } + interface TempFilesData { + /** 文件的临时路径 */ + tempFilePaths: string; + /** + * 图片的本地文件列表,每一项是一个 File 对象 + * @version 1.2.0 + */ + tempFiles: TempFile[]; + } + interface ChooseImageOptions extends BaseOptions { + /** 最多可以选择的图片张数,默认9 */ + count?: number; + /** original 原图,compressed 压缩图,默认二者都有 */ + sizeType?: ImageSizeType[]; + /** album 从相册选图,camera 使用相机,默认二者都有 */ + sourceType?: ImageSourceType[]; + /** 成功则返回图片的本地文件路径列表 tempFilePaths */ + success(res: TempFilesData): void; + } + /** + * 从本地相册选择图片或使用相机拍照。 + */ + function chooseImage(options: ChooseImageOptions): void; + interface PreviewImageOptions extends BaseOptions { + /** 当前显示图片的链接,不填则默认为 urls 的第一张 */ + current?: string; + /** 需要预览的图片链接列表 */ + urls: string[]; + } + /** + * 预览图片。 + */ + function previewImage(options: PreviewImageOptions): void; + interface GetImageInfoOptions extends BaseOptions { + /** + * 图片的路径,可以是相对路径,临时文件路径,存储文件路径,网络图片路径 + */ + src: string; + } + /** + * 获取图片信息 + */ + function getImageInfo(options: GetImageInfoOptions): void; + interface SaveImageToPhotosAlbumOptions extends BaseOptions { + /** + * 图片的路径,可以是相对路径,临时文件路径,存储文件路径,网络图片路径 + */ + filePath: string; + success(res: { errMsg: string }): void; + } + /** + * 保存图片到系统相册。 + * 需要用户授权 scope.writePhotosAlbum + * @version 1.2.0 + */ + function saveImageToPhotosAlbum( + options: SaveImageToPhotosAlbumOptions + ): void; + // 媒体-----录音 + interface StartRecordOptions extends BaseOptions { + /** 录音成功后调用,返回录音文件的临时文件路径,res = {tempFilePath: '录音文件的临时路径'} */ + success?(res: TempFileResponse): void; + } + /** + * 开始录音。当主动调用wx.stopRecord, + * 或者录音超过1分钟时自动结束录音,返回录音文件的临时文件路径。 + * 注:文件的临时路径,在小程序本次启动期间可以正常使用, + * 如需持久保存,需在主动调用wx.saveFile,在小程序下次启动时才能访问得到。 + * @deprecated 1.6.0 + */ + function startRecord(options: StartRecordOptions): void; + interface StopRecordOptions extends BaseOptions { + success?(): void; + } + /** + * 主动调用停止录音。 + */ + function stopRecord(options?: StopRecordOptions): void; + type EncodeBitRate = + | 8000 + | 11025 + | 12000 + | 16000 + | 22050 + | 24000 + | 32000 + | 44100 + | 48000; + interface RecorderManagerStartOptions { + /** + * 指定录音的时长,单位 ms + * 如果传入了合法的 duration + * 在到达指定的 duration 后会自动停止录音,最大值 600000(10 分钟),默认值 60000(1 分钟) + */ + duration?: number; + /** + * 采样率,有效值 8000/16000/44100 + */ + sampleRate?: number; + /** + * 否 录音通道数,有效值 1/2 + */ + numberOfChannels?: number; + /** + * 编码码率 + * 采样率和码率有一定要求,具体有效值如下: + * 采样率 编码码率 + * + 8000 16000 ~ 48000 + * + 11025 16000 ~ 48000 + * + 12000 24000 ~ 64000 + * + 16000 24000 ~ 96000 + * + 22050 32000 ~ 128000 + * + 24000 32000 ~ 128000 + * + 32000 48000 ~ 192000 + * + 44100 64000 ~ 320000 + * + 48000 64000 ~ 320000 + */ + encodeBitRate: number; + /** 音频格式,有效值 aac/mp3 */ + format: string; + /** + * 指定帧大小,单位 KB + * 传入 frameSize 后,每录制指定帧大小的内容后 + * 会回调录制的文件内容,不指定则不会回调。暂仅支持 mp3 格式。 + */ + frameSize: number; + } + interface OnRecorderManagerStopOptions { + tempFilePath: string; + } + interface OnFrameRecordedOptions { + /** 录音分片结果数据 */ + frameBuffer: ArrayBuffer; + /** 当前帧是否正常录音结束前的最后一帧 */ + isLastFrame: boolean; + } + interface RecorderManager { + /** 开始录音 */ + start(options?: RecorderManagerStartOptions): void; + /** 暂停录音 */ + pause(): void; + /** 继续录音 */ + resume(): void; + /** 停止录音 */ + stop(): void; + /** 录音开始事件 */ + onStart(callback?: () => void): void; + /** 录音暂停事件 */ + onPause(callback?: () => void): void; + /** 录音恢复事件 */ + onResume(callback?: () => void): void; + /** 录音停止事件,会回调文件地址 */ + onStop( + callback?: (options: OnRecorderManagerStopOptions) => void + ): void; + /** 已录制完指定帧大小的文件,会回调录音分片结果数据。如果设置了 frameSize ,则会回调此事件 */ + onFrameRecorded( + callback?: (options: OnFrameRecordedOptions) => void + ): void; + /** 录音错误事件, 会回调错误信息 */ + onError(callback?: (err: ErrMsgResponse) => void): void; + } + /** + * 获取全局唯一的录音管理器 recorderManager + * @version 1.6.0 + */ + function getRecorderManager(): RecorderManager; + // 媒体-----音频播放控制 + interface PlayVoiceOptions extends BaseOptions { + /** 需要播放的语音文件的文件路径 */ + filePath: string; + } + /** + * 开始播放语音,同时只允许一个语音文件正在播放, + * 如果前一个语音文件还没播放完,将中断前一个语音播放。 + * @deprecated 1.6.0 + */ + function playVoice(options: PlayVoiceOptions): void; + /** + * 暂停正在播放的语音。 + * 再次调用wx.playVoice播放同一个文件时,会从暂停处开始播放。 + * 如果想从头开始播放,需要先调用 wx.stopVoice。 + * @deprecated 1.6.0 + */ + function pauseVoice(): void; + /** + * 结束播放语音。 + * @deprecated 1.6.0 + */ + function stopVoice(): void; + // 媒体-----音乐播放控制 + interface BackgroundAudioPlayerState { + /** 选定音频的长度(单位:s),只有在当前有音乐播放时返回 */ + duration: number; + /** 选定音频的播放位置(单位:s),只有在当前有音乐播放时返回 */ + currentPosition: number; + /** 播放状态(2:没有音乐在播放,1:播放中,0:暂停中) */ + status: number; + /** 音频的下载进度(整数,80 代表 80%),只有在当前有音乐播放时返回 */ + downloadPercent: number; + /** 歌曲数据链接,只有在当前有音乐播放时返回 */ + dataUrl: string; + } + interface GetBackgroundAudioPlayerStateOptions extends BaseOptions { + /** 接口调用成功的回调函数 */ + success?(state: BackgroundAudioPlayerState): void; + /** 接口调用失败的回调函数 */ + fail?(): void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?(): void; + } + /** + * 获取音乐播放状态。 + * @deprecated 1.2.0 + */ + function getBackgroundAudioPlayerState( + options: GetBackgroundAudioPlayerStateOptions + ): void; + interface PlayBackgroundAudioOptions extends BaseOptions { + /** 音乐链接 */ + dataUrl: string; + /** 音乐标题 */ + title?: string; + /** 封面URL */ + coverImgUrl?: string; + } + /** + * 播放音乐,同时只能有一首音乐正在播放。 + * @deprecated 1.2.0 + */ + function playBackgroundAudio(options: PlayBackgroundAudioOptions): void; + /** + * 暂停播放音乐。 + * @deprecated 1.2.0 + */ + function pauseBackgroundAudio(options?: PlayBackgroundAudioOptions): void; + interface SeekBackgroundAudioOptions extends BaseOptions { + /** 音乐位置,单位:秒 */ + position: number; + } + /** + * 控制音乐播放进度。 + * @deprecated 1.2.0 + */ + function seekBackgroundAudio(options: SeekBackgroundAudioOptions): void; + /** + * 停止播放音乐。 + * @deprecated 1.2.0 + */ + function stopBackgroundAudio(options?: PlayBackgroundAudioOptions): void; + /** + * 监听音乐播放。 + * @deprecated 1.2.0 + */ + function onBackgroundAudioPlay(callback: () => void): void; + /** + * 监听音乐暂停。 + * @deprecated 1.2.0 + */ + function onBackgroundAudioPause(callback: () => void): void; + /** + * 监听音乐停止。 + * @deprecated 1.2.0 + */ + function onBackgroundAudioStop(callback: () => void): void; + interface BackgroundAudioManager { + /** 当前音频的长度(单位:s),只有在当前有合法的 src 时返回 */ + readonly duration: number; + /** 当前音频的播放位置(单位:s),只有在当前有合法的 src 时返回 */ + readonly currentTime: number; + /** 当前是是否暂停或停止状态,true 表示暂停或停止,false 表示正在播放 */ + readonly paused: boolean; + /** 音频的数据源,默认为空字符串,当设置了新的 src 时,会自动开始播放 ,目前支持的格式有 m4a, aac, mp3, wav */ + src: string; + /** 音频开始播放的位置(单位:s) */ + startTime: number; + /** 音频缓冲的时间点,仅保证当前播放时间点到此时间点内容已缓冲。 是 */ + buffered: number; + /** 音频标题,用于做原生音频播放器音频标题。原生音频播放器中的分享功能,分享出去的卡片标题,也将使用该值。 */ + title: string; + /** 专辑名,原生音频播放器中的分享功能,分享出去的卡片简介,也将使用该值 */ + epname: string; + /** 歌手名,原生音频播放器中的分享功能,分享出去的卡片简介,也将使用该值 */ + singer: string; + /** 封面图url,用于做原生音频播放器背景图。原生音频播放器中的分享功能,分享出去的卡片配图及背景也将使用该图。 */ + coverImgUrl: string; + /** 页面链接,原生音频播放器中的分享功能,分享出去的卡片简介,也将使用该值 */ + webUrl: string; + /** 播放 */ + play(): void; + /** 暂停 */ + pause(): void; + /** 停止 */ + stop(): void; + /** 跳转到指定位置,单位 s */ + seek(position: number): void; + /** 背景音频进入可以播放状态,但不保证后面可以流畅播放 */ + onCanplay(callback?: () => void): void; + /** 背景音频播放事件 */ + onPlay(callback?: () => void): void; + /** 背景音频暂停事件 */ + onPause(callback?: () => void): void; + /** 背景音频停止事件 */ + onStop(callback?: () => void): void; + /** 背景音频自然播放结束事件 */ + onEnded(callback?: () => void): void; + /** 背景音频播放进度更新事件 */ + onTimeUpdate(callback?: () => void): void; + /** 用户在系统音乐播放面板点击上一曲事件(iOS only) */ + onPrev(callback?: () => void): void; + /** 用户在系统音乐播放面板点击下一曲事件(iOS only) */ + onNext(callback?: () => void): void; + /** 背景音频播放错误事件 */ + onError(callback?: () => void): void; + /** 音频加载中事件,当音频因为数据不足,需要停下来加载时会触发 */ + onWaiting(callback?: () => void): void; + } + /** + * 获取全局唯一的背景音频管理器 backgroundAudioManager。 + * @version 1.2.0 + */ + function getBackgroundAudioManager(): BackgroundAudioManager; + // 媒体-----音频组件控制 + /** + * audioContext 通过 audioId 跟一个