diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index e377cd02ab..120db09a19 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 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/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/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/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/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/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/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/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/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/node/index.d.ts b/types/node/index.d.ts index 63b06965f6..9753d31cc6 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; @@ -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; } @@ -1891,7 +1893,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 +2202,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; @@ -6405,17 +6409,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..5a87685a68 100644 --- a/types/node/node-tests.ts +++ b/types/node/node-tests.ts @@ -862,6 +862,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 = () => {}; @@ -1708,7 +1709,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 +1789,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 +2366,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..729a0c0da8 100644 --- a/types/node/v8/index.d.ts +++ b/types/node/v8/index.d.ts @@ -5688,17 +5688,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..ba7347e849 100644 --- a/types/node/v9/index.d.ts +++ b/types/node/v9/index.d.ts @@ -5772,17 +5772,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 f2047ce098..490063fb77 100644 --- a/types/office-js/index.d.ts +++ b/types/office-js/index.d.ts @@ -522,7 +522,7 @@ declare namespace Office { * 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 @@ -629,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. @@ -1071,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. @@ -1146,18 +1146,18 @@ declare namespace Office { * @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. * * @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; } /** @@ -1586,6 +1586,7 @@ 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 {@link Office.AsyncResult}. * @@ -1607,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. @@ -2300,7 +2301,7 @@ 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. * @@ -2312,8 +2313,10 @@ declare namespace Office { * * @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. * @@ -2324,7 +2327,7 @@ declare namespace Office { * @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 {@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. * @@ -2455,7 +2458,7 @@ declare namespace Office { * * @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; } /** @@ -2602,8 +2605,9 @@ declare namespace Office { * @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 {@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. * @@ -2632,8 +2636,9 @@ declare namespace Office { * 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 {@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. * @@ -2667,8 +2672,9 @@ declare namespace Office { * 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 {@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. * @@ -2693,8 +2699,9 @@ 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 {@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 * @@ -2722,8 +2729,9 @@ 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 {@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 * @@ -2752,7 +2760,7 @@ 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}. */ - 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. @@ -2805,8 +2813,9 @@ 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 {@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. * @@ -2815,8 +2824,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 {@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. * @@ -2825,8 +2835,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 {@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. * @@ -2835,8 +2846,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 {@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. * @@ -2847,7 +2859,7 @@ 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}. */ - 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. * @@ -2860,7 +2872,7 @@ 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}. */ - 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. * @@ -2871,7 +2883,7 @@ 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}. */ - 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. @@ -2903,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; @@ -2921,7 +2933,7 @@ 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: (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. * @@ -2930,7 +2942,7 @@ 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}. */ - 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. * @@ -2939,8 +2951,9 @@ 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 {@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. * @@ -2948,8 +2961,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 {@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. * @@ -2961,7 +2975,7 @@ declare namespace Office { * @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 {@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; } /** @@ -3098,24 +3112,28 @@ 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 {@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 {@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 {@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. @@ -3150,7 +3168,7 @@ 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}. */ - 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. * @@ -3162,8 +3180,9 @@ declare namespace Office { * @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 {@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. * @@ -3175,8 +3194,9 @@ declare namespace Office { * @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 {@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. @@ -3329,7 +3349,7 @@ 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: 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). * @@ -3356,8 +3376,11 @@ 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}. + * 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. @@ -3399,8 +3422,9 @@ 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 {@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. * @@ -3427,8 +3451,9 @@ 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 {@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. * @@ -3517,8 +3542,11 @@ 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 {@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. * @@ -3532,8 +3560,8 @@ declare namespace Office { * 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). @@ -3558,8 +3586,9 @@ declare namespace Office { * @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 {@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. * @@ -3586,7 +3615,7 @@ declare namespace Office { * @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 {@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. * @@ -3696,15 +3725,16 @@ declare namespace Office { * 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 {@link Office.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 {@link Office.AsyncResult}. + * The `value` property of the result contains the `fieldValue` property, which represents the value of the specified field. * * @remarks * @@ -3722,13 +3752,14 @@ 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 {@link Office.AsyncResult}. + * The `value` property of the result is the GUID of the resource as a string. * * @remarks * @@ -3746,11 +3777,12 @@ 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 {@link Office.AsyncResult}. + * The `value` property of the result is the GUID of the resource as a string. * * @remarks * @@ -3768,11 +3800,12 @@ 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 {@link Office.AsyncResult}. + * The `value` property of the result is the GUID of the resource as a string. * * @remarks * @@ -3790,11 +3823,14 @@ 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 {@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 * @@ -3812,12 +3848,16 @@ 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 {@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 * @@ -3835,13 +3875,14 @@ 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 {@link Office.AsyncResult}. + * The `value` property of the result contains the `fieldValue` property, which represents the value of the specified field. * * @remarks * @@ -3859,11 +3900,14 @@ 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 {@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 * @@ -3881,7 +3925,7 @@ 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. * @@ -3889,6 +3933,7 @@ 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}. + * The `value` property of the result is the highest index number in the current project's resource collection. * * @remarks * @@ -3906,7 +3951,7 @@ 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. * @@ -3914,6 +3959,7 @@ 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}. + * The `value` property of the result is the highest index number in the current project's task collection. * * @remarks * @@ -3931,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. * @@ -3940,6 +3986,7 @@ 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 {@link Office.AsyncResult}. + * The `value` property of the result is the GUID of the resource as a string. * * @remarks * @@ -3957,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. * @@ -3966,6 +4013,7 @@ 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 {@link Office.AsyncResult}. + * The `value` property of the result is the GUID of the task as a string. * * @remarks * @@ -3983,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. * @@ -4011,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. * @@ -4039,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. @@ -4125,7 +4173,7 @@ declare namespace Office { * * @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. * @@ -4160,8 +4208,9 @@ 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 {@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 { /** @@ -4227,6 +4276,7 @@ declare namespace Office { * * 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 { @@ -4244,7 +4294,7 @@ 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 {@link Office.AsyncResult}. * @@ -4285,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. * @@ -4370,8 +4420,9 @@ declare namespace Office { * * * @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. * @@ -4440,7 +4491,7 @@ declare namespace Office { * @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 {@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. * @@ -4497,7 +4548,7 @@ 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 {@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. * @@ -4535,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. * @@ -4710,7 +4807,7 @@ 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}. */ - 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. * @@ -4750,7 +4847,7 @@ 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}. */ - 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. * @@ -4777,7 +4874,7 @@ 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}. */ - deleteAllDataValuesAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + deleteAllDataValuesAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Clears formatting on the bound table. * @@ -4801,15 +4898,60 @@ 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}. */ - 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. + * + * @remarks + * + * **Returned format structure** + * + * 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: + * + * **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). + * * @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) => void): void; + 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. * @@ -4904,32 +5046,6 @@ declare namespace Office { * 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.
- * * **Support details** * * A capital Y in the following matrix indicates that this method is supported in the corresponding Office host application. @@ -4948,7 +5064,7 @@ 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}. */ - 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. * @@ -5000,9 +5116,8 @@ 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}. * - */ - 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}. @@ -8477,14 +8592,15 @@ 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. * @@ -8502,10 +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 {@link Office.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. @@ -8519,10 +8635,10 @@ 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 - * {@link Office.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. * @@ -8545,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;` * @@ -8553,10 +8669,10 @@ 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 {@link Office.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. * @@ -8598,10 +8714,10 @@ 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 {@link Office.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. * @@ -8644,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;` * @@ -8652,10 +8768,10 @@ 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 {@link Office.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. * @@ -8701,10 +8817,10 @@ 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 {@link Office.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. * @@ -8751,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;` * @@ -8759,10 +8875,10 @@ 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 {@link Office.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. * @@ -8808,10 +8924,10 @@ 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 {@link Office.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. * @@ -8960,7 +9076,7 @@ declare namespace Office { * * {@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. @@ -9166,20 +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 {@link Office.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] * @@ -9189,10 +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 {@link Office.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; } /** @@ -9222,8 +9338,9 @@ 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; } /** @@ -9483,7 +9600,7 @@ 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. @@ -9494,7 +9611,7 @@ declare namespace Office { * 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. * @@ -9560,7 +9677,7 @@ declare namespace Office { * 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. * @@ -9582,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. * @@ -9600,7 +9719,7 @@ 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. @@ -9612,7 +9731,7 @@ declare namespace Office { * * @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. * @@ -9635,7 +9754,7 @@ declare namespace Office { * * @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. * @@ -9664,17 +9783,17 @@ 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 {@link Office.AsyncResult}. On success, the attachment identifier will be provided 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}. + * 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. * @@ -9753,11 +9872,11 @@ 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 {@link Office.AsyncResult}. On success, the attachment identifier will be provided 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}. + * 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 * @@ -9795,15 +9914,13 @@ 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 {@link Office.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}. * 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. + * 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. * @@ -9830,7 +9947,7 @@ declare namespace Office { * 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. * @@ -9856,7 +9973,7 @@ declare namespace Office { * @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. * @@ -9881,7 +9998,7 @@ declare namespace Office { * @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. * @@ -9907,16 +10024,15 @@ 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 {@link Office.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}. * 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. * @@ -9988,7 +10104,7 @@ declare namespace Office { * 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. * @@ -10005,7 +10121,7 @@ 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. @@ -10017,7 +10133,7 @@ declare namespace Office { * * @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. * @@ -10039,7 +10155,7 @@ declare namespace Office { * * @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. * @@ -10077,15 +10193,13 @@ 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 {@link Office.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. * @@ -10184,11 +10298,9 @@ 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 {@link Office.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. * @@ -10212,7 +10324,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;` * * @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. @@ -10226,10 +10338,9 @@ declare namespace Office { * 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}. - * If removing the attachment fails, the asyncResult.error property will contain an error code with the reason for the failure. + * 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. * @@ -10300,10 +10411,9 @@ declare namespace Office { * @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}. - * If removing the attachment fails, the asyncResult.error property will contain an error code with the reason for the failure. + * type {@link Office.AsyncResult}. */ - setSelectedDataAsync(data: string, callback: (result: AsyncResult) => void): void; + setSelectedDataAsync(data: string, callback: (result: AsyncResult) => void): void; } /** @@ -10634,7 +10744,7 @@ 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. @@ -10646,7 +10756,7 @@ declare namespace Office { * * @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. @@ -10670,7 +10780,7 @@ declare namespace Office { * * @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. @@ -10739,7 +10849,7 @@ 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. @@ -10751,7 +10861,7 @@ declare namespace Office { * * @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}. * @@ -10773,7 +10883,7 @@ declare namespace Office { * * @beta */ - getInitializationContextAsync(callback?: (result: AsyncResult) => void): void; + getInitializationContextAsync(callback?: (result: AsyncResult) => void): void; /** * Gets the entities found in the selected item's body. * @@ -11001,7 +11111,7 @@ declare namespace Office { * @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. @@ -11019,7 +11129,7 @@ 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. @@ -11031,7 +11141,7 @@ declare namespace Office { * * @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. * @@ -11054,7 +11164,7 @@ declare namespace Office { * * @beta */ - removeHandlerAsync(eventType:EventType, handler: any, callback?: (result: AsyncResult) => void): void; + removeHandlerAsync(eventType:EventType, handler: any, callback?: (result: AsyncResult) => void): void; } /** @@ -11201,7 +11311,7 @@ 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. @@ -11213,7 +11323,7 @@ declare namespace Office { * * @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. @@ -11236,7 +11346,7 @@ declare namespace Office { * * @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. @@ -11262,7 +11372,7 @@ declare namespace Office { * @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. @@ -11280,7 +11390,7 @@ 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. @@ -11292,7 +11402,7 @@ declare namespace Office { * * @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. @@ -11316,7 +11426,7 @@ declare namespace Office { * * @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}. @@ -11363,7 +11473,7 @@ 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. @@ -11376,7 +11486,7 @@ declare namespace Office { * 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. * @@ -11444,7 +11554,7 @@ declare namespace Office { * 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. @@ -11467,9 +11577,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 Exchange item, such as a message, as an attachment to the message or appointment. @@ -11499,7 +11611,7 @@ 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. @@ -11510,7 +11622,7 @@ declare namespace Office { * 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. * @@ -11594,7 +11706,7 @@ declare namespace Office { * 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 @@ -11641,7 +11753,7 @@ declare namespace Office { * * @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. * @@ -11667,7 +11779,7 @@ declare namespace Office { * @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. * @@ -11695,7 +11807,7 @@ declare namespace Office { * @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. * @@ -11721,7 +11833,7 @@ 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. @@ -11730,7 +11842,7 @@ declare namespace Office { * 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. * @@ -11801,7 +11913,7 @@ declare namespace Office { * 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. @@ -11840,7 +11952,7 @@ 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. @@ -11848,7 +11960,7 @@ declare namespace Office { * 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. * @@ -11952,7 +12064,7 @@ declare namespace Office { * 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. * @@ -11976,7 +12088,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;` * * @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. @@ -11991,9 +12103,8 @@ declare namespace Office { * 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}. - * If removing the attachment fails, the asyncResult.error property will contain an error code with the reason for the failure. */ - 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. * @@ -12066,9 +12177,8 @@ declare namespace Office { * 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}. - * If removing the attachment fails, the asyncResult.error property will contain an error code with the reason for the failure. */ - 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}. @@ -12250,7 +12360,7 @@ 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. @@ -12262,7 +12372,7 @@ declare namespace Office { * * @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}. * @@ -12285,7 +12395,7 @@ declare namespace Office { * * @beta */ - getInitializationContextAsync(callback?: (result: AsyncResult) => void): void; + getInitializationContextAsync(callback?: (result: AsyncResult) => void): void; /** * Gets the entities found in the selected item's body. * @@ -12758,7 +12868,7 @@ 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. @@ -12771,7 +12881,7 @@ declare namespace Office { * 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. * @@ -12838,7 +12948,7 @@ declare namespace Office { * 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. * @@ -12860,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. * @@ -12878,7 +12990,7 @@ 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. @@ -12890,7 +13002,7 @@ declare namespace Office { * * @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. * @@ -12913,7 +13025,7 @@ declare namespace Office { * * @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. * @@ -12942,7 +13054,7 @@ 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. @@ -12953,7 +13065,7 @@ declare namespace Office { * 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. * @@ -13037,7 +13149,7 @@ declare namespace Office { * 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 * @@ -13084,7 +13196,7 @@ declare namespace Office { * * @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. * @@ -13110,7 +13222,7 @@ declare namespace Office { * @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. * @@ -13138,7 +13250,7 @@ declare namespace Office { * @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. * @@ -13163,7 +13275,7 @@ declare namespace Office { * @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. * @@ -13189,7 +13301,7 @@ 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. @@ -13198,7 +13310,7 @@ declare namespace Office { * 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. * @@ -13269,7 +13381,7 @@ declare namespace Office { * 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. * @@ -13286,7 +13398,7 @@ 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. @@ -13298,7 +13410,7 @@ declare namespace Office { * * @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. * @@ -13321,7 +13433,7 @@ declare namespace Office { * * @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. * @@ -13359,15 +13471,14 @@ 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 {@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. * @@ -13468,9 +13579,8 @@ declare namespace Office { * * @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. * @@ -13494,7 +13604,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;` * * @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. @@ -13507,10 +13617,9 @@ declare namespace Office { * 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}. - * If removing the attachment fails, the asyncResult.error property will contain an error code with the reason for the failure. + * 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. * @@ -13581,10 +13690,9 @@ declare namespace Office { * @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}. - * If removing the attachment fails, the asyncResult.error property will contain an error code with the reason for the failure. + * 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}. @@ -13930,7 +14038,7 @@ 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. @@ -13942,7 +14050,7 @@ declare namespace Office { * * @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. @@ -13966,7 +14074,7 @@ declare namespace Office { * * @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. @@ -14036,7 +14144,7 @@ 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. @@ -14048,7 +14156,7 @@ declare namespace Office { * * @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}. @@ -14072,7 +14180,7 @@ declare namespace Office { * * @beta */ - getInitializationContextAsync(callback?: (result: AsyncResult) => void): void; + getInitializationContextAsync(callback?: (result: AsyncResult) => void): void; /** * Gets the entities found in the selected item's body. * @@ -14302,7 +14410,7 @@ declare namespace Office { * @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. * @@ -14319,7 +14427,7 @@ 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. @@ -14331,7 +14439,7 @@ declare namespace Office { * * @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. * @@ -14354,7 +14462,7 @@ declare namespace Office { * * @beta */ - removeHandlerAsync(eventType:EventType, handler: any, callback?: (result: AsyncResult) => void): void; + removeHandlerAsync(eventType:EventType, handler: any, callback?: (result: AsyncResult) => void): void; } /** @@ -14433,10 +14541,10 @@ 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. * @@ -14453,7 +14561,7 @@ 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. * @@ -14481,9 +14589,9 @@ 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. * @@ -14541,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. @@ -14664,7 +14772,7 @@ declare namespace Office { * @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. * @@ -14912,9 +15020,9 @@ 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. @@ -14922,7 +15030,7 @@ declare namespace Office { * @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. * @@ -14947,9 +15055,9 @@ 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. + * 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. * @@ -14977,7 +15085,7 @@ declare namespace Office { * 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. * @@ -14996,9 +15104,10 @@ declare namespace Office { * * @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. * @@ -15046,11 +15155,12 @@ 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 {@link Office.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; } /** @@ -15174,10 +15284,10 @@ 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. * @@ -15235,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. * @@ -15248,14 +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 {@link Office.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. * @@ -15266,10 +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 {@link Office.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. * @@ -15286,7 +15396,7 @@ 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. @@ -15294,7 +15404,7 @@ declare namespace Office { * @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. * @@ -15337,7 +15447,7 @@ declare namespace Office { * @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. * @@ -15356,7 +15466,7 @@ 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. @@ -15366,7 +15476,7 @@ declare namespace Office { * @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. * @@ -15421,7 +15531,7 @@ declare namespace Office { * @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. @@ -15485,7 +15595,7 @@ 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. @@ -15493,7 +15603,7 @@ declare namespace Office { * @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. * @@ -15566,11 +15676,11 @@ declare namespace Office { * @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] * @@ -15581,14 +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 {@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. * @@ -15603,8 +15714,9 @@ declare namespace Office { * * @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. * @@ -15633,7 +15745,7 @@ 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. @@ -15643,7 +15755,7 @@ declare namespace Office { * 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. * @@ -15724,7 +15836,7 @@ declare namespace Office { * 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; } @@ -15852,14 +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 {@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. @@ -15876,8 +15989,9 @@ declare namespace Office { * * @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. @@ -15896,7 +16010,7 @@ 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. @@ -15904,7 +16018,7 @@ declare namespace Office { * @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. @@ -15925,7 +16039,7 @@ declare namespace Office { * @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; } /** @@ -16016,7 +16130,7 @@ declare namespace Office { * 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. @@ -16087,7 +16201,7 @@ declare namespace Office { * @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. * @@ -16342,16 +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 {@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] @@ -16362,8 +16478,9 @@ 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. * @@ -16385,7 +16502,7 @@ 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. @@ -16393,7 +16510,7 @@ declare namespace Office { * @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. * @@ -16451,7 +16568,7 @@ declare namespace Office { * @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; } /** @@ -16503,13 +16620,14 @@ 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. * @@ -16524,8 +16642,9 @@ 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. * @@ -16549,7 +16668,7 @@ 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. @@ -16558,7 +16677,7 @@ declare namespace Office { * 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. * @@ -16623,7 +16742,7 @@ declare namespace Office { * 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; } /** 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/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/react-native/index.d.ts b/types/react-native/index.d.ts index d664018786..3d92f7ddd4 100644 --- a/types/react-native/index.d.ts +++ b/types/react-native/index.d.ts @@ -11,6 +11,7 @@ // Michele Bombardi // Tanguy Krotoff // Alexander T. +// Martin van Dam // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 @@ -6210,6 +6211,11 @@ export interface ScrollViewPropsAndroid { * - 'never' - Never allow a user to over-scroll this view. */ overScrollMode?: "auto" | "always" | "never"; + + /** + * Enables nested scrolling for Android API level 21+. Nested scrolling is supported by default on iOS. + */ + nestedScrollEnabled?: boolean; } export interface ScrollViewProps @@ -7859,6 +7865,7 @@ type TimePickerAndroidOpenOptions = { hour?: number; minute?: number; is24Hour?: boolean; + mode?: 'clock' | 'spinner' | 'default'; }; /** @@ -7891,6 +7898,10 @@ export interface TimePickerAndroidStatic { * * `is24Hour` (boolean) - If `true`, the picker uses the 24-hour format. If `false`, * the picker shows an AM/PM chooser. If undefined, the default for the current locale * is used. + * * `mode` (enum('clock', 'spinner', 'default')) - set the time picker mode + * * 'clock': Show a time picker in clock mode. + * * 'spinner': Show a time picker in spinner mode. + * * 'default': Show a default time picker based on Android versions. * * Returns a Promise which will be invoked an object containing `action`, `hour` (0-23), * `minute` (0-59) if the user picked a time. If the user dismissed the dialog, the Promise will diff --git a/types/react-native/test/index.tsx b/types/react-native/test/index.tsx index 4e21cb5c72..a9e3944a9b 100644 --- a/types/react-native/test/index.tsx +++ b/types/react-native/test/index.tsx @@ -72,6 +72,7 @@ import { WebView, KeyboardAvoidingView, Modal, + TimePickerAndroid, } from "react-native"; declare module "react-native" { @@ -390,7 +391,7 @@ class ScrollerListComponentTest extends React.Component<{}, { dataSource: ListVi throw new Error("Expected scroll to be enabled."); } - return ; + return ; }} renderRow={({ type, data }, _, row) => { return Filler; @@ -734,3 +735,12 @@ const AlertIOSTest = () => { const ModalTest = () => ( ) + +const TimePickerAndroidTest = () => ( + TimePickerAndroid.open({ + hour: 8, + minute: 15, + is24Hour: true, + mode: 'spinner' + }) +) diff --git a/types/react-navigation/index.d.ts b/types/react-navigation/index.d.ts index 31c3269af4..a1f60c0f81 100644 --- a/types/react-navigation/index.d.ts +++ b/types/react-navigation/index.d.ts @@ -21,6 +21,7 @@ // Linus Unnebäck // Yosuke Seki // Jake +// Gustavo Brunoro // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 @@ -565,6 +566,16 @@ export interface NavigationEventSubscription { remove: () => void; } +export interface NavigationEventsProps extends ViewProps { + navigation?: NavigationNavigator; + onWillFocus?: NavigationEventCallback; + onDidFocus?: NavigationEventCallback; + onWillBlur?: NavigationEventCallback; + onDidBlur?: NavigationEventCallback; +} + +export const NavigationEvents: React.ComponentType; + export interface NavigationScreenProp { state: S; dispatch: NavigationDispatch; @@ -996,25 +1007,16 @@ export namespace NavigationActions { const BACK: 'Navigation/BACK'; const INIT: 'Navigation/INIT'; const NAVIGATE: 'Navigation/NAVIGATE'; - const RESET: 'Navigation/RESET'; const SET_PARAMS: 'Navigation/SET_PARAMS'; - const URI: 'Navigation/URI'; - const POP: 'Navigation/POP'; - const POP_TO_TOP: 'Navigation/POP_TO_TOP'; function init(options?: NavigationInitActionPayload): NavigationInitAction; function navigate( options: NavigationNavigateActionPayload ): NavigationNavigateAction; - function reset(options: NavigationResetActionPayload): NavigationResetAction; function back(options?: NavigationBackActionPayload): NavigationBackAction; function setParams( options: NavigationSetParamsActionPayload ): NavigationSetParamsAction; - function pop(options: NavigationPopActionPayload): NavigationPopAction; - function popToTop( - options: NavigationPopToTopActionPayload - ): NavigationPopToTopAction; } /** diff --git a/types/react-navigation/react-navigation-tests.tsx b/types/react-navigation/react-navigation-tests.tsx index 60ca9b4758..30d984683e 100644 --- a/types/react-navigation/react-navigation-tests.tsx +++ b/types/react-navigation/react-navigation-tests.tsx @@ -11,6 +11,7 @@ import { DrawerNavigatorConfig, NavigationAction, NavigationActions, + NavigationEvents, NavigationBackAction, NavigationInitAction, NavigationNavigateAction, @@ -410,14 +411,6 @@ const navigateAction: NavigationNavigateAction = NavigationActions.navigate({ action: NavigationActions.navigate({ routeName: "BarScreen" }) }); -const resetAction: NavigationResetAction = NavigationActions.reset({ - index: 0, - key: "foo", - actions: [ - NavigationActions.navigate({ routeName: "FooScreen" }) - ] -}); - const backAction: NavigationBackAction = NavigationActions.back({ key: "foo" }); @@ -429,16 +422,6 @@ const setParamsAction: NavigationSetParamsAction = NavigationActions.setParams({ } }); -const popAction: NavigationPopAction = NavigationActions.pop({ - n: 1, - immediate: true -}); - -const popToTopAction: NavigationPopToTopAction = NavigationActions.popToTop({ - key: "foo", - immediate: true -}); - class Page1 extends React.Component { } const RootNavigator: NavigationContainer = createSwitchNavigator({ @@ -589,3 +572,14 @@ createStackNavigator( routeConfigMap, {transitionConfig: () => ({screenInterpolator: StackViewTransitionConfigs.SlideFromRightIOS.screenInterpolator})} ); + +// Test NavigationEvents component + +const ViewWithNavigationEvents = ( + +); diff --git a/types/react-navigation/v1/index.d.ts b/types/react-navigation/v1/index.d.ts index 16779c4e4e..8e7940c6ce 100644 --- a/types/react-navigation/v1/index.d.ts +++ b/types/react-navigation/v1/index.d.ts @@ -11,7 +11,6 @@ // Qibang Sun // Sergei Butko: // Veit Lehmann: -// Roberto Huertas: // Steven Miller // Armando Assuncao // Ciaran Liedeman diff --git a/types/redux-form/index.d.ts b/types/redux-form/index.d.ts index 989d9222d0..bbddfbd744 100644 --- a/types/redux-form/index.d.ts +++ b/types/redux-form/index.d.ts @@ -7,6 +7,7 @@ // Alex Young // Anton Novik // Huw Martin +// Ethan Resnick // Tim de Koning // Maddi Joyce // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -19,13 +20,13 @@ import { export type FieldType = "Field" | "FieldArray"; -export interface ErrorOther { +export interface ErrorOther { _error?: T; } -export type FormErrors = { - [P in keyof FormData]?: ReactElement | string | ErrorOther; -}; +export type FormErrors = { + [P in keyof FormData]?: ReactElement | T; +} & ErrorOther; export interface WarningOther { _warning?: T; diff --git a/types/redux-form/lib/Form.d.ts b/types/redux-form/lib/Form.d.ts index e708b0f965..0eee944be5 100644 --- a/types/redux-form/lib/Form.d.ts +++ b/types/redux-form/lib/Form.d.ts @@ -1,12 +1,12 @@ import { Component, FormHTMLAttributes, FormEvent, FormEventHandler } from "react"; import { FormProps, FormErrors, FormSubmitHandler, Omit } from "../index"; -interface FormSubmitProp { - onSubmit?: FormSubmitHandler; +interface FormSubmitProp { + onSubmit?: FormSubmitHandler; } -export type FormProps = Omit, "onSubmit"> & FormSubmitProp; +export type FormProps = Omit, "onSubmit"> & FormSubmitProp; -export class GenericForm extends Component> {} +export class GenericForm extends Component> {} -export class Form extends Component> implements GenericForm {} +export class Form extends Component> implements GenericForm {} diff --git a/types/redux-form/lib/SubmissionError.d.ts b/types/redux-form/lib/SubmissionError.d.ts index d2ec536a58..50695f34d0 100644 --- a/types/redux-form/lib/SubmissionError.d.ts +++ b/types/redux-form/lib/SubmissionError.d.ts @@ -1,9 +1,7 @@ import { FormErrors } from "../index"; -export interface SubmissionErrorConstructor { - new (errors?: FormErrors): Error; +export declare class SubmissionError extends Error { + constructor(errors?: FormErrors); } -export const SubmissionError: SubmissionErrorConstructor; - export default SubmissionError; diff --git a/types/redux-form/lib/actions.d.ts b/types/redux-form/lib/actions.d.ts index 4e0fd58558..dbe75106e4 100644 --- a/types/redux-form/lib/actions.d.ts +++ b/types/redux-form/lib/actions.d.ts @@ -36,11 +36,11 @@ export declare function registerField(form: string, name: string, type: FieldTyp export declare function reset(form: string): FormAction; export declare function resetSection(form: string, ...sections: string[]): FormAction; export declare function startAsyncValidation(form: string): FormAction; -export declare function stopAsyncValidation(form: string, errors?: any): FormAction; +export declare function stopAsyncValidation(form: string, errors?: FormErrors): FormAction; export declare function setSubmitFailed(form: string, ...fields: string[]): FormAction; export declare function setSubmitSucceeded(form: string, ...fields: string[]): FormAction; export declare function startSubmit(form: string): FormAction; -export declare function stopSubmit(form: string, errors?: any): FormAction; +export declare function stopSubmit(form: string, errors?: FormErrors): FormAction; export declare function submit(form: string): FormAction; export declare function clearSubmit(form: string): FormAction; export declare function clearSubmitErrors(form: string): FormAction; @@ -49,8 +49,8 @@ export declare function clearFields(form: string, keepTouched: boolean, persiste export declare function touch(form: string, ...fields: string[]): FormAction; export declare function unregisterField(form: string, name: string): FormAction; export declare function untouch(form: string, ...fields: string[]): FormAction; -export declare function updateSyncErrors(from: string, syncErrors: FormErrors, error: any): FormAction; -export declare function updateSyncWarnings(form: string, syncWarnings: FormWarnings, warning: any): FormAction; +export declare function updateSyncErrors(from: string, syncErrors: FormErrors, error: T): FormAction; +export declare function updateSyncWarnings(form: string, syncWarnings: FormWarnings, warning: T): FormAction; declare const actions: { arrayInsert: typeof arrayInsert, diff --git a/types/redux-form/lib/reduxForm.d.ts b/types/redux-form/lib/reduxForm.d.ts index 07f8e197ca..5d0d90d7b8 100644 --- a/types/redux-form/lib/reduxForm.d.ts +++ b/types/redux-form/lib/reduxForm.d.ts @@ -17,14 +17,14 @@ import { FormStateMap } from "../index"; -export type FormSubmitHandler = - (values: FormData, dispatch: Dispatch, props: P) => void | FormErrors | Promise; +export type FormSubmitHandler = + (values: FormData, dispatch: Dispatch, props: P) => void | FormErrors | Promise; export type GetFormState = (state: any) => FormStateMap; -export interface SubmitHandler { +export interface SubmitHandler { ( - submit: FormSubmitHandler, - props?: InjectedFormProps, + submit: FormSubmitHandler, + props?: InjectedFormProps, valid?: boolean, asyncValidate?: any, fields?: string[] @@ -32,16 +32,16 @@ export interface SubmitHandler { (event: SyntheticEvent): void; } -export interface ValidateCallback { +export interface ValidateCallback { values: FormData; - nextProps: P & InjectedFormProps; - props: P & InjectedFormProps; + nextProps: P & InjectedFormProps; + props: P & InjectedFormProps; initialRender: boolean; structure: any; } -export interface AsyncValidateCallback { - asyncErrors?: FormErrors; +export interface AsyncValidateCallback { + asyncErrors?: FormErrors; initialized: boolean; trigger: "blur" | "submit"; blurredField?: string; @@ -68,7 +68,7 @@ export interface RegisteredField { type: "Field" | "FieldArray"; } -export interface InjectedFormProps { +export interface InjectedFormProps { anyTouched: boolean; array: InjectedArrayProps; asyncValidate(): void; @@ -79,9 +79,9 @@ export interface InjectedFormProps { clearAsyncError(field: string): void; destroy(): void; dirty: boolean; - error: string; + error: ErrorType; form: string; - handleSubmit: SubmitHandler; + handleSubmit: SubmitHandler; initialize(data: Partial): void; initialized: boolean; initialValues: Partial; @@ -98,11 +98,11 @@ export interface InjectedFormProps { registeredFields: { [name: string]: RegisteredField }; } -export interface ConfigProps { +export interface ConfigProps { form: string; asyncBlurFields?: string[]; asyncChangeFields?: string[]; - asyncValidate?(values: FormData, dispatch: Dispatch, props: P & InjectedFormProps, blurredField: string): Promise; + asyncValidate?(values: FormData, dispatch: Dispatch, props: P & InjectedFormProps, blurredField: string): Promise; destroyOnUnmount?: boolean; enableReinitialize?: boolean; forceUnregisterOnUnmount?: boolean; @@ -111,24 +111,29 @@ export interface ConfigProps { initialValues?: Partial; keepDirtyOnReinitialize?: boolean; updateUnregisteredFields?: boolean; - onChange?(values: Partial, dispatch: Dispatch, props: P & InjectedFormProps): void; - onSubmit?: FormSubmitHandler> | SubmitHandler>; - onSubmitFail?(errors: FormErrors, dispatch: Dispatch, submitError: any, props: P & InjectedFormProps): void; - onSubmitSuccess?(result: any, dispatch: Dispatch, props: P & InjectedFormProps): void; + onChange?(values: Partial, dispatch: Dispatch, props: P & InjectedFormProps): void; + onSubmit?: FormSubmitHandler, ErrorType> | SubmitHandler, ErrorType>; + onSubmitFail?( + errors: FormErrors | undefined, + dispatch: Dispatch, + submitError: any, + props: P & InjectedFormProps + ): void; + onSubmitSuccess?(result: any, dispatch: Dispatch, props: P & InjectedFormProps): void; propNamespace?: string; pure?: boolean; - shouldValidate?(params: ValidateCallback): boolean; - shouldError?(params: ValidateCallback): boolean; - shouldWarn?(params: ValidateCallback): boolean; - shouldAsyncValidate?(params: AsyncValidateCallback): boolean; + shouldValidate?(params: ValidateCallback): boolean; + shouldError?(params: ValidateCallback): boolean; + shouldWarn?(params: ValidateCallback): boolean; + shouldAsyncValidate?(params: AsyncValidateCallback): boolean; touchOnBlur?: boolean; touchOnChange?: boolean; persistentSubmitErrors?: boolean; - validate?(values: FormData, props: P & InjectedFormProps): FormErrors; - warn?(values: FormData, props: P & InjectedFormProps): FormWarnings; + validate?(values: FormData, props: P & InjectedFormProps): FormErrors; + warn?(values: FormData, props: P & InjectedFormProps): FormWarnings; } -export interface FormInstance extends Component

{ +export interface FormInstance extends Component

{ dirty: boolean; invalid: boolean; pristine: boolean; @@ -138,22 +143,22 @@ export interface FormInstance extends Component

{ submit(): Promise; valid: boolean; values: Partial; - wrappedInstance: ReactElement

>; + wrappedInstance: ReactElement

>; } -export interface DecoratedComponentClass { - new(props?: P, context?: any): FormInstance; +export interface DecoratedComponentClass { + new(props?: P, context?: any): FormInstance; } -export type FormDecorator = - (component: ComponentType

>) => DecoratedComponentClass; +export type FormDecorator = + (component: ComponentType

>) => DecoratedComponentClass; -export declare function reduxForm( - config: ConfigProps -): FormDecorator>>; +export declare function reduxForm( + config: ConfigProps +): FormDecorator>, ErrorType>; -export declare function reduxForm( - config: Partial> -): FormDecorator>; +export declare function reduxForm( + config: Partial> +): FormDecorator, ErrorType>; export default reduxForm; diff --git a/types/redux-form/lib/selectors.d.ts b/types/redux-form/lib/selectors.d.ts index c996388d5c..c97d99859b 100644 --- a/types/redux-form/lib/selectors.d.ts +++ b/types/redux-form/lib/selectors.d.ts @@ -1,7 +1,7 @@ import { FormErrors, GetFormState } from "../index"; export type DataSelector = (formName: string, getFormState?: GetFormState) => (state: State) => FormData; -export type ErrorSelector = (formName: string, getFormState?: GetFormState) => (state: State) => FormErrors; +export type ErrorSelector = (formName: string, getFormState?: GetFormState) => (state: State) => FormErrors; export type BooleanSelector = (formName: string, getFormState?: GetFormState) => (state: State) => boolean; export type NamesSelector = (getFormState?: GetFormState) => (state: State) => string[]; export type FormOrFieldsBooleanSelector = (formName: string, getFormState?: GetFormState) => (state: State, ...fields: string[]) => boolean; diff --git a/types/redux-form/redux-form-tests.tsx b/types/redux-form/redux-form-tests.tsx index ea13a9618f..3b6869474e 100644 --- a/types/redux-form/redux-form-tests.tsx +++ b/types/redux-form/redux-form-tests.tsx @@ -61,8 +61,9 @@ type InjectedProps = InjectedFormProps; class TestFormComponent extends React.Component { render() { - const { form, initialValues } = this.props; + const { form, initialValues, error } = this.props; const foo = initialValues.foo; + const errorIsString = error + 'test'; return null; } } @@ -238,7 +239,7 @@ const Test = reduxForm({ render() { const { handleSubmit } = this.props; - const FormCustom = Form as new () => GenericForm; + const FormCustom = Form as new () => GenericForm; return (

@@ -409,3 +410,38 @@ class FormNameTest extends React.Component { ); } } + +// Test SubmissionError with custom error format +// See https://github.com/DefinitelyTyped/DefinitelyTyped/pull/26494 +// Note: explicit parameters not needed in TS 2.7 +new LibSubmissionError<{ myField: any }, string[]>({ + _error: ["First form-level error", "Second form-level error"], + myField: ["Field-level error"] +}); + +new SubmissionError({ + _error: ["First form-level error", "Second form-level error"] +}); + +// Test forms with custom error format. +const HandleSubmitTestForm2 = reduxForm({ form : "test" })( + (props: InjectedFormProps) =>
+); + +class HandleSubmitTest2 extends React.Component { + handleSubmit = (values: Partial, dispatch: Dispatch, props: {}) => {}; + render() { + return ; + } +} + +type InjectedProps2 = InjectedFormProps; +class TestFormComponent2 extends React.Component { + render() { + const { error, initialValues, handleSubmit } = this.props; + error.concat(['error is a string array']); + + handleSubmit((values) => ({ foo: ['string'], _error: [] })); + return null; + } +} diff --git a/types/restify/index.d.ts b/types/restify/index.d.ts index bcaf74c140..5d4b19285b 100644 --- a/types/restify/index.d.ts +++ b/types/restify/index.d.ts @@ -851,7 +851,7 @@ export interface RedirectOptions { /** * redirect location's query string parameters */ - query?: string; + query?: string|object; /** * if true, `options.query` diff --git a/types/scrollreveal/index.d.ts b/types/scrollreveal/index.d.ts index 992f1c1498..2dee7833f6 100644 --- a/types/scrollreveal/index.d.ts +++ b/types/scrollreveal/index.d.ts @@ -5,7 +5,7 @@ declare const ScrollReveal: scrollReveal.ScrollRevealObject; -declare module 'ScrollReveal' { +declare module 'scrollreveal' { export = ScrollReveal; } diff --git a/types/sequelize/index.d.ts b/types/sequelize/index.d.ts index ecbdba3602..9c3ca8474e 100644 --- a/types/sequelize/index.d.ts +++ b/types/sequelize/index.d.ts @@ -4672,6 +4672,20 @@ declare namespace sequelize { } + /** + * Interface for Attributes provided for a column + * + * @see Sequelize.define + */ + type DefineModelAttributes = { + + /** + * The description of a database column for model + */ + [P in keyof T]: string | DataTypeAbstract | DefineAttributeColumnOptions; + + } + /** * Interface for query options * @@ -5976,7 +5990,7 @@ declare namespace sequelize { * @param options These options are merged with the default define options provided to the Sequelize * constructor */ - define(modelName: string, attributes: DefineAttributes, + define(modelName: string, attributes: DefineModelAttributes, options?: DefineOptions): Model; /** diff --git a/types/sequelize/sequelize-tests.ts b/types/sequelize/sequelize-tests.ts index c3bd9e63af..702821ae25 100644 --- a/types/sequelize/sequelize-tests.ts +++ b/types/sequelize/sequelize-tests.ts @@ -34,11 +34,16 @@ s.transaction().then( ( a ) => t = a ); interface GUserAttributes { id? : number; username? : string; + email: string; } interface GUserInstance extends Sequelize.Instance {} -var GUser = s.define( 'user', { id: Sequelize.INTEGER, username : Sequelize.STRING }); -GUser.create({ id : 1, username : 'one' }).then( ( guser ) => guser.save() ); +const GUser = s.define('user', { + id: Sequelize.INTEGER, + username: Sequelize.STRING, + email: Sequelize.STRING +}); +GUser.create({ id : 1, username : 'one', email: 'one@lol.com' }).then((guser) => guser.save()); var schema : Sequelize.DefineAttributes = { key : { type : Sequelize.STRING, primaryKey : true }, @@ -1294,7 +1299,7 @@ var testModel = s.define( 'User', { theDate : Sequelize.DATE, aBool : Sequelize.BOOLEAN } ); -var testModel = s.define( 'FrozenUser', {}, { freezeTableName : true } ); +const testFrozenModel = s.define( 'FrozenUser', {}, { freezeTableName : true } ); s.define( 'UserWithClassAndInstanceMethods', {}, { classMethods : { doSmth : function() { return 1; } }, instanceMethods : { makeItSo : function() { return 2; } } @@ -1539,7 +1544,11 @@ interface ChairAttributes { } interface ChairInstance extends Sequelize.Instance {} -const Chair = s.define('chair', {}); +const Chair = s.define('chair', { + id: Sequelize.NUMBER, + color: Sequelize.STRING, + legs: Sequelize.NUMBER +}); Chair.findAll({ where: { @@ -1728,7 +1737,7 @@ s.define('DefineOptionsIndexesTest', { email: { allowNull: false, type: Sequelize.STRING(255), - set: function (val) { + set: function (val: any) { if (typeof val === "string") { val = val.toLowerCase(); } else { diff --git a/types/shapefile/index.d.ts b/types/shapefile/index.d.ts index 54a18a2503..6cbee9e837 100644 --- a/types/shapefile/index.d.ts +++ b/types/shapefile/index.d.ts @@ -1,32 +1,28 @@ -// Type definitions for shapefile 0.5.6 +// Type definitions for shapefile 0.6 // Project: https://github.com/mbostock/shapefile -// Definitions by: Denis Carriere +// Definitions by: Denis Carriere +// James Bromwell // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 -/// +/// -declare const shapefile: shapefile.ShapefileStatic; +import { Feature, FeatureCollection, GeometryObject, GeoJsonProperties } from "geojson"; +import { Readable } from "stream"; -declare namespace shapefile { - interface Options { - encoding: string - highWaterMark: number - } - interface Feature { - done: boolean - value: GeoJSON.Feature - } - interface Shapefile { - bbox: Array - read(): Promise; - } - interface ShapefileStatic { - open(shp: any, dbf?: any, options?: Options): Promise; - read(shp: any, dbf?: any, options?: Options): Promise>; - } +export interface Options { + encoding?: string; + highWaterMark?: number; +} +export interface Source { + bbox: number[]; + read(): Promise<{done: boolean, value: RecordType}>; + cancel(): Promise; } -declare module "shapefile" { - export = shapefile -} +export type Openable = string | ArrayBuffer | Uint8Array | Readable | ReadableStream; + +export function open(shp: Openable, dbf?: Openable, options?: Options): Promise>; +export function openShp(source: Openable, options?: Options): Promise>; +export function openDbf(source: Openable, options?: Options): Promise>; +export function read(shp: Openable, dbf?: Openable, options?: Options): Promise; diff --git a/types/shapefile/shapefile-tests.ts b/types/shapefile/shapefile-tests.ts index 71b7f6f7ae..cf5dd34e65 100644 --- a/types/shapefile/shapefile-tests.ts +++ b/types/shapefile/shapefile-tests.ts @@ -1,18 +1,38 @@ -import * as shapefile from 'shapefile' +import { open, openDbf, openShp, read } from 'shapefile'; -shapefile.open('./example.shp') +open('./example.shp', new ArrayBuffer(123)) .then(source => { - source.bbox + source.bbox; source.read() .then(result => { - result.value - result.done - }) - }) + result.value.geometry; + result.done; + }); + }); -shapefile.read("example.shp") +openDbf('./example.dbf', {encoding: "utf8"}) + .then(source => { + source.bbox; + source.read() + .then(result => { + result.value; + result.done; + }); + }); + +openShp('./example.shp', {highWaterMark: 0xabad1dea}) + .then(source => { + source.bbox; + source.read() + .then(result => { + result.value; + result.done; + }); + }); + +read("example.shp") .then(result => { - result.bbox - result.features - result.type - }) + result.bbox; + result.features; + result.type; + }); diff --git a/types/shapefile/tsconfig.json b/types/shapefile/tsconfig.json index 86a07711b7..7f63c5b58c 100644 --- a/types/shapefile/tsconfig.json +++ b/types/shapefile/tsconfig.json @@ -2,7 +2,8 @@ "compilerOptions": { "module": "commonjs", "lib": [ - "es6" + "es6", + "dom" ], "noImplicitAny": true, "noImplicitThis": true, @@ -20,4 +21,4 @@ "index.d.ts", "shapefile-tests.ts" ] -} \ No newline at end of file +} diff --git a/types/shapefile/tslint.json b/types/shapefile/tslint.json index a41bf5d19a..f93cf8562a 100644 --- a/types/shapefile/tslint.json +++ b/types/shapefile/tslint.json @@ -1,79 +1,3 @@ { - "extends": "dtslint/dt.json", - "rules": { - "adjacent-overload-signatures": false, - "array-type": false, - "arrow-return-shorthand": false, - "ban-types": false, - "callable-types": false, - "comment-format": false, - "dt-header": false, - "eofline": false, - "export-just-namespace": false, - "import-spacing": false, - "interface-name": false, - "interface-over-type-literal": false, - "jsdoc-format": false, - "max-line-length": false, - "member-access": false, - "new-parens": false, - "no-any-union": false, - "no-boolean-literal-compare": false, - "no-conditional-assignment": false, - "no-consecutive-blank-lines": false, - "no-construct": false, - "no-declare-current-package": false, - "no-duplicate-imports": false, - "no-duplicate-variable": false, - "no-empty-interface": false, - "no-for-in-array": false, - "no-inferrable-types": false, - "no-internal-module": false, - "no-irregular-whitespace": false, - "no-mergeable-namespace": false, - "no-misused-new": false, - "no-namespace": false, - "no-object-literal-type-assertion": false, - "no-padding": false, - "no-redundant-jsdoc": false, - "no-redundant-jsdoc-2": false, - "no-redundant-undefined": false, - "no-reference-import": false, - "no-relative-import-in-test": false, - "no-self-import": false, - "no-single-declare-module": false, - "no-string-throw": false, - "no-unnecessary-callback-wrapper": false, - "no-unnecessary-class": false, - "no-unnecessary-generics": false, - "no-unnecessary-qualifier": false, - "no-unnecessary-type-assertion": false, - "no-useless-files": false, - "no-var-keyword": false, - "no-var-requires": false, - "no-void-expression": false, - "no-trailing-whitespace": false, - "object-literal-key-quotes": false, - "object-literal-shorthand": false, - "one-line": false, - "one-variable-per-declaration": false, - "only-arrow-functions": false, - "prefer-conditional-expression": false, - "prefer-const": false, - "prefer-declare-function": false, - "prefer-for-of": false, - "prefer-method-signature": false, - "prefer-template": false, - "radix": false, - "semicolon": false, - "space-before-function-paren": false, - "space-within-parens": false, - "strict-export-declare-modifiers": false, - "trim-file": false, - "triple-equals": false, - "typedef-whitespace": false, - "unified-signatures": false, - "void-return": false, - "whitespace": false - } + "extends": "dtslint/dt.json" } diff --git a/types/socket.io/index.d.ts b/types/socket.io/index.d.ts index 6c12e444b0..95a9ff1b4f 100644 --- a/types/socket.io/index.d.ts +++ b/types/socket.io/index.d.ts @@ -616,7 +616,7 @@ declare namespace SocketIO { * take an optional parameter, err, of a possible error * @return This Socket */ - join( name: string, fn?: ( err?: any ) => void ): Socket; + join( name: string|string[], fn?: ( err?: any ) => void ): Socket; /** * Leaves a room diff --git a/types/stripe/index.d.ts b/types/stripe/index.d.ts index cc944284e0..4d8aba7d9a 100644 --- a/types/stripe/index.d.ts +++ b/types/stripe/index.d.ts @@ -1322,7 +1322,7 @@ declare namespace Stripe { /** * ID of the default source attached to this customer. [Expandable] */ - default_source: string | cards.ICard | bitcoinReceivers.IBitcoinReceiver; + default_source: string | cards.ICard | bitcoinReceivers.IBitcoinReceiver | null; /** * Whether or not the latest charge for the customer's latest invoice has failed diff --git a/types/styled-system/dist/styles.d.ts b/types/styled-system/dist/styles.d.ts index 57f470e96a..7c666f9a9d 100644 --- a/types/styled-system/dist/styles.d.ts +++ b/types/styled-system/dist/styles.d.ts @@ -110,6 +110,7 @@ export function letterSpacing(...args: any[]): any; */ export type DisplayValue = + | "none" | "inline" | "block" | "contents" diff --git a/types/superagent/index.d.ts b/types/superagent/index.d.ts index ffedf346ff..971cc3c4c2 100644 --- a/types/superagent/index.d.ts +++ b/types/superagent/index.d.ts @@ -101,6 +101,7 @@ declare namespace request { get(header: string): string; header: any; info: boolean; + links: object; noContent: boolean; notAcceptable: boolean; notFound: boolean; diff --git a/types/unzipper/index.d.ts b/types/unzipper/index.d.ts index 034fb5b099..43c50e1818 100644 --- a/types/unzipper/index.d.ts +++ b/types/unzipper/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for unzipper 0.8 +// Type definitions for unzipper 0.9 // Project: https://github.com/ZJONSSON/node-unzipper#readme // Definitions by: s73obrien // Nate @@ -57,6 +57,7 @@ export function unzip( ): Entry; export namespace Open { + function buffer(data: Buffer): Promise; function file(filename: string): Promise; function url( request: ClientRequest, diff --git a/types/unzipper/unzipper-tests.ts b/types/unzipper/unzipper-tests.ts index 7a8fbf9f4a..26cebebdef 100644 --- a/types/unzipper/unzipper-tests.ts +++ b/types/unzipper/unzipper-tests.ts @@ -41,3 +41,4 @@ createReadStream("http://example.org/path/to/archive.zip") const dir1: Promise = Open.file("Z:\\path\\to\\archive.zip"); const dir2: Promise = Open.url(get("url/to/archive.zip"), {}); const dir3: Promise = Open.s3("any", "any"); +const dir4: Promise = Open.buffer(Buffer.from('ZIPDATA'));